0

I have an image and I am interested in computing the blurr present in the image; for that I have used openCV in build functionality called cv2.Laplacian(image). But I could able to quantify the amount of blur present in the image. Is there anyway that we can compute a normalized value of the blur for a given image.

def blur(path):
    image = cv2.imread(path)
    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    fm = cv2.Laplacian(gray, cv2.CV_64F).var()
    return fm
acoustic python
  • 259
  • 1
  • 2
  • 12
  • See this post: https://stackoverflow.com/questions/60587428/how-to-detect-blur-rate-of-a-face-effectively-in-c/60593957#60593957 – stateMachine Dec 23 '21 at 07:46
  • But I wanted to express the threshold which lies between 0 to 1; meaning the blur value should also be between 0 to 1 – acoustic python Dec 23 '21 at 07:53
  • Take two images, with minimal and maximal blur, and use the values for a linear transformation. –  Dec 23 '21 at 08:25
  • There is no way to obtain a blurriness value in a general setting. You need to make assumptions about the subject in the picture and about the contrast. – Cris Luengo Dec 23 '21 at 13:53

0 Answers0