Describe the doc issue
countNonZero in most cases is used to know if hasNonZero.
Using hasNonZero in that cases is
- more efficient
- semantically correct
Fix suggestion
To promote adaequate code I suggest to add to the doc of countNonZero
something like:
For determing IF there is a non-zero array element use hasNonZero.
(For multi-channel arrays do a Mat::reshape (O(1) operation) before.
Moreover add links to hasNonZero and Mat::reshape.