ZMapの生成

Zmapは距離をグレースケール値としてコード化した基準平面上のポイントクラウドまたは基準面の投影です。

ZMapsはすべてのOpen eVision2Dライブラリと互換性のあるグレースケール画像です。
Zmapは歪みがなく、メトリック座標系からまたはメトリック座標系にアフィン変換されます。

深度マップ(左)およびそれに対応するZMap(右)、
デフォルトの生成パラメータと定義されていないピクセルの塗りつぶしが有効

すべてのOpen eVision2D処理は、ZMapで利用できます。フィルタリングと閾値処理、ブロブ オブジェクトと同義語。抽出、EasyGaugeによる測定、EasyFindまたはEasyMatchとのモデルマッチングなどです。

The EPointCloudToZMapConverter class implements the conversion from a point cloud to a ZMap (EMeshToZMapConverter converts a mesh to a ZMap). With all parameters at default value, the Convert method automatically chooses the projection plane, the orientation, the map size and the resolution.

必要に応じて、コンバージョンをさらに制御するいくつかの方法があります。

SetReferencePlane defines a world space projection plane. Zmapピクセルの値はポイントクラウドからその基準平面までの距離です。

デフォルトでは、基準平面は原点を横断し、ワールドZ軸に対して垂直です。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.

方向ベクトルは、基準平面の法線の周りでオブジェクト 一般的な文章では、オブジェクトという用語はクラスインスタンスという意味で理解します。一方、EasyObjectでは、レイヤ背景に属する連結した隣接ピクセルから成る最大限の大きさの領域のことをオブジェクトと呼びます。を「回転」させることができます。

SetOrigin specifies the world position that is on the ZMap lower left pixel (0, 0).
SetMapSize defines the resolution (number of pixels in X and Y axis) of the generated ZMap.
SetMapXYResolution adjusts the X and Y resolution of the ZMap pixels, in world space unit per pixel (for example mm/pixel). この値は、基準平面上のポイントクラウドの投影されたサイズに応じて、ZMapサイズ(幅と高さ)を計算するために使用されます。
SetMapZResolution sets the Z resolution, in world space unit per pixel unit (gray value). Z解像度は、基準計画までの距離の整数8、16または32ビットピクセル値への変換を計算するために使用されます。
EnableFillMode and SetFillMode control the options used to fill the "hole" in the ZMap. ピクセル位置でZMapに3Dポイントが投影されていないときは穴が存在します。

The methods SetReferencePlane, SetOrientationVector and SetOrigin are used to set up the transformation between the world space and the ZMap space. これは厳密な変換です(距離は保持されます)。

Alternatively, it is possible to directly set that transformation with the method SetWorldToZMapTransform using a rigid matrix as parameter. この場合、基準面、方向ベクトルおよび原点パラメータは無視されます。

ZMap上のポイントクラウドの投影は、
ワールド空間、ZMap空間、ピクセル空間の3つの座標系を示しています。

The Convert method performs the effective projection of a point cloud (EPointCloud) or a 3D object (EMesh) to the 8, 16 or 32 bits ZMap.

ポイントクラウドからZMapを生成する場合、個々のポイントのみがZMapに投影されます。ポイントクラウド密度とZMap解像度に応じて、ZMapの一部の領域が「未定義」のままになることがあります。To get around this problem, adjust the resolution of the ZMap (SetMapXYResolution method) to remove “holes” on the ZMap.

デフォルトでは、ポイントクラウドからZMapへの変換は、塗りつぶしアルゴリズムを実行します。このプロセスは、未定義のピクセルをローカルに補間された値に置き換えようとします。

左:高解像度ZMap、ピクセルスケールがポイントクラウド密度を超えます
中央:同じジェネレータパラメータで充填が有効になっています
右:ZMapの縮尺/解像度が低く、充填されていません

メッシュがサーフェスを定義すると、その三角形がZMap平面に投影されます。その結果、生成された画像の連続性が向上し、未定義のピクセルが少なくなります。However, the generation of a ZMap from an EMesh is slower than from an EPointCloud.