8 #ifndef META_OCEAN_CV_ADVANCED_WHITE_POINT_DETECTOR_H
9 #define META_OCEAN_CV_ADVANCED_WHITE_POINT_DETECTOR_H
80 static inline void rgb2yuv(
const float r,
const float g,
const float b,
float& y,
float& u,
float& v);
91 static inline void yuv2rgb(
const float y,
const float u,
const float v,
float& r,
float& g,
float& b);
97 y = 0.299000f * r + 0.587000f * g + 0.114000f * b;
98 u = -0.168736f * r - 0.331264f * g + 0.500000f * b;
99 v = 0.500000f * r - 0.418688f * g - 0.081312f * b;
105 r = y - 1.21889419e-06f * u + 1.40199959e+00f * v;
106 g = y - 3.44135678e-01f * u - 7.14136156e-01f * v;
107 b = y + 1.77200007e+00f * u + 4.06298063e-07f * v;
Provides functions for white point detection and correction.
Definition: WhitePointDetector.h:33
static unsigned char colorRange(const CV::Histogram::Histogram8BitPerChannel< 3u > &histogram, const unsigned char channel, const unsigned int threshold)
Iterates through the specified color channel histogram from highest to lowest bin to find the first b...
static void correctWhitePoint(Frame &frame, const VectorF3 &whitePoint, Worker *worker=nullptr)
Applies white point balancing on the image frame.
static VectorF3 detectWhitePointHistogram(const Frame &frame, Worker *worker=nullptr)
Attempts to detect the white point in the specified image frame.
static VectorF3 detectWhitePointGrayPoints(const Frame &frame, const float grayThreshold=0.4f)
Attempts to detect the white point in the specified frame using the iterative gray points algorithm.
static void yuv2rgb(const float y, const float u, const float v, float &r, float &g, float &b)
Converts from YUV to RGB color space.
Definition: WhitePointDetector.h:102
static void rgb2yuv(const float r, const float g, const float b, float &y, float &u, float &v)
Converts from RGB to YUV color space.
Definition: WhitePointDetector.h:94
This class implements a standard histogram object storing 8 bit per channel.
Definition: Histogram.h:208
This class implements Ocean's image class.
Definition: Frame.h:1792
This class implements a vector with three elements.
Definition: Vector3.h:97
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15