CVB.Net 14.0
Polarization Class Reference

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

Public Types

enum  ImageResolution { Half = 0 , Full = 1 }
 Possible up sampling modes for extracted polarization planes. More...
 
enum  PseudoColorMode {
  Hsv1 = 0 , Hsv2 = 1 , Degree = 2 , AngleMono = 3 ,
  AngleRgb = 4
}
 Available colorization modes to visualize polarization. More...
 
enum  Pattern {
  Square_90_45_135_0 = 0 , Line_0_90_135 = 1 , BayerGreenBlue = 1 << 16 , BayerBlueGreen = 1 << 17 ,
  BayerRedGreen = 1 << 18 , BayerGreenRed = 1 << 19
}
 Possible patterns of raw polarization images. More...
 

Static Public Member Functions

static Image ConvertToPlanes (Image rawImage, Pattern pattern, ImageResolution resolution)
 Extracts the four polarization angles from a raw image to a four plane image. More...
 
static Image CalculateStokesImage (Image polarizationImage)
 From an extracted polarizationImage a new image is returned with the Stokes 0 to 2 as planes. More...
 
static Image CalculateStokes0 (Image polarizationImage)
 From an extracted polarizationImage a new image is returned with the Stokes 0 as content. More...
 
static Image CalculateStokes1 (Image polarizationImage)
 From an extracted polarizationImage a new image is returned with the Stokes 1 as content. More...
 
static Image CalculateStokes2 (Image polarizationImage)
 From an extracted polarizationImage a new image is returned with the Stokes 2 as content. More...
 
static Image CalculateMinReflectionImage (Image polarizationImage)
 From an extracted polarizationImage the minimum reflection image is calculated and returned. More...
 
static Image Colorize (Image stokesImage, PseudoColorMode colorMode)
 An extracted stokesImage is colorized in a chosen way to visualize the polarization. More...
 

Detailed Description

Functions and type definitions of the CVPolarization library.

Member Enumeration Documentation

◆ ImageResolution

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 Pattern

Possible patterns of raw polarization images.

Enumerator
Square_90_45_135_0 

The standard pattern for 2D polarization cameras.

90° 45°
135°
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

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
AngleMono 

Mono image with:

  • Intensity angle of polarization
AngleRgb 

RGB image from:

  • Hue angle of polarization
  • Saturation full
  • Value full

Member Function Documentation

◆ CalculateMinReflectionImage()

static Image CalculateMinReflectionImage ( Image  polarizationImage)
static

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()

static Image CalculateStokes0 ( Image  polarizationImage)
static

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 in outImage. 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()

static Image CalculateStokes1 ( Image  polarizationImage)
static

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 in outImage.

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

◆ CalculateStokes2()

static Image CalculateStokes2 ( Image  polarizationImage)
static

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.

◆ CalculateStokesImage()

static Image CalculateStokesImage ( Image  polarizationImage)
static

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 in outImage. 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.

◆ Colorize()

static Image Colorize ( Image  stokesImage,
PseudoColorMode  colorMode 
)
static

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()

static Image ConvertToPlanes ( Image  rawImage,
Pattern  pattern,
ImageResolution  resolution 
)
static

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 CVPOL_RESOLUTION_FULL the image is interpolated and has the same size as rawImage, otherwise it will be half the size.

Parameters
rawImageInput image with raw polarization data.
patternIndicates in which pattern the polarization angles are ordered in rawImage.
resolutionResolution of outImage. If set to CVPOL_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.