如何估计/确定在深度图像的点,面法线和切面? [英] How to estimate/determine surface normals and tangent planes at points of a depth image?

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

问题描述

我有深度图像,我已经使用3D CAD数据生成。这个深度图像也可采取从深度摄像传感器,诸如超高动力学或立体照相机。因此,基本上它是在成像视图中可见点的深度图。换句话说,它是从某个视图分段点云的物体的

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.

我们需要的信息的关键部分是这样的:在现实世界中的每个像素是多么宽阔的坐标?对于非正交突起(如所使用的真实世界的图像捕获装置),我们可以通过假设每个象素重新presents现实世界的一个固定角度内的光近似此。如果我们知道这个角度(称之为 P 和弧度衡量),那么现实世界的距离覆盖的像素就是罪(第)。* D ,或约页* 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;

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆