0

Is it possible to dash the blurred part of the image?

Right now I am using python with OpenCV. I know only how to load images and display if the image is blurred.

My input is a blurred image:

Import

I would like to get:

Export

I do not have: original/unblurred image.

Output can have still blurred parts but dashed.

Thanks a lot for help!

Maciej Pulikowski
  • 2,457
  • 3
  • 15
  • 34
  • make a pattern of white dots on a black image the same size of your original image. Then binary-and / invert / etc... you original image with the pattern, using the same mask you used for blurring – Miki Oct 16 '20 at 12:23
  • Thanks for the answer! Nice point, however, I do not do blurring. My input is already a blurred image. So I need to recognize what part of the image is blurred. Then after that, I have to add a pattern of white dots as u mentioned. But I do not know how to find blurred parts :( – Maciej Pulikowski Oct 16 '20 at 12:33
  • Then you have two bigger problems: 1) find the blurred parts, 2) recover the sharp shape – Miki Oct 16 '20 at 12:39
  • Only 1 :D. I do not need to sharp shape. (edited main post) "Output can have still blurred parts but dashed." – Maciej Pulikowski Oct 16 '20 at 12:46
  • then the laplacian trick should work well enough ;) – Miki Oct 16 '20 at 12:52

1 Answers1

1

You could try by computing the "Variance of the Laplacian" on parts of the image to detect the regions that have a low variation in greyscales (= assumed blurry) and which regions have a high variation in greyscale (= assumed non-blurry).

There is a nice tutorial on how to check if an image is blurry, it can be found here

There is also a post here that explains the theory behind it.

It ain't a complete solution, but it might be a way to start.

Dieter Maes
  • 151
  • 6
  • Thanks! I have found out that tutorial. I was trying with this project https://github.com/WillBrennan/BlurDetection2 by WillBrennan. It is a ready solution for showing me blurred parts: http://prntscr.com/v0ko5s . I have added swap black and white: Now I have: http://prntscr.com/v0kq0w . So it is something! :) – Maciej Pulikowski Oct 16 '20 at 13:02