change_radial_distortion_imageT_change_radial_distortion_imageChangeRadialDistortionImageChangeRadialDistortionImagechange_radial_distortion_image更改径向畸变图像(算子)

名称

change_radial_distortion_imageT_change_radial_distortion_imageChangeRadialDistortionImageChangeRadialDistortionImagechange_radial_distortion_image — 更改图像的径向畸变。

签名

change_radial_distortion_image(Image, Region : ImageRectified : CamParamIn, CamParamOut : )

Herror T_change_radial_distortion_image(const Hobject Image, const Hobject Region, Hobject* ImageRectified, const Htuple CamParamIn, const Htuple CamParamOut)

void ChangeRadialDistortionImage(const HObject& Image, const HObject& Region, HObject* ImageRectified, const HTuple& CamParamIn, const HTuple& CamParamOut)

HImage HImage::ChangeRadialDistortionImage(const HRegion& Region, const HCamPar& CamParamIn, const HCamPar& CamParamOut) const

HImage HCamPar::ChangeRadialDistortionImage(const HImage& Image, const HRegion& Region, const HCamPar& CamParamOut) const

static void HOperatorSet.ChangeRadialDistortionImage(HObject image, HObject region, out HObject imageRectified, HTuple camParamIn, HTuple camParamOut)

HImage HImage.ChangeRadialDistortionImage(HRegion region, HCamPar camParamIn, HCamPar camParamOut)

HImage HCamPar.ChangeRadialDistortionImage(HImage image, HRegion region, HCamPar camParamOut)

def change_radial_distortion_image(image: HObject, region: HObject, cam_param_in: Sequence[Union[int, float, str]], cam_param_out: Sequence[Union[int, float, str]]) -> HObject

描述

change_radial_distortion_imagechange_radial_distortion_imageChangeRadialDistortionImageChangeRadialDistortionImageChangeRadialDistortionImagechange_radial_distortion_image 根据内部相机参数 CamParamInCamParamInCamParamInCamParamIncamParamIncam_param_inCamParamOutCamParamOutCamParamOutCamParamOutcamParamOutcam_param_out 改变输入图像 ImageImageImageImageimageimage 的径向畸变。输出图像中位于区域 RegionRegionRegionRegionregionregion 内的每个像素,将通过 CamParamOutCamParamOutCamParamOutCamParamOutcamParamOutcam_param_out 转换至图像平面,随后利用 CamParamInCamParamInCamParamInCamParamIncamParamIncam_param_in 投影至图像 ImageImageImageImageimageimage 的亚像素。最终灰度值通过双线性插值确定。若亚像素超出 ImageImageImageImageimageimage 边界,则对应的 ImageRectifiedImageRectifiedImageRectifiedImageRectifiedimageRectifiedimage_rectified 像素将被设为“黑色”并从图像域中剔除。

若需计算输出图像中所有像素的灰度值,只需在 RegionRegionRegionRegionregionregion 参数中传递一个空对象(该对象必须事先生成,例如通过 gen_empty_objgen_empty_objGenEmptyObjGenEmptyObjGenEmptyObjgen_empty_obj)。当输出图像尺寸与输入图像尺寸不一致时,此方法尤为实用——此时无法直接将输入图像区域传递至 RegionRegionRegionRegionregionregion 参数。

若通过 change_radial_distortion_cam_parchange_radial_distortion_cam_parChangeRadialDistortionCamParChangeRadialDistortionCamParChangeRadialDistortionCamParchange_radial_distortion_cam_par 计算 CamParamOutCamParamOutCamParamOutCamParamOutcamParamOutcam_param_out,则ImageRectifiedImageRectifiedImageRectifiedImageRectifiedimageRectifiedimage_rectified 等同于使用修正径向畸变镜头获得的 ImageImageImageImageimageimage。当 时,图像即为校正状态。后续姿态估计(即外部相机参数的确定)不受此操作影响。

请注意 change_radial_distortion_imagechange_radial_distortion_imageChangeRadialDistortionImageChangeRadialDistortionImageChangeRadialDistortionImagechange_radial_distortion_image 无法用于配备透视镜头的线扫描相机。您可能需要改用 image_to_world_planeimage_to_world_planeImageToWorldPlaneImageToWorldPlaneImageToWorldPlaneimage_to_world_plane

注意

若输入图像尺寸未超过所选设备的图像对象最大尺寸,则可在 OpenCL 设备上执行 change_radial_distortion_imagechange_radial_distortion_imageChangeRadialDistortionImageChangeRadialDistortionImageChangeRadialDistortionImagechange_radial_distortion_image 操作。由于 OpenCL 实现采用单精度运算,其结果可能与 CPU 实现存在差异。

执行信息

参数

ImageImageImageImageimageimage (输入对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject (byte / uint2 / real)

原始图像。

RegionRegionRegionRegionregionregion (输入对象)  region objectHRegionHObjectHRegionHobject

ImageRectifiedImageRectifiedImageRectifiedImageRectifiedimageRectifiedimage_rectified 中的感兴趣区域。

ImageRectifiedImageRectifiedImageRectifiedImageRectifiedimageRectifiedimage_rectified (输出对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject * (byte / uint2 / real)

经过径向畸变修正后的图像。

CamParamInCamParamInCamParamInCamParamIncamParamIncam_param_in (输入控制)  campar HCamPar, HTupleSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

ImageImageImageImageimageimage 的内部相机参数。

CamParamOutCamParamOutCamParamOutCamParamOutcamParamOutcam_param_out (输入控制)  campar HCamPar, HTupleSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

ImageImageImageImageimageimage 的内部相机参数。

结果

change_radial_distortion_imagechange_radial_distortion_imageChangeRadialDistortionImageChangeRadialDistortionImageChangeRadialDistortionImagechange_radial_distortion_image 在所有参数值正确时返回 2 (H_MSG_TRUE)。如果输入为空(无可用输入图像),可通过 set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)。如有必要,则抛出异常。

可能的前趋

change_radial_distortion_cam_parchange_radial_distortion_cam_parChangeRadialDistortionCamParChangeRadialDistortionCamParChangeRadialDistortionCamParchange_radial_distortion_cam_par, read_imageread_imageReadImageReadImageReadImageread_image, grab_imagegrab_imageGrabImageGrabImageGrabImagegrab_image

可能的后继

edges_imageedges_imageEdgesImageEdgesImageEdgesImageedges_image, thresholdthresholdThresholdThresholdThresholdthreshold

另见

change_radial_distortion_cam_parchange_radial_distortion_cam_parChangeRadialDistortionCamParChangeRadialDistortionCamParChangeRadialDistortionCamParchange_radial_distortion_cam_par, camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationCameraCalibrationcamera_calibration, read_cam_parread_cam_parReadCamParReadCamParReadCamParread_cam_par, change_radial_distortion_contours_xldchange_radial_distortion_contours_xldChangeRadialDistortionContoursXldChangeRadialDistortionContoursXldChangeRadialDistortionContoursXldchange_radial_distortion_contours_xld, change_radial_distortion_pointschange_radial_distortion_pointsChangeRadialDistortionPointsChangeRadialDistortionPointsChangeRadialDistortionPointschange_radial_distortion_points

模块

标定