OpenCV error: approval failed (ksize.width> ...... for GaussianBlur

when I call Imgproc.GaussianBlur (dst, dst, new size (3,3), 1); in my application it works fine. As soon as I increase the kernel size to a new size (4.4), or I get

OpenCV Error: Assertion failed (ksize.width > 0 && ksize.width % 2 == 1 && ksize.height > 0 && ksize.height % 2 == 1) in cv::createGaussianFilter, file

........ \ opencv \ modules \ imgproc \ src \ smooth.cpp, line 816 Caused: CvException [org.opencv.core.CvException: cv :: Exception: ........ \ opencv \ modules \ imgproc \ src \ smooth.cpp: 816: error: (-215) ksize.width> 0 && ksize.width% 2 == 1 && ksize.height

0 && ksize.height% 2 == 1 in the cv :: createGaussianFilter] function on org.opencv.imgproc.Imgproc.GaussianBlur_1 (own method) on org.opencv.imgproc.Imgproc.GaussianBlur (Imgproc.java∗33)

Can someone put me on the right track? I have no idea where or what to look for.

thank.

+4
source share
1 answer

As I understand from the track, you are allowed to use new Size(x,y), where xand yare odd

+9
source

Source: https://habr.com/ru/post/1567995/


All Articles