Namespace for collection of functions converting images with a Bayer pattern. More...
Enumerations | |
enum class | RGBConversion { Linear = CExports::RGB_INTERPOLATE , NearestNeighbor = CExports::RGB_NEIGHBOUR , HalfResolution = CExports::RGB_HALF } |
Available conversion modes from Bayer patterns to RGB images. More... | |
enum class | BayerPattern { GreenBlue = CExports::PM_GREENBLUE , BlueGreen = CExports::PM_BLUEGREEN , RedGreen = CExports::PM_REDGREEN , GreenRed = CExports::PM_GREENRED } |
Bayer pattern of the sensor used to acquire the image to be converted. More... | |
enum class | GammaCorrection { Gamma100 = CExports::GAMMA_100 , Gamma045 = CExports::GAMMA_045 , Gamma060 = CExports::GAMMA_060 } |
Different gamma corrections that can be applied while converting from Bayer pattern to RGB. More... | |
Functions | |
std::unique_ptr< Image > | CreateDestinationImage (int width, int height, RGBConversion mode) |
Create a destination image for Bayer to RGB conversions. More... | |
std::unique_ptr< Image > | CreateDestinationImage (Size2D< int > size, RGBConversion mode) |
Create a destination image for Bayer to RGB conversions. More... | |
void | BayerToRGB (const Image &imageSrc, Image &imageDst, BayerPattern pattern, RGBConversion conversion, GammaCorrection gamma=GammaCorrection::Gamma100, WhiteBalanceFactors whiteBalance=WhiteBalanceFactors::Identity()) |
Convert a Bayer-pattern image to an RGB image. More... | |
std::unique_ptr< Image > | BayerToRGB (const Image &image, BayerPattern pattern, RGBConversion conversion, GammaCorrection gamma=GammaCorrection::Gamma100, WhiteBalanceFactors whiteBalance=WhiteBalanceFactors::Identity()) |
Convert a Bayer-pattern image to an RGB image. More... | |
std::unique_ptr< Image > | BayerToMono (const Image &image, BayerPattern pattern, RGBConversion conversion, GammaCorrection gamma=GammaCorrection::Gamma100, WhiteBalanceFactors whiteBalance=WhiteBalanceFactors::Identity()) |
Convert a monochrome image with a Bayer pattern to a proper monochrome image. More... | |
std::unique_ptr< Image > | RGBToBayer (const Image &image, BayerPattern pattern) |
Convert an RGB image to a monochrome image with Bayer pattern. More... | |
WhiteBalanceFactors | GetWhiteBalance (const Image &image, BayerPattern pattern, Area2D aoi) |
Determine a suitable white balance from a monochrome image with Bayer pattern. More... | |
WhiteBalanceFactors | GetWhiteBalance (const Image &image, BayerPattern pattern) |
Determine a suitable white balance from a monochrome image with Bayer pattern. More... | |
Namespace for collection of functions converting images with a Bayer pattern.
|
strong |
Bayer pattern of the sensor used to acquire the image to be converted.
The enums refer to the top left pixel and the pixel next to it.
Enumerator | |
---|---|
GreenBlue | Left top pixels are green and blue. |
BlueGreen | Left top pixels are blue and green. |
RedGreen | Left top pixels are red and green. |
GreenRed | Left top pixels are green and red. |
|
strong |
|
strong |
Available conversion modes from Bayer patterns to RGB images.
Enumerator | |
---|---|
Linear | This method offers the highest accuracy, but also the slowest speed. Interpolation of the nearest pixels is used to calculate the two unknown color values for each position. Depending on the position of the pixel either two or four pixels are used for the interpolation. In this mode full spatial resolution is maintained. |
NearestNeighbor | This method offers the fastest speed for a full resolution image, but the color accuracy is not as high as the RGBConversion.Linear method. The color from a neighbor pixel is used for the two unknown color values. This makes the conversion faster, because there is no need for interpolation. In this method full spatial resolution is maintained. |
HalfResolution | This method is provided primarily for display. This method creates an RGB image with half the height and half the width of the source image, the color accuracy is the same as the RGBConversion.NearestNeighbor method, but half the spacial accuracy is lost. If the user needs a fast display for focusing or setup of the camera, then this method will allow higher frame rates on a suitable PC. |
|
inline |
Convert a monochrome image with a Bayer pattern to a proper monochrome image.
[in] | image | Image to be converted. |
[in] | pattern | Pattern in the top left corner of the sensor with which image was acquired. |
[in] | conversion | Conversion method. |
[in] | gamma | Gamma correction. |
[in] | whiteBalance | White balance. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Convert a Bayer-pattern image to an RGB image.
[in] | image | Image to be converted. |
[in] | pattern | Pattern in the top left corner of the sensor with which image was acquired. |
[in] | conversion | Conversion method. |
[in] | gamma | Gamma correction. |
[in] | whiteBalance | White balance. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Convert a Bayer-pattern image to an RGB image.
[in] | imageSrc | Monochrome image with the Bayer pattern to be converted. |
[in] | imageDst | Destination to receive the conversion results (preferably created by CreateDestinationImage()). |
[in] | pattern | Pattern in the top left corner of the sensor with which imageDst was acquired. |
[in] | conversion | Conversion method. |
[in] | gamma | Gamma correction. |
[in] | whiteBalance | White balance. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Create a destination image for Bayer to RGB conversions.
[in] | width | Width of the input image to convert for. |
[in] | height | Height of the input image to convert for. |
[in] | mode | Conversion mode to be used. |
Any | exception derived from std::exception including CvbException. |
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.
|
inline |
Create a destination image for Bayer to RGB conversions.
[in] | size | Size of the input image to convert for. |
[in] | mode | Conversion mode to be used. |
Any | exception derived from std::exception including CvbException. |
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.
|
inline |
Determine a suitable white balance from a monochrome image with Bayer pattern.
[in] | image | Monochrome image with Bayer pattern. |
[in] | pattern | Pattern in the top left corner of the sensor with which image was acquired. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Determine a suitable white balance from a monochrome image with Bayer pattern.
[in] | image | Monochrome image with Bayer pattern. |
[in] | pattern | Pattern in the top left corner of the sensor with which the image was acquired. |
[in] | aoi | Area in which to determine the white balance factors. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Convert an RGB image to a monochrome image with Bayer pattern.
[in] | image | Image to be converted. |
[in] | pattern | Pattern in the top left corner of the sensor with which image was acquired. |
Any | exception derived from std::exception including CvbException. |