Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Your Java code:

Imgproc.GaussianBlur(rgba_clone, rgba_clone, new Size(3, 3), 9);

Your native C++ code:

cv::GaussianBlur(rgba_clone, rgba_clone, cv::Size(9, 9), 3);

The execution time of Gaussian blur is mostly determined by the kernel size (proportional to its linear size). It is not determined by sigma. (Using a kernel size that is inappropriate for the given sigma result in truncation of the smoothing function, but for some applications it might be acceptable.)

Unless you need numerically accurate large-radius blurring, it would be faster to pyramid-downsample, blur with a smaller radius, and then pyramid-upsample.

Your Java code:

Imgproc.GaussianBlur(rgba_clone, rgba_clone, new Size(3, 3), 9);

Your native C++ code:

cv::GaussianBlur(rgba_clone, rgba_clone, cv::Size(9, 9), 3);

The execution time of Gaussian blur is mostly determined by the kernel size (proportional to its linear size). It The execution time is not determined by sigma. (Using

Using a kernel size that is inappropriate for the given sigma result in truncation of the smoothing function, function (i.e. numerical inaccuracy and blocky artifacts), but for some applications it might be acceptable.)acceptable.

Unless you need numerically accurate large-radius blurring, it would be faster to pyramid-downsample, blur with a smaller radius, and then pyramid-upsample.

Your Java code:

Imgproc.GaussianBlur(rgba_clone, rgba_clone, new Size(3, 3), 9);

Your native C++ code:

cv::GaussianBlur(rgba_clone, rgba_clone, cv::Size(9, 9), 3);

The execution time of Gaussian blur is mostly determined by the kernel size (proportional to its linear size). The execution time is not determined by sigma. Increasing kernel size from 3x3 to 9x9 will at least triple the execution time.

Using a kernel size that is inappropriate for the given sigma result in truncation of the smoothing function (i.e. numerical inaccuracy and blocky artifacts), but for some applications it might be acceptable.

Unless you need numerically accurate large-radius blurring, it would be faster to pyramid-downsample, blur with a smaller radius, and then pyramid-upsample.