to avoid:
> error: suggest explicit braces to avoid ambiguous ‘else’ [-Werror=parentheses]

I suggest:
```
CV_Assert( mask.empty() || mask.size() == _img.size() );
```