1from __future__
import annotations
4from typing
import Any, TYPE_CHECKING
8from ids_peak_icv
import lib_loader
22 Transforms a depth map with radial coordinates to a three-channel image with cartesian coordinates.
24 This class converts an undistorted depth map with radial coordinates to a three-channel image with cartesian coordinates.
25 Radial coordinates represent the distance directly from the optical center to the reflected object, resulting in
26 values that appear more distant as you move outwards from the image center. In contrast, Cartesian coordinates
27 interpret the optical center as a plane, resulting in straight lines from the camera to the reflected object. For
28 example, if the camera is placed in front of a flat wall, only the Cartesian values will show a flat plane.
30 @ingroup ids_peak_icv_python_types
31 @since ids_peak_icv 1.1
38 Creates an instance of XYZImage using an undistorted depth map image and intrinsic parameters
40 @param undistorted_depth_map: Undistorted depth map with radial coordinates.
42 @since ids_peak_icv 1.1
44 return cls(_undistorted_depth_map=undistorted_depth_map)
46 def __init__(self, *args: Any, **kwargs: Any) ->
None:
49 In order to create a point cloud, please refer to the class methods.
51 @since ids_peak_icv 1.1
53 if "_undistorted_depth_map" in kwargs:
54 image = Image.create_from_pixel_format_and_size(PixelFormat.COORD3D_ABC32F,
55 Size(kwargs[
"_undistorted_depth_map"].width,
56 kwargs[
"_undistorted_depth_map"].height))
57 super().
__init__(_handle=image._handle)
60 execute_and_map_return_codes(lib_loader.dll().peak_icv_Transform_DepthMap_To_XYZImage,
62 kwargs[
"_undistorted_depth_map"].intrinsic_parameters._parameters,
64 kwargs[
"_undistorted_depth_map"].intrinsic_parameters._parameters),
65 kwargs[
"_undistorted_depth_map"]._handle)
66 elif "_handle" in kwargs:
67 super().
__init__(_handle=kwargs[
"_handle"])
70 "Cannot initialize {} with __init__. Please use a classmethod.".format(self.__class__.__name__))
75 Transforms the image to workspace coordinates using the specified extrinsic parameters.
77 The transformation uses the inverse of the extrinsic matrix
78 to convert from camera to workspace coordinate system.
80 @param extrinsic_parameters: Extrinsic parameters from the workspace calibration.
82 @since ids_peak_icv 1.1
87 execute_and_map_return_codes(lib_loader.dll().peak_icv_Image_Create,
88 ctypes.pointer(output_handle),
89 ctypes.c_int(PixelFormat.COORD3D_ABC32F.value),
91 execute_and_map_return_codes(lib_loader.dll().peak_icv_Image_TransformToWorkspace,
93 extrinsic_parameters._parameters, ctypes.sizeof(extrinsic_parameters._parameters),
96 return XYZImage(_handle=output_handle)
A size consists of width and height where width and height have to be greater than or equal to zero.
Image Class for working with algorithms.
Transforms a depth map with radial coordinates to a three-channel image with cartesian coordinates.
None __init__(self, *Any args, **Any kwargs)
In order to create a point cloud, please refer to the class methods.
XYZImage transform_to_workspace(self, ExtrinsicParameters extrinsic_parameters)
Transforms the image to workspace coordinates using the specified extrinsic parameters.
XYZImage create_from_undistorted_image(cls, UndistortedImage undistorted_depth_map)
Creates an instance of XYZImage using an undistorted depth map image and intrinsic parameters.
Thrown when an operation cannot be performed due to logical constraints.