Easy Z-distance calculation from DisparityMap

General Information

Product: C57-6-M
Serial Number: 244888
Ensenso SDK Version: 4.0.1502
Operating System: Windows

Problem / Question

As explained in the above topic,
I would like to do a

but what data should I use to determine the 100mm in the Z direction?

Is there an easy way to determine every 100mm in the Z direction
from the disparity data?

If possible, I would like to use the DisparityMap data
before running ComputePointMap().

Best regards,
K.N,

The mapping from disparity map to point map is given by the reprojection matrix followed by a transformation of the points using the camera link (if the camera has one).

This computation is exactly what the ComputePointMap command does.

There is no fixed number of disparities that corresponds to 100mm, since disparities are not linear. You either have to color the disparities in fixed intervals (making the coloring non-linear in the depth) or do a conversion using the matrix above.

1 Like

Hi daniel

First, thanks a lot for your quick response!

Converting to a point map results in a large amount of data,
so I thought that if we could keep it as a disparity map,
the processing would be lighter,
but that seems difficult.

So, does NxView also make its judgments based on
the data after running ComputePointMap()?

Thanks for your support and
With kind regards
K.N.

Yes, NxView always shows the point map and uses z values to color it.

You can also do the coloring based on disparity values if you don’t mind the non-linearity. Just pick a repetition length in disparities instead of mm. Older versions of NxView also did that.

The most efficient way to do the coloring based on the depth is probably to render the disparity map (which is smaller) and apply the reprojection matrix inline in a shader before coloring. This is what the RenderView command does.

1 Like

Thank you for your answer.
When using a point map and z-values,
how should the xy coordinates that determine the color by the z coordinate value correspond to the pixels of the raw image that I want to color?

When using a point map and Z values,
how do I find the pixel in the raw image that corresponds
to the x and y coordinates whose color is determined
by the Z coordinate value?
(Sorry for the basic question.)

Best regards,
K.N,

I am not sure if I understand your question correctly. You want to overlay the colored point map (or disparity map) with the texture as NxView does? If so you can check this guide in the manual: Aligning Images With 3D Data — Guides - Ensenso SDK 4.1.1023 Documentation.

1 Like

Hi daniel

Thank you for your answer.

I knew that the offset of DisparityMap and the rectified images
is DisparityMapOffset,but I didn’t know that the offset of PointMap
and the rectified images is also DisparityMapOffset.

I was able to understand a lot of things.
Thank you very much.
K.N.