sim_caltabT_sim_caltabSimCaltabSimCaltabsim_caltab (Operator)

Name

sim_caltabT_sim_caltabSimCaltabSimCaltabsim_caltab — Simulate an image with calibration plate.

Signature

sim_caltab( : SimImage : CalPlateDescr, CameraParam, CalPlatePose, GrayBackground, GrayPlate, GrayMarks, ScaleFac : )

Herror T_sim_caltab(Hobject* SimImage, const Htuple CalPlateDescr, const Htuple CameraParam, const Htuple CalPlatePose, const Htuple GrayBackground, const Htuple GrayPlate, const Htuple GrayMarks, const Htuple ScaleFac)

void SimCaltab(HObject* SimImage, const HTuple& CalPlateDescr, const HTuple& CameraParam, const HTuple& CalPlatePose, const HTuple& GrayBackground, const HTuple& GrayPlate, const HTuple& GrayMarks, const HTuple& ScaleFac)

void HImage::SimCaltab(const HString& CalPlateDescr, const HCamPar& CameraParam, const HPose& CalPlatePose, Hlong GrayBackground, Hlong GrayPlate, Hlong GrayMarks, double ScaleFac)

void HImage::SimCaltab(const char* CalPlateDescr, const HCamPar& CameraParam, const HPose& CalPlatePose, Hlong GrayBackground, Hlong GrayPlate, Hlong GrayMarks, double ScaleFac)

void HImage::SimCaltab(const wchar_t* CalPlateDescr, const HCamPar& CameraParam, const HPose& CalPlatePose, Hlong GrayBackground, Hlong GrayPlate, Hlong GrayMarks, double ScaleFac)   (Windows only)

HImage HCamPar::SimCaltab(const HString& CalPlateDescr, const HPose& CalPlatePose, Hlong GrayBackground, Hlong GrayPlate, Hlong GrayMarks, double ScaleFac) const

HImage HCamPar::SimCaltab(const char* CalPlateDescr, const HPose& CalPlatePose, Hlong GrayBackground, Hlong GrayPlate, Hlong GrayMarks, double ScaleFac) const

HImage HCamPar::SimCaltab(const wchar_t* CalPlateDescr, const HPose& CalPlatePose, Hlong GrayBackground, Hlong GrayPlate, Hlong GrayMarks, double ScaleFac) const   (Windows only)

HImage HPose::SimCaltab(const HString& CalPlateDescr, const HCamPar& CameraParam, Hlong GrayBackground, Hlong GrayPlate, Hlong GrayMarks, double ScaleFac) const

HImage HPose::SimCaltab(const char* CalPlateDescr, const HCamPar& CameraParam, Hlong GrayBackground, Hlong GrayPlate, Hlong GrayMarks, double ScaleFac) const

HImage HPose::SimCaltab(const wchar_t* CalPlateDescr, const HCamPar& CameraParam, Hlong GrayBackground, Hlong GrayPlate, Hlong GrayMarks, double ScaleFac) const   (Windows only)

static void HOperatorSet.SimCaltab(out HObject simImage, HTuple calPlateDescr, HTuple cameraParam, HTuple calPlatePose, HTuple grayBackground, HTuple grayPlate, HTuple grayMarks, HTuple scaleFac)

void HImage.SimCaltab(string calPlateDescr, HCamPar cameraParam, HPose calPlatePose, int grayBackground, int grayPlate, int grayMarks, double scaleFac)

HImage HCamPar.SimCaltab(string calPlateDescr, HPose calPlatePose, int grayBackground, int grayPlate, int grayMarks, double scaleFac)

HImage HPose.SimCaltab(string calPlateDescr, HCamPar cameraParam, int grayBackground, int grayPlate, int grayMarks, double scaleFac)

def sim_caltab(cal_plate_descr: str, camera_param: Sequence[Union[int, float, str]], cal_plate_pose: Sequence[Union[int, float]], gray_background: int, gray_plate: int, gray_marks: int, scale_fac: float) -> HObject

Description

sim_caltabsim_caltabSimCaltabSimCaltabSimCaltabsim_caltab is used to generate a simulated calibration image. The calibration plate description is read from the file CalPlateDescrCalPlateDescrCalPlateDescrCalPlateDescrcalPlateDescrcal_plate_descr and will be projected into the image plane using the given camera parameters, thus internal camera parameters CameraParamCameraParamCameraParamCameraParamcameraParamcamera_param and external camera parameters CalPlatePoseCalPlatePoseCalPlatePoseCalPlatePosecalPlatePosecal_plate_pose (see also project_3d_pointproject_3d_pointProject3dPointProject3dPointProject3dPointproject_3d_point). Thereby the pose is expected to be in the form , where ccs denotes the camera coordinate system and wcs the world coordinate system (see Transformations / Poses and “Solution Guide III-C - 3D Vision”).

In the simulated image only the calibration plate is shown. The image background is set to the gray value GrayBackgroundGrayBackgroundGrayBackgroundGrayBackgroundgrayBackgroundgray_background, the calibration plate background is set to GrayPlateGrayPlateGrayPlateGrayPlategrayPlategray_plate, and the calibration marks are set to the gray value GrayMarksGrayMarksGrayMarksGrayMarksgrayMarksgray_marks. The parameter ScaleFacScaleFacScaleFacScaleFacscaleFacscale_fac influences the number of supporting points to approximate the elliptic contours of the calibration marks, see also disp_caltabdisp_caltabDispCaltabDispCaltabDispCaltabdisp_caltab. Increasing the number of supporting points causes a more accurate determination of the mark boundary, but increases the computation time, too. For each pixel of the simulated image which touches a subpixel-boundary of this kind, the gray value is set linearly between GrayMarksGrayMarksGrayMarksGrayMarksgrayMarksgray_marks and GrayPlateGrayPlateGrayPlateGrayPlategrayPlategray_plate dependent on the proportion Inside/Outside.

By applying the operator sim_caltabsim_caltabSimCaltabSimCaltabSimCaltabsim_caltab you can generate synthetic calibration images (with known camera parameters!) to test the quality of the calibration algorithm (see Calibration).

Execution Information

Parameters

SimImageSimImageSimImageSimImagesimImagesim_image (output_object)  image objectHImageHObjectHImageHobject * (byte)

Simulated calibration image.

CalPlateDescrCalPlateDescrCalPlateDescrCalPlateDescrcalPlateDescrcal_plate_descr (input_control)  filename.read HTuplestrHTupleHtuple (string) (string) (HString) (char*)

File name of the calibration plate description.

Default value: 'calplate_320mm.cpd' "calplate_320mm.cpd" "calplate_320mm.cpd" "calplate_320mm.cpd" "calplate_320mm.cpd" "calplate_320mm.cpd"

List of values: 'calplate_10mm.cpd'"calplate_10mm.cpd""calplate_10mm.cpd""calplate_10mm.cpd""calplate_10mm.cpd""calplate_10mm.cpd", 'calplate_1200mm.cpd'"calplate_1200mm.cpd""calplate_1200mm.cpd""calplate_1200mm.cpd""calplate_1200mm.cpd""calplate_1200mm.cpd", 'calplate_160mm.cpd'"calplate_160mm.cpd""calplate_160mm.cpd""calplate_160mm.cpd""calplate_160mm.cpd""calplate_160mm.cpd", 'calplate_20mm.cpd'"calplate_20mm.cpd""calplate_20mm.cpd""calplate_20mm.cpd""calplate_20mm.cpd""calplate_20mm.cpd", 'calplate_20mm_dark_on_light.cpd'"calplate_20mm_dark_on_light.cpd""calplate_20mm_dark_on_light.cpd""calplate_20mm_dark_on_light.cpd""calplate_20mm_dark_on_light.cpd""calplate_20mm_dark_on_light.cpd", 'calplate_320mm.cpd'"calplate_320mm.cpd""calplate_320mm.cpd""calplate_320mm.cpd""calplate_320mm.cpd""calplate_320mm.cpd", 'calplate_40mm.cpd'"calplate_40mm.cpd""calplate_40mm.cpd""calplate_40mm.cpd""calplate_40mm.cpd""calplate_40mm.cpd", 'calplate_40mm_dark_on_light.cpd'"calplate_40mm_dark_on_light.cpd""calplate_40mm_dark_on_light.cpd""calplate_40mm_dark_on_light.cpd""calplate_40mm_dark_on_light.cpd""calplate_40mm_dark_on_light.cpd", 'calplate_5mm.cpd'"calplate_5mm.cpd""calplate_5mm.cpd""calplate_5mm.cpd""calplate_5mm.cpd""calplate_5mm.cpd", 'calplate_640mm.cpd'"calplate_640mm.cpd""calplate_640mm.cpd""calplate_640mm.cpd""calplate_640mm.cpd""calplate_640mm.cpd", 'calplate_80mm.cpd'"calplate_80mm.cpd""calplate_80mm.cpd""calplate_80mm.cpd""calplate_80mm.cpd""calplate_80mm.cpd", 'calplate_80mm_dark_on_light.cpd'"calplate_80mm_dark_on_light.cpd""calplate_80mm_dark_on_light.cpd""calplate_80mm_dark_on_light.cpd""calplate_80mm_dark_on_light.cpd""calplate_80mm_dark_on_light.cpd", '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_2500um.descr'"caltab_2500um.descr""caltab_2500um.descr""caltab_2500um.descr""caltab_2500um.descr""caltab_2500um.descr", 'caltab_30mm.descr'"caltab_30mm.descr""caltab_30mm.descr""caltab_30mm.descr""caltab_30mm.descr""caltab_30mm.descr", 'caltab_650um.descr'"caltab_650um.descr""caltab_650um.descr""caltab_650um.descr""caltab_650um.descr""caltab_650um.descr", 'caltab_6mm.descr'"caltab_6mm.descr""caltab_6mm.descr""caltab_6mm.descr""caltab_6mm.descr""caltab_6mm.descr", 'caltab_800mm.descr'"caltab_800mm.descr""caltab_800mm.descr""caltab_800mm.descr""caltab_800mm.descr""caltab_800mm.descr", 'caltab_big.descr'"caltab_big.descr""caltab_big.descr""caltab_big.descr""caltab_big.descr""caltab_big.descr", 'caltab_small.descr'"caltab_small.descr""caltab_small.descr""caltab_small.descr""caltab_small.descr""caltab_small.descr"

File extension: .cpd, .descr

CameraParamCameraParamCameraParamCameraParamcameraParamcamera_param (input_control)  campar HCamPar, HTupleSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Internal camera parameters.

CalPlatePoseCalPlatePoseCalPlatePoseCalPlatePosecalPlatePosecal_plate_pose (input_control)  pose HPose, HTupleSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

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

Number of elements: 7

GrayBackgroundGrayBackgroundGrayBackgroundGrayBackgroundgrayBackgroundgray_background (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Gray value of image background.

Default value: 128

Suggested values: 0, 32, 64, 96, 128, 160

Restriction: 0 <= GrayBackground <= 255

GrayPlateGrayPlateGrayPlateGrayPlategrayPlategray_plate (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Gray value of calibration plate.

Default value: 80

Suggested values: 144, 160, 176, 192, 208, 224, 240

Restriction: 0 <= GrayPlate <= 255

GrayMarksGrayMarksGrayMarksGrayMarksgrayMarksgray_marks (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Gray value of calibration marks.

Default value: 224

Suggested values: 16, 32, 48, 64, 80, 96, 112

Restriction: 0 <= GrayMarks <= 255

ScaleFacScaleFacScaleFacScaleFacscaleFacscale_fac (input_control)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Scaling factor to reduce oversampling.

Default value: 1.0

Suggested values: 1.0, 0.5, 0.25, 0.125

Recommended increment: 0.05

Restriction: 1.0 >= ScaleFac

Example (HDevelop)

* Read calibration image.
read_image(Image1, 'calib-01')
* Find calibration pattern.
CameraType := 'area_scan_division'
StartCamPar := [CameraType, Focus, Kappa, Sx, Sy, Cx, Cy, \
                ImageWidth, ImageHeight]
create_calib_data ('calibration_object', 1, 1, CalibDataID)
set_calib_data_cam_param (CalibDataID, 0, [], StartCamPar)
set_calib_data_calib_object (CalibDataID, 0, 'calplate.cpd')
find_caltab(Image1, CalPlate1, 'caltab.descr', 3, 112, 5)
* Find calibration marks and initial pose.
find_calib_object (Image1, CalibDataID, 0, 0, 0, [], [])
* Camera calibration.
calibrate_cameras (CalibDataID, Error)
* Simulate calibration image.
get_calib_data (CalibDataID, 'calib_obj_pose', [0, 0], 'pose', FinalPose)
get_calib_data (CalibDataID, 'camera', 0, 'params', CameraParam)
sim_caltab(Image1Sim, 'calplate.cpd', CameraParam, FinalPose, 128, \
           80, 224, 1)

Result

sim_caltabsim_caltabSimCaltabSimCaltabSimCaltabsim_caltab returns TRUE if all parameter values are correct. If necessary, an exception is raised.

Possible Predecessors

camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationCameraCalibrationcamera_calibration, find_marks_and_posefind_marks_and_poseFindMarksAndPoseFindMarksAndPoseFindMarksAndPosefind_marks_and_pose, read_poseread_poseReadPoseReadPoseReadPoseread_pose, read_cam_parread_cam_parReadCamParReadCamParReadCamParread_cam_par, hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPoseHomMat3dToPosehom_mat3d_to_pose

Possible Successors

find_caltabfind_caltabFindCaltabFindCaltabFindCaltabfind_caltab

See also

find_caltabfind_caltabFindCaltabFindCaltabFindCaltabfind_caltab, find_marks_and_posefind_marks_and_poseFindMarksAndPoseFindMarksAndPoseFindMarksAndPosefind_marks_and_pose, camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationCameraCalibrationcamera_calibration, disp_caltabdisp_caltabDispCaltabDispCaltabDispCaltabdisp_caltab, create_posecreate_poseCreatePoseCreatePoseCreatePosecreate_pose, hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPoseHomMat3dToPosehom_mat3d_to_pose, project_3d_pointproject_3d_pointProject3dPointProject3dPointProject3dPointproject_3d_point, gen_caltabgen_caltabGenCaltabGenCaltabGenCaltabgen_caltab

Module

Calibration