23 #include <fvfilters/colorthreshold.h>
24 #include <fvutils/color/rgbyuv.h>
25 #include <fvutils/color/threshold.h>
26 #include <fvutils/color/yuv.h>
30 namespace firevision {
33 : Filter(
"FilterColorThreshold", 1), color_model_(color_model)
37 FilterColorThreshold::~FilterColorThreshold()
49 unsigned char *p_src_u =
53 unsigned char *p_src_v =
58 unsigned char *p_dst_y =
60 unsigned char *p_dst_u =
63 unsigned char *p_dst_v =
67 unsigned const char *p_line_src_y = p_src_y, *p_line_src_u = p_src_u, *p_line_src_v = p_src_v,
68 *p_line_dst_y = p_dst_y, *p_line_dst_u = p_dst_u, *p_line_dst_v = p_dst_v;
70 for (h = 0; (h <
src_roi[0]->
height) && (h < dst_roi->height); ++h) {
71 for (w = 0; (w <
src_roi[0]->
width) && (w < dst_roi->width); w += 2) {
73 *p_dst_y++ = *p_src_y++;
74 *p_dst_y++ = *p_src_y++;
76 if (color_model_->
determine(*p_src_y, *p_src_u, *p_src_v) != C_OTHER) {
77 *p_dst_u++ = *p_src_u;
78 *p_dst_v++ = *p_src_v;