@Namespace(value="cv::xphoto") @Properties(inherit=opencv_xphoto.class) public class GrayworldWB extends WhiteBalancer
This algorithm scales the values of pixels based on a gray-world assumption which states that the average of all channels should result in a gray image.
It adds a modification which thresholds pixels based on their saturation value and only uses pixels below the provided threshold in finding average pixel values.
Saturation is calculated using the following for a 3-channel RGB image per pixel I and is in the range [0, 1]:
\[ \texttt{Saturation} [I] = \frac{\textrm{max}(R,G,B) - \textrm{min}(R,G,B)
}{\textrm{max}(R,G,B)} \]
A threshold of 1 means that all pixels are used to white-balance, while a threshold of 0 means no pixels are used. Lower thresholds are useful in white-balancing saturated images.
Currently supports images of type \ref CV_8UC3 and \ref CV_16UC3.
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter| Constructor and Description |
|---|
GrayworldWB(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
float |
getSaturationThreshold()
\brief Maximum saturation for a pixel to be included in the
gray-world assumption
|
void |
setSaturationThreshold(float val)
\copybrief getSaturationThreshold @see getSaturationThreshold
|
balanceWhite, balanceWhite, balanceWhiteclear, empty, getDefaultName, position, read, save, save, write, write, writeaddress, 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, zeropublic GrayworldWB(Pointer p)
Pointer.Pointer(Pointer).public float getSaturationThreshold()
setSaturationThresholdpublic void setSaturationThreshold(float val)
Copyright © 2020. All rights reserved.