image_to_world_planeT_image_to_world_planeImageToWorldPlaneImageToWorldPlane (Operator)

Name

image_to_world_planeT_image_to_world_planeImageToWorldPlaneImageToWorldPlane — 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)

Beschreibung

image_to_world_planeimage_to_world_planeImageToWorldPlaneImageToWorldPlaneImageToWorldPlane rektifiziert ein Bild ImageImageImageImageimage durch Transformation in die Ebene z=0 (Messebene) eines Weltkoordinatensystems. Das resultierende Bild ImageWorldImageWorldImageWorldImageWorldimageWorld 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 WorldPoseWorldPoseWorldPoseWorldPoseworldPose ü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 CameraParamCameraParamCameraParamCameraParamcameraParam müssen die internen Kameraparameter übergeben werden (siehe Kalibrierung für ihre Reihenfolge und das zu Grunde liegende Kameramodell).

In vielen Fällen sind CameraParamCameraParamCameraParamCameraParamcameraParam und WorldPoseWorldPoseWorldPoseWorldPoseworldPose das Ergebnis einer vorherigen Kamerakalibrierung mit dem Operator calibrate_camerascalibrate_camerasCalibrateCamerasCalibrateCamerasCalibrateCameras. Ein Beispiel findet sich weiter unten.

Die Pixel-Position der linken oberen Ecke des Ergebnisbildes ImageWorldImageWorldImageWorldImageWorldimageWorld ist durch den Ursprung des Weltkoordinatensystems festgelegt. Die Ausdehnung des Ergebnisbildes ImageWorldImageWorldImageWorldImageWorldimageWorld kann durch die Parameter WidthWidthWidthWidthwidth, HeightHeightHeightHeightheight und ScaleScaleScaleScalescale gewählt werden. Dabei sind WidthWidthWidthWidthwidth und HeightHeightHeightHeightheight in Pixel anzugeben.

Mit dem Parameter ScaleScaleScaleScalescale 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.

ScaleScaleScaleScalescale 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", 'cm'"cm""cm""cm""cm", 'mm'"mm""mm""mm""mm", 'microns'"microns""microns""microns""microns" oder 'um'"um""um""um""um" anzugeben.

Der Parameter InterpolationInterpolationInterpolationInterpolationinterpolation gibt an, ob zwischen den Pixeln des Eingabebildes bilinear interpoliert ('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") 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_mapGenImageToWorldPlaneMapGenImageToWorldPlaneMapGenImageToWorldPlaneMap und map_imagemap_imageMapImageMapImageMapImage wesentlich effizienter als der Operator image_to_world_planeimage_to_world_planeImageToWorldPlaneImageToWorldPlaneImageToWorldPlane, da die Abbildungsvorschrift nur einmal berechnet werden muss.

Achtung

image_to_world_planeimage_to_world_planeImageToWorldPlaneImageToWorldPlaneImageToWorldPlane 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

ImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHobject (byte / uint2 / real)

Eingabebild.

ImageWorldImageWorldImageWorldImageWorldimageWorld (output_object)  (multichannel-)image(-array) objectHImageHImageHobject * (byte / uint2 / real)

Transformiertes Bild.

CameraParamCameraParamCameraParamCameraParamcameraParam (input_control)  campar HCamPar, HTupleHTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Interne Kameraparameter.

WorldPoseWorldPoseWorldPoseWorldPoseworldPose (input_control)  pose HPose, HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

3D-Lage des Weltkoordinatensystems in Kamerakoordinaten.

Parameteranzahl: 7

WidthWidthWidthWidthwidth (input_control)  extent.x HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Breite des Ergebnisbildes in Pixel.

Restriktion: Width >= 1

HeightHeightHeightHeightheight (input_control)  extent.y HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Höhe des Ergebnisbildes in Pixel.

Restriktion: Height >= 1

ScaleScaleScaleScalescale (input_control)  number HTupleHTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Maßstab oder Dimension.

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

Wertevorschläge: 'm'"m""m""m""m", 'cm'"cm""cm""cm""cm", 'mm'"mm""mm""mm""mm", 'microns'"microns""microns""microns""microns", 'um'"um""um""um""um", 1.0, 0.01, 0.001, 1.0e-6, 0.0254, 0.3048, 0.9144

Restriktion: Scale > 0

InterpolationInterpolationInterpolationInterpolationinterpolation (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Art der Interpolation.

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

Werteliste: 'bilinear'"bilinear""bilinear""bilinear""bilinear", '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_planeImageToWorldPlaneImageToWorldPlaneImageToWorldPlane den Wert 2 (H_MSG_TRUE).

Vorgänger

create_posecreate_poseCreatePoseCreatePoseCreatePose, hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPoseHomMat3dToPose, camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationCameraCalibration, hand_eye_calibrationhand_eye_calibrationHandEyeCalibrationHandEyeCalibrationHandEyeCalibration, set_origin_poseset_origin_poseSetOriginPoseSetOriginPoseSetOriginPose

Alternativen

gen_image_to_world_plane_mapgen_image_to_world_plane_mapGenImageToWorldPlaneMapGenImageToWorldPlaneMapGenImageToWorldPlaneMap, map_imagemap_imageMapImageMapImageMapImage

Siehe auch

contour_to_world_plane_xldcontour_to_world_plane_xldContourToWorldPlaneXldContourToWorldPlaneXldContourToWorldPlaneXld, image_points_to_world_planeimage_points_to_world_planeImagePointsToWorldPlaneImagePointsToWorldPlaneImagePointsToWorldPlane

Modul

Calibration