mirror of
https://github.com/opencv/opencv.git
synced 2026-09-13 05:42:51 -05:00
Add CV_Asserts for channels count
This commit is contained in:
@@ -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(
|
|||||||
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();
|
||||||
|
|||||||
Reference in New Issue
Block a user