Image Blur Detection via Hough Transform — IV
In my previous three articles (1,2,3) I discussed how to use Canny edge detection and Hough transform to identify blur images. Here I will show some results from the algorithm discussed before.
Results
When presented with images that are clear, the algorithm correctly identified most of them (see images below):
The following images illustrate how the original image (top right) is divided into sub regions. Canny detection is performed on each of the sub images.
|
|
|
|
|
|
|
|
|
When performing Hough Transform, I chose to detect up to ten lines in each image, with the following stepping parameter (the detection results are very sensitive to these parameters, the following parameters were chosen based on experiment results):
\[\rho=1, \theta=0.01\]
Out of all the detected lines, a few sections are selected based on line continuity and the calculated average gradients around the detected lines. The following images shows the chosen Hough line segments based on the algorithm.
|
|
|
|
|
|
|
|
|
The table below shows the gradient index calculated within each area (the average of the gradients along all the chosen line segments within a sub-image. The result is scaled by 1000, the scale factor is chosen such that for clear images the resulted index is greater than 1 and for blur images the resulted index is less than 1).
| 1 | 1.709 |
| 2 | 2.383 |
| 3 | 1.012 |
| 4 | 2.842 |
| 5 | 3.389 |
| 6 | 2.419 |
| 7 | 2.933 |
| 8 | 2.168 |
| 9 | 2.534 |
And the sub images are indexed as follows:
| 1 | 4 | 7 |
| 2 | 5 | 8 |
| 3 | 6 | 9 |
The algorithm can also detect images with deliberate blur regions (e.g. Bokeh). The results are illustrated below:
| 1 | 0.000 |
| 2 | 1.750 |
| 3 | 1.973 |
| 4 | 1.595 |
| 5 | 2.815 |
| 6 | 3.188 |
| 7 | 0.000 |
| 8 | 1.204 |
| 9 | 1.308 |
Note that the 0’s in the detection results indicate that within those regions, no lines could be reliably detected and thus those regions are considered blurred.
Generally speaking, when an image contains both blurred and clear regions, some of the indexes will be zero and others will be greater than one.
The following images are detected as blurred, with the detected indexes far less than one.
Limitations
when image contrast is low, or when objects borders are not clearly defined, the algorithm may have difficulty in distinguishing whether an image is blurred. Take the following two cloud images for instance, the image on the left was correctly classified as a clear image due to the relatively high contrast around the center. But the image to the right was classified as blurred due to its lack of contrast.



























Hi.
I am currently a student at the university of La Rochelle, France, in an image processing & mathematics master.
Our teachers asked us to build several image default detector: noise(salt&pepper, ccd), block artifact, color dominance, motion-blur and out-of-focus blur.
I am working since yesterday on your articles for blur detection via Hough Transform.
Working on Matlab, i succesfully reproduce almost everything, except for the final part of the algorythm: the calcul of the gradient on the line.
I didn’t understand what you are doing:
- in which image is this line? In the Hough transform? In the orignal image?
- Similarly, what is the use of the perpendicular line whom you speak of for the gradient calculation?
My principal problem lies with the definition of the gradient D of an image :
In classics way, D=[Ix,Iy] with Ix and Iy being a vector field (Ix(x,y)=I(x,y)-I(x-1,y), the same for Iy). Here i do not know what is it.
If you’re willing to enlight me, i would be thankful.
Antonin.
The gradient calculation involves fitting a line through the detected edge points. After the linear equation is obtained, calculating the perpendicular line is simple. Similarly, the gradient can be calculated by modeling the intensity as a linear function (the simplest method) and the gradient would be the tangent of the linear function. Hope this helps.