ClassesClassesClassesClasses | | | | Operators

disp_caltabT_disp_caltabDispCaltabdisp_caltabDispCaltabDispCaltab (Operator)

Name

disp_caltabT_disp_caltabDispCaltabdisp_caltabDispCaltabDispCaltab — Project and visualize the 3D model of the calibration plate in the image.

Signature

disp_caltab( : : WindowHandle, CalTabDescrFile, CameraParam, CaltabPose, ScaleFac : )

Herror T_disp_caltab(const Htuple WindowHandle, const Htuple CalTabDescrFile, const Htuple CameraParam, const Htuple CaltabPose, const Htuple ScaleFac)

Herror disp_caltab(const HTuple& WindowHandle, const HTuple& CalTabDescrFile, const HTuple& CameraParam, const HTuple& CaltabPose, const HTuple& ScaleFac)

void HWindow::DispCaltab(const HTuple& CalTabDescrFile, const HTuple& CameraParam, const HTuple& CaltabPose, const HTuple& ScaleFac) const

void DispCaltab(const HTuple& WindowHandle, const HTuple& CalTabDescrFile, const HTuple& CameraParam, const HTuple& CaltabPose, const HTuple& ScaleFac)

void HWindow::DispCaltab(const HString& CalTabDescrFile, const HTuple& CameraParam, const HPose& CaltabPose, double ScaleFac) const

void HWindow::DispCaltab(const char* CalTabDescrFile, const HTuple& CameraParam, const HPose& CaltabPose, double ScaleFac) const

void HOperatorSetX.DispCaltab(
[in] VARIANT WindowHandle, [in] VARIANT CalTabDescrFile, [in] VARIANT CameraParam, [in] VARIANT CaltabPose, [in] VARIANT ScaleFac)

void HWindowX.DispCaltab(
[in] BSTR CalTabDescrFile, [in] VARIANT CameraParam, [in] VARIANT CaltabPose, [in] double ScaleFac)

static void HOperatorSet.DispCaltab(HTuple windowHandle, HTuple calTabDescrFile, HTuple cameraParam, HTuple caltabPose, HTuple scaleFac)

void HWindow.DispCaltab(string calTabDescrFile, HTuple cameraParam, HPose caltabPose, double scaleFac)

Description

disp_caltabdisp_caltabDispCaltabdisp_caltabDispCaltabDispCaltab is used to visualize the calibration marks and the connecting lines between the marks of the used calibration plate (CalTabDescrFileCalTabDescrFileCalTabDescrFileCalTabDescrFileCalTabDescrFilecalTabDescrFile) in the window specified by WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle. Additionally, the x- and y-axes of the plate's coordinate system are printed on the plate's surface. For this, the 3D model of the calibration plate is projected into the image plane using the internal (CameraParamCameraParamCameraParamCameraParamCameraParamcameraParam) and external camera parameters (CaltabPoseCaltabPoseCaltabPoseCaltabPoseCaltabPosecaltabPose, i.e., the pose of the calibration plate in camera coordinates). The underlying camera model (pinhole, telecentric, or line scan camera with radial distortion) is described in write_cam_parwrite_cam_parWriteCamParwrite_cam_parWriteCamParWriteCamPar.

Typically, disp_caltabdisp_caltabDispCaltabdisp_caltabDispCaltabDispCaltab is used to verify the result of the camera calibration (see calibrate_camerascalibrate_camerasCalibrateCamerascalibrate_camerasCalibrateCamerasCalibrateCameras) or camera_calibrationcamera_calibrationCameraCalibrationcamera_calibrationCameraCalibrationCameraCalibration) by superimposing it onto the original image. The current line width can be set by set_line_widthset_line_widthSetLineWidthset_line_widthSetLineWidthSetLineWidth, the current color can be set by set_colorset_colorSetColorset_colorSetColorSetColor. Additionally, the font type of the labels of the coordinate axes can be set by set_fontset_fontSetFontset_fontSetFontSetFont.

The parameter ScaleFacScaleFacScaleFacScaleFacScaleFacscaleFac influences the number of supporting points to approximate the elliptic contours of the calibration marks. You should increase the number of supporting points, if the image part in the output window is displayed with magnification (see set_partset_partSetPartset_partSetPartSetPart).

Parallelization

Parameters

WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHTupleHWindowX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Window in which the calibration plate should be visualized.

CalTabDescrFileCalTabDescrFileCalTabDescrFileCalTabDescrFileCalTabDescrFilecalTabDescrFile (input_control)  filename.read HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

File name of the calibration plate description.

Default value: 'caltab.descr' "caltab.descr" "caltab.descr" "caltab.descr" "caltab.descr" "caltab.descr"

List of values: 'caltab.descr'"caltab.descr""caltab.descr""caltab.descr""caltab.descr""caltab.descr", 'caltab_100mm.descr'"caltab_100mm.descr""caltab_100mm.descr""caltab_100mm.descr""caltab_100mm.descr""caltab_100mm.descr", 'caltab_10mm.descr'"caltab_10mm.descr""caltab_10mm.descr""caltab_10mm.descr""caltab_10mm.descr""caltab_10mm.descr", 'caltab_200mm.descr'"caltab_200mm.descr""caltab_200mm.descr""caltab_200mm.descr""caltab_200mm.descr""caltab_200mm.descr", 'caltab_30mm.descr'"caltab_30mm.descr""caltab_30mm.descr""caltab_30mm.descr""caltab_30mm.descr""caltab_30mm.descr"

File extension: .descr

CameraParamCameraParamCameraParamCameraParamCameraParamcameraParam (input_control)  number-array HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Internal camera parameters.

Number of elements: CameraParam == 8 || CameraParam == 11 || CameraParam == 12

CaltabPoseCaltabPoseCaltabPoseCaltabPoseCaltabPosecaltabPose (input_control)  pose HPose, HTupleHTupleHTupleHPoseX, VARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

External camera parameters (3D pose of the calibration plate in camera coordinates).

Number of elements: 7

ScaleFacScaleFacScaleFacScaleFacScaleFacscaleFac (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Scaling factor for the visualization.

Default value: 1.0

Suggested values: 0.5, 1.0, 2.0, 3.0

Recommended increment: 0.05

Restriction: 0.0 < ScaleFac

Example (HDevelop)

* read calibration image
read_image(Image1, 'calib-01')
* find calibration pattern
find_caltab(Image1, Caltab1, 'caltab.descr', 3, 112, 5)
* find calibration marks and start poses
StartCamPar := [Focus, Kappa, Sx, Sy, Cx, Cy, ImageWidth, ImageHeight]
find_marks_and_pose(Image1, Caltab1, 'caltab.descr', StartCamPar, \
                    128, 10, 18, 0.9, 15.0, 100.0, RCoord1, CCoord1, \
                    StartPose1)
* read 3D positions of calibration marks
caltab_points('caltab.descr', NX, NY, NZ)
* camera calibration
camera_calibration(NX, NY, NZ, RCoord1, CCoord1, StartCamPar, \
                   StartPose1, 11, CameraParam, FinalPose, Errors)
*  visualize calibration result
disp_image(Image1, WindowHandle)
set_color(WindowHandle, 'red')
disp_caltab(WindowHandle, 'caltab.descr', CameraParam, FinalPose, 1.0)

Example (HDevelop)

* read calibration image
read_image(Image1, 'calib-01')
* find calibration pattern
find_caltab(Image1, Caltab1, 'caltab.descr', 3, 112, 5)
* find calibration marks and start poses
StartCamPar := [Focus, Kappa, Sx, Sy, Cx, Cy, ImageWidth, ImageHeight]
find_marks_and_pose(Image1, Caltab1, 'caltab.descr', StartCamPar, \
                    128, 10, 18, 0.9, 15.0, 100.0, RCoord1, CCoord1, \
                    StartPose1)
* read 3D positions of calibration marks
caltab_points('caltab.descr', NX, NY, NZ)
* camera calibration
camera_calibration(NX, NY, NZ, RCoord1, CCoord1, StartCamPar, \
                   StartPose1, 11, CameraParam, FinalPose, Errors)
*  visualize calibration result
disp_image(Image1, WindowHandle)
set_color(WindowHandle, 'red')
disp_caltab(WindowHandle, 'caltab.descr', CameraParam, FinalPose, 1.0)

Example (HDevelop)

* read calibration image
read_image(Image1, 'calib-01')
* find calibration pattern
find_caltab(Image1, Caltab1, 'caltab.descr', 3, 112, 5)
* find calibration marks and start poses
StartCamPar := [Focus, Kappa, Sx, Sy, Cx, Cy, ImageWidth, ImageHeight]
find_marks_and_pose(Image1, Caltab1, 'caltab.descr', StartCamPar, \
                    128, 10, 18, 0.9, 15.0, 100.0, RCoord1, CCoord1, \
                    StartPose1)
* read 3D positions of calibration marks
caltab_points('caltab.descr', NX, NY, NZ)
* camera calibration
camera_calibration(NX, NY, NZ, RCoord1, CCoord1, StartCamPar, \
                   StartPose1, 11, CameraParam, FinalPose, Errors)
*  visualize calibration result
disp_image(Image1, WindowHandle)
set_color(WindowHandle, 'red')
disp_caltab(WindowHandle, 'caltab.descr', CameraParam, FinalPose, 1.0)

Example (C++ (HALCON 5.0-10.0))

HTuple StartCamPar, NX, NY, NZ;
HTuple RCoord1, CCoord1, StartPose1;
HTuple StartPose, CameraParam, FinalPose, Errors;
// read calibration image
HImage Image1("calib-01");
// find calibration pattern
HRegion Caltab1 = Image1.FindCaltab("caltab.descr", 3, 112, 5);
// find calibration marks and start pose
StartCamPar[7] = 576;          // ImageHeight
StartCamPar[6] = 768;          // ImageWidth
StartCamPar[5] = 288;          // Cy
StartCamPar[4] = 384;          // Cx
StartCamPar[3] = 0.000011;     // Sy
StartCamPar[2] = 0.000011;     // Sx
StartCamPar[1] = 0.0;          // Kappa
StartCamPar[0] = 0.008;        // Focus
RCoord1 = Image1.FindMarksAndPose(Caltab1, "caltab.descr", StartCamPar,
                                  128, 10, &CCoord1, &StartPose);
// read 3D positions of calibration marks
caltab_points("caltab.descr", &NX, &NY, &NZ);
// camera calibration
camera_calibration(NX, NY, NZ, RCoord1, CCoord1, StartCamPar, StartPose,
                   11, &CameraParam, &FinalPose, &Errors);
// visualize calibration result
disp_image(Image1, WindowHandle);
set_color(WindowHandle, "red");
disp_caltab(WindowHandle, "caltab.descr", CameraParam, FinalPose, 1.0);

Example (HDevelop)

* read calibration image
read_image(Image1, 'calib-01')
* find calibration pattern
find_caltab(Image1, Caltab1, 'caltab.descr', 3, 112, 5)
* find calibration marks and start poses
StartCamPar := [Focus, Kappa, Sx, Sy, Cx, Cy, ImageWidth, ImageHeight]
find_marks_and_pose(Image1, Caltab1, 'caltab.descr', StartCamPar, \
                    128, 10, 18, 0.9, 15.0, 100.0, RCoord1, CCoord1, \
                    StartPose1)
* read 3D positions of calibration marks
caltab_points('caltab.descr', NX, NY, NZ)
* camera calibration
camera_calibration(NX, NY, NZ, RCoord1, CCoord1, StartCamPar, \
                   StartPose1, 11, CameraParam, FinalPose, Errors)
*  visualize calibration result
disp_image(Image1, WindowHandle)
set_color(WindowHandle, 'red')
disp_caltab(WindowHandle, 'caltab.descr', CameraParam, FinalPose, 1.0)

Example (HDevelop)

* read calibration image
read_image(Image1, 'calib-01')
* find calibration pattern
find_caltab(Image1, Caltab1, 'caltab.descr', 3, 112, 5)
* find calibration marks and start poses
StartCamPar := [Focus, Kappa, Sx, Sy, Cx, Cy, ImageWidth, ImageHeight]
find_marks_and_pose(Image1, Caltab1, 'caltab.descr', StartCamPar, \
                    128, 10, 18, 0.9, 15.0, 100.0, RCoord1, CCoord1, \
                    StartPose1)
* read 3D positions of calibration marks
caltab_points('caltab.descr', NX, NY, NZ)
* camera calibration
camera_calibration(NX, NY, NZ, RCoord1, CCoord1, StartCamPar, \
                   StartPose1, 11, CameraParam, FinalPose, Errors)
*  visualize calibration result
disp_image(Image1, WindowHandle)
set_color(WindowHandle, 'red')
disp_caltab(WindowHandle, 'caltab.descr', CameraParam, FinalPose, 1.0)

Result

disp_caltabdisp_caltabDispCaltabdisp_caltabDispCaltabDispCaltab returns 2 (H_MSG_TRUE) if all parameter values are correct. If necessary, an exception is raised.

Possible Predecessors

camera_calibrationcamera_calibrationCameraCalibrationcamera_calibrationCameraCalibrationCameraCalibration, read_cam_parread_cam_parReadCamParread_cam_parReadCamParReadCamPar, read_poseread_poseReadPoseread_poseReadPoseReadPose

See also

find_marks_and_posefind_marks_and_poseFindMarksAndPosefind_marks_and_poseFindMarksAndPoseFindMarksAndPose, camera_calibrationcamera_calibrationCameraCalibrationcamera_calibrationCameraCalibrationCameraCalibration, sim_caltabsim_caltabSimCaltabsim_caltabSimCaltabSimCaltab, write_cam_parwrite_cam_parWriteCamParwrite_cam_parWriteCamParWriteCamPar, read_cam_parread_cam_parReadCamParread_cam_parReadCamParReadCamPar, create_posecreate_poseCreatePosecreate_poseCreatePoseCreatePose, write_posewrite_poseWritePosewrite_poseWritePoseWritePose, read_poseread_poseReadPoseread_poseReadPoseReadPose, project_3d_pointproject_3d_pointProject3dPointproject_3d_pointProject3dPointProject3dPoint, get_line_of_sightget_line_of_sightGetLineOfSightget_line_of_sightGetLineOfSightGetLineOfSight

Module

Foundation


ClassesClassesClassesClasses | | | | Operators