image_to_world_plane T_image_to_world_plane ImageToWorldPlane ImageToWorldPlane image_to_world_plane (算子)
名称
image_to_world_plane T_image_to_world_plane ImageToWorldPlane ImageToWorldPlane image_to_world_plane — 通过将图像变换到世界坐标系的平面 z=0 来校正图像。
签名
void ImageToWorldPlane (const HObject& Image , HObject* ImageWorld , const HTuple& CameraParam , const HTuple& WorldPose , const HTuple& Width , const HTuple& Height , const HTuple& Scale , const HTuple& Interpolation )
HImage HImage ::ImageToWorldPlane (const HCamPar& CameraParam , const HPose& WorldPose , Hlong Width , Hlong Height , const HTuple& Scale , const HString& Interpolation ) const
HImage HImage ::ImageToWorldPlane (const HCamPar& CameraParam , const HPose& WorldPose , Hlong Width , Hlong Height , const HString& Scale , const HString& Interpolation ) const
HImage HImage ::ImageToWorldPlane (const HCamPar& CameraParam , const HPose& WorldPose , Hlong Width , Hlong Height , const char* Scale , const char* Interpolation ) const
HImage HImage ::ImageToWorldPlane (const HCamPar& CameraParam , const HPose& WorldPose , Hlong Width , Hlong Height , const wchar_t* Scale , const wchar_t* Interpolation ) const
(
Windows only)
HImage HCamPar ::ImageToWorldPlane (const HImage& Image , const HPose& WorldPose , Hlong Width , Hlong Height , const HTuple& Scale , const HString& Interpolation ) const
HImage HCamPar ::ImageToWorldPlane (const HImage& Image , const HPose& WorldPose , Hlong Width , Hlong Height , const HString& Scale , const HString& Interpolation ) const
HImage HCamPar ::ImageToWorldPlane (const HImage& Image , const HPose& WorldPose , Hlong Width , Hlong Height , const char* Scale , const char* Interpolation ) const
HImage HCamPar ::ImageToWorldPlane (const HImage& Image , const HPose& WorldPose , Hlong Width , Hlong Height , const wchar_t* Scale , const wchar_t* Interpolation ) const
(
Windows only)
HImage HPose ::ImageToWorldPlane (const HImage& Image , const HCamPar& CameraParam , Hlong Width , Hlong Height , const HTuple& Scale , const HString& Interpolation ) const
HImage HPose ::ImageToWorldPlane (const HImage& Image , const HCamPar& CameraParam , Hlong Width , Hlong Height , const HString& Scale , const HString& Interpolation ) const
HImage HPose ::ImageToWorldPlane (const HImage& Image , const HCamPar& CameraParam , Hlong Width , Hlong Height , const char* Scale , const char* Interpolation ) const
HImage HPose ::ImageToWorldPlane (const HImage& Image , const HCamPar& CameraParam , Hlong Width , Hlong Height , const wchar_t* Scale , const wchar_t* Interpolation ) const
(
Windows only)
static void HOperatorSet .ImageToWorldPlane (HObject image , out HObject imageWorld , HTuple cameraParam , HTuple worldPose , HTuple width , HTuple height , HTuple scale , HTuple interpolation )
HImage HImage .ImageToWorldPlane (HCamPar cameraParam , HPose worldPose , int width , int height , HTuple scale , string interpolation )
HImage HImage .ImageToWorldPlane (HCamPar cameraParam , HPose worldPose , int width , int height , string scale , string interpolation )
HImage HCamPar .ImageToWorldPlane (HImage image , HPose worldPose , int width , int height , HTuple scale , string interpolation )
HImage HCamPar .ImageToWorldPlane (HImage image , HPose worldPose , int width , int height , string scale , string interpolation )
HImage HPose .ImageToWorldPlane (HImage image , HCamPar cameraParam , int width , int height , HTuple scale , string interpolation )
HImage HPose .ImageToWorldPlane (HImage image , HCamPar cameraParam , int width , int height , string scale , string interpolation )
def image_to_world_plane (image : HObject, camera_param : Sequence[Union[int, float, str]], world_pose : Sequence[Union[int, float]], width : int, height : int, scale : Union[int, float, str], interpolation : str) -> HObject
描述
image_to_world_plane image_to_world_plane ImageToWorldPlane ImageToWorldPlane ImageToWorldPlane image_to_world_plane rectifies an image Image Image Image Image image image by
transforming it into the plane z=0 (plane of measurements) in a world
coordinate system. The resulting rectified image ImageWorld ImageWorld ImageWorld ImageWorld imageWorld image_world shows
neither radial nor perspective distortions; it corresponds to an image
acquired by a distortion-free camera that looks perpendicularly onto the
plane of measurements. The world coordinate system is chosen by passing its
3D pose relative to the camera coordinate system in WorldPose WorldPose WorldPose WorldPose worldPose world_pose .
Hence, latter one is expected 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 CameraParam CameraParam CameraParam CameraParam cameraParam camera_param you must pass the internal camera parameters (see
标定 for the sequence of the parameters and the
underlying camera model).
In many cases CameraParam CameraParam CameraParam CameraParam cameraParam camera_param and WorldPose WorldPose WorldPose WorldPose worldPose world_pose are the result of
calibrating the camera with the operator calibrate_cameras calibrate_cameras CalibrateCameras CalibrateCameras CalibrateCameras calibrate_cameras 。See
below for an example.
The pixel position of the upper left corner of the output image
ImageWorld ImageWorld ImageWorld ImageWorld imageWorld image_world is determined by the origin of the world coordinate
system. The size of the output image ImageWorld ImageWorld ImageWorld ImageWorld imageWorld image_world can be chosen by
the parameters Width Width Width Width width width , Height Height Height Height height height , and
Scale Scale Scale Scale scale scale . Width Width Width Width width width and Height Height Height Height height height must be given in pixels.
The parameter Scale Scale Scale Scale scale scale can be used to specify the size of a pixel in the
transformed image. There are two ways to use this parameter:
Scale pixels to metric units:
Scale the image such that one pixel in the transformed image corresponds
to a metric unit, e.g., setting 'mm' "mm" "mm" "mm" "mm" "mm" determines that a pixel in the
transformed image corresponds to the area 1mm x 1mm in the
plane of measurements. For this, the original unit needs to be meters.
This is the case if you use a standard calibration plate.
值列表: 'm' "m" "m" "m" "m" "m" , 'cm' "cm" "cm" "cm" "cm" "cm" , 'mm' "mm" "mm" "mm" "mm" "mm" ,
'microns' "microns" "microns" "microns" "microns" "microns" , 'um' "um" "um" "um" "um" "um" .
Default: 'm' "m" "m" "m" "m" "m" .
Control scaling manually:
Scale the image by giving a number that determines the ratio of
original unit length / desired number of pixels .
E.g., if your original unit is meters and you want
every pixel of your transformed image to represent 3mm x 3mm
of the measuring plane, your scale is calculated
.
If you want to perform a task like shape-based matching on your
transformed image, it is useful to scale the image such that its content
appears in a size similar to the original image.
Restriction: Scale Scale Scale Scale scale scale > 0 .
The parameter Interpolation Interpolation Interpolation Interpolation interpolation interpolation specifies, whether bilinear
interpolation ('bilinear' "bilinear" "bilinear" "bilinear" "bilinear" "bilinear" ) should be applied between the pixels in
the input image or whether the gray value of the nearest neighboring pixel
('nearest_neighbor' "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" ) should be used.
If several images have to be rectified using the same parameters,
gen_image_to_world_plane_map gen_image_to_world_plane_map GenImageToWorldPlaneMap GenImageToWorldPlaneMap GenImageToWorldPlaneMap gen_image_to_world_plane_map in combination with map_image map_image MapImage MapImage MapImage map_image
is much more efficient than the operator image_to_world_plane image_to_world_plane ImageToWorldPlane ImageToWorldPlane ImageToWorldPlane image_to_world_plane
because the mapping function needs to be computed only once.
注意
image_to_world_plane image_to_world_plane ImageToWorldPlane ImageToWorldPlane ImageToWorldPlane image_to_world_plane can be executed on OpenCL devices if the input
image does not exceed the maximum size of image objects of the selected
device. There can be slight differences in the output compared to the
execution on the CPU.
执行信息
支持 OpenCL 计算设备。
多线程类型:可重入(与非独占算子并行运行)。
多线程作用域:全局(可从任何线程调用)。
在元组级别上自动并行化。
参数
Image Image Image Image image image (输入对象) (multichannel-)image(-array) → object HImage HObject HImage Hobject (byte / uint2 / real)
输入图像。
ImageWorld ImageWorld ImageWorld ImageWorld imageWorld image_world (输出对象) (multichannel-)image(-array) → object HImage HObject HImage Hobject * (byte / uint2 / real)
转换后的图像。
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*)
内部相机参数。
WorldPose WorldPose WorldPose WorldPose worldPose world_pose (输入控制) pose → HPose , HTuple Sequence[Union[int, float]] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
3D pose of the world coordinate system in camera
coordinates.
元素数量:
7
Width Width Width Width width width (输入控制) extent.x → HTuple int HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Width of the resulting image in pixels.
限制:
Width >= 1
Height Height Height Height height height (输入控制) extent.y → HTuple int HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Height of the resulting image in pixels.
限制:
Height >= 1
Scale Scale Scale Scale scale scale (输入控制) number → HTuple Union[int, float, str] HTuple Htuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
Scale or unit.
默认值:
'm'
"m"
"m"
"m"
"m"
"m"
建议值:
'm' "m" "m" "m" "m" "m" , 'cm' "cm" "cm" "cm" "cm" "cm" , 'mm' "mm" "mm" "mm" "mm" "mm" , 'microns' "microns" "microns" "microns" "microns" "microns" , 'um' "um" "um" "um" "um" "um" , 1.0, 0.01, 0.001, 1.0e-6, 0.0254, 0.3048, 0.9144
限制:
Scale > 0
Interpolation Interpolation Interpolation Interpolation interpolation interpolation (输入控制) string → HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
插值类型。
默认值:
'bilinear'
"bilinear"
"bilinear"
"bilinear"
"bilinear"
"bilinear"
值列表:
'bilinear' "bilinear" "bilinear" "bilinear" "bilinear" "bilinear" , 'nearest_neighbor' "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" "nearest_neighbor"
示例(HDevelop)
* Calibrate camera.
calibrate_cameras (CalibDataID, Error)
* Obtain camera parameters.
get_calib_data (CalibDataID, 'camera', 0, 'params', CamParam)
* Example values, if no calibration data is available:
CamParam := ['area_scan_division', 0.0087, -1859, 8.65e-006, 8.6e-006, \
362.5, 291.6, 768, 576]
* Get reference pose (pose 4 of calibration object 0).
get_calib_data (CalibDataID, 'calib_obj_pose',\
[0,4], 'pose', Pose)
* Example values, if no calibration data is available:
Pose := [-0.11, -0.21, 2.51, 352.73, 346.73, 336.48, 0]
* Compensate thickness of plate.
set_origin_pose (Pose, -1.125, -1.0, 0, PoseNewOrigin)
* Transform the image into the world plane.
read_image (Image, 'calib/calib-3d-coord-04')
image_to_world_plane (Image, ImageWorld, CamParam, PoseNewOrigin,\
900, 800, 0.0025, 'bilinear')
结果
image_to_world_plane image_to_world_plane ImageToWorldPlane ImageToWorldPlane ImageToWorldPlane image_to_world_plane 在所有参数值正确时返回 2 (H_MSG_TRUE )。如有必要,则抛出异常。
可能的前趋
create_pose create_pose CreatePose CreatePose CreatePose create_pose ,
hom_mat3d_to_pose hom_mat3d_to_pose HomMat3dToPose HomMat3dToPose HomMat3dToPose hom_mat3d_to_pose ,
camera_calibration camera_calibration CameraCalibration CameraCalibration CameraCalibration camera_calibration ,
hand_eye_calibration hand_eye_calibration HandEyeCalibration HandEyeCalibration HandEyeCalibration hand_eye_calibration ,
set_origin_pose set_origin_pose SetOriginPose SetOriginPose SetOriginPose set_origin_pose
替代
gen_image_to_world_plane_map gen_image_to_world_plane_map GenImageToWorldPlaneMap GenImageToWorldPlaneMap GenImageToWorldPlaneMap gen_image_to_world_plane_map ,
map_image map_image MapImage MapImage MapImage map_image
另见
contour_to_world_plane_xld contour_to_world_plane_xld ContourToWorldPlaneXld ContourToWorldPlaneXld ContourToWorldPlaneXld contour_to_world_plane_xld ,
image_points_to_world_plane image_points_to_world_plane ImagePointsToWorldPlane ImagePointsToWorldPlane ImagePointsToWorldPlane image_points_to_world_plane
模块
标定