find_marks_and_pose ( Image, CalTabRegion : : CalTabDescrFile, StartCamParam, StartThresh, DeltaThresh : RCoord, CCoord, StartPose )

Extract the 2D calibration marks from the video image and calculate initial values for the external camera parameters.

find_marks_and_pose is used to determine the necessary input data for the subsequent camera calibration (see camera_calibration): On the one hand the 2D center points [RCoord,CCoord] of the calibration marks within the region CalTabRegion of the input image Image are extracted and ordered. On the other hand a rough estimate for the external camera parameters (StartPose) is computed, i.e., the 3D pose of the camera in the calibration table coordinate system.

Within the region CalTabRegion, which may have been found by applying the operator find_caltab, in the input image Image an edge detector is applied, see edges__. In this edge image closed contours are searched for: The number of closed contours must correspond to the number of calibration marks as described in the calibration table description file CalTabDescrFile and the contours have to be elliptic shaped. For that purpose a threshold operator is applied, which segments the bright regions in the amplitude of the edge detector. First, the threshold value is set to StartThresh. If the search for the closed contours or the successive pose estimate fails, this threshold value is decreased by DeltaThresh successively.

Each of the found contours is refined with subpixel accuracy and subsequently approximated by an ellipse. The center points of these ellipses represent a good approximation of the desired 2D image coordinates [RCoord,CCoord] of the calibration mark center points. The order of the values within these two tuples is in row-major order beginning on the upper left in the image. This order must correspond to the order of the 3D coordinates of the calibration marks in the calibration table description file CalTabDescrFile, since this fixes the correspondences between extracted image marks and known model marks!

Based on the ellipse parameters for each calibration mark a rough estimate for the external camera parameters is computed finally. For that purpose the fixed correspondences between extracted image marks and known model marks are used. The estimate StartPose describes the pose of the camera in the calibration table coordinate system (see write_cam_pose) as desired by the operator camera_calibration.


Parameters

Image (input_object)
image -> object : byte
Input image.

CalTabRegion (input_object)
region -> object
Region of the calibration table.

CalTabDescrFile (input_control)
string -> string
File name of the calibration table description.
Default value: 'caltab.descr'

StartCamParam (input_control)
number-array -> real / integer
Initial values for the internal camera parameters.

StartThresh (input_control)
number -> integer
Initial threshold value for contour detection.
Default value: 128
List of values: 80, 96, 112, 128, 144, 160

DeltaThresh (input_control)
number -> integer
Loop value for successive reduction of StartThresh.
Default value: 10
List of values: 6, 8, 10, 12, 14, 16, 18, 20, 22

RCoord (output_control)
real-array -> real
Tuple with row-coordinates of the detected marks.

CCoord (output_control)
real-array -> real
Tuple with column-coordinates of the detected marks.

StartPose (output_control)
number-array -> real / integer
Estimation for the external camera parameters.
Number of elements: 7


Example
/* read calibration image */
read_image(:Image:'calib-01.tiff':) >
/* find calibration pattern */
find_caltab(Image:Caltab1:'caltab.descr',3,112:) >
/* find calibration marks and start pose */
find_marks_and_pose(Image,Caltab::'caltab.descr',[0.008,0.0,
  0.000011,0.000011,384,288,768,576],128,10:RCoord,CCoord,StartPose).

Result

find_marks_and_pose returns TRUE if all parameter values are correct and an estimation for the external camera parameters has been determined successfully. If necessary an exception is raised.


Possible Predecessors

find_caltab


Possible Successors

camera_calibration


See also

find_caltab, camera_calibration, disp_caltab, sim_caltab, read_cam_par, write_cam_pose, pose_to_hom_mat, caltab_points, create_caltab



Copyright © 1996-1997 MVTec Software GmbH