简体   繁体   English

3D到2D图像转换-PointCloud到OpenCV图像-C ++

[英]3d to 2d image transformation - PointCloud to OpenCV Image - C++

I'm collecting a hand 3d image from my Kinect, and I want to generate a 2d image using only the X and Y values to do image processing using OpenCV. 我正在从Kinect收集手形3d图像,我想仅使用X和Y值生成2d图像,以使用OpenCV进行图像处理。 The size of the 3d matrix is variable and depends on the output from the Kinect and the X and Y values are not in proper scale to generate an 2d image. 3d矩阵的大小是可变的,并且取决于Kinect的输出,并且X和Y值未按适当比例缩放以生成2d图像。 My 3d points and my 3d image are: http://postimg.org/image/g0hm3y06n/ 我的3d点和3d图像为: http : //postimg.org/image/g0hm3y06n/

在此处输入图片说明

I really don't know how can I generate my 2d image to perform my Image Processing. 我真的不知道如何生成2d图像以执行图像处理。

Someone can help me or have a good example that I can use to create my image and do the proper scaling for that problem? 有人可以帮助我,或者有一个很好的例子,可以用来创建图像并针对该问题进行适当的缩放? I want as output the HAND CONTOURS. 我希望将HAND CONTOURS作为输出。

I think you should apply Delaunay triangulation to 2D coordinates of point cloud (depth ignored), then remove too long vertices from triangles. 我认为您应该将Delaunay三角剖分应用于点云的2D坐标(忽略深度),然后从三角形中删除太长的顶点。 You can estimate the length threshold by counting points per some area and evaluating square root from the value you'll get. 您可以通过计算每个区域的点数,并根据获得的值评估平方根来估算长度阈值。 After you got triangulation you can draw filled triangles and find contours. 进行三角剖分后,您可以绘制实心三角形并找到轮廓。

I think what you are looking for is the OKPCL package .. Also, make sure you check out this PCL post about the topic.. There is also an OpenCVPCL Bridge class but apparently the website is down. 我认为您正在寻找的是OKPCL软件包 。.另外,请确保您查看有关此主题的PCL帖子 。.还有一个OpenCVPCL Bridge类,但显然该网站已关闭。

And lastly, there has been official word that the OpenCV and PCL are joining forces for a development platform that integrates GPU computing with 2d/3D perception and processing. 最后, 官方的说法是,OpenCV和PCL正在联合开发平台,该平台将GPU计算与2d / 3D感知和处理集成在一起。

HTH HTH

You could use PCLs RangeImage respectively RangeImagePlanar class with its createFromPointCloud method (I think you do have a point cloud, right? Or what do you mean by 3D image?). 您可以将PCL RangeImage或 RangeImagePlanar类及其createFromPointCloud方法一起使用(我认为您确实有一个点云,对吗?或者3D图像是什么意思?)。

Then you can create a OpenCV Mat using getImagePoint functions. 然后,您可以使用getImagePoint函数创建OpenCV Mat。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM