RenderPointMap¶
Renders the camera surfaces as orthographic/telecentric or perspective projection and outputs a depth map containing only z coordinates or a full, three channel xyz point map.
The resulting depth data is stored in Result/Images/RenderPointMap together with its texture information from monocular cameras in Result/Images/RenderPointMapTexture.
By default, a telecentric projection is generated using each camera’s DisparityMap. When specifying the (Camera) parameter, a perspective projection is rendered.
Note
The point coordinates are automatically transformed into world/workspace coordinates. See the multi camera setup guide for more information about different coordinate systems.
Note
Rendering commands like RenderPointMap and RenderView use a single OpenGL context and therefore will be internally serialized and run sequentially, also when executed from separate Execute nodes.
Rendering Methods¶
Due to the very different architectures of CPU and GPU, the RenderPointMap command uses two different methods to transform the camera’s depth data into another perspective depending on the selection of the (UseOpenGL) parameter. Both methods produce slightly different results and might have advantages and disadvantages for your application, so it is advised to read through the descriptions below and choose what best fits your application needs and computer setup.
Rendering with OpenGL on the GPU¶
In order to handle the depth data on the graphics card efficiently, we transform the disparity map into a mesh of triangles in 3d space. We simply divide each square of 2x2 pixels in the disparity map into two triangles by computing each pixels 3d coordinate. If two points of a triangle are more than SurfaceConnectivity apart in the camera’s Z direction we consider those pixels to be on different sides of an edge in the surface and discard the corresponding triangle to also break up our virtual surface at this edge.
Doing this on all camera’s depth data gives us triangulated surface meshes of all cameras which we can efficiently pass over to OpenGL for rendering from a perspective of our choice.
Rendering on the CPU¶
Because the CPU is less suited for handling triangle meshes, we use a slightly simpler transformation on the CPU. Each point in the disparity map is transformed to its corresponding 3D point and, instead of forming triangles with its neighbors, that 3D point is projected directly into the target image where its coordinates are recorded. If two points land on the same pixel in the target image, the one with the smaller Z value in the target perspective is kept (as in the OpenGL variant). However, when the density of 3D points is lower than the target perspective’s pixel size, many pixels are not hit by any projection and remain empty, which leads to aliasing or very sparsely filled rendered images and can complicate further processing.
To circumvent this, set a (Scaling) factor smaller than 1 to reduce the target image resolution during rendering so the pixels are large enough that each receives a 3D point projection. After projecting all pixels into the reduced target image, the image is upscaled to the final requested (Size) and (PixelSize), and any holes are filled by nearest-neighbor interpolation.
Comparison of rendering methods¶
Advantage |
Disadvantage |
|
With OpenGL |
Using the triangulated meshes, the GPU will take care of correctly resampling the mesh, regardless of the target image resolution. |
The triangulation requires to set SurfaceConnectivity a priori. Too large values might lead to spurious surfaces along the viewing direction, too small values might break surfaces apart due to noise on the Z coordinates. |
On the CPU |
No graphics card required. This simpler method might also outperform the OpenGL variant on mid-end graphics cards. |
You might need to set the (Scaling) factor to avoid sparse result images and aliasing when the resampled resolution is higher than the 3d point cloud point distance. Choosing a good (Scaling) factor might be difficult when dealing with point clouds of very different resolution. |