Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Check if binary mask is not empty?

Hi!

Is there an efficient way to check if a binary mask is not empty, i.e. there is at least one non-zero pixel? I know the function countNonZero() but it causes a slight overhead for my intention since I am not interested in the actual pixel count. Therefore it would be possible to early terminate if any 'true' pixel is found - something like the Matlab function any()...

Greetings!