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_))
virtual int get(fawkes::upoint_t pixel)
Getter.
virtual void set_colorspace(colorspace_t colorspace)
colorspace setter
unsigned int y
y coordinate
unsigned int x
x coordinate
A NULL pointer was supplied where not allowed.
virtual void set_buffer(unsigned char *buffer, unsigned int width=0, unsigned int height=0)
buffer setter
virtual unsigned char * get_buffer()
Get buffer.
virtual int get(fawkes::upoint_t pixel)
Getter.
virtual colorspace_t get_colorspace()
Get colorspace.
unsigned int size_
Size of the buffer.
virtual int get(fawkes::upoint_t pixel)
Getter.
unsigned int width_
Width of the buffer.
colorspace_t colorspace_
Colorspace of the buffer.
unsigned char * buffer_
Image buffer.
Point with cartesian coordinates as unsigned integers.
Qualifier()
Default constructor.
Expected parameter is missing.
virtual ~Qualifier()
Destructor.
unsigned int height_
Height of the buffer.
Abstract Qualifier for a single pixel.