Detect blur image

Hello, I would like to check blurring on a lot of medical pictures (more than 10000). (the goal is to remove bad files). is it possible ? if yes, can someone give me a simple way to do that ? I'm not a guru in image analysis, and I spent days to look for that kind of tool. I use visual studio to compile numerous c++ files like thislink text but c++ is not my favorite language (nor english! :-) ) and I can't understand the mixing complexity of all this mathematical technology... thank you ! Alan / France'countrySide

edit retag close merge delete

1
( 2012-10-18 12:13:07 -0500 )edit

Sort by » oldest newest most voted

That's a difficult task. Cameras can change the focus and thus analyse, if the image gets sharper or not. Having only one picture, how can you decide if your image is blurred or if it is a perfectly sharp photo of a Gerhard Richter painting?

Basically, sharpness can be measured by analysing the edges, for example with a Sobel filter. Having strong edges is a good sign for sharpness. But if you don't have high contrasts in your image, it could also mean that you took a picture of something lacking contours.

The good thing is: you probably know, what's represented on your pictures. If you're expecting certain objects, it is easier to define some threshold which classifies the image as blurred or sharp.

more

Thanks you very much for your answers : I finaly use Laplacian/gauss filter and get stronger pixel to estimate blur : it's Ok for my need. I translate C++ code to VB.Net and use EMGU Opencv library. this is my code :

Module Module1
Private Sub GetBlur(ByVal imgfile As String)
Dim factor As Single
Dim imgB As Bitmap = New Bitmap(imgfile)
imgB = New Bitmap(imgB)
Dim imgGray As Image(Of Gray, Byte) = img.Convert(Of Gray, Byte)()
Dim imgTmp As Image(Of Gray, Single) = imgGray.Laplace(1)
Dim maxLap As Short = -32767
For Each MyByte As Single In imgTmp.Data
If MyByte > maxLap Then
maxLap = MyByte
End If
Next
Debug.Print(imgfile & "   " & maxLap)
imgGray.Dispose()
img.Dispose()
imgTmp.Dispose()
imgB.Dispose()
End Sub


End Module

Where Maxlap is the "blur score" of the picture.

Alan

more