Ask Your Question

Revision history [back]

Generate 1C Mask

Given a multichannel image (e.g. BGR), what's the most efficient way to generate a (binary) 1C mask for pixel value equality?

cv::compare() works only for single channel images.

Using op== yields a 3C mask.
I can then reduce that but that seems like a wasteful second pass.

Generate 1C Mask

Given a multichannel image (e.g. BGR), what's the most efficient way to generate a (binary) 1C mask for pixel value equality?

cv::compare() works only for single channel images.

Using op== yields a 3C mask.
I can then reduce that but that seems like a wasteful second pass.

Is there a single-pass way of doing this?