Commit 18de45f7 authored by Victor Passichenko's avatar Victor Passichenko

Add CV_Asserts for channels count

parent 92edd4fc
...@@ -106,6 +106,8 @@ FastNlMeansDenoisingInvoker<T>::FastNlMeansDenoisingInvoker( ...@@ -106,6 +106,8 @@ FastNlMeansDenoisingInvoker<T>::FastNlMeansDenoisingInvoker(
int search_window_size, int search_window_size,
const double h) : src_(src), dst_(dst) const double h) : src_(src), dst_(dst)
{ {
CV_Assert(src.channels() <= 3);
template_window_half_size_ = template_window_size / 2; template_window_half_size_ = template_window_size / 2;
search_window_half_size_ = search_window_size / 2; search_window_half_size_ = search_window_size / 2;
template_window_size_ = template_window_half_size_ * 2 + 1; template_window_size_ = template_window_half_size_ * 2 + 1;
......
...@@ -115,6 +115,9 @@ FastNlMeansMultiDenoisingInvoker<T>::FastNlMeansMultiDenoisingInvoker( ...@@ -115,6 +115,9 @@ FastNlMeansMultiDenoisingInvoker<T>::FastNlMeansMultiDenoisingInvoker(
int search_window_size, int search_window_size,
const double h) : dst_(dst), extended_srcs_(srcImgs.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; rows_ = srcImgs[0].rows;
cols_ = srcImgs[0].cols; cols_ = srcImgs[0].cols;
channels_count_ = srcImgs[0].channels(); channels_count_ = srcImgs[0].channels();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment