image_to_world_planeT_image_to_world_planeImageToWorldPlaneImageToWorldPlaneimage_to_world_plane (Operator)

Name

image_to_world_planeT_image_to_world_planeImageToWorldPlaneImageToWorldPlaneimage_to_world_plane — Rektifizieren eines Bildes durch Transformation in die Ebene z=0 eines Weltkoordinatensystems.

Signatur

image_to_world_plane(Image : ImageWorld : CameraParam, WorldPose, Width, Height, Scale, Interpolation : )

Herror T_image_to_world_plane(const Hobject Image, Hobject* ImageWorld, const Htuple CameraParam, const Htuple WorldPose, const Htuple Width, const Htuple Height, const Htuple Scale, const Htuple Interpolation)

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   (Nur Windows)

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   (Nur Windows)

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   (Nur Windows)

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

Beschreibung

image_to_world_planeimage_to_world_planeImageToWorldPlaneImageToWorldPlaneImageToWorldPlaneimage_to_world_plane rektifiziert ein Bild ImageImageImageImageimageimage durch Transformation in die Ebene z=0 (Messebene) eines Weltkoordinatensystems. Das resultierende Bild ImageWorldImageWorldImageWorldImageWorldimageWorldimage_world weist weder radiale noch perspektivische Verzerrungen auf; es entspricht einem Bild, das von einer verzerrungsfreien Kamera aufgenommen wird, die senkrecht auf die Messebene im Weltkoordinatensystem schaut. Das Weltkoordinatensystem wird gewählt, indem man seine 3D-Lage in Kamerakoordinaten in WorldPoseWorldPoseWorldPoseWorldPoseworldPoseworld_pose übergibt. Diese 3D-Lage wird in der Form erwartet. Dabei steht ccs für das Kamerakoordinatensystem und wcs für das Weltkoordinatensystem (siehe auch Transformationen / Posen und „Solution Guide III-C - 3D Vision“). In CameraParamCameraParamCameraParamCameraParamcameraParamcamera_param müssen die internen Kameraparameter übergeben werden (siehe Kalibrierung für ihre Reihenfolge und das zu Grunde liegende Kameramodell).

In vielen Fällen sind CameraParamCameraParamCameraParamCameraParamcameraParamcamera_param und WorldPoseWorldPoseWorldPoseWorldPoseworldPoseworld_pose das Ergebnis einer vorherigen Kamerakalibrierung mit dem Operator calibrate_camerascalibrate_camerasCalibrateCamerasCalibrateCamerasCalibrateCamerascalibrate_cameras. Ein Beispiel findet sich weiter unten.

Die Pixel-Position der linken oberen Ecke des Ergebnisbildes ImageWorldImageWorldImageWorldImageWorldimageWorldimage_world ist durch den Ursprung des Weltkoordinatensystems festgelegt. Die Ausdehnung des Ergebnisbildes ImageWorldImageWorldImageWorldImageWorldimageWorldimage_world kann durch die Parameter WidthWidthWidthWidthwidthwidth, HeightHeightHeightHeightheightheight und ScaleScaleScaleScalescalescale gewählt werden. Dabei sind WidthWidthWidthWidthwidthwidth und HeightHeightHeightHeightheightheight in Pixel anzugeben.

Mit dem Parameter ScaleScaleScaleScalescalescale kann die Größe eines Pixels im transformierten Bild festgelegt werden. Hierbei gibt es zwei typische Szenarien: Erstens kann das Bild so skaliert werden, dass Pixelkoordinaten im transformierten Bild direkt in einer metrischen Einheit vorliegen, dass ein Pixel also z.B. einem Mikrometer entspricht. Dies ist nützlich, falls im transformierten Bild Messaufgaben durchgeführt werden sollen, deren Ergebnisse dann automatisch in metrischen Einheiten vorliegen. Im zweiten Szenario skaliert man das Bild so, dass sein Inhalt im transformierten Bild in ähnlicher Größe vorliegt wie im Originalbild. Diese Art der Skalierung ist z.B. günstig, wenn man im transformierten Bild formbasiertes Matching anwenden will.

ScaleScaleScaleScalescalescale entspricht dem Verhältnis gewünschte Pixelgröße/ursprüngliche Einheit. Ein Pixelgröße von 1um heißt, dass ein Pixel im transformierten Bild der Fläche 1um x 1um in der Messebene entspricht. Die ursprüngliche Einheit ist durch die Koordinaten des Kalibrierkörpers gegeben. Falls dies, wie bei der Standard-Kalibrierplatte, Meter sind, ist es auch möglich, die gewünschte Einheit der Pixelkoordinaten direkt durch 'm'"m""m""m""m""m", 'cm'"cm""cm""cm""cm""cm", 'mm'"mm""mm""mm""mm""mm", 'microns'"microns""microns""microns""microns""microns" oder 'um'"um""um""um""um""um" anzugeben.

Der Parameter InterpolationInterpolationInterpolationInterpolationinterpolationinterpolation gibt an, ob zwischen den Pixeln des Eingabebildes bilinear interpoliert ('bilinear'"bilinear""bilinear""bilinear""bilinear""bilinear") oder lediglich der Grauwert des am nächsten liegenden Pixels ('nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor") verwendet werden soll.

Sollen mehrere Bilder unter Verwendung derselben Parameter transformiert werden, so ist die Kombination aus gen_image_to_world_plane_mapgen_image_to_world_plane_mapGenImageToWorldPlaneMapGenImageToWorldPlaneMapGenImageToWorldPlaneMapgen_image_to_world_plane_map und map_imagemap_imageMapImageMapImageMapImagemap_image wesentlich effizienter als der Operator image_to_world_planeimage_to_world_planeImageToWorldPlaneImageToWorldPlaneImageToWorldPlaneimage_to_world_plane, da die Abbildungsvorschrift nur einmal berechnet werden muss.

Achtung

image_to_world_planeimage_to_world_planeImageToWorldPlaneImageToWorldPlaneImageToWorldPlaneimage_to_world_plane kann auf OpenCL-Geräten ausgeführt werden, wenn das Eingangsbild die maximale Größe für Bildobjekte des ausgewählten Gerätes nicht überschreitet. Das Ergebnis kann dabei geringfügig von dem auf der CPU berechneten abweichen.

Ausführungsinformationen

Parameter

ImageImageImageImageimageimage (input_object)  (multichannel-)image(-array) objectHImageHObjectHImageHobject (byte / uint2 / real)

Eingabebild.

ImageWorldImageWorldImageWorldImageWorldimageWorldimage_world (output_object)  (multichannel-)image(-array) objectHImageHObjectHImageHobject * (byte / uint2 / real)

Transformiertes Bild.

CameraParamCameraParamCameraParamCameraParamcameraParamcamera_param (input_control)  campar HCamPar, HTupleSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Interne Kameraparameter.

WorldPoseWorldPoseWorldPoseWorldPoseworldPoseworld_pose (input_control)  pose HPose, HTupleSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

3D-Lage des Weltkoordinatensystems in Kamerakoordinaten.

Parameteranzahl: 7

WidthWidthWidthWidthwidthwidth (input_control)  extent.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Breite des Ergebnisbildes in Pixel.

Restriktion: Width >= 1

HeightHeightHeightHeightheightheight (input_control)  extent.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Höhe des Ergebnisbildes in Pixel.

Restriktion: Height >= 1

ScaleScaleScaleScalescalescale (input_control)  number HTupleUnion[int, float, str]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Maßstab oder Dimension.

Defaultwert: 'm' "m" "m" "m" "m" "m"

Wertevorschläge: '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

Restriktion: Scale > 0

InterpolationInterpolationInterpolationInterpolationinterpolationinterpolation (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Art der Interpolation.

Defaultwert: 'bilinear' "bilinear" "bilinear" "bilinear" "bilinear" "bilinear"

Werteliste: 'bilinear'"bilinear""bilinear""bilinear""bilinear""bilinear", 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor"

Beispiel (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')

Ergebnis

Sind die Parameterwerte korrekt, dann liefert image_to_world_planeimage_to_world_planeImageToWorldPlaneImageToWorldPlaneImageToWorldPlaneimage_to_world_plane den Wert TRUE.

Vorgänger

create_posecreate_poseCreatePoseCreatePoseCreatePosecreate_pose, hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPoseHomMat3dToPosehom_mat3d_to_pose, camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationCameraCalibrationcamera_calibration, hand_eye_calibrationhand_eye_calibrationHandEyeCalibrationHandEyeCalibrationHandEyeCalibrationhand_eye_calibration, set_origin_poseset_origin_poseSetOriginPoseSetOriginPoseSetOriginPoseset_origin_pose

Alternativen

gen_image_to_world_plane_mapgen_image_to_world_plane_mapGenImageToWorldPlaneMapGenImageToWorldPlaneMapGenImageToWorldPlaneMapgen_image_to_world_plane_map, map_imagemap_imageMapImageMapImageMapImagemap_image

Siehe auch

contour_to_world_plane_xldcontour_to_world_plane_xldContourToWorldPlaneXldContourToWorldPlaneXldContourToWorldPlaneXldcontour_to_world_plane_xld, image_points_to_world_planeimage_points_to_world_planeImagePointsToWorldPlaneImagePointsToWorldPlaneImagePointsToWorldPlaneimage_points_to_world_plane

Modul

Calibration