24 #include <fvclassifiers/shrinker.h> 25 #include <fvutils/base/roi.h> 26 #include <fvutils/color/colorspaces.h> 30 namespace firevision {
66 src = yuv422planar_buffer;
85 if (roi->
width <= 100) {
91 unsigned char * line_startTmp = bufferTmp;
96 bool pixelFound =
false;
97 for (x = 0; !pixelFound && (x < roi->
width / 2); ++x) {
98 for (y = 0; y < roi->
height / 2; ++y) {
99 if (*bufferTmp > 230) {
107 bufferTmp = line_startTmp;
111 line_startTmp = bufferTmp;
115 for (y = 0; !pixelFound && (y < roi->
height / 2); ++y) {
116 for (x = 0; x < roi->
width; ++x) {
117 if (*bufferTmp > 230) {
138 bufferTmp = line_startTmp;
142 line_startTmp = bufferTmp;
145 if ((leftmostPixel.
x >= topmostPixel.
x) || (topmostPixel.
y >= leftmostPixel.
y)
146 || (2 * (topmostPixel.
x - leftmostPixel.
x) >= roi->
width)
147 || (2 * (leftmostPixel.
y - topmostPixel.
y) >= roi->
height)) {
155 roi->
height = 2 * (leftmostPixel.
y - topmostPixel.
y);
unsigned int y
y coordinate
unsigned int x
x coordinate
unsigned int width
ROI width.
unsigned char * src
Source image buffer.
virtual void setFilteredBuffer(unsigned char *yuv422planar_buffer)
Set the filtered buffer.
virtual ~Shrinker()
Destructor.
unsigned char * get_roi_buffer_start(unsigned char *buffer) const
Get ROI buffer start.
Point with cartesian coordinates as unsigned integers.
unsigned int height
ROI height.
unsigned int line_step
line step
virtual void shrink(ROI *roi)
Shrink! Do the actual shrinking.