Skip to content

Commit 2932420

Browse files
Nicolas AbrilNicolas Abril
authored andcommitted
Ensures that the input arguments are valid
If 'lambda <= 0' or 'kappa <= 1.0', the stop condition for the solver is never met because beta would not be increasing.
1 parent 1a15cbc commit 2932420

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/ximgproc/src/l0_smooth.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ namespace cv
252252
CV_Assert(!S.empty());
253253
CV_Assert(S.depth() == CV_8U || S.depth() == CV_16U
254254
|| S.depth() == CV_32F || S.depth() == CV_64F);
255+
CV_Assert(lambda > 0.0);
256+
CV_Assert(kappa > 1.0);
255257

256258
dst.create(src.size(), src.type());
257259

0 commit comments

Comments
 (0)