calibrate_sheet_of_lightT_calibrate_sheet_of_lightCalibrateSheetOfLightCalibrateSheetOfLightcalibrate_sheet_of_light标定激光三角测量(算子)

名称

calibrate_sheet_of_lightT_calibrate_sheet_of_lightCalibrateSheetOfLightCalibrateSheetOfLightcalibrate_sheet_of_light — 使用三维标定对象标定激光三角测量设置。

签名

calibrate_sheet_of_light( : : SheetOfLightModelID : Error)

Herror T_calibrate_sheet_of_light(const Htuple SheetOfLightModelID, Htuple* Error)

void CalibrateSheetOfLight(const HTuple& SheetOfLightModelID, HTuple* Error)

double HSheetOfLightModel::CalibrateSheetOfLight() const

static void HOperatorSet.CalibrateSheetOfLight(HTuple sheetOfLightModelID, out HTuple error)

double HSheetOfLightModel.CalibrateSheetOfLight()

def calibrate_sheet_of_light(sheet_of_light_model_id: HHandle) -> float

描述

calibrate_sheet_of_lightcalibrate_sheet_of_lightCalibrateSheetOfLightCalibrateSheetOfLightCalibrateSheetOfLightcalibrate_sheet_of_light 通过三维标定对象的单幅视差图像校准激光三角测量设置 SheetOfLightModelIDSheetOfLightModelIDSheetOfLightModelIDSheetOfLightModelIDsheetOfLightModelIDsheet_of_light_model_id,并将优化过程中的反向误差返回至 ErrorErrorErrorErrorerrorerror

概述

使用 calibrate_sheet_of_lightcalibrate_sheet_of_lightCalibrateSheetOfLightCalibrateSheetOfLightCalibrateSheetOfLightcalibrate_sheet_of_light 标定激光三角测量装置比使用标准 HALCON 标定板标定更简单,后者在 HDevelop 示例 calibrate_sheet_of_light_calplate.hdev 中有所展示。只需获取特殊三维标定对象的单次未校准重建结果(即视差图像),即可完成激光三角测量模型的校准。

以下将描述标定所需的步骤。

激光三角测量装置的标定

提供三维标定对象

必须提供一个特殊的三维标定对象。该标定对象必须与使用 create_sheet_of_light_calib_objectcreate_sheet_of_light_calib_objectCreateSheetOfLightCalibObjectCreateSheetOfLightCalibObjectCreateSheetOfLightCalibObjectcreate_sheet_of_light_calib_object 创建的 CAD 模型相匹配。该三维标定对象包含一个倾斜平面,其上放置着一个截头金字塔。该金字塔具有较薄的一侧,此后称为标定对象的正面。较厚的一侧则称为标定对象的背面。

标定对象的尺寸应选择得当,以确保标定对象能够覆盖整个测量体积。请注意,仅考虑三维标定对象中高于 HeightMinHeightMinHeightMinHeightMinheightMinheight_min(参见 create_sheet_of_light_calib_objectcreate_sheet_of_light_calib_objectCreateSheetOfLightCalibObjectCreateSheetOfLightCalibObjectCreateSheetOfLightCalibObjectcreate_sheet_of_light_calib_object)的部分。

该 CAD 模型以 DXF 文件格式存储,同时作为标定对象的描述文件。

激光三角测量模型的预处理

为标定准备激光三角测量模型时,必须执行以下步骤。

未校准的三维标定对象重建

必须使用上述准备的(未校准)激光三角测量模型重建三维标定对象,即必须生成该标定对象的视差图像。

标定对象的视差图像

为此,标定对象必须定位为其正面或背面先与光平面相交(即运动向量应与标定对象的 Y 轴平行,详见 create_sheet_of_light_calib_objectcreate_sheet_of_light_calib_objectCreateSheetOfLightCalibObjectCreateSheetOfLightCalibObjectCreateSheetOfLightCalibObjectcreate_sheet_of_light_calib_object)。尽可能将标定对象的视差图像域限制在标定对象范围内。此外,视差图像域在截头金字塔上不应存在缺口。截头金字塔的四面必须清晰可见。

激光三角测量装置的标定

使用 calibrate_sheet_of_lightcalibrate_sheet_of_lightCalibrateSheetOfLightCalibrateSheetOfLightCalibrateSheetOfLightcalibrate_sheet_of_light 执行标定。返回的 ErrorErrorErrorErrorerrorerror 为重建点到标定对象距离的 RMS 均方根值(单位:米)。

对于使用 calibrate_sheet_of_lightcalibrate_sheet_of_lightCalibrateSheetOfLightCalibrateSheetOfLightCalibrateSheetOfLightcalibrate_sheet_of_light 校准的激光三角测量模型,在极少数情况下,参数可能导致设置不切实际。然而,使用校准参数进行的测量质量不会受到影响。

执行信息

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

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

参数

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

激光三角测量的句柄。

ErrorErrorErrorErrorerrorerror (输出控制)  number HTuplefloatHTupleHtuple (real) (double) (double) (double)

优化过程中的平均反向投影误差。

示例(HDevelop)

* Calibrate a sheet-of-light model with a 3D calibration object
gen_rectangle1 (Rectangle, 300, 0, 800, 1023)
CameraParam := ['area_scan_division', 0.016, 0, 4.65e-6, 4.65e-6, \
                640.0, 512.0, 1280, 1024]
create_sheet_of_light_model (Rectangle, 'min_gray', 50, SheetOfLightModelID)
set_sheet_of_light_param (SheetOfLightModelID, 'camera_parameter', \
                          CameraParam)
set_sheet_of_light_param (SheetOfLightModelID, 'calibration_object', \
                         'calib_object.dxf')
* Uncalibrated reconstruction of the calibration object
for ProfileIndex := 1 to 1000 by 1
    grab_image_async (Image, AcqHandle, -1)
    measure_profile_sheet_of_light (Image, SheetOfLightModelID, [])
endfor
* Calibration of the sheet-of-light-model
calibrate_sheet_of_light (SheetOfLightModelID, Error)
* Now get a calibrated reconstruction of the calibration object
get_sheet_of_light_result_object_model_3d (SheetOfLightModelID, \
                                           ObjectModel3D)

结果

算子 calibrate_sheet_of_lightcalibrate_sheet_of_lightCalibrateSheetOfLightCalibrateSheetOfLightCalibrateSheetOfLightcalibrate_sheet_of_light 返回值 2 (H_MSG_TRUE) if the calibration was successful. 否则,将抛出异常。

可能的前趋

create_sheet_of_light_modelcreate_sheet_of_light_modelCreateSheetOfLightModelCreateSheetOfLightModelCreateSheetOfLightModelcreate_sheet_of_light_model, set_sheet_of_light_paramset_sheet_of_light_paramSetSheetOfLightParamSetSheetOfLightParamSetSheetOfLightParamset_sheet_of_light_param, set_profile_sheet_of_lightset_profile_sheet_of_lightSetProfileSheetOfLightSetProfileSheetOfLightSetProfileSheetOfLightset_profile_sheet_of_light, measure_profile_sheet_of_lightmeasure_profile_sheet_of_lightMeasureProfileSheetOfLightMeasureProfileSheetOfLightMeasureProfileSheetOfLightmeasure_profile_sheet_of_light

可能的后继

set_profile_sheet_of_lightset_profile_sheet_of_lightSetProfileSheetOfLightSetProfileSheetOfLightSetProfileSheetOfLightset_profile_sheet_of_light, apply_sheet_of_light_calibrationapply_sheet_of_light_calibrationApplySheetOfLightCalibrationApplySheetOfLightCalibrationApplySheetOfLightCalibrationapply_sheet_of_light_calibration

模块

三维计量