CVB++ 15.0
polarization.hpp
1#pragma once
2
3#if defined _WIN32
4
5# include "../_cexports/c_polarization.h"
6
7# include "../global.hpp"
8
9# include "../image.hpp"
10
11namespace Cvb
12{
13
14 CVB_BEGIN_INLINE_NS
15
16 namespace Foundation
17 {
18
20
24 namespace Polarization
25 {
27 enum class ImageResolution
28 {
34 Half = 0,
41 Full = 1
42 };
43
45 enum class PseudoColorMode
46 {
64 Hsv1 = CExports::CVPOL_PCM_HSV_1,
82 Hsv2 = CExports::CVPOL_PCM_HSV_2,
92 Degree = CExports::CVPOL_PCM_DEGREE_POL,
102 AnglePolMono = CExports::CVPOL_PCM_ANGLE_POL_MONO,
120 AngleRgb = CExports::CVPOL_PCM_ANGLE_POL_COL
121 };
122
124 enum class Pattern
125 {
139 Square_90_45_135_0 = CExports::CVPOL_PATTERN_90_45_135_0,
157 Line_0_90_135 = CExports::CVPOL_PATTERN_LINE_0_90_135,
182 BayerGreenBlue = CExports::CVPOL_PATTERN_BAYER_GREEN_BLUE,
207 BayerBlueGreen = CExports::CVPOL_PATTERN_BAYER_BLUE_GREEN,
232 BayerRedGreen = CExports::CVPOL_PATTERN_BAYER_RED_GREEN,
257 BayerGreenRed = CExports::CVPOL_PATTERN_BAYER_GREEN_RED
258 };
259
278 inline std::unique_ptr<Image> ConvertToPlanes(const Image &rawImage, const Pattern pattern,
279 const ImageResolution resolution)
280 {
281 return Internal::DoResCallObjectOut<Image>([&](void *&handle) {
282 return CVB_CALL_CAPI(
283 CVPolConvertPatternImageToPlanes(rawImage.Handle(), static_cast<CExports::cvbval_t>(pattern),
284 static_cast<CExports::CVPOL_RESOLUTION>(resolution), handle));
285 });
286 }
287
299 inline std::unique_ptr<Image> CalculateStokesImage(const Image &polarizationImage)
300 {
301 return Internal::DoResCallObjectOut<Image>([&](void *&handle) {
302 return CVB_CALL_CAPI(CVPolCalculateStokesImage(polarizationImage.Handle(), handle));
303 });
304 }
305
315 inline std::unique_ptr<Image> CalculateStokes0(const Image &polarizationImage)
316 {
317 return Internal::DoResCallObjectOut<Image>(
318 [&](void *&handle) { return CVB_CALL_CAPI(CVPolCalculateStokes0(polarizationImage.Handle(), handle)); });
319 }
320
329 inline std::unique_ptr<Image> CalculateStokes1(const Image &polarizationImage)
330 {
331 return Internal::DoResCallObjectOut<Image>(
332 [&](void *&handle) { return CVB_CALL_CAPI(CVPolCalculateStokes1(polarizationImage.Handle(), handle)); });
333 }
334
343 inline std::unique_ptr<Image> CalculateStokes2(const Image &polarizationImage)
344 {
345 return Internal::DoResCallObjectOut<Image>(
346 [&](void *&handle) { return CVB_CALL_CAPI(CVPolCalculateStokes2(polarizationImage.Handle(), handle)); });
347 }
348
360 {
361 return Internal::DoResCallObjectOut<Image>([&](void *&handle) {
362 return CVB_CALL_CAPI(CVPolCalculateMinReflectionImage(polarizationImage.Handle(), handle));
363 });
364 }
365
378 inline std::unique_ptr<Image> ColorizeStokesImage(const Image &stokesImage, const PseudoColorMode &colorMode)
379 {
380 return Internal::DoResCallObjectOut<Image>([&](void *&handle) {
381 return CVB_CALL_CAPI(CVPolColorizePolarization(
382 stokesImage.Handle(), static_cast<CExports::CVPOL_PSEUDO_COLOR_MODE>(colorMode), handle));
383 });
384 }
385 }; // namespace Polarization
386
390
398
399 } // namespace Foundation
400
401 CVB_END_INLINE_NS
402} // namespace Cvb
403
404#endif
The Common Vision Blox image.
Definition decl_image.hpp:50
void * Handle() const noexcept
Classic API image handle.
Definition decl_image.hpp:237
Functions and type definitions of the polarization library.
Definition polarization.hpp:25
ImageResolution
Possible up sampling modes for extracted polarization planes.
Definition polarization.hpp:28
@ Full
When extracting the polarization angles as planes of a raw polarization image, the planes are interpo...
Definition polarization.hpp:41
@ Half
When extracting the polarization angles as planes of a raw polarization image, the planes are not up ...
Definition polarization.hpp:34
Pattern
Possible patterns of raw polarization images.
Definition polarization.hpp:125
@ Square_90_45_135_0
The standard pattern for 2D polarization cameras. 90 45 135 0
Definition polarization.hpp:139
@ BayerGreenBlue
A flag to add if the polarization plane is additionally color-encoded with a bayer pattern....
Definition polarization.hpp:182
@ BayerGreenRed
A flag to add if the polarization plane is additionally color-encoded with a bayer pattern....
Definition polarization.hpp:257
@ Line_0_90_135
A line scanner pattern found in Piranha4 cameras. Planes 0 line 90 line 135 line
Definition polarization.hpp:157
@ BayerBlueGreen
A flag to add if the polarization plane is additionally color-encoded with a bayer pattern....
Definition polarization.hpp:207
@ BayerRedGreen
A flag to add if the polarization plane is additionally color-encoded with a bayer pattern....
Definition polarization.hpp:232
std::unique_ptr< Image > ColorizeStokesImage(const Image &stokesImage, const PseudoColorMode &colorMode)
An extracted stokesImage is colorized in a chosen way to visualize the polarization.
Definition polarization.hpp:378
std::unique_ptr< Image > CalculateMinReflectionImage(const Image &polarizationImage)
From an extracted polarizationImage the minimum reflection image is calculated and returned.
Definition polarization.hpp:359
std::unique_ptr< Image > CalculateStokes0(const Image &polarizationImage)
From an extracted polarizationImage a new image is returned with the Stokes 0 as content.
Definition polarization.hpp:315
PseudoColorMode
Available colorization modes to visualize polarization.
Definition polarization.hpp:46
@ AngleRgb
RGB image from: Hue angle of polarization Saturation full Value full
Definition polarization.hpp:120
@ AnglePolMono
Mono image with: Intensity angle of polarization
Definition polarization.hpp:102
@ Hsv1
RGB image from: Hue angle of polarization Saturation full Value degree of polarization
Definition polarization.hpp:64
@ Degree
Mono image with: Intensity degree of polarization
Definition polarization.hpp:92
@ Hsv2
RGB image from: Hue angle of polarization Saturation degree of polarization Value stokes 0
Definition polarization.hpp:82
std::unique_ptr< Image > CalculateStokesImage(const Image &polarizationImage)
From an extracted polarizationImage a new image is returned with the Stokes 0 to 2 as planes.
Definition polarization.hpp:299
std::unique_ptr< Image > ConvertToPlanes(const Image &rawImage, const Pattern pattern, const ImageResolution resolution)
Extracts the four polarization angles from a raw image to a four plane image.
Definition polarization.hpp:278
std::unique_ptr< Image > CalculateStokes1(const Image &polarizationImage)
From an extracted polarizationImage a new image is returned with the Stokes 1 as content.
Definition polarization.hpp:329
std::unique_ptr< Image > CalculateStokes2(const Image &polarizationImage)
From an extracted polarizationImage a new image is returned with the Stokes 2 as content.
Definition polarization.hpp:343
Namespace for the Foundation package.
Definition decl_metric_aqs12_calibration_piece.hpp:11
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17