Name
binocular_distance T_binocular_distance BinocularDistance binocular_distance BinocularDistance BinocularDistance — Compute the distance values for a rectified stereo image pair using correlation
techniques.
binocular_distance (ImageRect1 , ImageRect2 : Distance , Score : CamParamRect1 , CamParamRect2 , RelPoseRect , Method , MaskWidth , MaskHeight , TextureThresh , MinDisparity , MaxDisparity , NumLevels , ScoreThresh , Filter , SubDistance : )
Herror T_binocular_distance (const Hobject ImageRect1 , const Hobject ImageRect2 , Hobject* Distance , Hobject* Score , const Htuple CamParamRect1 , const Htuple CamParamRect2 , const Htuple RelPoseRect , const Htuple Method , const Htuple MaskWidth , const Htuple MaskHeight , const Htuple TextureThresh , const Htuple MinDisparity , const Htuple MaxDisparity , const Htuple NumLevels , const Htuple ScoreThresh , const Htuple Filter , const Htuple SubDistance )
Herror binocular_distance (Hobject ImageRect1 , Hobject ImageRect2 , Hobject* Distance , Hobject* Score , const HTuple& CamParamRect1 , const HTuple& CamParamRect2 , const HTuple& RelPoseRect , const HTuple& Method , const HTuple& MaskWidth , const HTuple& MaskHeight , const HTuple& TextureThresh , const HTuple& MinDisparity , const HTuple& MaxDisparity , const HTuple& NumLevels , const HTuple& ScoreThresh , const HTuple& Filter , const HTuple& SubDistance )
HImage HImage ::BinocularDistance (const HImage& ImageRect2 , HImage* Score , const HTuple& CamParamRect1 , const HTuple& CamParamRect2 , const HTuple& RelPoseRect , const HTuple& Method , const HTuple& MaskWidth , const HTuple& MaskHeight , const HTuple& TextureThresh , const HTuple& MinDisparity , const HTuple& MaxDisparity , const HTuple& NumLevels , const HTuple& ScoreThresh , const HTuple& Filter , const HTuple& SubDistance ) const
void BinocularDistance (const HObject& ImageRect1 , const HObject& ImageRect2 , HObject* Distance , HObject* Score , const HTuple& CamParamRect1 , const HTuple& CamParamRect2 , const HTuple& RelPoseRect , const HTuple& Method , const HTuple& MaskWidth , const HTuple& MaskHeight , const HTuple& TextureThresh , const HTuple& MinDisparity , const HTuple& MaxDisparity , const HTuple& NumLevels , const HTuple& ScoreThresh , const HTuple& Filter , const HTuple& SubDistance )
HImage HImage ::BinocularDistance (const HImage& ImageRect2 , HImage* Score , const HTuple& CamParamRect1 , const HTuple& CamParamRect2 , const HPose& RelPoseRect , const HString& Method , Hlong MaskWidth , Hlong MaskHeight , const HTuple& TextureThresh , Hlong MinDisparity , Hlong MaxDisparity , Hlong NumLevels , const HTuple& ScoreThresh , const HTuple& Filter , const HTuple& SubDistance ) const
HImage HImage ::BinocularDistance (const HImage& ImageRect2 , HImage* Score , const HTuple& CamParamRect1 , const HTuple& CamParamRect2 , const HPose& RelPoseRect , const HString& Method , Hlong MaskWidth , Hlong MaskHeight , double TextureThresh , Hlong MinDisparity , Hlong MaxDisparity , Hlong NumLevels , double ScoreThresh , const HString& Filter , const HString& SubDistance ) const
HImage HImage ::BinocularDistance (const HImage& ImageRect2 , HImage* Score , const HTuple& CamParamRect1 , const HTuple& CamParamRect2 , const HPose& RelPoseRect , const char* Method , Hlong MaskWidth , Hlong MaskHeight , double TextureThresh , Hlong MinDisparity , Hlong MaxDisparity , Hlong NumLevels , double ScoreThresh , const char* Filter , const char* SubDistance ) const
HImage HPose ::BinocularDistance (const HImage& ImageRect1 , const HImage& ImageRect2 , HImage* Score , const HTuple& CamParamRect1 , const HTuple& CamParamRect2 , const HString& Method , Hlong MaskWidth , Hlong MaskHeight , const HTuple& TextureThresh , Hlong MinDisparity , Hlong MaxDisparity , Hlong NumLevels , const HTuple& ScoreThresh , const HTuple& Filter , const HTuple& SubDistance ) const
HImage HPose ::BinocularDistance (const HImage& ImageRect1 , const HImage& ImageRect2 , HImage* Score , const HTuple& CamParamRect1 , const HTuple& CamParamRect2 , const HString& Method , Hlong MaskWidth , Hlong MaskHeight , double TextureThresh , Hlong MinDisparity , Hlong MaxDisparity , Hlong NumLevels , double ScoreThresh , const HString& Filter , const HString& SubDistance ) const
HImage HPose ::BinocularDistance (const HImage& ImageRect1 , const HImage& ImageRect2 , HImage* Score , const HTuple& CamParamRect1 , const HTuple& CamParamRect2 , const char* Method , Hlong MaskWidth , Hlong MaskHeight , double TextureThresh , Hlong MinDisparity , Hlong MaxDisparity , Hlong NumLevels , double ScoreThresh , const char* Filter , const char* SubDistance ) const
void HOperatorSetX .BinocularDistance ( [in] IHUntypedObjectX* ImageRect1 , [in] IHUntypedObjectX* ImageRect2 , [out] IHUntypedObjectX* * Distance , [out] IHUntypedObjectX* * Score , [in] VARIANT CamParamRect1 , [in] VARIANT CamParamRect2 , [in] VARIANT RelPoseRect , [in] VARIANT Method , [in] VARIANT MaskWidth , [in] VARIANT MaskHeight , [in] VARIANT TextureThresh , [in] VARIANT MinDisparity , [in] VARIANT MaxDisparity , [in] VARIANT NumLevels , [in] VARIANT ScoreThresh , [in] VARIANT Filter , [in] VARIANT SubDistance )
IHImageX* HImageX .BinocularDistance ( [in] IHImageX* ImageRect2 , [out] IHImageX* * Score , [in] VARIANT CamParamRect1 , [in] VARIANT CamParamRect2 , [in] VARIANT RelPoseRect , [in] BSTR Method , [in] Hlong MaskWidth , [in] Hlong MaskHeight , [in] VARIANT TextureThresh , [in] Hlong MinDisparity , [in] Hlong MaxDisparity , [in] Hlong NumLevels , [in] VARIANT ScoreThresh , [in] VARIANT Filter , [in] VARIANT SubDistance )
IHImageX* HPoseX .BinocularDistance ( [in] IHImageX* ImageRect1 , [in] IHImageX* ImageRect2 , [out] IHImageX* * Score , [in] VARIANT CamParamRect1 , [in] VARIANT CamParamRect2 , [in] VARIANT RelPoseRect , [in] BSTR Method , [in] Hlong MaskWidth , [in] Hlong MaskHeight , [in] VARIANT TextureThresh , [in] Hlong MinDisparity , [in] Hlong MaxDisparity , [in] Hlong NumLevels , [in] VARIANT ScoreThresh , [in] VARIANT Filter , [in] VARIANT SubDistance )
static void HOperatorSet .BinocularDistance (HObject imageRect1 , HObject imageRect2 , out HObject distance , out HObject score , HTuple camParamRect1 , HTuple camParamRect2 , HTuple relPoseRect , HTuple method , HTuple maskWidth , HTuple maskHeight , HTuple textureThresh , HTuple minDisparity , HTuple maxDisparity , HTuple numLevels , HTuple scoreThresh , HTuple filter , HTuple subDistance )
HImage HImage .BinocularDistance (HImage imageRect2 , out HImage score , HTuple camParamRect1 , HTuple camParamRect2 , HPose relPoseRect , string method , int maskWidth , int maskHeight , HTuple textureThresh , int minDisparity , int maxDisparity , int numLevels , HTuple scoreThresh , HTuple filter , HTuple subDistance )
HImage HImage .BinocularDistance (HImage imageRect2 , out HImage score , HTuple camParamRect1 , HTuple camParamRect2 , HPose relPoseRect , string method , int maskWidth , int maskHeight , double textureThresh , int minDisparity , int maxDisparity , int numLevels , double scoreThresh , string filter , string subDistance )
HImage HPose .BinocularDistance (HImage imageRect1 , HImage imageRect2 , out HImage score , HTuple camParamRect1 , HTuple camParamRect2 , string method , int maskWidth , int maskHeight , HTuple textureThresh , int minDisparity , int maxDisparity , int numLevels , HTuple scoreThresh , HTuple filter , HTuple subDistance )
HImage HPose .BinocularDistance (HImage imageRect1 , HImage imageRect2 , out HImage score , HTuple camParamRect1 , HTuple camParamRect2 , string method , int maskWidth , int maskHeight , double textureThresh , int minDisparity , int maxDisparity , int numLevels , double scoreThresh , string filter , string subDistance )
binocular_distance binocular_distance BinocularDistance binocular_distance BinocularDistance BinocularDistance computes the distance values for a
rectified stereo image pair using correlation techniques. The operator
first calculates the disparities between the two images ImageRect1 ImageRect1 ImageRect1 ImageRect1 ImageRect1 imageRect1
and ImageRect2 ImageRect2 ImageRect2 ImageRect2 ImageRect2 imageRect2 similar to binocular_disparity binocular_disparity BinocularDisparity binocular_disparity BinocularDisparity BinocularDisparity . The
resulting disparities are transformed into distance values of
the corresponding 3D world points to the rectified stereo camera system
as in disparity_to_distance disparity_to_distance DisparityToDistance disparity_to_distance DisparityToDistance DisparityToDistance . The distances are returned in the
single-channel image Distance Distance Distance Distance Distance distance in which each gray value
represents the distance of the respective 3D world point to the stereo
camera system.
The algorithm requires a reference image ImageRect1 ImageRect1 ImageRect1 ImageRect1 ImageRect1 imageRect1 and a search
image ImageRect2 ImageRect2 ImageRect2 ImageRect2 ImageRect2 imageRect2 which must be rectified, i.e.,
corresponding epipolar lines are parallel and lie on identical image
rows (
). In case this assumption is
violated the images can be rectified by using the operators
calibrate_cameras calibrate_cameras CalibrateCameras calibrate_cameras CalibrateCameras CalibrateCameras ,
gen_binocular_rectification_map gen_binocular_rectification_map GenBinocularRectificationMap gen_binocular_rectification_map GenBinocularRectificationMap GenBinocularRectificationMap and
map_image map_image MapImage map_image MapImage MapImage . Hence, given a pixel in the reference image
ImageRect1 ImageRect1 ImageRect1 ImageRect1 ImageRect1 imageRect1 the homologous pixel in ImageRect2 ImageRect2 ImageRect2 ImageRect2 ImageRect2 imageRect2 is selected
by searching along the corresponding row in ImageRect2 ImageRect2 ImageRect2 ImageRect2 ImageRect2 imageRect2 and
matching a local neighborhood within a rectangular window of size
MaskWidth MaskWidth MaskWidth MaskWidth MaskWidth maskWidth and MaskHeight MaskHeight MaskHeight MaskHeight MaskHeight maskHeight . For each defined
reference pixel the pixel correspondences are transformed into
distances of the world points defined by the intersection of the
lines of sight of a corresponding pixel pair to the z=0
plane of the rectified stereo system.
For this transformation the rectified internal camera parameters
CamParamRect1 CamParamRect1 CamParamRect1 CamParamRect1 CamParamRect1 camParamRect1 of camera 1 and CamParamRect2 CamParamRect2 CamParamRect2 CamParamRect2 CamParamRect2 camParamRect2
of camera 2, and the external parameters
RelPoseRect RelPoseRect RelPoseRect RelPoseRect RelPoseRect relPoseRect have to
be defined. Latter characterizes the relative pose of both cameras to each
other and specifies a point transformation from the rectified camera
system 2 to the rectified camera system 1. These parameters can
be obtained from the operator calibrate_cameras calibrate_cameras CalibrateCameras calibrate_cameras CalibrateCameras CalibrateCameras and
gen_binocular_rectification_map gen_binocular_rectification_map GenBinocularRectificationMap gen_binocular_rectification_map GenBinocularRectificationMap GenBinocularRectificationMap . After all, a quality
measure for each distance value is returned in Score Score Score Score Score score ,
containing the best result of the matching function
S of a reference pixel. For the matching, the gray values of the
original unprocessed images are used.
The used matching function is defined by the parameter Method Method Method Method Method method
allocating three different kinds of correlation:
'sad' "sad" "sad" "sad" "sad" "sad" : Summed Absolute Differences
'ssd' "ssd" "ssd" "ssd" "ssd" "ssd" : Summed Squared Differences
'ncc' "ncc" "ncc" "ncc" "ncc" "ncc" : Normalized Cross Correlation
with
r1, c1, r2, c2: row and column coordinates of the corresponding pixels of
the two input images,
g1, g2: gray values of the unprocessed input images,
N=(2m+1)(2n+1): size of correlation window
mean value within the correlation window of width 2m+1 and
height 2n+1.
Note that the methods 'sad' "sad" "sad" "sad" "sad" "sad" and 'ssd' "ssd" "ssd" "ssd" "ssd" "ssd" compare the gray
values of the pixels within a mask window directly, whereas 'ncc' "ncc" "ncc" "ncc" "ncc" "ncc"
compensates for the mean gray value and its variance within the mask
window. Therefore, if the two images differ in brightness and contrast, this
method should be preferred. For images with similar brightness and contrast
'sad' "sad" "sad" "sad" "sad" "sad" and 'ssd' "ssd" "ssd" "ssd" "ssd" "ssd" are to be preferred as they are faster
because of less complex internal computations.
It should be noted that the quality of correlation for rising S is
falling in methods 'sad' "sad" "sad" "sad" "sad" "sad" and 'ssd' "ssd" "ssd" "ssd" "ssd" "ssd" (the best
quality value is 0) but rising in method 'ncc' "ncc" "ncc" "ncc" "ncc" "ncc" (the best
quality value is 1.0).
The size of the correlation window has to be odd numbered and is
passed in MaskWidth MaskWidth MaskWidth MaskWidth MaskWidth maskWidth and MaskHeight MaskHeight MaskHeight MaskHeight MaskHeight maskHeight . The search
space is confined by the minimum and maximum disparity value
MinDisparity MinDisparity MinDisparity MinDisparity MinDisparity minDisparity and MaxDisparity MaxDisparity MaxDisparity MaxDisparity MaxDisparity maxDisparity . Due to pixel values
not defined beyond the image border the resulting domain of
Distance Distance Distance Distance Distance distance and Score Score Score Score Score score is generally not set along the
image border within a margin of height MaskHeight MaskHeight MaskHeight MaskHeight MaskHeight maskHeight /2 at the
top and bottom border and of width MaskWidth MaskWidth MaskWidth MaskWidth MaskWidth maskWidth /2 at the left
and right border. For the same reason, the maximum disparity range
is reduced at the left and right image border.
Since matching turns out to be highly unreliable when dealing with
poorly textured areas, the minimum variance within the
correlation window can be defined in TextureThresh TextureThresh TextureThresh TextureThresh TextureThresh textureThresh . This
threshold is applied on both input images ImageRect1 ImageRect1 ImageRect1 ImageRect1 ImageRect1 imageRect1 and
ImageRect2 ImageRect2 ImageRect2 ImageRect2 ImageRect2 imageRect2 . In addition, ScoreThresh ScoreThresh ScoreThresh ScoreThresh ScoreThresh scoreThresh guarantees the
matching quality and defines the maximum
('sad' "sad" "sad" "sad" "sad" "sad" ,'ssd' "ssd" "ssd" "ssd" "ssd" "ssd" ) or, respectively, minimum
('ncc' "ncc" "ncc" "ncc" "ncc" "ncc" ) score value of the correlation
function. Setting Filter Filter Filter Filter Filter filter to 'left_right_check' "left_right_check" "left_right_check" "left_right_check" "left_right_check" "left_right_check" ,
moreover, increases the robustness of the returned matches, as the
result relies on a concurrent direct and reverse match, whereas
'none' "none" "none" "none" "none" "none" switches it off.
The number of pyramid levels used to improve the time response of
binocular_distance binocular_distance BinocularDistance binocular_distance BinocularDistance BinocularDistance is determined by
NumLevels NumLevels NumLevels NumLevels NumLevels numLevels . Following a coarse-to-fine scheme disparity
images of higher levels are computed and segmentated into
rectangular subimages to reduce the disparity range on the next
lower pyramid level. TextureThresh TextureThresh TextureThresh TextureThresh TextureThresh textureThresh and ScoreThresh ScoreThresh ScoreThresh ScoreThresh ScoreThresh scoreThresh
are applied on every level and the returned domain of the
Distance Distance Distance Distance Distance distance and Score Score Score Score Score score images arises from the
intersection of the resulting domains of every single
level. Generally, pyramid structures are the more advantageous the
more the distance image can be segmented into regions of homogeneous
distance values and the bigger the disparity range must be
specified. As a drawback, coarse pyramid levels might loose
important texture information which can result in deficient distance
values.
Finally, the value 'interpolation' "interpolation" "interpolation" "interpolation" "interpolation" "interpolation" for parameter
SubDistance SubDistance SubDistance SubDistance SubDistance subDistance increases the refinement and accuracy of the
distance values. It is switched off by setting the parameter to
'none' "none" "none" "none" "none" "none" .
If using cameras with telecentric lenses, the Distance Distance Distance Distance Distance distance is not
defined as the distance of a point to the camera but as the distance from
the point to the plane, defined by the y-axes of both cameras and their
baseline (see gen_binocular_rectification_map gen_binocular_rectification_map GenBinocularRectificationMap gen_binocular_rectification_map GenBinocularRectificationMap GenBinocularRectificationMap ).
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
Multithreading scope: global (may be called from any thread).
Automatically parallelized on internal data level.
Rectified image of camera 1.
Rectified image of camera 2.
Evaluation of a distance value.
Internal camera parameters of the rectified
camera 1.
Number of elements: CamParamRect1 == 8 || CamParamRect1 == 12
Internal camera parameters of the rectified
camera 2.
Number of elements: CamParamRect2 == 8 || CamParamRect2 == 12
Point transformation from the rectified camera 2 to the
rectified camera 1.
Number of elements: 7
Matching function.
Default value:
'ncc'
"ncc"
"ncc"
"ncc"
"ncc"
"ncc"
List of values: 'ncc' "ncc" "ncc" "ncc" "ncc" "ncc" , 'sad' "sad" "sad" "sad" "sad" "sad" , 'ssd' "ssd" "ssd" "ssd" "ssd" "ssd"
Width of the correlation window.
Default value: 11
Suggested values: 5, 7, 9, 11, 21
Restriction: 3 <= MaskWidth && odd(MaskWidth)
Height of the correlation window.
Default value: 11
Suggested values: 5, 7, 9, 11, 21
Restriction: 3 <= MaskHeight && odd(MaskHeight)
Variance threshold of textured image regions.
Default value: 0.0
Suggested values: 0.0, 2.0, 5.0, 10.0
Restriction: 0.0 <= TextureThresh
Minimum of the expected disparities.
Default value: 0
Typical range of values: -32768
≤
MinDisparity
MinDisparity
MinDisparity
MinDisparity
MinDisparity
minDisparity
≤
32767
Maximum of the expected disparities.
Default value: 30
Typical range of values: -32768
≤
MaxDisparity
MaxDisparity
MaxDisparity
MaxDisparity
MaxDisparity
maxDisparity
≤
32767
Number of pyramid levels.
Default value: 1
List of values: 1, 2, 3, 4
Restriction: 1 <= NumLevels
Threshold of the correlation function.
Default value: 0.0
List of values: 0.0, 2.0, 5.0, 10.0
Downstream filters.
Default value:
'none'
"none"
"none"
"none"
"none"
"none"
List of values: 'left_right_check' "left_right_check" "left_right_check" "left_right_check" "left_right_check" "left_right_check" , 'none' "none" "none" "none" "none" "none"
Distance interpolation.
Default value:
'none'
"none"
"none"
"none"
"none"
"none"
List of values: 'interpolation' "interpolation" "interpolation" "interpolation" "interpolation" "interpolation" , 'none' "none" "none" "none" "none" "none"
* read the internal and external stereo parameters
read_cam_par ('cam_left.dat', CamParam1)
read_cam_par ('cam_right.dat', CamParam2)
read_pose ('relpose.dat', RelPose)
* compute the mapping for rectified images
gen_binocular_rectification_map (Map1, Map2, CamParam1, CamParam2, \
RelPose, 1, 'geometric', 'bilinear', \
CamParamRect1, CamParamRect2, \
Cam1PoseRect1, Cam2PoseRect2, RelPoseRect)
* compute the distance values in online images
while (1)
grab_image_async (Image1, AcqHandle1, -1)
map_image (Image1, Map1, ImageRect1)
grab_image_async (Image2, AcqHandle2, -1)
map_image (Image2, Map2, ImageRect2)
binocular_distance (ImageRect1, ImageRect2, Distance, Score, \
CamParamRect1, CamParamRect2, RelPoseRect, 'sad', \
11, 11, 20, -40, 20, 2, 25, \
'left_right_check', 'interpolation')
endwhile
* read the internal and external stereo parameters
read_cam_par ('cam_left.dat', CamParam1)
read_cam_par ('cam_right.dat', CamParam2)
read_pose ('relpose.dat', RelPose)
* compute the mapping for rectified images
gen_binocular_rectification_map (Map1, Map2, CamParam1, CamParam2, \
RelPose, 1, 'geometric', 'bilinear', \
CamParamRect1, CamParamRect2, \
Cam1PoseRect1, Cam2PoseRect2, RelPoseRect)
* compute the distance values in online images
while (1)
grab_image_async (Image1, AcqHandle1, -1)
map_image (Image1, Map1, ImageRect1)
grab_image_async (Image2, AcqHandle2, -1)
map_image (Image2, Map2, ImageRect2)
binocular_distance (ImageRect1, ImageRect2, Distance, Score, \
CamParamRect1, CamParamRect2, RelPoseRect, 'sad', \
11, 11, 20, -40, 20, 2, 25, \
'left_right_check', 'interpolation')
endwhile
* read the internal and external stereo parameters
read_cam_par ('cam_left.dat', CamParam1)
read_cam_par ('cam_right.dat', CamParam2)
read_pose ('relpose.dat', RelPose)
* compute the mapping for rectified images
gen_binocular_rectification_map (Map1, Map2, CamParam1, CamParam2, \
RelPose, 1, 'geometric', 'bilinear', \
CamParamRect1, CamParamRect2, \
Cam1PoseRect1, Cam2PoseRect2, RelPoseRect)
* compute the distance values in online images
while (1)
grab_image_async (Image1, AcqHandle1, -1)
map_image (Image1, Map1, ImageRect1)
grab_image_async (Image2, AcqHandle2, -1)
map_image (Image2, Map2, ImageRect2)
binocular_distance (ImageRect1, ImageRect2, Distance, Score, \
CamParamRect1, CamParamRect2, RelPoseRect, 'sad', \
11, 11, 20, -40, 20, 2, 25, \
'left_right_check', 'interpolation')
endwhile
// read the internal and external stereo parameters
read_cam_par("cam_left.dat",CamParam1);
read_cam_par("cam_right.dat",CamParam2);
read_pose("relpose.dat",RelPose);
// compute the mapping for rectified images
gen_binocular_rectification_map(&Map1,&Map2,CamParam1,CamParam2,RelPose,1,
"geometric","bilinear",&CamParamRect1,
&CamParamRect2,&CamPoseRect1,&CamPoseRect2,
&RelPoseRect);
// compute the distance values in online images
while (1)
{
grab_image_async(&Image1,AcqHandle1,-1);
map_image(Image1,Map1,&ImageRect1);
grab_image_async(&Image2,AcqHandle2,-1);
map_image(Image2,Map2,&ImageRect2);
binocular_distance(ImageRect1,ImageRect2,&Distance,&Score,
CamParamRect1,CamParamRect2,RelPose,"sad",11,11,
20,-40,20,2,25,"left_right_check","interpolation");
}
* read the internal and external stereo parameters
read_cam_par ('cam_left.dat', CamParam1)
read_cam_par ('cam_right.dat', CamParam2)
read_pose ('relpose.dat', RelPose)
* compute the mapping for rectified images
gen_binocular_rectification_map (Map1, Map2, CamParam1, CamParam2, \
RelPose, 1, 'geometric', 'bilinear', \
CamParamRect1, CamParamRect2, \
Cam1PoseRect1, Cam2PoseRect2, RelPoseRect)
* compute the distance values in online images
while (1)
grab_image_async (Image1, AcqHandle1, -1)
map_image (Image1, Map1, ImageRect1)
grab_image_async (Image2, AcqHandle2, -1)
map_image (Image2, Map2, ImageRect2)
binocular_distance (ImageRect1, ImageRect2, Distance, Score, \
CamParamRect1, CamParamRect2, RelPoseRect, 'sad', \
11, 11, 20, -40, 20, 2, 25, \
'left_right_check', 'interpolation')
endwhile
* read the internal and external stereo parameters
read_cam_par ('cam_left.dat', CamParam1)
read_cam_par ('cam_right.dat', CamParam2)
read_pose ('relpose.dat', RelPose)
* compute the mapping for rectified images
gen_binocular_rectification_map (Map1, Map2, CamParam1, CamParam2, \
RelPose, 1, 'geometric', 'bilinear', \
CamParamRect1, CamParamRect2, \
Cam1PoseRect1, Cam2PoseRect2, RelPoseRect)
* compute the distance values in online images
while (1)
grab_image_async (Image1, AcqHandle1, -1)
map_image (Image1, Map1, ImageRect1)
grab_image_async (Image2, AcqHandle2, -1)
map_image (Image2, Map2, ImageRect2)
binocular_distance (ImageRect1, ImageRect2, Distance, Score, \
CamParamRect1, CamParamRect2, RelPoseRect, 'sad', \
11, 11, 20, -40, 20, 2, 25, \
'left_right_check', 'interpolation')
endwhile
binocular_disparity binocular_disparity BinocularDisparity binocular_disparity BinocularDisparity BinocularDisparity returns 2 (H_MSG_TRUE) if all parameter values
are correct. If necessary, an exception is raised.
map_image map_image MapImage map_image MapImage MapImage
threshold threshold Threshold threshold Threshold Threshold
binocular_distance_mg binocular_distance_mg BinocularDistanceMg binocular_distance_mg BinocularDistanceMg BinocularDistanceMg ,
binocular_distance_ms binocular_distance_ms BinocularDistanceMs binocular_distance_ms BinocularDistanceMs BinocularDistanceMs ,
binocular_disparity binocular_disparity BinocularDisparity binocular_disparity BinocularDisparity BinocularDisparity ,
binocular_disparity_mg binocular_disparity_mg BinocularDisparityMg binocular_disparity_mg BinocularDisparityMg BinocularDisparityMg ,
binocular_disparity_ms binocular_disparity_ms BinocularDisparityMs binocular_disparity_ms BinocularDisparityMs BinocularDisparityMs
map_image map_image MapImage map_image MapImage MapImage ,
gen_binocular_rectification_map gen_binocular_rectification_map GenBinocularRectificationMap gen_binocular_rectification_map GenBinocularRectificationMap GenBinocularRectificationMap ,
binocular_calibration binocular_calibration BinocularCalibration binocular_calibration BinocularCalibration BinocularCalibration ,
distance_to_disparity distance_to_disparity DistanceToDisparity distance_to_disparity DistanceToDisparity DistanceToDisparity ,
disparity_to_distance disparity_to_distance DisparityToDistance disparity_to_distance DisparityToDistance DisparityToDistance ,
disparity_image_to_xyz disparity_image_to_xyz DisparityImageToXyz disparity_image_to_xyz DisparityImageToXyz DisparityImageToXyz
3D Metrology