Package org.opencv.xphoto
Class LearningBasedWB
- java.lang.Object
- 
- org.opencv.core.Algorithm
- 
- org.opencv.xphoto.WhiteBalancer
- 
- org.opencv.xphoto.LearningBasedWB
 
 
 
- 
 public class LearningBasedWB extends WhiteBalancer More sophisticated learning-based automatic white balance algorithm. As REF: GrayworldWB, this algorithm works by applying different gains to the input image channels, but their computation is a bit more involved compared to the simple gray-world assumption. More details about the algorithm can be found in CITE: Cheng2015 . To mask out saturated pixels this function uses only pixels that satisfy the following condition: \( \frac{\textrm{max}(R,G,B)}{\texttt{range_max_val}} < \texttt{saturation_thresh} \) Currently supports images of type REF: CV_8UC3 and REF: CV_16UC3.
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedLearningBasedWB(long addr)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LearningBasedWB__fromPtr__(long addr)voidextractSimpleFeatures(Mat src, Mat dst)Implements the feature extraction part of the algorithm.protected voidfinalize()intgetHistBinNum()Defines the size of one dimension of a three-dimensional RGB histogram that is used internally by the algorithm.intgetRangeMaxVal()Maximum possible value of the input image (e.g.floatgetSaturationThreshold()Threshold that is used to determine saturated pixels, i.e.voidsetHistBinNum(int val)getHistBinNum SEE: getHistBinNumvoidsetRangeMaxVal(int val)getRangeMaxVal SEE: getRangeMaxValvoidsetSaturationThreshold(float val)getSaturationThreshold SEE: getSaturationThreshold- 
Methods inherited from class org.opencv.xphoto.WhiteBalancerbalanceWhite
 - 
Methods inherited from class org.opencv.core.Algorithmclear, empty, getDefaultName, getNativeObjAddr, save
 
- 
 
- 
- 
- 
Method Detail- 
__fromPtr__public static LearningBasedWB __fromPtr__(long addr) 
 - 
getSaturationThresholdpublic float getSaturationThreshold() Threshold that is used to determine saturated pixels, i.e. pixels where at least one of the channels exceeds \(\texttt{saturation_threshold}\times\texttt{range_max_val}\) are ignored. SEE: setSaturationThreshold- Returns:
- automatically generated
 
 - 
getHistBinNumpublic int getHistBinNum() Defines the size of one dimension of a three-dimensional RGB histogram that is used internally by the algorithm. It often makes sense to increase the number of bins for images with higher bit depth (e.g. 256 bins for a 12 bit image). SEE: setHistBinNum- Returns:
- automatically generated
 
 - 
getRangeMaxValpublic int getRangeMaxVal() Maximum possible value of the input image (e.g. 255 for 8 bit images, 4095 for 12 bit images) SEE: setRangeMaxVal- Returns:
- automatically generated
 
 - 
extractSimpleFeaturespublic void extractSimpleFeatures(Mat src, Mat dst) Implements the feature extraction part of the algorithm. In accordance with CITE: Cheng2015 , computes the following features for the input image: 1. Chromaticity of an average (R,G,B) tuple 2. Chromaticity of the brightest (R,G,B) tuple (while ignoring saturated pixels) 3. Chromaticity of the dominant (R,G,B) tuple (the one that has the highest value in the RGB histogram) 4. Mode of the chromaticity palette, that is constructed by taking 300 most common colors according to the RGB histogram and projecting them on the chromaticity plane. Mode is the most high-density point of the palette, which is computed by a straightforward fixed-bandwidth kernel density estimator with a Epanechnikov kernel function.- Parameters:
- src- Input three-channel image (BGR color space is assumed).
- dst- An array of four (r,g) chromaticity tuples corresponding to the features listed above.
 
 - 
setHistBinNumpublic void setHistBinNum(int val) getHistBinNum SEE: getHistBinNum- Parameters:
- val- automatically generated
 
 - 
setRangeMaxValpublic void setRangeMaxVal(int val) getRangeMaxVal SEE: getRangeMaxVal- Parameters:
- val- automatically generated
 
 - 
setSaturationThresholdpublic void setSaturationThreshold(float val) getSaturationThreshold SEE: getSaturationThreshold- Parameters:
- val- automatically generated
 
 - 
finalizeprotected void finalize() throws java.lang.Throwable- Overrides:
- finalizein class- WhiteBalancer
- Throws:
- java.lang.Throwable
 
 
- 
 
-