Add CV_Asserts for channels count
This commit is contained in:
parent
92edd4fc6e
commit
18de45f7bc
@ -106,6 +106,8 @@ FastNlMeansDenoisingInvoker<T>::FastNlMeansDenoisingInvoker(
|
||||
int search_window_size,
|
||||
const double h) : src_(src), dst_(dst)
|
||||
{
|
||||
CV_Assert(src.channels() <= 3);
|
||||
|
||||
template_window_half_size_ = template_window_size / 2;
|
||||
search_window_half_size_ = search_window_size / 2;
|
||||
template_window_size_ = template_window_half_size_ * 2 + 1;
|
||||
|
@ -115,6 +115,9 @@ FastNlMeansMultiDenoisingInvoker<T>::FastNlMeansMultiDenoisingInvoker(
|
||||
int search_window_size,
|
||||
const double h) : dst_(dst), extended_srcs_(srcImgs.size())
|
||||
{
|
||||
CV_Assert(srcImgs.size() > 0);
|
||||
CV_Assert(srcImgs[0].channels() <= 3);
|
||||
|
||||
rows_ = srcImgs[0].rows;
|
||||
cols_ = srcImgs[0].cols;
|
||||
channels_count_ = srcImgs[0].channels();
|
||||
|
Loading…
x
Reference in New Issue
Block a user