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