Viewing a single comment thread. View all comments

Bax_Cadarn t1_j9g9qhy wrote

>lets assume you already know how much it’s been blurred.

the poster seemed to consider a situation when they know precisely how the image was blurred lol. Is it possible then?

​

Like x+y=3, if You know y =1, can You know x if x is the blurred image?

3

Training_Ad_2086 t1_j9gfmf5 wrote

Likely not if every pixel is blurred.

In that case all original pixel values are lost and replaced by blur pixel values.

Since every original pixel is blurred there is no information to extrapolate from for a undo and so knowing the method is useless.

Its like listening to music on a old telephone, you can make out the sound but all the details of the sound can't be recovered from the audio you are listening to

3

Bax_Cadarn t1_j9ggwpb wrote

Um, maybe this will explain what I think they mean.

Say the picture is one dimensional. There are also only 10 colours. Blurring is moving the colour in some way.

Picture:0137156297 Blurring:11111(-1)(-1)(-1)(-1)(-1)

Blurred:1248245286

Now lnowing both bottom lines, can You figure the top?

1

Training_Ad_2086 t1_j9gi7c1 wrote

Well what you described isn't really a blur function (it'd be a brightness shift). But if we want to call it that then yes it is reversible there.

There are several other mathematical operations you can do that are just reversible like that. However none of them are anywhere close to actual blur functions.

3

The_Hunster t1_j9i7uwt wrote

Given 1 dimensional images again. Is blurry more like taking the image "2,3,4" and turning them all to the average "3,3,3"? Which could of course be "1,3,5" or "4,3,2". Meaning you lose the original information. Would that be a good example of a blur function?

2

MagiMas t1_j9j8gtn wrote

Yes, but it's usually done with a moving average.

So if you have the pixel values 1,3,2,4,3,1,5,2 you could always average in groups of three

1,3,2 => 2
3,2,4 => 3
2,4,3 => 3
4,3,1 => 2.66
3,1,5 => 3
1,5,2 => 2.66

so the blurred image is

2,3,3,2.66,3,2.66

An actual blur filter is usually a bit more complex, a gaussian blur for example weights the original pixels in different amounts (according to a gaussian curve). So instead of just taking the average of 1,3,2 you'd calculate

0.25 * 1 + 0.5 * 3 + 0.25 * 2 = 2.25

And you can choose how broad you want to make the window of values that you consider in the operation etc.

Crucially, if we write the simple blurring operation from the top as a set of equations with the original pixel values unknown and named as x_i:

(x_1 + x_2 + x_3) / 3 = 2
(x_2 + x_3 + x_4) / 3 = 3
(x_3 + x_4 + x_5) / 3 = 3
(x_4 + x_5 + x_6) / 3 = 2.66
(x_5 + x_6 + x_7) / 3 = 3
(x_6 + x_7 + x_8) / 3 = 2.66

you can see that we have 8 unknown values but only 6 equations. If you remember the maths of systems of equations from school we need 8 equations to fully determine 8 unknowns. So this problem is under-determined even in a case of such a simple blurring operation where we know exactly which kind of operation was done to the original image. In a more realistic scenario, where we don't know the exact type of blurring operation done to an image, it gets even less feasible to reverse the operation without somehow using prior knowledge of how unblurred content usually looks like (which is what neural networks are doing when they are used to scale up and unblur small images).

3

SlingyRopert t1_j9ghtzw wrote

There’s a whole bunch of special cases but I tried to target the case where you know exactly how it is blurred but the blurred version you have has additional noise. It is this additional noise that does you in. My example also could if explicitly brought in the blurring into the equation example and brought in the convolution nature:

Let’s think about a one dimensional deblurring problem where we measure just two blurred pixels. The left one is 34 and the right one is 27. Suppose we exactly know the blur (in kernel form) is three pixels wide and the blur has values A, B, C. If w,x,y,z is the unblurred image then

Aw + Bx + C*y + N= 34 and

Ax + By + C*z + M = 27

where N and M are small random numbers (noise in the pixel measurement).

To estimate the middle two pixels of the unblurred image, you have to solve the above equations for x and y. You only know A B and C but you (often) can assume that w, x,y,z are zero or positive and that N and M are fairly small. Even if you are really good at linear algebra, solving the above two equations for the two to six unknowns is il-posed.

If you get enough pixels (say more than the width of the blur), you can get away from having to solve for edge pixels like w and z and you can get approximate solutions like using the Wiener filter.

I have been assuming you know the blur and that the blur is the same everywhere in the image. If the blur is not the same over the image, the linear algebra tricks that make the Wiener filter don’t work and you have to selectively apply them over small enough patches that they still sort of work.

If you do not know the blur, it’s strong assumption time (also called “blind deconvolution”) and you need to consult a professional with details about your inverse problem to see how well it can be solved.

2