Add CV_Asserts for channels count

This commit is contained in:
Victor Passichenko 2012-08-21 16:05:18 +04:00
parent 92edd4fc6e
commit 18de45f7bc
2 changed files with 5 additions and 0 deletions

View File

@ -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;

View File

@ -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();