简体   繁体   English

基于网格信息的点云在二维图像上的投影

[英]Projection of point cloud on 2D image based on mesh information

I have a point cloud and meshes (vertices=points of the point cloud).我有一个点云和网格(顶点=点云的点)。 I want to project the point cloud with a certain virtual camera.我想用某个虚拟相机投影点云。 Here, since the point cloud is sparse, the rendered result includes the points which should be occluded by foreground objects.这里,由于点云是稀疏的,渲染结果包括了应该被前景物体遮挡的点。

To resolve this issue, I want to use mesh information to identify which points should be occluded.为了解决这个问题,我想使用网格信息来识别哪些点应该被遮挡。 Is there any smart way to do this in python?在 python 中有什么聪明的方法可以做到这一点吗?

Kind advice will be greatly appreciated.善意的建议将不胜感激。

After hours of searching, I conclude that I have to re-implement a novel rendering pipeline to achieve my goal.经过几个小时的搜索,我得出结论,我必须重新实现一个新颖的渲染管道才能实现我的目标。

So, instead of this, I use a mesh-based renderer to render a depth map. And then I simply project the points of the point cloud with a projection matrix.因此,我使用基于网格的渲染器来渲染深度 map,而不是这个。然后我使用投影矩阵简单地投影点云的点。 Here, I use the depth map to check whether the point fits with the depth or not.在这里,我使用深度 map 来检查该点是否与深度相符。 If the projected point is the one that should be occluded, then the depth of the point would be larger than the depth map value at the corresponding pixel.如果投影点是应该被遮挡的点,那么该点的深度将大于相应像素处的深度 map 值。 So, such points should be ignored while rendering.因此,在渲染时应忽略这些点。

I know that this is a less elegant and inefficient trick but anyway it works very well:)我知道这是一个不太优雅且效率低下的技巧,但无论如何它效果很好:)

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

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