sim_caltab T_sim_caltab SimCaltab SimCaltab sim_caltab (算子)
名称
sim_caltab T_sim_caltab SimCaltab SimCaltab sim_caltab — 用标定板仿真图像。
签名
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 )
描述
sim_caltab sim_caltab SimCaltab SimCaltab SimCaltab sim_caltab is used to generate a simulated calibration
image. The calibration plate description is read from the file
CalPlateDescr CalPlateDescr CalPlateDescr CalPlateDescr calPlateDescr cal_plate_descr and will be projected into the image plane
using the given camera parameters, thus internal camera parameters
CameraParam CameraParam CameraParam CameraParam cameraParam camera_param and external camera parameters
CalPlatePose CalPlatePose CalPlatePose CalPlatePose calPlatePose cal_plate_pose (see also project_3d_point project_3d_point Project3dPoint Project3dPoint Project3dPoint project_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 GrayBackground GrayBackground GrayBackground GrayBackground grayBackground gray_background ,
the calibration plate background is set to GrayPlate GrayPlate GrayPlate GrayPlate grayPlate gray_plate , and
the calibration marks are set to the gray value GrayMarks GrayMarks GrayMarks GrayMarks grayMarks gray_marks .
The parameter ScaleFac ScaleFac ScaleFac ScaleFac scaleFac scale_fac influences the number of supporting
points to approximate the elliptic contours of the calibration
marks, see also disp_caltab disp_caltab DispCaltab DispCaltab DispCaltab disp_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 GrayMarks GrayMarks GrayMarks GrayMarks grayMarks gray_marks and
GrayPlate GrayPlate GrayPlate GrayPlate grayPlate gray_plate dependent on the proportion Inside/Outside.
By applying the operator sim_caltab sim_caltab SimCaltab SimCaltab SimCaltab sim_caltab you can generate
synthetic calibration images (with known camera parameters!) to test
the quality of the calibration algorithm (see
标定 ).
执行信息
多线程类型:可重入(与非独占算子并行运行)。
多线程作用域:全局(可从任何线程调用)。
在内部数据级别上自动并行化。
参数
SimImage SimImage SimImage SimImage simImage sim_image (输出对象) image → object HImage HObject HImage Hobject * (byte)
Simulated calibration image.
CalPlateDescr CalPlateDescr CalPlateDescr CalPlateDescr calPlateDescr cal_plate_descr (输入控制) filename.read → HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
File name of the calibration plate description.
默认值:
'calplate_320mm.cpd'
"calplate_320mm.cpd"
"calplate_320mm.cpd"
"calplate_320mm.cpd"
"calplate_320mm.cpd"
"calplate_320mm.cpd"
值列表:
'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
CameraParam CameraParam CameraParam CameraParam cameraParam camera_param (输入控制) campar → HCamPar , HTuple Sequence[Union[int, float, str]] HTuple Htuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)
Internal camera parameters.
CalPlatePose CalPlatePose CalPlatePose CalPlatePose calPlatePose cal_plate_pose (输入控制) pose → HPose , HTuple Sequence[Union[int, float]] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
External camera parameters (3D pose of the calibration
plate in camera coordinates).
元素数量:
7
GrayBackground GrayBackground GrayBackground GrayBackground grayBackground gray_background (输入控制) integer → HTuple int HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Gray value of image background.
默认值:
128
建议值:
0, 32, 64, 96, 128, 160
限制:
0 <= GrayBackground <= 255
GrayPlate GrayPlate GrayPlate GrayPlate grayPlate gray_plate (输入控制) integer → HTuple int HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Gray value of calibration plate.
默认值:
80
建议值:
144, 160, 176, 192, 208, 224, 240
限制:
0 <= GrayPlate <= 255
GrayMarks GrayMarks GrayMarks GrayMarks grayMarks gray_marks (输入控制) integer → HTuple int HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Gray value of calibration marks.
默认值:
224
建议值:
16, 32, 48, 64, 80, 96, 112
限制:
0 <= GrayMarks <= 255
ScaleFac ScaleFac ScaleFac ScaleFac scaleFac scale_fac (输入控制) real → HTuple float HTuple Htuple (real) (double ) (double ) (double )
Scaling factor to reduce oversampling.
默认值:
1.0
建议值:
1.0, 0.5, 0.25, 0.125
建议增量:
0.05
限制:
1.0 >= ScaleFac
示例(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)
结果
sim_caltab sim_caltab SimCaltab SimCaltab SimCaltab sim_caltab returns 2 (
H_MSG_TRUE )
if all parameter values are
correct。如有必要,则抛出异常。
可能的前趋
camera_calibration camera_calibration CameraCalibration CameraCalibration CameraCalibration camera_calibration ,
find_marks_and_pose find_marks_and_pose FindMarksAndPose FindMarksAndPose FindMarksAndPose find_marks_and_pose ,
read_pose read_pose ReadPose ReadPose ReadPose read_pose ,
read_cam_par read_cam_par ReadCamPar ReadCamPar ReadCamPar read_cam_par ,
hom_mat3d_to_pose hom_mat3d_to_pose HomMat3dToPose HomMat3dToPose HomMat3dToPose hom_mat3d_to_pose
可能的后继
find_caltab find_caltab FindCaltab FindCaltab FindCaltab find_caltab
另见
find_caltab find_caltab FindCaltab FindCaltab FindCaltab find_caltab ,
find_marks_and_pose find_marks_and_pose FindMarksAndPose FindMarksAndPose FindMarksAndPose find_marks_and_pose ,
camera_calibration camera_calibration CameraCalibration CameraCalibration CameraCalibration camera_calibration ,
disp_caltab disp_caltab DispCaltab DispCaltab DispCaltab disp_caltab ,
create_pose create_pose CreatePose CreatePose CreatePose create_pose ,
hom_mat3d_to_pose hom_mat3d_to_pose HomMat3dToPose HomMat3dToPose HomMat3dToPose hom_mat3d_to_pose ,
project_3d_point project_3d_point Project3dPoint Project3dPoint Project3dPoint project_3d_point ,
gen_caltab gen_caltab GenCaltab GenCaltab GenCaltab gen_caltab
模块
标定