Blur detection in imagej

Dear All,

Is there any plugin in imagej to detect and measure the degree of blur of an


Hey @vincent,

maybe an image quality measurement does the job?

Also, if you could share some example images, we could guide you better :wink:


Dear Robert,

It seems that the Microscope Image Focus Quality plugin can’t identify image blurring. I have read some paper suggests the use of haar wavelet transform to detect blur but I can’t find any imagej plugin for that purpose.


May I ask what’s causing the blur?

Your question has no generic answer. Imagine a photo of a white wall. How do you expect to measure “blurring” in such situation?

The blur is caused by movement

Are you doing video processing? Could you subtract two subsequent images? Or measure local contrast and differences in local contrast?

If you could share an example image (sequence) it might be easier for us to point you in the right direction :wink:

Sorry I should be more specific. I’m working on a project to identify blur mammogram (the blur can be local or global) for example the one on the left is blur and the one on the right is clear

I see. This looks very tough. I hardly see a different in these two images. However, if you are looking for a measurement of local contrast (which is decreased in case of motion blur), you could start by applying a standard-deviation filter.

Starting from your image, this macro executed in Fiji:


// Local standard devuation filter as surrogat parameter for local contrast
run("Standard Deviation", "block_radius_x=5 block_radius_y=5");

// visualisation
run("Enhance Contrast", "saturated=0.35");

// configure measurement to do pixel statistics
run("Set Measurements...", "mean standard min redirect=None decimal=3");

// measure on left side
// measure on right side

results in this visualisation and measurement of local contrast:


I hope that helps


I did something to very loosely recreate the code flow from this paper:

Here’s the macro for a starting point.
blur_index.ijm (1.3 KB)

I used it to determine when to chop off the blurry part of a large zstack of SPIM data, so I wasn’t splitting hairs. You may need to consider the thresholding in the macro, and/or think about adding user selected regions of the image.


1 Like

Run an FFT power spectrum of a line across a sharp edge. This is equal to the MTF. Compare it with a sharp image’s edge. Keep the line lengths the same.

1 Like

I run an FFT on both blur and unblur image and I cannot see the difference

A simpler method is to look at the max - min in a similar area. The in focus image will have a greater value. It’s sigma (std Dev) can also be used as an indicator. The bigger the more in focus.

This is usually done across a high contrast edge…