OpenCV blur detection c++
Hello, what I want to do is: (Please note that I am a new user of OpenCV)
At first I want to take a picture and read it (imread)
Then, split it in to grid (for now row and col number doesnt matter)
Finally, I want the code to iterate through each grid element and output blurriness level. Also it would be nice to see it when the code runs in which block the detection is happening.
Now my question is where should I start and if this mechanism is good enough? Also suggestions of learning material?
Thanks in advance
My idea would be to do a transform to the frequency domain (Fourier or DCT) and check for high-frequency components. I would recommend to use a small sliding window instead of dividing the image in blocks.
There are still some difficulties in this problem: the uniform parts of the image won't be considered in focus; some blocks with a small area in focus will be considered not blurry (almost every block in the image because the bars), and the optical blur ("bokeh") isn't gaussian, so in the out-of-focus areas you can still have high-frequency components (see the border between leaves/sky).
a paper about your project