IDS peak ICV v1.2.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
38class XYZImage final : public Image
39{
40public:
59 explicit XYZImage(const UndistortedImage& undistortedDepthMap);
60
74 XYZImage TransformToWorkspace(const ExtrinsicParameters& extrinsicParameters) const;
75
76private:
77 friend peak::common::detail::BackendAccessor<XYZImage>;
78
79 using Image::Image;
80};
81
82inline XYZImage::XYZImage(const UndistortedImage& undistortedDepthMap)
83 : Image{ peak::common::PixelFormat::Coord3D_ABC32f, undistortedDepthMap.GetSize() }
84{
85 auto* const depthMapHandle = peak::common::detail::BackendAccessor<Image>::BackendHandle(undistortedDepthMap);
86
87 auto* const xyzImageHandle = peak::common::detail::BackendAccessor<Image>::BackendHandle(*this);
88
89 const auto cType = peak::common::detail::BackendAccessor<IntrinsicParameters>::CreateCType(
90 undistortedDepthMap.GetIntrinsicParameters());
92 return PEAK_ICV_C_ABI_PREFIX peak_icv_Transform_DepthMap_To_XYZImage(
93 xyzImageHandle, cType, sizeof(peak_icv_intrinsic_parameters), depthMapHandle);
94 });
95}
96
97inline XYZImage XYZImage::TransformToWorkspace(const ExtrinsicParameters& extrinsicParameters) const
98{
99 const auto extrinsicParametersC = peak::common::detail::BackendAccessor<ExtrinsicParameters>::CreateCType(extrinsicParameters);
100
101 XYZImage outputImage{ this->GetPixelFormat(), this->GetSize() };
102 auto* outputHandle = peak::common::detail::BackendAccessor<XYZImage>::BackendHandle(outputImage);
104 return PEAK_ICV_C_ABI_PREFIX peak_icv_Image_TransformToWorkspace(
105 this->GetHandle(), extrinsicParametersC, sizeof(peak_icv_extrinsic_parameters), outputHandle);
106 });
108 return outputImage;
109}
110
111} /* namespace icv */
112} /* 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 with Cartesian coordinates derived from an undistorted depth map.
XYZImage(const UndistortedImage &undistortedDepthMap)
Constructs a Cartesian coordinate image from the specified undistorted depth map.
XYZImage TransformToWorkspace(const ExtrinsicParameters &extrinsicParameters) const
Transforms the image to workspace coordinates using the specified extrinsic parameters.
void ExecuteAndMapReturnCodes(const CallableType &callableObject)