HALCON Reference Manual 10.0.2
Table of Contents / 3D Reconstruction / Binocular Stereo ClassesClassesClasses | | | Operators

binocular_distance_mgT_binocular_distance_mgbinocular_distance_mgBinocularDistanceMgBinocularDistanceMg (Operator)

Name

binocular_distance_mgT_binocular_distance_mgbinocular_distance_mgBinocularDistanceMgBinocularDistanceMg — Compute the distance values for a rectified stereo image pair using multigrid methods.

Signature

binocular_distance_mg(Image1, Image2 : Distance, Score : CamParamRect1, CamParamRect2, RelPoseRect, GrayConstancy, GradientConstancy, Smoothness, InitialGuess, CalculateScore, MGParamName, MGParamValue : )

Herror T_binocular_distance_mg(const Hobject Image1, const Hobject Image2, Hobject* Distance, Hobject* Score, const Htuple CamParamRect1, const Htuple CamParamRect2, const Htuple RelPoseRect, const Htuple GrayConstancy, const Htuple GradientConstancy, const Htuple Smoothness, const Htuple InitialGuess, const Htuple CalculateScore, const Htuple MGParamName, const Htuple MGParamValue)

Herror binocular_distance_mg(Hobject Image1, Hobject Image2, Hobject* Distance, Hobject* Score, const HTuple& CamParamRect1, const HTuple& CamParamRect2, const HTuple& RelPoseRect, const HTuple& GrayConstancy, const HTuple& GradientConstancy, const HTuple& Smoothness, const HTuple& InitialGuess, const HTuple& CalculateScore, const HTuple& MGParamName, const HTuple& MGParamValue)

HImage HImage::BinocularDistanceMg(const HImage& Image2, HImage* Score, const HTuple& CamParamRect1, const HTuple& CamParamRect2, const HTuple& RelPoseRect, const HTuple& GrayConstancy, const HTuple& GradientConstancy, const HTuple& Smoothness, const HTuple& InitialGuess, const HTuple& CalculateScore, const HTuple& MGParamName, const HTuple& MGParamValue) const

HImageArray HImageArray::BinocularDistanceMg(const HImageArray& Image2, HImageArray* Score, const HTuple& CamParamRect1, const HTuple& CamParamRect2, const HTuple& RelPoseRect, const HTuple& GrayConstancy, const HTuple& GradientConstancy, const HTuple& Smoothness, const HTuple& InitialGuess, const HTuple& CalculateScore, const HTuple& MGParamName, const HTuple& MGParamValue) const

void HOperatorSetX.BinocularDistanceMg(
[in] IHUntypedObjectX* Image1, [in] IHUntypedObjectX* Image2, [out] IHUntypedObjectX*Distance, [out] IHUntypedObjectX*Score, [in] VARIANT CamParamRect1, [in] VARIANT CamParamRect2, [in] VARIANT RelPoseRect, [in] VARIANT GrayConstancy, [in] VARIANT GradientConstancy, [in] VARIANT Smoothness, [in] VARIANT InitialGuess, [in] VARIANT CalculateScore, [in] VARIANT MGParamName, [in] VARIANT MGParamValue)

IHImageX* HPoseX.BinocularDistanceMg(
[in] IHImageX* Image1, [in] IHImageX* Image2, [out] IHImageX*Score, [in] VARIANT CamParamRect1, [in] VARIANT CamParamRect2, [in] VARIANT RelPoseRect, [in] double GrayConstancy, [in] double GradientConstancy, [in] double Smoothness, [in] double InitialGuess, [in] BSTR CalculateScore, [in] VARIANT MGParamName, [in] VARIANT MGParamValue)

IHImageX* HImageX.BinocularDistanceMg(
[in] IHImageX* Image2, [out] IHImageX*Score, [in] VARIANT CamParamRect1, [in] VARIANT CamParamRect2, [in] VARIANT RelPoseRect, [in] double GrayConstancy, [in] double GradientConstancy, [in] double Smoothness, [in] double InitialGuess, [in] BSTR CalculateScore, [in] VARIANT MGParamName, [in] VARIANT MGParamValue)

static void HOperatorSet.BinocularDistanceMg(HObject image1, HObject image2, out HObject distance, out HObject score, HTuple camParamRect1, HTuple camParamRect2, HTuple relPoseRect, HTuple grayConstancy, HTuple gradientConstancy, HTuple smoothness, HTuple initialGuess, HTuple calculateScore, HTuple MGParamName, HTuple MGParamValue)

HImage HPose.BinocularDistanceMg(HImage image1, HImage image2, out HImage score, HTuple camParamRect1, HTuple camParamRect2, double grayConstancy, double gradientConstancy, double smoothness, double initialGuess, string calculateScore, HTuple MGParamName, HTuple MGParamValue)

HImage HPose.BinocularDistanceMg(HImage image1, HImage image2, out HImage score, HTuple camParamRect1, HTuple camParamRect2, double grayConstancy, double gradientConstancy, double smoothness, double initialGuess, string calculateScore, string MGParamName, string MGParamValue)

HImage HImage.BinocularDistanceMg(HImage image2, out HImage score, HTuple camParamRect1, HTuple camParamRect2, HPose relPoseRect, double grayConstancy, double gradientConstancy, double smoothness, double initialGuess, string calculateScore, HTuple MGParamName, HTuple MGParamValue)

HImage HImage.BinocularDistanceMg(HImage image2, out HImage score, HTuple camParamRect1, HTuple camParamRect2, HPose relPoseRect, double grayConstancy, double gradientConstancy, double smoothness, double initialGuess, string calculateScore, string MGParamName, string MGParamValue)

Description

binocular_distance_mgbinocular_distance_mgbinocular_distance_mgBinocularDistanceMgBinocularDistanceMg calculates the disparity between two rectified stereo images Image1Image1Image1Image1image1 und Image2Image2Image2Image2image2. In contrast to binocular_disparity_mgbinocular_disparity_mgbinocular_disparity_mgBinocularDisparityMgBinocularDisparityMg, the results are transformed into distance values of the corresponding points in the scene from the first camera of the stereo system and returned in DistanceDistanceDistanceDistancedistance. In contrast to binocular_distancebinocular_distancebinocular_distanceBinocularDistanceBinocularDistance, a variational approach based on multigrid methods is used. This approach returns disparity and distance values also for image parts that contain no texture.

For the transformation of the disparity to the distance, the internal camera parameters of the rectified camera 1 CamParamRect1CamParamRect1CamParamRect1CamParamRect1camParamRect1 and of the rectified camera 2 CamParamRect2CamParamRect2CamParamRect2CamParamRect2camParamRect2, as well as the relative pose of the cameras RelPoseRectRelPoseRectRelPoseRectRelPoseRectrelPoseRect must be specified. The relative pose defines a point transformation from the rectified camera system 2 to the rectified camera system 1. These parameters can be obtained from the operators calibrate_camerascalibrate_camerascalibrate_camerasCalibrateCamerasCalibrateCameras and gen_binocular_rectification_mapgen_binocular_rectification_mapgen_binocular_rectification_mapGenBinocularRectificationMapGenBinocularRectificationMap.

A detailed description of the algorithm and of the remaining parameters can be found in the documentation of binocular_disparity_mgbinocular_disparity_mgbinocular_disparity_mgBinocularDisparityMgBinocularDisparityMg.

Parallelization

Parameters

Image1Image1Image1Image1image1 (input_object)  singlechannelimage(-array) objectHImageHImageHImageXHobject (byte / uint2 / real)

Rectified image of camera 1.

Image2Image2Image2Image2image2 (input_object)  singlechannelimage(-array) objectHImageHImageHImageXHobject (byte / uint2 / real)

Rectified image of camera 2.

DistanceDistanceDistanceDistancedistance (output_object)  singlechannelimage(-array) objectHImageHImageHImageXHobject * (real)

Distance image.

ScoreScoreScoreScorescore (output_object)  singlechannelimage(-array) objectHImageHImageHImageXHobject * (real)

Score of the calculated disparity if CalculateScoreCalculateScoreCalculateScoreCalculateScorecalculateScore is set to 'true'"true""true""true""true".

CamParamRect1CamParamRect1CamParamRect1CamParamRect1camParamRect1 (input_control)  number-array HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Internal camera parameters of the rectified camera 1.

Number of elements: (CamParamRect1 == 8) || (CamParamRect1 == 12)

CamParamRect2CamParamRect2CamParamRect2CamParamRect2camParamRect2 (input_control)  number-array HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Internal camera parameters of the rectified camera 2.

Number of elements: (CamParamRect2 == 8) || (CamParamRect2 == 12)

RelPoseRectRelPoseRectRelPoseRectRelPoseRectrelPoseRect (input_control)  pose-array HPose, HTupleHTupleHPoseX, VARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Point transformation from rectified camera 2 to rectified camera 1.

Number of elements: 7

GrayConstancyGrayConstancyGrayConstancyGrayConstancygrayConstancy (input_control)  real HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Weight of the gray value constancy in the data term.

Default value: 1.0

Suggested values: 0.0, 1.0, 2.0, 10.0

Restriction: GrayConstancy >= 0.0

GradientConstancyGradientConstancyGradientConstancyGradientConstancygradientConstancy (input_control)  real HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Weight of the gradient constancy in the data term.

Default value: 30.0

Suggested values: 0.0, 1.0, 5.0, 10.0, 30.0, 50.0, 70.0

Restriction: GradientConstancy >= 0.0

SmoothnessSmoothnessSmoothnessSmoothnesssmoothness (input_control)  real HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Weight of the smoothness term in relation to the data term.

Default value: 5.0

Suggested values: 1.0, 3.0, 5.0, 10.0

Restriction: Smoothness > 0.0

InitialGuessInitialGuessInitialGuessInitialGuessinitialGuess (input_control)  real HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Initial guess of the disparity.

Default value: 0.0

Suggested values: -30.0, -20.0, -10.0, 0.0, 10.0, 20.0, 30.0

CalculateScoreCalculateScoreCalculateScoreCalculateScorecalculateScore (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Should the quality measure be returned in ScoreScoreScoreScorescore?

Default value: 'false' "false" "false" "false" "false"

Suggested values: 'true'"true""true""true""true", 'false'"false""false""false""false"

MGParamNameMGParamNameMGParamNameMGParamNameMGParamName (input_control)  attribute.name(-array) HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Parameter name(s) for the multigrid algorithm.

Default value: 'default_parameters' "default_parameters" "default_parameters" "default_parameters" "default_parameters"

List of values: 'default_parameters'"default_parameters""default_parameters""default_parameters""default_parameters", 'mg_solver'"mg_solver""mg_solver""mg_solver""mg_solver", 'mg_cycle_type'"mg_cycle_type""mg_cycle_type""mg_cycle_type""mg_cycle_type", 'mg_pre_relax'"mg_pre_relax""mg_pre_relax""mg_pre_relax""mg_pre_relax", 'mg_post_relax'"mg_post_relax""mg_post_relax""mg_post_relax""mg_post_relax", 'initial_level'"initial_level""initial_level""initial_level""initial_level", 'pyramid_factor'"pyramid_factor""pyramid_factor""pyramid_factor""pyramid_factor", 'iterations'"iterations""iterations""iterations""iterations"

MGParamValueMGParamValueMGParamValueMGParamValueMGParamValue (input_control)  attribute.value(-array) HTupleHTupleVARIANTHtuple (string / real / integer) (string / double / int / long) (char* / double / Hlong) (BSTR / double / Hlong) (char* / double / Hlong)

Parameter value(s) for the multigrid algorithm.

Default value: 'fast_accurate' "fast_accurate" "fast_accurate" "fast_accurate" "fast_accurate"

Suggested values: 'very_accurate'"very_accurate""very_accurate""very_accurate""very_accurate", 'accurate'"accurate""accurate""accurate""accurate", 'fast_accurate'"fast_accurate""fast_accurate""fast_accurate""fast_accurate", 'fast'"fast""fast""fast""fast", 'v'"v""v""v""v", 'w'"w""w""w""w", 'none'"none""none""none""none", 'gauss_seidel'"gauss_seidel""gauss_seidel""gauss_seidel""gauss_seidel", 'multigrid'"multigrid""multigrid""multigrid""multigrid", 'full_multigrid'"full_multigrid""full_multigrid""full_multigrid""full_multigrid", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, -1, -2, -3, -4, -5

Result

If the parameter values are correct, binocular_distance_mgbinocular_distance_mgbinocular_distance_mgBinocularDistanceMgBinocularDistanceMg returns the value 2 (H_MSG_TRUE). If the input is empty (no input images are available) the behavior can be set via set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary, an exception is raised.

Possible Predecessors

map_imagemap_imagemap_imageMapImageMapImage

Possible Successors

thresholdthresholdthresholdThresholdThreshold

Alternatives

binocular_disparitybinocular_disparitybinocular_disparityBinocularDisparityBinocularDisparity, binocular_distancebinocular_distancebinocular_distanceBinocularDistanceBinocularDistance, binocular_disparity_mgbinocular_disparity_mgbinocular_disparity_mgBinocularDisparityMgBinocularDisparityMg

See also

map_imagemap_imagemap_imageMapImageMapImage, gen_binocular_rectification_mapgen_binocular_rectification_mapgen_binocular_rectification_mapGenBinocularRectificationMapGenBinocularRectificationMap, binocular_calibrationbinocular_calibrationbinocular_calibrationBinocularCalibrationBinocularCalibration

Module

3D Metrology


Table of Contents / 3D Reconstruction / Binocular Stereo ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH