I want to detect how blurred an image is, may be It can be called "blur extend". I found a useful paper for this:
http://www.cs.cmu.edu/~htong/pdf/ICME04_tong.pdf
I used OpenCV and implemented all steps from this paper, but the result is not same as result from this paper.
Can someone give me any advise for detecting "blur extend"?
You can detect a blurring image with using next algorithm:
Calculate the maximal absolute second derivative from the gray image (for every point):
d[x,y] = max(abs(2*d[x,y] - d[x,y+1] -d[x,y-1]), abs(2*d[x,y] - d[x+1,y] -d[x-1,y]));
Calculate the histogram of this estimated image (maximal absolute second derivative).
Find the upper quantile (0,999) of this histogram.
If this value is less than the threshold (about 25% from image dynamic range), then the image is blurred.
If you want to estimate a blur value, perform steps 2-5 for reduced image.
You can write these algorithms on their own or use one from the implementation of Simd Library (disclaimer: I'm the author).
Simd::BgrToGray
or Simd::BgraToGray
(for step 1).Simd::AbsSecondDerivativeHistogram
(for steps 2-5).Simd::ReduceGray2x2
(for step 6).