Example #1
0
// Run skin-detection algorithm
frame detect_skin(const frame& in) {
    dtn_frame = in;

    const rgb_byte ZERO = { };
    for(int y = HEIGHT - 1; y; --y) {
        for(int x = WIDTH - 1; x; --x) {
            auto orig = dtn_frame.get_pixel(x, y);
            rgb hist_in = { orig[2], orig[1], orig[0] };
            if(hist.value(hist_in) < tld) {
                orig[0] = orig[1] = orig[2] = 0;
            }
        }
    }

    return dtn_frame;
}