简体   繁体   English

3D地图可视化范围(使用vtk?)

[英]range 3D map visualization (with vtk?)

we have a ZMap (aka depth-map) picture obtained from 3D triangulation with laser and camera. 我们有一个用激光和相机从3D三角剖分获得的ZMap(又称深度图)图片。 We know the depth value of each pixel and the resolution of camera (each pixel is associated to a 3d coordinate in mm). 我们知道每个像素的深度值和相机的分辨率(每个像素与以mm为单位的3d坐标相关联)。 Our goal is to visualize the Zmap as a 2d Surface, so we thought of creating a point cloud, generate a mesh and display it with some 3D library We thought vtk could be the right choice, but we encountered some problem. 我们的目标是将Zmap可视化为2d曲面,因此我们考虑创建点云,生成网格并使用一些3D库显示它。我们认为vtk是正确的选择,但遇到了一些问题。

First we tried unorganized structure (vtkPolyData), generating meshes by 3dDalaunay triangulation. 首先,我们尝试使用无组织结构(vtkPolyData),通过3dDalaunay三角剖分生成网格。 But the code is properly working when number of points is < 50k. 但是,当点数<50k时,代码可以正常工作。 Our 3D reconstruction is composed by 480k points and the computation time is really too much high. 我们的3D重构由480k点组成,计算时间确实太长了。

Then we switched to organized (point with connections). 然后,我们切换到有条理(连接点)。 IMHO this additional information should reduce computation time to create mesh, but we are not able to understand how to create a "vtkStructuredGrid" and to feed it with our Z values to get a 2D meshed surface. 恕我直言,这些附加信息应减少创建网格的计算时间,但是我们无法理解如何创建“ vtkStructuredGrid”并将其Z值输入以获得2D网格化表面。

Is it the proper way to do? 这是正确的方法吗? Has anyone never tried this? 有没有人尝试过?

Thanks in advance 提前致谢

if your points are organized in 2D grid (while scanning) then you do not need complicated and slow triangulation algorithms 如果您的点以2D网格组织(在扫描时),则不需要复杂而缓慢的三角剖分算法

  1. organize points into 2D table/grid 将点组织到2D表/网格中

    • something like this: 像这样的东西:
    • 点格
    • the grey squares are the points 灰色方块是重点
    • so point x,y axises are parallel to table/grid u,v indexes 所以点x,y轴平行于表格/网格u,v索引
    • if your data is not yet organized in this manner then sort the points so it does 如果您的数据尚未以这种方式组织,则对点进行排序,以便
    • store in something like: double pnt[maxU][maxV][3]; 存储在类似: double pnt[maxU][maxV][3];
    • in case x,y are directly aligned to grid then you need to store just the Z coordinate to spare some memory 如果x,y直接与网格对齐,那么您只需要存储Z坐标即可节省一些内存
  2. segmentate segmentate

    • in 3D scanned pointcloud organized like this is easy 在3D扫描的点云中这样组织起来很容易
    • just join together all neighboring points with Z coordinate difference smaller then treshold 只需将Z坐标差小于阈值的所有相邻点连接在一起
    • the colored point squares in my image 我图像中的彩色方形点
    • the gray points are the background out of range Z coordinates now 灰色点现在是超出Z坐标范围的背景
    • so add structure like: int obj[maxU][maxV]; 因此添加如下结构: int obj[maxU][maxV];
    • set all background/out of range points as obj[u][v]=-1; 将所有背景/超出范围的点设置为obj [u] [v] =-1;
    • set the rest with unique obj index like (u*maxV+v) 设置其余的唯一obj索引,例如(u*maxV+v)
    • now process each line and if points near have near Z coordinate reindex one of them (so object is growing) 现在处理每条线,如果附近的点的Z坐标附近,则重新索引其中之一(因此对象正在增长)
    • when done process all lines and try to merge reindex adjacen objects 完成后,处理所有行并尝试合并重新索引相邻对象
    • loop until no merge ocur 循环直到没有合并发生
    • this is way faster then flood-fill based segmentation (if used proper speed up structures for the line merging) 这比基于洪水填充的分段要快得多(如果使用了适当的加速线合并结构)
  3. triangulate 三角

    • process the tab quad by quad 逐个处理选项卡
    • if all 4 points belong to same object from segmentation add quad to mesh 如果所有4个点都属于分割对象,则将四边形添加到网格
    • if just 3 add the triangle (4 combinations) 如果仅3个添加三角形(4个组合)
    • if 1 or 2 do not add anything 如果1或2不添加任何内容
    • the result is the colored areas 结果是彩色区域

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

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