Deblurring Images for OSINT and more — Part 1

During intelligence operations, we often come across images that may contain important information but they are too blurred, noisy or just unclear to make sense out of. In this article, I am going to talk about some techniques that we can use to retrieve information from blurred images.

How do filters work?

We will apply a filter on it using something we call a Kernel. Both the image and the kernel are matrices.
Let’s use this 3x3 Kernel

We will place this kernel over our image like this

Let’s multiply values of the kernel and the overlayed values of the image

(94 x 0) + (178 x 2) + (124 x 0) + (23 x 2) + (94 x 4) + (135 x 2) + (153 x 0) + (120 x 2) + (140 x 0)Let's do some maths!
0 + 356 + 0 + 46 + 376 + 270 + 0 + 240 + 0
Doing some more maths gives as 1288Now let's divide 1288 by the sum of values of the kernel i.e. 121288 / 12 = 107

Now, this is the new value of the pixel in the center (the one having 94 value).
So yeah...

We keep moving our kernel all over the image

We keep doing this to get the new values for the pixel in the center of the kernel. No, I am not going to calculate the value of each pixel now but you get the idea.

So this is how filters work. The values and dimension of the kernel determine what the output image will be. For example, the following kernel will Sharpen the image

 0  -1   0
-1 5 -1
0 -1 0

But we are interested in blur filters and the most common type of blur is Gaussian blur which is done using Gaussian function and its kernel looks something like this:

Source: WikiPedia

Notice how the values are being normalized and how the values start decreasing with distance from the center? That’s what reduces the details in images and makes them look blurry.

Reversing Blur

The operation that we performed on our image earlier is called convolution and all filters work on the same principle. To unblur the image we will use self explanatory operation, deconvolution.

Let’s take this image for example

Let’s use Gaussian blur of radius 3 on this

If you want to try it yourself, download GIMP and install a plugin names G’MIC. After installing, go to Filters>G’MIC>Details>Sharpen (Deblur) to access the concerned tool.

Anyway, using deconvolution with appropriate values produces this result which is readable

For better comparison, check this out

Maths is cool, isn’t it?

Well, that’s all for now. We will talk about more techniques in the next article in this series.

Further reading:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store