HALCON 12: Stereo analysis with binocular_disparity_ms

The operator binocular_disparity_ms has been introduced with HALCON 12. It is used to compute the disparities of a rectified stereo image pair via multi-scanline optimisation. The operator calculates the disparities from the similarity measure, and then optimises the intermediate results by utilising a multi-scanline method. This optimisation increases the robustness in low-texture areas, without blurring dis­con­tinuities in the disparity image.

Parameter setting with SurfaceSmoothing and EdgeSmoothing

The multi-scanline optimisation is controlled by the parameters SurfaceSmoothing and EdgeSmoothing. SurfaceSmoothing controls the smoothness within surfaces and EdgeSmoothing controls the occurrence and shape of the  edges. High SurfaceSmoothing can suppress disparity differences of one pixel. High EdgeSmoothing leads to fewer and rounder edges. For both parameters, reasonable values usually range between 0 and 100. If both parameters are set to zero, no optimisation is performed.

1

Advantages of multi-scanline optimisation

There are three different approaches available for stereo matching in HALCON:

  • binocular_disparity: correlation-based stereo (NCC)
  • binocular_disparity_mg: multigrid stereo
  • binocular_disparity_ms: multi-scanline stereo

Compared with the other two methods, the multi-scanline approach also works for image parts that contain only little texture. Furthermore, it also preserves discontinuities, which are blurred by, for instance the multi-grid approach.

As the example image below shows, binocular_disparity (NCC) returns robust results in regions with sufficient texture, but fails when there is insufficient texture.
binocular_disparity_mg (multigrid) interpolates regions with low texture, but blurs discontinuities.
binocular_disparity_ms preserves dis­con­tinui­tes and inter­polates partially.

To sum things up, by utilising the operator binocular_disparity_ms,  noise in the disparity image is reduced while sharp edges are being maintained.

2

Additional tips

By using the corresponding operator binocular_distance_ms, the results can be transformed into distance values.

Note that when using the multi-scanline stereo approach, runtime significantly increases if large image sizes and disparity ranges are used. Furthermore, this combination also leads to high memory consumption. Thus, when working with large images, the disparity range should be chosen as narrow as possible.