CVB.Net 14.0
BayerConversion Class Reference

Functions for converting images with a Bayer pattern. More...

Static Public Member Functions

static Image CreateDestinationImage (Image img, RgbConversion mode)
 Create a destination image for Bayer to RGB conversions. More...
 
static Image CreateDestinationImage (Size2D size, RgbConversion mode)
 Create a destination image for Bayer to RGB conversions. More...
 
static Image CreateDestinationImage (int width, int height, RgbConversion mode)
 Create a destination image for Bayer to RGB conversions. More...
 
static void ToRgb (Image imgSrc, Image imgDst, BayerPattern pattern, RgbConversion conversion, GammaCorrection gamma, WhiteBalanceFactors whiteBalance)
 Convert a Bayer-pattern image to an RGB image. More...
 
static void ToRgb (Image imgSrc, Image imgDst, BayerPattern pattern, RgbConversion conversion)
 Convert a Bayer-pattern image to an RGB image (omitting the gamma correction and the white balance). More...
 
static Image ToRgb (Image imgSrc, BayerPattern pattern, RgbConversion conversion, GammaCorrection gamma, WhiteBalanceFactors whiteBalance)
 Convert a Bayer-pattern image to an RGB image. More...
 
static Image ToRgb (Image imgSrc, BayerPattern pattern, RgbConversion conversion)
 Convert a Bayer-pattern image to an RGB image (omitting the gamma correction and the white balance). More...
 
static Image ToMono (Image imgSrc, BayerPattern pattern, RgbConversion conversion, GammaCorrection gamma, WhiteBalanceFactors whiteBalance)
 Convert a monochrome image with a Bayer pattern to a proper monochrome image. More...
 
static Image ToBayer (Image imgSrc, BayerPattern pattern)
 Convert an RGB image to a monochrome image with Bayer pattern. More...
 
static WhiteBalanceFactors GetWhiteBalance (Image img, BayerPattern pattern, Area2D aoi)
 Determine a suitable white balance from a monochrome image with Bayer pattern. More...
 
static WhiteBalanceFactors GetWhiteBalance (Image img, BayerPattern pattern)
 Determine a suitable white balance from a monochrome image with Bayer pattern. More...
 

Detailed Description

Functions for converting images with a Bayer pattern.

Member Function Documentation

◆ CreateDestinationImage() [1/3]

static Image CreateDestinationImage ( Image  img,
RgbConversion  mode 
)
static

Create a destination image for Bayer to RGB conversions.

Bayer to RGB conversions are also implemented as in-place operations, however the destination image needs to have a suitable width and height to be eligible. The destination width and height depend on the size of the input image as well as the conversion method.

Parameters
imgImage to create the destination image for
modeConversion mode to be used
Returns
BayerToRGB destination image
Exceptions
ArgumentNullExceptionIf the input img is null.
ObjectDisposedExceptionIf the input img has already been disposed

◆ CreateDestinationImage() [2/3]

static Image CreateDestinationImage ( int  width,
int  height,
RgbConversion  mode 
)
static

Create a destination image for Bayer to RGB conversions.

Bayer to RGB conversions are also implemented as in-place operations, however the destination image needs to have a suitable width and height to be eligible. The destination width and height depends on the size of the input image as well as the conversion method.

Parameters
widthWidth of the input image to convert for.
heightHeight of the input image to convert for.
modeConversion mode to be used
Returns
BayerToRGB destination image

◆ CreateDestinationImage() [3/3]

static Image CreateDestinationImage ( Size2D  size,
RgbConversion  mode 
)
static

Create a destination image for Bayer to RGB conversions.

Bayer to RGB conversions are also implemented as in-place operations, however the destination image needs to have a suitable width and height to be eligible. The destination width and height depends on the size of the input image as well as the conversion method.

Parameters
sizeSize of the input image to convert for.
modeConversion mode to be used
Returns
BayerToRGB destination image

◆ GetWhiteBalance() [1/2]

static WhiteBalanceFactors GetWhiteBalance ( Image  img,
BayerPattern  pattern 
)
static

Determine a suitable white balance from a monochrome image with Bayer pattern.

Parameters
imgMonochrome image with Bayer pattern
patternPattern in the top left corner of the sensor with which img was acquired
Returns
White balance factors
Exceptions
ArgumentNullExceptionIf the input img is null.
ObjectDisposedExceptionIf the input img has already been disposed

◆ GetWhiteBalance() [2/2]

static WhiteBalanceFactors GetWhiteBalance ( Image  img,
BayerPattern  pattern,
Area2D  aoi 
)
static

Determine a suitable white balance from a monochrome image with Bayer pattern.

Parameters
imgMonochrome image with Bayer pattern
patternPattern in the top left corner of the sensor with which the img was acquired
aoiArea in which to determine the white balance factors
Returns
White balance factors
Exceptions
ArgumentNullExceptionIf the input img is null.
ObjectDisposedExceptionIf the input img has already been disposed

◆ ToBayer()

static Image ToBayer ( Image  imgSrc,
BayerPattern  pattern 
)
static

Convert an RGB image to a monochrome image with Bayer pattern.

Parameters
imgSrcImage to be converted
patternBayer pattern to which to convert
Returns
Converted image
Exceptions
ArgumentNullExceptionIf the input imgSrc is null.
ObjectDisposedExceptionIf the input imgSrc has already been disposed

◆ ToMono()

static Image ToMono ( Image  imgSrc,
BayerPattern  pattern,
RgbConversion  conversion,
GammaCorrection  gamma,
WhiteBalanceFactors  whiteBalance 
)
static

Convert a monochrome image with a Bayer pattern to a proper monochrome image.

Parameters
imgSrcImage to be converted
patternPattern in the top left corner of the sensor with which imgSrc was acquired
conversionConversion method
gammaGamma correction
whiteBalanceWhite balance
Returns
Newly created image that contains the conversion result
Exceptions
ArgumentNullExceptionIf the input imgSrc is null.
ObjectDisposedExceptionIf the input imgSrc has already been disposed

◆ ToRgb() [1/4]

static Image ToRgb ( Image  imgSrc,
BayerPattern  pattern,
RgbConversion  conversion 
)
static

Convert a Bayer-pattern image to an RGB image (omitting the gamma correction and the white balance).

Parameters
imgSrcImage to be converted
patternPattern in the top left corner of the sensor with which imgSrc was acquired
conversionConversion method
Returns
Newly created image that contains the conversion result
Exceptions
ArgumentNullExceptionIf the input imgSrc is null.
ObjectDisposedExceptionIf the input imgSrc has already been disposed

◆ ToRgb() [2/4]

static Image ToRgb ( Image  imgSrc,
BayerPattern  pattern,
RgbConversion  conversion,
GammaCorrection  gamma,
WhiteBalanceFactors  whiteBalance 
)
static

Convert a Bayer-pattern image to an RGB image.

Parameters
imgSrcImage to be converted
patternPattern in the top left corner of the sensor with which imgSrc was acquired
conversionConversion method
gammaGamma correction
whiteBalanceWhite balance
Returns
Newly created image that contains the conversion result
Exceptions
ArgumentNullExceptionIf the input imgSrc is null.
ObjectDisposedExceptionIf the input imgSrc has already been disposed

◆ ToRgb() [3/4]

static void ToRgb ( Image  imgSrc,
Image  imgDst,
BayerPattern  pattern,
RgbConversion  conversion 
)
static

Convert a Bayer-pattern image to an RGB image (omitting the gamma correction and the white balance).

Parameters
imgSrcMonochrome image with the Bayer pattern to be converted
imgDstDestination to receive the conversion results (preferable created by CreateDestinationImage(Size2D, RgbConversion)).
patternPattern in the top left corner of the sensor with which imgDst was acquired
conversionConversion method
Exceptions
ArgumentNullExceptionIf the input imgSrc /imgDst is null.
ObjectDisposedExceptionIf the input imgSrc /imgDst has already been disposed

◆ ToRgb() [4/4]

static void ToRgb ( Image  imgSrc,
Image  imgDst,
BayerPattern  pattern,
RgbConversion  conversion,
GammaCorrection  gamma,
WhiteBalanceFactors  whiteBalance 
)
static

Convert a Bayer-pattern image to an RGB image.

Parameters
imgSrcMonochrome image with the Bayer pattern to be converted
imgDstDestination to receive the conversion results (preferable created by CreateDestinationImage(Size2D, RgbConversion)).
patternPattern in the top left corner of the sensor with which imgDst was acquired
conversionConversion method
gammaGamma correction
whiteBalanceWhite balance
Exceptions
ArgumentNullExceptionIf the input imgSrc /imgDst is null.
ObjectDisposedExceptionIf the input imgSrc /imgDst has already been disposed