24 #include <fvclassifiers/shrinker.h> 25 #include <fvutils/color/colorspaces.h> 26 #include <fvutils/base/roi.h> 70 src = yuv422planar_buffer;
91 if ( roi->
width <= 100 ) {
97 unsigned char *line_startTmp = bufferTmp;
102 bool pixelFound =
false;
103 for (x = 0; !pixelFound && (x < roi->
width / 2); ++x) {
104 for (y = 0; y < roi->
height/2; ++y) {
105 if (*bufferTmp > 230) {
113 bufferTmp = line_startTmp;
117 line_startTmp = bufferTmp;
121 for (y = 0; !pixelFound && (y < roi->
height/2); ++y) {
122 for (x = 0; x < roi->
width; ++x) {
123 if (*bufferTmp > 230) {
144 bufferTmp = line_startTmp;
148 line_startTmp = bufferTmp;
151 if ( (leftmostPixel.
x >= topmostPixel.
x) ||
152 (topmostPixel.
y >= leftmostPixel.
y) ||
153 (2 * (topmostPixel.
x - leftmostPixel.
x) >= roi->
width) ||
154 (2 * (leftmostPixel.
y - topmostPixel.
y) >= roi->
height) ) {
162 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.