本文介绍了如何估计/确定表面法线和切面在深度图像的点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我有深度图像,我使用3D CAD数据生成。该深度图像还可以从诸如Kinect的深度成像传感器或立体相机获取。因此基本上是在成像视图中可见的点的深度图。换句话说,它是来自某个视图的对象的分割点云。

I have depth image, that I've generated using 3D CAD data. This depth image can also be taken from a depth imaging sensor such as Kinect or a stereo camera. So basically it is depth map of points visible in the imaging view. In other words it is segmented point cloud of an object from a certain view.

我想确定(估计也将做)每个点的表面法线,然后找到该点的切线平面。

I would like to determine (estimating will also do) the surface normals of each point, then find tangent plane of that point.

我该如何做?我做了一些研究,找到一些技术,但不太了解他们(我不能实现它)。更重要的是我该如何做到这一点在Matlab或OpenCV?我不能设法使用 surfnorm 命令。 AFAIK它需要单面,而且我的深度图像中有部分曲面。

How can I do this? I've did some research and find some techniques but didn't understand them well (I could not implement it). More importantly how can I do this in Matlab or OpenCV? I've couldn't manage to do this using surfnorm command. AFAIK it needs single surface, and I have partial surfaces in my depth image.

这是一个深度图像示例。

This is an example depth image.

>

我想做的是,当我在每个点获得曲面法线之后,我将在这些点创建切线平面。然后使用那些切线平面通过取相邻点到切平面的距离的总和来确定该点是否来自平坦区域。

What I want to do is, after I get the surface normal at each point I will create tangent planes at those points. Then use those tangent planes to decide if that point is coming from a flat region or not by taking the sum of distances of neighbor points to the tangent plane.

推荐答案

因此,在您的问题中有一些未定义的事情,请尽量概述一个答案。

So there are a couple of things that are undefined in your question, but I'll do my best to outline an answer.

您想要做的基本想法是采取图像的渐变,然后应用一个变换到渐变得到法向量。在matlab中使用渐变很容易:

The basic idea for what you want to do is to take the gradient of the image, and then apply a transformation to the gradient to get the normal vectors. Taking the gradient in matlab is easy:

[m, g] = imgradient(d);

给我们的大小( m )在每个点处的图像的梯度(相对于水平和以度计量)的方向( g )。例如,如果我们为您的图片显示渐变的大小,它看起来像这样:

gives us the magnitude (m) and the direction (g) of the gradient (relative to the horizontal and measured in degrees) of the image at every point. For instance, if we display the magnitude of the gradient for your image it looks like this:

现在,更难的部分是获取有关渐变的信息,并将其转换为正常向量。为了做到这一点,我们需要知道如何从图像坐标转换为世界坐标。对于像您的CAD生成的图像,此信息包含在用于制作图像的投影变换中。对于像Kinect这样的真实图像,您必须查找图像捕获设备的规格。

Now, the harder part is to take this information we have about the gradient and turn it into a normal vector. In order to do this properly we need to know how to transform from image coordinates to world coordinates. For a CAD-generated image like yours, this information is contained in the projection transformation used to make the image. For a real-world image like one you'd get from a Kinect, you would have to look up the spec for the image-capture device.

我们需要的关键信息是:真实世界坐标中每个像素有多宽?对于非正交投影(如真实世界图像捕获设备所使用的投影),我们可以通过假设每个像素表示在真实世界的固定角度内的光来近似。如果我们知道这个角度(称为 p 并以弧度为单位),那么像素覆盖的现实世界距离只是 sin )。* d 或约 p。* d 其中 d

The key piece of information we need is this: just how wide is each pixel in real-world coordinates? For non-orthonormal projections (like those used by real-world image capture devices) we can approximate this by assuming each pixel represents light within a fixed angle of the real world. If we know this angle (call it p and measure it in radians), then the real-world distance covered by a pixel is just sin(p) .* d, or approximately p .* d where d is the depth of the image at each pixel.

现在,如果我们有这个信息,我们可以构造法线向量的3个组成部分:

Now if we have this info, we can construct the 3 components of the normal vectors:

width = p .* d;
gradx = m .* cos(g) * width;
grady = m .* sin(g) * width;

normx = - gradx;
normy = - grady;
normz = 1;

len = sqrt(normx .^ 2 + normy .^ 2 + normz .^ 2);
x = normx ./ len;
y = normy ./ len;
z = normz ./ len;

这篇关于如何估计/确定表面法线和切面在深度图像的点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 15:07