IDS peak ICV v1.0.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{
23namespace experimental
24{
25
26
39class XYZImage final : public Image
40{
41public:
49 explicit XYZImage(const UndistortedImage& undistortedDepthMap);
50
63 XYZImage TransformToWorkspace(const ExtrinsicParameters& extrinsicParameters) const;
64
65private:
66 friend peak::common::detail::BackendAccessor<XYZImage>;
67
68 using Image::Image;
69};
70
71inline XYZImage::XYZImage(const UndistortedImage& undistortedDepthMap)
72 : Image{ peak::common::PixelFormat::Coord3D_ABC32f, undistortedDepthMap.GetSize() }
73{
74 auto* const depthMapHandle = peak::common::detail::BackendAccessor<Image>::BackendHandle(undistortedDepthMap);
75
76 auto* const xyzImageHandle = peak::common::detail::BackendAccessor<Image>::BackendHandle(*this);
77
79 return PEAK_ICV_C_ABI_PREFIX peak_icv_Transform_DepthMap_To_XYZImage(xyzImageHandle,
80 peak::common::detail::BackendAccessor<IntrinsicParameters>::CreateCType(undistortedDepthMap.GetIntrinsicParameters()),
81 depthMapHandle);
82 });
83}
84
85inline XYZImage XYZImage::TransformToWorkspace(const ExtrinsicParameters& extrinsicParameters) const
86{
87 const auto extrinsicParametersC = peak::common::detail::BackendAccessor<ExtrinsicParameters>::CreateCType(extrinsicParameters);
88
89 XYZImage outputImage{ this->GetPixelFormat(), this->GetSize() };
90 auto* outputHandle = peak::common::detail::BackendAccessor<XYZImage>::BackendHandle(outputImage);
92 return PEAK_ICV_C_ABI_PREFIX peak_icv_Image_TransformToWorkspace(this->GetHandle(), extrinsicParametersC, outputHandle);
93 });
94
95 return outputImage;
96}
97} /* namespace experimental */
98
99} /* namespace icv */
100} /* namespace peak */
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.
Image(const peak::common::IImageView &imageView)
Constructs an Image from an IImageView Instance. This can be a buffer or a possibility to convert oth...
peak::common::PixelFormat GetPixelFormat() const
Provides the pixel format of the image.
This class stores and provides access to the extrinsic parameters, which include the translation,...
IntrinsicParameters GetIntrinsicParameters() const
Returns the intrinsic parameters.
Transforms an undistorted depth map with radial coordinates to a three-channel image with cartesian c...
XYZImage(const UndistortedImage &undistortedDepthMap)
Constructs a XYZImage object from a given UndistortedImage.
XYZImage TransformToWorkspace(const ExtrinsicParameters &extrinsicParameters) const
Transforms a XYZ image to the workspace coordinate system using the extrinsic parameters.
void ExecuteAndMapReturnCodes(const CallableType &callableObject)