I'm looking for a “very” easy way to check if a bitmap is blurry. I do not need an exact and complicating algorithm that includes fft, wavelet, etc. Just a very simple idea, even if it is inaccurate.
I thought to calculate the average Euclidean distance between the pixels (x, y) and the pixel (x + 1, y), given their RGB components, and then using a threshold, but it works very poorly. Any other idea?
Do not calculate average differences between adjacent pixels.
, , . . , , - .
, , . , , , 10 .
PHP GD (Bokeh_Ipomea.jpg). Sharpness - 255 ( , , , ). , .
Sharpness
, , :
, , . , (maxdiff) (). :
sharpness = (maxdiff/( + )) * (1,0 + /255) * 100%
- , , . ( 15.)
. , 40%, , . ( 9 × 9 ):
()
. , , :
Bokeh , :
, , . , , , , , .
, , ... , -, . , . , :
1 2 E = --- Σ I, where I the image and N the number of pixels (defined for grayscale) N
(LoG), "" , . .
. MATLAB, : , LoG LoG
LoG, :
E = 1265 E = 88 or bl
..., , ...
L1- :
N1=1/(2*N_pixel) * sum( abs(p(x,y)-p(x-1,y)) + abs(p(x,y)-p(x,y-1)) )
L2:
N2= 1/(2*N_pixel) * sum( (p(x,y)-p(x-1,y))^2 + (p(x,y)-p(x,y-1))^2 )
N2/(N1 * N1) . , .