CVB++ 15.0
Cvb::Foundation::Polarization Namespace Reference

Functions and type definitions of the polarization library. More...

Enumerations

enum class  ImageResolution { Half = 0 , Full = 1 }
 Possible up sampling modes for extracted polarization planes. More...
 
enum class  PseudoColorMode {
  Hsv1 = CExports::CVPOL_PCM_HSV_1 , Hsv2 = CExports::CVPOL_PCM_HSV_2 , Degree = CExports::CVPOL_PCM_DEGREE_POL , AnglePolMono = CExports::CVPOL_PCM_ANGLE_POL_MONO ,
  AngleRgb = CExports::CVPOL_PCM_ANGLE_POL_COL
}
 Available colorization modes to visualize polarization. More...
 
enum class  Pattern {
  Square_90_45_135_0 = CExports::CVPOL_PATTERN_90_45_135_0 , Line_0_90_135 = CExports::CVPOL_PATTERN_LINE_0_90_135 , BayerGreenBlue = CExports::CVPOL_PATTERN_BAYER_GREEN_BLUE , BayerBlueGreen = CExports::CVPOL_PATTERN_BAYER_BLUE_GREEN ,
  BayerRedGreen = CExports::CVPOL_PATTERN_BAYER_RED_GREEN , BayerGreenRed = CExports::CVPOL_PATTERN_BAYER_GREEN_RED
}
 Possible patterns of raw polarization images. More...
 

Functions

std::unique_ptr< ImageConvertToPlanes (const Image &rawImage, const Pattern pattern, const ImageResolution resolution)
 Extracts the four polarization angles from a raw image to a four plane image. More...
 
std::unique_ptr< ImageCalculateStokesImage (const Image &polarizationImage)
 From an extracted polarizationImage a new image is returned with the Stokes 0 to 2 as planes. More...
 
std::unique_ptr< ImageCalculateStokes0 (const Image &polarizationImage)
 From an extracted polarizationImage a new image is returned with the Stokes 0 as content. More...
 
std::unique_ptr< ImageCalculateStokes1 (const Image &polarizationImage)
 From an extracted polarizationImage a new image is returned with the Stokes 1 as content. More...
 
std::unique_ptr< ImageCalculateStokes2 (const Image &polarizationImage)
 From an extracted polarizationImage a new image is returned with the Stokes 2 as content. More...
 
std::unique_ptr< ImageCalculateMinReflectionImage (const Image &polarizationImage)
 From an extracted polarizationImage the minimum reflection image is calculated and returned. More...
 
std::unique_ptr< ImageColorizeStokesImage (const Image &stokesImage, const PseudoColorMode &colorMode)
 An extracted stokesImage is colorized in a chosen way to visualize the polarization. More...
 

Detailed Description

Functions and type definitions of the polarization library.

Remarks
CMake users: Link to imported target CVB::CvbFoundationPolarization

Enumeration Type Documentation

◆ ImageResolution

enum class ImageResolution
strong

Possible up sampling modes for extracted polarization planes.

Enumerator
Half 

When extracting the polarization angles as planes of a raw polarization image, the planes are not up sampled and therefore only half the size of the raw image.

Full 

When extracting the polarization angles as planes of a raw polarization image, the planes are interpolated via up sampling to smooth the image and better represent the real scene. The resulting image will be the same size as the raw image.

◆ Pattern

enum class Pattern
strong

Possible patterns of raw polarization images.

Enumerator
Square_90_45_135_0 

The standard pattern for 2D polarization cameras.

90 45
135 0
Line_0_90_135 

A line scanner pattern found in Piranha4 cameras.

Planes
0 line
90 line
135 line
BayerGreenBlue 

A flag to add if the polarization plane is additionally color-encoded with a bayer pattern. Only supported with Square_90_45_135_0. The bayer-pattern is assumed to be:

GG BB
GG BB
RR GG
RR GG

Therefore a polarization pattern group is within one color group.

BayerBlueGreen 

A flag to add if the polarization plane is additionally color-encoded with a bayer pattern. Only supported with Square_90_45_135_0. The bayer-pattern is assumed to be:

BB GG
BB GG
GG RR
GG RR

Therefore a polarization pattern group is within one color group.

BayerRedGreen 

A flag to add if the polarization plane is additionally color-encoded with a bayer pattern. Only supported with Square_90_45_135_0. The bayer-pattern is assumed to be:

RR GG
RR GG
GG BB
GG BB

Therefore a polarization pattern group is within one color group.

BayerGreenRed 

A flag to add if the polarization plane is additionally color-encoded with a bayer pattern. Only supported with Square_90_45_135_0. The bayer-pattern is assumed to be:

GG RR
GG RR
BB GG
BB GG

Therefore a polarization pattern group is within one color group.

◆ PseudoColorMode

enum class PseudoColorMode
strong

Available colorization modes to visualize polarization.

Enumerator
Hsv1 

RGB image from:

  • Hue angle of polarization
  • Saturation full
  • Value degree of polarization
Hsv2 

RGB image from:

  • Hue angle of polarization
  • Saturation degree of polarization
  • Value stokes 0
Degree 

Mono image with:

  • Intensity degree of polarization
AnglePolMono 

Mono image with:

  • Intensity angle of polarization
AngleRgb 

RGB image from:

  • Hue angle of polarization
  • Saturation full
  • Value full

Function Documentation

◆ CalculateMinReflectionImage()

std::unique_ptr< Image > CalculateMinReflectionImage ( const Image polarizationImage)
inline

From an extracted polarizationImage the minimum reflection image is calculated and returned.

The minimum reflection image is calculated by taking the minimum value of all the polarization angles that are contained in the input image.

Parameters
polarizationImageInput image with extracted polarization data. Usually from ConvertToPlanes.
Returns
The resulting image with one plane.

◆ CalculateStokes0()

std::unique_ptr< Image > CalculateStokes0 ( const Image polarizationImage)
inline

From an extracted polarizationImage a new image is returned with the Stokes 0 as content.

From an extracted polarization image Stokes 0 is calculated and returned. Stokes 0 is calculated as (0 + 45 + 90 + 135) * 0.25.

Parameters
polarizationImageInput image with extracted polarization data. Usually from ConvertToPlanes.
Returns
The resulting image with one plane.

◆ CalculateStokes1()

std::unique_ptr< Image > CalculateStokes1 ( const Image polarizationImage)
inline

From an extracted polarizationImage a new image is returned with the Stokes 1 as content.

From an extracted polarization image Stokes 1 is calculated and returned.

Parameters
polarizationImageInput image with extracted polarization data. Usually from ConvertToPlanes.
Returns
The resulting image with one plane.

◆ CalculateStokes2()

std::unique_ptr< Image > CalculateStokes2 ( const Image polarizationImage)
inline

From an extracted polarizationImage a new image is returned with the Stokes 2 as content.

From an extracted polarization image Stokes 2 is calculated and returned in outImage.

Parameters
polarizationImageInput image with extracted polarization data. Usually from ConvertToPlanes.
Returns
The resulting image with one plane.

s

◆ CalculateStokesImage()

std::unique_ptr< Image > CalculateStokesImage ( const Image polarizationImage)
inline

From an extracted polarizationImage a new image is returned with the Stokes 0 to 2 as planes.

From a extracted polarization image the three first Stokes are calculated and returned. Stokes 0 is calculated as (0 + 45 + 90 + 135) * 0.25. The index of the plane represents the Stokes number.

Parameters
polarizationImageInput image with extracted polarization data. Usually from ConvertToPlanes.
Returns
The resulting image with 3 planes.

◆ ColorizeStokesImage()

std::unique_ptr< Image > ColorizeStokesImage ( const Image stokesImage,
const PseudoColorMode colorMode 
)
inline

An extracted stokesImage is colorized in a chosen way to visualize the polarization.

Depending on the colorMode the polarization of the input image is visualized in different ways. See the comments for PseudoColorMode on information what colorization modes are available.

Parameters
stokesImageInput image with calculated stokes from a polarization image. Usually from CalculateStokesImage.
colorModeThe PseudoColorMode that will be used to colorize the image.
Returns
The resulting image is a mono or rgb image, depending on the selected colorMode

◆ ConvertToPlanes()

std::unique_ptr< Image > ConvertToPlanes ( const Image rawImage,
const Pattern  pattern,
const ImageResolution  resolution 
)
inline

Extracts the four polarization angles from a raw image to a four plane image.

From a raw polarization image this function extracts the polarization angles to outImage. The returned image holds the polarization data as 4 planes sorted by increasing angle: 0, 45, 90, 135

The expected pattern of the raw image with Pattern::Square_90_45_135_0 for example is a 2x2 pattern with: Top-left: 90, Top-right: 45, Bottom-left: 135, Bottom-right: 0.

If resolution is set to <see cref="Resolution::full/> the image is interpolated and has the same size as rawImage, otherwise it will be half the size. </remarks> <param name="rawImage">Input image with raw polarization data.</param> <param name="pattern">Indicates in which pattern the polarization angles are ordered in \a rawImage.</param> <param name="resolution">Resolution of outImage. If set to <see cref="Resolution::Full/> the image is interpolated and will equal the size of rawImage, otherwise it will be half the size.

Returns
The resulting image with 4 planes.