Documentation Portal      

What are you looking for?

Generating a ZMap

A ZMap is the projection of a point cloud or a 3D object on a reference plane, with the distance coded as gray scale values:

ZMaps are grayscale images, compatible with all Open eVision 2D libraries.
ZMaps are distortion free, with affine transformation from/to metric coordinate system.

A depth map (left) and the corresponding ZMap (right),
with default generation parameters and undefined pixel filling enabled

All Open eVision 2D processing are available on ZMaps: filtering and thresholding, blob extraction, measure with EasyGauge, model matching with EasyFind or EasyMatch…

The class E3DZMapGenerator implements the conversion from a point cloud to a ZMap. With all parameters at default value, the method Convert() chooses automatically the projection plane, the orientation, the resolution and the scale.

Optionally, several methods are available to control the conversion:

SetReferencePlane() defines a world space projection plane. The values of the ZMap pixels are the distance of the point cloud to that reference plane.

By default, the reference plane cross the origin and is perpendicular to the world Z axis. The plane is defined as a E3DPlane object.

SetOrientationVector() sets a world space vector representing the expected direction of the X (width) axis of the ZMap.

The orientation vector allows to “rotate” the object around the normal of the reference plane.

SetOrigin() chooses the world position that is on the ZMap lower left pixel (0,0).
SetResolution() defines the resolution (number of pixels in X and Y axis) of the generated ZMap.
SetScale() adjusts the scale of the ZMap pixels, in world space unit per pixel (for example in mm/pixel).

This value is used to compute the ZMap resolution (width and height), depending on the projected size of the point cloud on the reference plane.

SetZScale() sets the Z scale, in world space unit per pixel unit (gray value).

The Z scale is used to compute the transformation of the distance to the reference plan to the integer 8, 16 or 32 bits pixel value.

EnableFillMode() and SetFillMode() control the options used to fill the "hole" in the ZMap. Hole exists when no 3D point is projected in the ZMap at a pixel position.

The methods SetReferencePlane(), SetOrientationVector() and SetOrigin() are used to setup the transformation between the world space and the ZMap space. This is a rigid transformation(distances are kept).

Alternatively, it is possible to directly set that transformation with the method SetWorldToZMapTransform() using a rigid matrix as parameter. In that case, the reference plane, orientation vector and origin parameters are ignored.

The projection of a point cloud on a ZMap,
showing 3 coordinate systems: the world space, the ZMap space and the pixel space.

The method Convert() performs the effective projection of a point cloud (E3DPointCloud) or a 3D object (E3DObject) to the 8 bits and 16 bits ZMap.

When generating a ZMap from a point cloud, only individual points are projected on the ZMap. Depending on the point cloud density and the ZMap resolution, some regions of the ZMap may remain “undefined”. To get around this problem, adjust the scale of the ZMap (SetScale method) to remove “holes” on the ZMap.

By default, the point cloud to ZMap converter performs a filling algorithm. This process tries to replace undefined pixels with locally interpolated values.

Left: high resolution ZMap, the pixel scale exceeds the point cloud density
Center: the same generator parameters with the filling enabled
Right: a reduced ZMap scale/resolution, without filling

As a 3D object defines a surface, small triangles are projected to the ZMap plane. Then, the generated image shows better continuity and less undefined pixels. However, the generation of a ZMap from a E3DObject is slower than from a E3DPointCloud.

Which API shall we display?

© 2018 EURESYS s.a.  -  About Documentation  -  Open Source Licenses  -  Open eVision 2.5.1.1107