本文介绍了投影的3D点以形成图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要为一个问题,我有你的智慧的建议。我有三维点数据以及强度场(X,Y,Z,I)从而重新present 3D场景。我想这个转换成3D图像数据(二维矩阵,强度值)。

I want your intellectual suggestions for a problem i have. I have 3D points data along with intensity field (x,y,z,I) which represent the 3D scene. I want this 3D data converted into an image (2D matrix with intensity values 'I').

我计划利用针孔照相机模型的三维点透视投影(维基百科)。

I plan to do perspective projection of 3D points using pinhole camera model (Wikipedia).

X'= F * X / Z Y'= F * Y / Z

我应该选择什么f值?如何为图像的依赖于它的大小? (比方说我需要尺寸500 * 500的图像,什么样的价值将适合的'F'

What value should I select for 'f'? How is the size of image dependent on it? (say I need an image of size 500*500 , what value will suit for 'f')

由于2D图像坐标是整数,我应该怎么量化 X' Y'的价值观和替代相应的强度值?例如。如果我得到了两套(通过使用 F = 10 )的

Since coordinates in 2D image are integers, how should I quantize x' and y' values and substitute the corresponding intensity value? E.g. if I get two sets(by using f=10) as

x,y,z,I
(3,1,2,128) -> x',y',I(15,5,128)
(3.1,1.1,2,150) -> (15.5,5.5,150)

以上的两组,我应该只是四舍五入 X' Y'的值,并使用其在那种强度的坐标,或者我应该使用非整数的强度平均坐标?

Of the above two sets, should i just round off the x' and y' values and use its intensity at that coordinate or should I use an average of intensity of the non-integer coordinates ?

将生成的图像清晰地描绘2D场景(比如从摄像头拍摄的照片)?

Will the resulting image be clearly depicting the scene in 2D (like a photo taken from a camera)?

应支付多少感谢您的想法。谢谢

Shall pay much gratitude for your ideas. Thanks

推荐答案

取决于您的应用程序。 OpenGL的,例如,当它这样做的操作,让你选择(见GL_TEXTURE_MIN_FILTER和GL_TEXTURE_MAG_FILTER)的选项。

Whether you use the average intensity or nearest neighbour or other kinds of interpolation depends on your application. OpenGL for instance, when it does this operation, gives you the option of choosing (see GL_TEXTURE_MIN_FILTER and GL_TEXTURE_MAG_FILTER).

我建议你尝试不同的方法,看看他们的样子;线性和最邻近插值之间的区别是一条线的code。有关目标应用程序的更多信息,很可能是有帮助的。

I suggest you try different approaches and see what they look like; the difference between linear and nearest neighbour interpolation is one line of code. More information about your intended application would probably be helpful.

从算法的最简单的方法来操作的凸起不一定是最计算效率。这是很容易以code此如果而非投射点的过程将开始与2D像素位置,找到对应的附近3D点和(即使只是最邻近插值)进行内插,以获得强度。这将阻止你不必如图像中的空白,你再也不用担心有因为放大插值以及象素之间的空间。

Algorithmically the simplest approach to doing the projection is not necessarily the most computationally efficient. It is much easier to code this if rather than projecting the points the process would start with the 2D pixel location, find the corresponding nearby 3D points and perform interpolation (even if just nearest neighbour interpolation) to get the intensity. This will stop you from having e.g. gaps in the image and you no longer have to worry about having interpolation because of magnification as well as spaces between pixels.

如何预测数据也取决于你想要达到的目的,以便有关应用程序的更多信息将是有益的 - 例如,你试图将所有的点进的形象?或者是你想填的形象呢?还是有云,使得它可能是挤压成一个正方形,如果预计的某些属性?如果它被收集的图像阵列那么它应该是可以容易地投射它(和许多不必要的上述力学的,因为它应该很容易恢复原始坐标)。否则有可能是不露面的图像或部分图像不具有相应点在点

How to project the data again depends on what you are trying to achieve so some more information about the application would be useful - e.g. are you trying to fit all of the points into the image? Or are you trying to fill the image? Or is there some property of the cloud that makes it likely to be squeezable into a square if projected? If it was collected by an image array then it should be possible to project it easily (and much of the above mechanics unnecessary since it should be easy to recover the original coordinates). Otherwise there are likely to be points that don't turn up in the image or parts of the image that don't have corresponding points.

如果我做一些假设,那么我就可以解决的限制投影方程。如果我们假设一个640×480图像,而且突起的中心位于图像的中心,然后,我们有:

If I make some assumptions then I can solve the projection equation for the limits. If we assume a 640 x 480 image and that the centre of projection is at the centre of the image then we have:

x'=f*x/z + 320

(注意,这是misuing焦距如通常所做映射到像素,其中真模型具有它映射到图像阵列的规模,此后进入像素)。

(note that this is misuing the focal length as is commonly done to map onto pixels where the true model has it mapping onto the scale of the image array and thereafter into pixels).

greatestx:X 是最大的 X 的点阵列中的价值和 greatestx :Z 相应的以Z 值的点,然后

Let greatestx:x be the largest x value in the point array and greatestx:z the corresponding z value for that point then

639.5=f*greatestx:x/greatestx:z + 320

因此​​,

f = 319.5*greatestx:z / greatestx:x

如果你这样做的最小的x值,最小的y值,和最大的y值:

If you do this for the smallest x value, smallest y value, and largest y value:

f = -319.5*smallestx:z / smallestx: x

f = 239.5*greatesty:z / greatesty: y

f = -239.5*smallesty:z / smallesty: y

现在,如果我们选择最小的 F 上面的话,我们保证点云以适合图像(但可能有差距)。如果我们选择了最大的 F 然后我们保证那里是图像中没有间隙(但可能有部分不适合到图像)。

Now if we choose the smallest f of the above then we guarantee the point cloud to fit into the image (but there might be gaps). If we choose the largest f then we guarantee there to be no gaps in the image (but there might be parts that don't fit onto the image).

这篇关于投影的3D点以形成图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 22:39