Blur Detection using OpenCV (Laplacian and FFT based approach)

After doing some computer vision projects I found some of the images taken from the camera in real-time are blurry. When I searched in google to identify blur detection using the OpenCV-based approach.

In below, I mentioned two approaches for blur detection using Fast Fourier Transform (FFT) and Laplacian

Fig Clear image vs Blurry image

Method 1

Laplacian approach for blur detection

The Laplace filter is mainly used to define the edge lines in a picture. What is meant here by the edge are the sharp color separations that usually separate objects from the background. The Laplace filter, also known as the Sharpening Filter, uses a window while operating.

Steps involved :

  1. Read the input RGB image for analysis
  2. Convert the RGB to the grayscale image
  3. Measure the variance using Laplacian
  4. Based on the focal measure score, apply the condition for blurry analysis.

Method 2:

Fast Fourier Transform (FFT) for blur detection

The Fast Fourier Transform is a convenient mathematical algorithm for computing the Discrete Fourier Transform. It is used for converting a signal from one domain into another.

The FFT is useful in many disciplines, ranging from music, mathematics, science, and engineering.

In terms of computer vision, we often think of the FFT as an image processing tool that represents an image in two domains:

  1. Fourier (i.e., frequency) domain
  2. Spatial domain

Therefore, the FFT represents the image in both and components.

By analyzing these values, we can perform image processing routines such as blurring, edge detection, thresholding, texture analysis, and

Adjust the threshold, based on mean values of FFT to determine blurry or not

ComputerVision-Fun-Projects/Blur_detection at main · soorajece1993/ComputerVision-Fun-Projects (github.com)

Aspiring on Computer vision, Data science , NLP , IoT