apply_sheet_of_light_calibrationT_apply_sheet_of_light_calibrationApplySheetOfLightCalibrationApplySheetOfLightCalibrationapply_sheet_of_light_calibration应用激光三角测量标定(算子)

名称

apply_sheet_of_light_calibrationT_apply_sheet_of_light_calibrationApplySheetOfLightCalibrationApplySheetOfLightCalibrationapply_sheet_of_light_calibration — 将标定变换应用于输入视差图像。

签名

apply_sheet_of_light_calibration(Disparity : : SheetOfLightModelID : )

Herror T_apply_sheet_of_light_calibration(const Hobject Disparity, const Htuple SheetOfLightModelID)

void ApplySheetOfLightCalibration(const HObject& Disparity, const HTuple& SheetOfLightModelID)

void HImage::ApplySheetOfLightCalibration(const HSheetOfLightModel& SheetOfLightModelID) const

void HSheetOfLightModel::ApplySheetOfLightCalibration(const HImage& Disparity) const

static void HOperatorSet.ApplySheetOfLightCalibration(HObject disparity, HTuple sheetOfLightModelID)

void HImage.ApplySheetOfLightCalibration(HSheetOfLightModel sheetOfLightModelID)

void HSheetOfLightModel.ApplySheetOfLightCalibration(HImage disparity)

def apply_sheet_of_light_calibration(disparity: HObject, sheet_of_light_model_id: HHandle) -> None

描述

算子 apply_sheet_of_light_calibrationapply_sheet_of_light_calibrationApplySheetOfLightCalibrationApplySheetOfLightCalibrationApplySheetOfLightCalibrationapply_sheet_of_light_calibration 读取视差图像 DisparityDisparityDisparityDisparitydisparitydisparity,将其存储至由 SheetOfLightModelIDSheetOfLightModelIDSheetOfLightModelIDSheetOfLightModelIDsheetOfLightModelIDsheet_of_light_model_id 指定的激光三角测量模型中,并对该图像应用标定变换,从而计算出重建三维表面点的标定坐标。标定后的坐标可通过调用 get_sheet_of_light_resultget_sheet_of_light_resultGetSheetOfLightResultGetSheetOfLightResultGetSheetOfLightResultget_sheet_of_light_result 算子从模型中获取。可通过 get_sheet_of_light_result_object_model_3dget_sheet_of_light_result_object_model_3dGetSheetOfLightResultObjectModel3dGetSheetOfLightResultObjectModel3dGetSheetOfLightResultObjectModel3dget_sheet_of_light_result_object_model_3d 获取对应的三维对象模型。请注意,在下次调用 apply_sheet_of_light_calibrationapply_sheet_of_light_calibrationApplySheetOfLightCalibrationApplySheetOfLightCalibrationApplySheetOfLightCalibrationapply_sheet_of_light_calibration 处理高度较小的视差图像之前,应先调用 reset_sheet_of_light_modelreset_sheet_of_light_modelResetSheetOfLightModelResetSheetOfLightModelResetSheetOfLightModelreset_sheet_of_light_model

视差图像 DisparityDisparityDisparityDisparitydisparitydisparity 可能之前已通过 measure_profile_sheet_of_lightmeasure_profile_sheet_of_lightMeasureProfileSheetOfLightMeasureProfileSheetOfLightMeasureProfileSheetOfLightmeasure_profile_sheet_of_light 算子获取,或由图像采集设备直接提供视差值并依据激光三角测量技术工作。

为计算标定坐标,必须通过 set_sheet_of_light_paramset_sheet_of_light_paramSetSheetOfLightParamSetSheetOfLightParamSetSheetOfLightParamset_sheet_of_light_param 算子为激光三角测量模型设置下列参数:

'calibration'"calibration""calibration""calibration""calibration""calibration"

标定变换的范围,该变换将应用于视差图像。 'calibration'"calibration""calibration""calibration""calibration""calibration" 必须设置为 'xz'"xz""xz""xz""xz""xz"'xyz'"xyz""xyz""xyz""xyz""xyz"'offset_scale'"offset_scale""offset_scale""offset_scale""offset_scale""offset_scale"。有关此参数的详细信息,请参阅 set_sheet_of_light_paramset_sheet_of_light_paramSetSheetOfLightParamSetSheetOfLightParamSetSheetOfLightParamset_sheet_of_light_param

'camera_parameter'"camera_parameter""camera_parameter""camera_parameter""camera_parameter""camera_parameter"

用于测量的相机内部参数。当标定范围设置为 'xyz'"xyz""xyz""xyz""xyz""xyz"'xz'"xz""xz""xz""xz""xz" 时,需要此姿态。

'camera_pose'"camera_pose""camera_pose""camera_pose""camera_pose""camera_pose"

世界坐标系相对于相机坐标系的姿态。当标定范围设置为 'xyz'"xyz""xyz""xyz""xyz""xyz"'xz'"xz""xz""xz""xz""xz" 时,需要此姿态。

'lightplane_pose'"lightplane_pose""lightplane_pose""lightplane_pose""lightplane_pose""lightplane_pose"

光平面坐标系相对于世界坐标系的姿态。光平面坐标系必须选择使其平面 z=0 与光线投影仪描述的光平面重合。当标定范围设置为 'xyz'"xyz""xyz""xyz""xyz""xyz"'xz'"xz""xz""xz""xz""xz" 时,需要此姿态。

'movement_pose'"movement_pose""movement_pose""movement_pose""movement_pose""movement_pose"

该姿态表示对象在相邻两幅轮廓图像之间相对于由相机和激光器构成的测量系统的运动轨迹。当标定范围设置为 'xyz'"xyz""xyz""xyz""xyz""xyz" 时需要该姿态,而当标定范围设置为 'xz'"xz""xz""xz""xz""xz" 时则忽略该姿态。

'scale'"scale""scale""scale""scale""scale"

通过此参数,可对视差图像应用标定变换后生成的三维坐标 X 、 Y 和 Z 进行缩放。 'scale'"scale""scale""scale""scale""scale" 参数必须以 desired unit目标单位/original unit原始单位 的比例形式指定。原始单位由标定对象的坐标决定。若原始单位为米(使用标准标定板时即为此情况),可通过在 Scale 参数中选择 'm'、‘cm’、'mm' 或 'um' 直接设置目标单位。默认情况下,'scale'"scale""scale""scale""scale""scale" 参数值设为1.0。

执行信息

此算子修改后续输入参数的状态:

在执行此算子时,若该参数值需在多个线程间使用,则必须对其访问进行同步。

参数

DisparityDisparityDisparityDisparitydisparitydisparity (输入对象)  singlechannelimage objectHImageHObjectHImageHobject (real)

待标定的高度或范围图像。

SheetOfLightModelIDSheetOfLightModelIDSheetOfLightModelIDSheetOfLightModelIDsheetOfLightModelIDsheet_of_light_model_id (输入控制,状态被修改)  sheet_of_light_model HSheetOfLightModel, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

激光三角测量的句柄。

示例(HDevelop)

* ...
* Read an already acquired disparity map from file
read_image (Disparity, 'sheet_of_light/connection_rod_disparity.tif')
*
* Create a model and set the required parameters
gen_rectangle1 (ProfileRegion, 120, 75, 195, 710)
create_sheet_of_light_model (ProfileRegion, ['min_gray','num_profiles', \
                             'ambiguity_solving'], [70,290,'first'], \
                              SheetOfLightModelID)
set_sheet_of_light_param (SheetOfLightModelID, 'calibration', 'xyz')
set_sheet_of_light_param (SheetOfLightModelID, 'scale', 'mm')
set_sheet_of_light_param (SheetOfLightModelID, 'camera_parameter', \
                          CameraParameter)
set_sheet_of_light_param (SheetOfLightModelID, 'camera_pose', CameraPose)
set_sheet_of_light_param (SheetOfLightModelID, 'lightplane_pose', \
                          LightPlanePose)
set_sheet_of_light_param (SheetOfLightModelID, 'movement_pose', \
                          MovementPose)
*
* Apply the calibration transforms and
* get the resulting calibrated coordinates
apply_sheet_of_light_calibration (Disparity, SheetOfLightModelID)
get_sheet_of_light_result (X, SheetOfLightModelID, 'x')
get_sheet_of_light_result (Y, SheetOfLightModelID, 'y')
get_sheet_of_light_result (Z, SheetOfLightModelID, 'z')
*

结果

算子 apply_sheet_of_light_calibrationapply_sheet_of_light_calibrationApplySheetOfLightCalibrationApplySheetOfLightCalibrationApplySheetOfLightCalibrationapply_sheet_of_light_calibration 在给定的参数正确时返回值 2 ( H_MSG_TRUE )。否则,将抛出异常。

可能的后继

get_sheet_of_light_resultget_sheet_of_light_resultGetSheetOfLightResultGetSheetOfLightResultGetSheetOfLightResultget_sheet_of_light_result, get_sheet_of_light_result_object_model_3dget_sheet_of_light_result_object_model_3dGetSheetOfLightResultObjectModel3dGetSheetOfLightResultObjectModel3dGetSheetOfLightResultObjectModel3dget_sheet_of_light_result_object_model_3d

模块

三维计量