简体   繁体   中英

Most efficient way to blur an image in opencv

I am blurring the background of an image using the blur method. All the tutorials I have seen show the highest kernel size of (7,7). But that is not blurred enough for what I need it for.

I have used Size(33,33) and it works alright but I would like to go higher so currently I am using Size(77,77). Is this the most efficient way of blurring an image in OpenCV? And is it okay to go that high at all?

Another Idea is run the blur method more than once. with a kernel size of (7,7), but that doesn't seem like it is more efficient.

EDIT: OpenCV version 3.2

Try cv::stackBlur() .

It's an addition from v4.7.0. Its performance is almost flat, ie independent of kernel size. The pull request contains performance figures: https://github.com/opencv/opencv/pull/20379

  • GaussianBlur(sigmaX=22) (30 ms)
  • stackBlur(ksize=(101,101)) (0.4 ms)

高斯模糊 堆栈模糊

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM