首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >range 3D地图可视化(使用vtk?)

range 3D地图可视化(使用vtk?)
EN

Stack Overflow用户
提问于 2015-09-29 02:15:51
回答 1查看 583关注 0票数 1

我们有一张ZMap (也就是深度图)图片,是用激光和相机进行三维三角测量得到的。我们知道每个像素的深度值和相机的分辨率(每个像素与一个以毫米为单位的3d坐标相关联)。我们的目标是将Zmap可视化为一个2d表面,所以我们想创建一个点云,生成一个网格,并用一些3D库显示它。我们认为vtk可能是正确的选择,但我们遇到了一些问题。

首先,我们尝试了无组织结构(vtkPolyData),通过3dDalaunay三角剖分生成网格。但是当点数小于50k时,代码可以正常工作。我们的三维重建是由480k个点组成的,计算时间实在太长了。

然后我们切换到有组织(point with connections)。这个额外的信息应该会减少创建网格的计算时间,但是我们不能理解如何创建一个"vtkStructuredGrid“,并用我们的Z值给它提供一个2D网格曲面。

这是正确的做法吗?有没有人从来没有试过?

提前感谢

EN

回答 1

Stack Overflow用户

发布于 2015-09-29 15:17:04

如果您的点是在2D格网中组织的(扫描时),则不需要复杂且缓慢的三角测量算法

  1. organize指向2D table/grid

代码语言:javascript
运行
复制
- something like this:
- ​

代码语言:javascript
运行
复制
- the grey squares are the points
- so point `x,y` axises are parallel to table/grid `u,v` indexes
- 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];`
- in case `x,y` are directly aligned to grid then you need to store just the Z coordinate to spare some memory

  1. segmentate

代码语言:javascript
运行
复制
- in 3D scanned pointcloud organized like this is easy
- just join together all neighboring points with Z coordinate difference smaller then treshold
- the colored point squares in my image
- the gray points are the background out of range Z coordinates now
- so add structure like: `int obj[maxU][maxV];`
- set all background/out of range points as obj[u][v]=-1;
- set the rest with unique obj index like `(u*maxV+v)`
- now process each line and if points near have near Z coordinate reindex one of them (so object is growing) 
- 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)

  1. triangulate

代码语言:javascript
运行
复制
- process the tab quad by quad
- if all 4 points belong to same object from segmentation add quad to mesh
- if just 3 add the triangle (4 combinations)
- if 1 or 2 do not add anything
- the result is the colored areas

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32829340

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档