@Namespace(value="cv::xphoto") @Properties(inherit=opencv_xphoto.class) public class LearningBasedWB extends WhiteBalancer
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.
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
LearningBasedWB(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
extractSimpleFeatures(GpuMat src,
GpuMat dst) |
void |
extractSimpleFeatures(Mat src,
Mat dst)
\brief Implements the feature extraction part of the algorithm.
|
void |
extractSimpleFeatures(UMat src,
UMat dst) |
int |
getHistBinNum()
\brief Defines the size of one dimension of a three-dimensional RGB histogram that is used internally
by the algorithm.
|
int |
getRangeMaxVal()
\brief Maximum possible value of the input image (e.g.
|
float |
getSaturationThreshold()
\brief Threshold that is used to determine saturated pixels, i.e.
|
void |
setHistBinNum(int val)
\copybrief getHistBinNum @see getHistBinNum
|
void |
setRangeMaxVal(int val)
\copybrief getRangeMaxVal @see getRangeMaxVal
|
void |
setSaturationThreshold(float val)
\copybrief getSaturationThreshold @see getSaturationThreshold
|
balanceWhite, balanceWhite, balanceWhite
clear, empty, getDefaultName, position, read, save, save, write, write, write
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zero
public LearningBasedWB(Pointer p)
Pointer.Pointer(Pointer)
.public void extractSimpleFeatures(@ByVal Mat src, @ByVal Mat dst)
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.
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.public int getRangeMaxVal()
setRangeMaxVal
public void setRangeMaxVal(int val)
public float getSaturationThreshold()
\texttt{saturation_threshold}\times\texttt{range_max_val}
are ignored.setSaturationThreshold
public void setSaturationThreshold(float val)
public int getHistBinNum()
setHistBinNum
public void setHistBinNum(int val)
Copyright © 2020. All rights reserved.