16 ms·
You are correct a standard Gaussian Blur can be reversed except along the edges where data is effectively lost outside the blurred rectangle. In this case the r
by barbegal 6y ago
You are correct a standard Gaussian Blur can be reversed except along the edges where data is effectively lost outside the blurred rectangle. In this case the radius of the blur is large enough that a lot of data will be lost. Combined with JPEG compression removing a lot of information too, reversing this blur should be impossible.
A better blur algorithm (in that it can easily be proven not to be reversible and is faster to process) is to divide the area to be blurred into a small number of cells, (9,16 or 25) get the averaged colour in each cell and then apply an interpolation between those colours as your output. This algorithm is essentially O(n) where n is the number of pixels to be blurred. You can easily prove that the information in the image is at most 3 bytes (each colour) * 25 (number of cells) = 75 bytes which is not enough to encode a face however it may be enough to encode some limited details (such as skin colour, distinctive clothing etc.) so always better to use a black box.
- regularfry 6y agoYou're right about information being lost at the edges, but I do wonder if that leaves a region in the center of the image that's got enough information to be recognisable. There's one way to check, I guess... Also I can't help but wonder, in a case like this where you've got the rest of the image, whether the pixels around the border of the blurred region are useful. There's going to be a probability that they're a similar colour to the outer ring of pixels that got blurred, and that might give you enough to start working inwards.
- contravariant 6y agoProvided you know the exact method you can in theory recover even the edges. Although this is very numerically unstable, to the extent that just double precision might not be quite enough. That said, that's just the theoretical exact inverse. With proper regularization you might be able to recover far more (although with a complex prior like a neural network it becomes debatable what information you are recovering and what information you are putting in yourself). Side note, even with a mere 25px image (effectively) of someone's face I'm not sure if it leaks as little information as you think it does. Just 33 bits would be enough to uniquely identify someone, let alone 75 bytes. Practically you wouldn't be able to recover more than some basic estimates of skin colour and distance between the eyes etc, but in extreme cases that might still too much.