Add CV_Asserts for channels count

pull/14/head
Victor Passichenko 13 years ago
parent 92edd4fc6e
commit 18de45f7bc
  1. 2
      modules/photo/src/fast_nlmeans_denoising_invoker.hpp
  2. 3
      modules/photo/src/fast_nlmeans_multi_denoising_invoker.hpp

@ -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…
Cancel
Save