Ask Your Question
0

how to modify the function of GaussianBlur with mask based on GPU?

asked 2019-03-15 04:27:18 -0600

When developing some interesting project like bokeh,i found sometimes we just blur some area.However,realizing it on cpu will spend too much time to be up to real time.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-03-15 10:14:04 -0600

HYPEREGO gravatar image

There is no need to modify it since an implementation based on CUDA is already available in OpenCV (remember to Google before post!). To be more precise, a lot of filters are already implemented in cv::cuda class in OpenCV. So you have to compile OpenCV library from source with CUDA enabled and then you can take a look HERE.

HERE you find the documentation regardind the createGaussianFilter() function while in this link you'll find the documentation regarding the GuassianBlur().

I don't know if they have changed the implementation but as far as I remember it doesn't work with kernel bigger than 32, but you can overcome to this just running the filter more than one times (it's equivalent to run it with a bigger kernel)

If you are into reserach, maybe THIS paper can be useful to you to understand why and what is done.

What I'm giving to you are the link to the OpenCV 3.4.5 documentation, find the right one for your OpenCV version.

Cheers and have fun!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-03-15 04:27:18 -0600

Seen: 857 times

Last updated: Mar 15 '19