IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
peak_icv_xyz_image.hpp
Go to the documentation of this file.
1
11#pragma once
12
16#include <peak_icv_c/algorithms/transformations/peak_icv_xyz_image_transformer.h>
17#include <utility>
18
19namespace peak
20{
21namespace icv
22{
23
44class XYZImage final : public Image
45{
46public:
63 explicit XYZImage(const UndistortedImage& undistortedDepthMap);
64
78 XYZImage TransformToWorkspace(const ExtrinsicParameters& extrinsicParameters) const;
79
80private:
81 friend peak::common::detail::BackendAccessor<XYZImage>;
82
83 using Image::Image;
84};
85
86inline XYZImage::XYZImage(const UndistortedImage& undistortedDepthMap)
87 : Image{ peak::common::PixelFormat::Coord3D_ABC32f, undistortedDepthMap.GetSize() }
88{
89 auto* const depthMapHandle = peak::common::detail::BackendAccessor<Image>::BackendHandle(undistortedDepthMap);
90
91 auto* const xyzImageHandle = peak::common::detail::BackendAccessor<Image>::BackendHandle(*this);
92
93 const auto cType = peak::common::detail::BackendAccessor<IntrinsicParameters>::CreateCType(
94 undistortedDepthMap.GetIntrinsicParameters());
96 return PEAK_ICV_C_ABI_PREFIX peak_icv_Transform_DepthMap_To_XYZImage(
97 xyzImageHandle, cType, sizeof(peak_icv_intrinsic_parameters), depthMapHandle);
98 });
99}
100
101inline XYZImage XYZImage::TransformToWorkspace(const ExtrinsicParameters& extrinsicParameters) const
102{
103 const auto extrinsicParametersC = peak::common::detail::BackendAccessor<ExtrinsicParameters>::CreateCType(extrinsicParameters);
104
105 XYZImage outputImage{ this->GetPixelFormat(), this->GetSize() };
106 auto* outputHandle = peak::common::detail::BackendAccessor<XYZImage>::BackendHandle(outputImage);
108 return PEAK_ICV_C_ABI_PREFIX peak_icv_Image_TransformToWorkspace(
109 this->GetHandle(), extrinsicParametersC, sizeof(peak_icv_extrinsic_parameters), outputHandle);
110 });
112 return outputImage;
113}
114
115} /* namespace icv */
116} /* namespace peak */
This class stores and provides access to the extrinsic parameters, which include the translation,...
For detailed information about the use of ids_peak_icv Image refer to the Image Guide.
peak::common::Size GetSize() const
Provides the size of the image in pixels.
Image(const peak::common::IImageView &imageView)
Constructs an Image from an IImageView Instance.
peak::common::PixelFormat GetPixelFormat() const
Provides the pixel format of the image.
Represents an image that has undergone undistortion.
IntrinsicParameters GetIntrinsicParameters() const
Represents a three-channel image encoding cartesian coordinates (x, y, z) of a 3D point.
XYZImage(const UndistortedImage &undistortedDepthMap)
Constructs a cartesian coordinate image from an undistorted depth map.
XYZImage TransformToWorkspace(const ExtrinsicParameters &extrinsicParameters) const
Transforms the camera-centric coordinates into workspace coordinates.
void ExecuteAndMapReturnCodes(const CallableType &callableObject)