23 #include <core/exceptions/software.h>
24 #include <fvclassifiers/qualifiers.h>
25 #include <fvutils/color/yuv.h>
31 namespace firevision {
59 colorspace_t colorspace)
63 if (!width || !height)
136 LumaQualifier::LumaQualifier(
unsigned char *buffer,
139 colorspace_t colorspace)
140 :
Qualifier(buffer, width, height, colorspace)
178 SkyblueQualifier::SkyblueQualifier(
unsigned char *buffer,
181 colorspace_t colorspace)
182 :
Qualifier(buffer, width, height, colorspace)
204 unsigned int u_addr =
size_ + (pixel.
y *
width_ + pixel.
x) / 2;
205 unsigned char u =
buffer_[u_addr];
208 if ((u < threshold_) || (v < threshold_))
227 YellowQualifier::YellowQualifier(
unsigned char *buffer,
230 colorspace_t colorspace)
231 :
Qualifier(buffer, width, height, colorspace)
253 unsigned int y_addr = (pixel.
y *
width_ + pixel.
x);
254 unsigned int u_addr =
size_ + y_addr / 2;
255 unsigned char y =
buffer_[y_addr];
256 unsigned int u = (255 -
buffer_[u_addr]) * y;
257 unsigned int v = (255 - abs(127 -
buffer_[u_addr +
size_ / 2]) * 2) * y;
259 if ((u <= threshold_) || (v <= threshold_))