Documentation Portal      

What are you looking for?

White Balance

Functional Guide | Reference: PixelAverage, WhiteBalance, Transform

/////////////////////////////////////////////////////////////
// This code snippet shows how to perform white balancing. //
/////////////////////////////////////////////////////////////
// Images constructor
EImageC24 srcImage, dstImage;
EImageC24 whiteRef;
// ...
// Create a lookup table
EColorLookup lut;
// Measure the calibration values from a white reference image
float r, g, b;
EasyImage::PixelAverage(&whiteRef, r, g, b);
// Prepare the lookup table for
// a white balance operation
lut.WhiteBalance(1.00f, EasyColor::GetCompensateNtscGamma(), r, g, b);
// Source and destination images must have the same size
dstImage.SetSize(&srcImage);
// Perform the white balance operation
lut.Transform(&srcImage, &dstImage);
'/////////////////////////////////////////////////////////////
'// This code snippet shows how to perform white balancing. //
'/////////////////////////////////////////////////////////////
' EasyColor context constructor
Dim EasyColor As New EasyColor
' EasyImage context constructor
Dim EasyImage As New EasyImage
' Images constructor
Dim srcImage As New EImageC24
Dim dstImage As New EImageC24
Dim whiteRef As New EImageC24
' ...
' Create a lookup table
Dim lut As New EColorLookup
' Measure the calibration values from a white reference image
Dim r As Single
Dim g As Single
Dim b As Single
EasyImage.PixelAverageC24 whiteRef, r, g, b
' Prepare the lookup table for
' a white balance operation
lut.WhiteBalance 1, EasyColor.CompensateNtscGamma, r, g, b
' Source and destination images must have the same size
dstImage.SetSize srcImage.Width, srcImage.Height
' Perform the white balance operation
lut.TransformImage srcImage, dstImage
/////////////////////////////////////////////////////////////
// This code snippet shows how to perform white balancing. //
/////////////////////////////////////////////////////////////
// Images constructor
EImageC24 srcImage= new EImageC24();
EImageC24 dstImage= new EImageC24();
EImageC24 whiteRef= new EImageC24();
// ...
// Create a lookup table
EColorLookup lut= new EColorLookup();
// Measure the calibration values from a white reference image
float r, g, b;
EasyImage.PixelAverage(whiteRef, out r, out g, out b);
// Prepare the lookup table for
// a white balance operation
lut.WhiteBalance(1.00f, EasyColor.CompensateNtscGamma, r, g, b);
// Source and destination images must have the same size
dstImage.SetSize(srcImage);
// Perform the white balance operation
lut.Transform(srcImage, dstImage);

See also in the Reference

PixelAverage

WhiteBalance

Transform

Which API shall we display?

© 2019 EURESYS s.a.  -  About Documentation  -  Open Source Licenses  -  Open eVision 2.10.0.1121