15 #include "thresholds_black.h" 19 namespace firevision {
37 unsigned int u_thresh,
38 unsigned int v_thresh,
41 : y_thresh_(y_thresh), u_thresh_(u_thresh), v_thresh_(v_thresh), ref_u_(ref_u), ref_v_(ref_v)
48 int diff_u = ref_u_ - u;
49 int diff_v = ref_v_ - v;
51 #
if defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || (__GNUC__ > 4))
52 && std::abs(diff_u) < u_thresh_ && std::abs(diff_v) < v_thresh_
55 ? (diff_u > -1 * (
int)u_thresh_)
56 : (diff_u < (
int)u_thresh_) && (diff_v < 0) ? (diff_v > -1 * (
int)v_thresh_)
57 : (diff_v < (
int)v_thresh_)
69 return "ColorModelBlack";
color_t determine(unsigned int y, unsigned int u, unsigned int v) const
Determine classification of YUV pixel.
ColorModelBlack(unsigned int y_thresh=30, unsigned int u_thresh=30, unsigned int v_thresh=30, unsigned int ref_u=128, unsigned int ref_v=128)
Initialize black colormodel.
const char * get_name()
Get name of color model.