Czy da się 'odblurować' zdjęcie? - techniczne wyjaśnienie kwestii rozmycia obrazu (film, 10m)
Captain Disillusion zorganizował wyzwanie w internecie, w którym poprosił o pomoc w odblurzeniu mocno rozmytego obrazu, aby ujawnić tajny wzór liczb pod nim. Obiecał shout-out dla tego, kto jako pierwszy to zrobi. W wiele prób zaangażowały się różne osoby, ale tylko jedna odegrała się sprawnie - czy jednak na pewno? Czy naprawdę można przywrócić z pozoru zniszczone informacje w zdjęciu? Jak w ogóle działa rozmycie obrazu? Obrazy składają się z pikseli, które mają zestaw wartości kolorów. A ponieważ liczby mogą być modyfikowane za pomocą arytmetyki, podstawowe dostosowania mogą sprawić, że obraz stanie się jaśniejszy lub ciemniejszy w zależności od tego, co zrobimy z wartościami pikseli. Stąd również powinien pojawić się termin funkcji rozkładu punktów, czyli PSS. Na przykład, jeśli dodamy wartości wszystkich sąsiednich pikseli, możemy osiągnąć efekt rozmycia. Mimo że to najprostszy rodzaj rozmycia, to jednak początek. Możemy również użyć różnych rozkładów w tym 'jądrze' wartości, co wnosi nas do bardziej zaawansowanego rozmycia, znanego jako rozmycie Gaussowskie.
Jednak zaawansowane przetwarzanie obrazu nie kończy się na rozmyciu. Gdy obraz jest duży, proces konwolucji staje się niezwykle czasochłonny. Kapitan przyznaje, że istnieją sztuczki, które mogą przyspieszyć ten proces, za pomocą separowalnych funkcji. Jeśli funkcja jest separowalna, można dwukrotnie konwolować jednowymiarowe kawałki jądra zamiast całego obrazu. Kapitan przechodzi również do tematu przekształcenia Fouriera, które jest metodą do rozkładu sygnału na składniki częstotliwościowe. Z tego powodu szybkie przekształcenie Fouriera otrzymuje szczególne uznanie - pozwala ono w sposób efektywny i szybki pracować z obrazami.
W swoim filmie, Kapitan Disillusion opowiada o technikach, które mogą być wykorzystane do 'odblurzenia' obrazu, a przy tym uczy, jak matematyka może zmienić sposób, w jaki postrzegamy i przetwarzamy obrazy. Główna idea, którą Kapitan próbuje przekazać, to że każdy obraz można zamienić na macierz z wartościami częstotliwości, co staje się fundamentem dla głębszej analizy. Proces konwolucji w dziedzinie częstotliwości sprawia, że operacje na obrazach stają się łatwiejsze, zmniejszając złożoność obliczeniową. W jego przykładach jasno pokazano, jak istotne jest zrozumienie pojawiających się wyzwań, które występują, gdy próbujemy dekonwolucjonować obraz.
Jednak nie wszystko jest tak proste, jak mogłoby się wydawać. Kapitan podkreśla, że nie można po prostu 'odblurzyć' obrazu, nie znając dokładnej funkcji jądra. Zmiany w rozmytym obrazie skutkują błędami w relacji do jądra, co dodatkowo komplikuje sprawę. Istnieją podejścia, takie jak dekonwolucja Wienera, które próbują skorygować szumy w dziedzinie częstotliwości. Kapitan kieruje widzów do dalszego zgłębiania tematu, jednak analogia ze zrobieniem barszczu wydaje się zrozumiała dla ogółu.
Na koniec, Kapitan zakończa film humorystycznym podejściem, komentując, że można łatwo stworzyć obraz powielony na podstawie zgadywanek, ale nie daje to prawdziwego wyniku w przypadku unikalnych obrazów. Może mimo wszystko niektórzy wykorzystają te techniki, aby zgłębić tajniki obrazowania w sposób bardziej kreatywny. Oglądając ten film trwający 17:12 minut, widzowie mogą zyskać nowe spojrzenie na sztukę przetwarzania obrazów, podczas gdy liczba wyświetleń wynosi obecnie 1,110,277, a liczba polubień to 95,153. Na pewno warto się z tym zapoznać!
Toggle timeline summary
-
Prelegent wyzwał internet do odblurzenia mocno zamazanego obrazu.
-
Tylko jedna osoba pomyślnie odblurzyła obraz, co skłoniło do dalszego dochodzenia.
-
Prelegent kwestionuje proces przywracania brakujących informacji w obrazach.
-
Wprowadzono badanie, jak obrazy mogą być zamazane.
-
Piksele w obrazach składają się z wartości kolorów wpływających na zmiany arytmetyczne.
-
Bardziej złożone techniki przetwarzania obrazów mogą zamazywać obrazy na podstawie otaczających pikseli.
-
Technika rozmycia Gaussa jest wyjaśniona jako gładsza alternatywa.
-
Wprowadzono konwolucję jako istotny proces w manipulacji obrazami.
-
Prelegent wspomina techniki przyspieszania konwolucji przy użyciu separowalnych jąder.
-
Omówiono transformatę Fouriera jako metodę efektywnego obliczania filtrów.
-
Obrazy można rozłożyć na składowe częstotliwości za pomocą transformaty Fouriera.
-
Prelegent porównuje dziedziny przestrzenne i częstotliwościowe w przetwarzaniu obrazów.
-
Wzmianka o dekonwolucji Wiener przesyła wiadomość w walce z hałasem.
-
Opisana jest sprytna, ale ograniczona metoda reprodukcji, podkreślająca, że to nie jest prawdziwe odblurzenie.
-
Prelegent zauważa postępy w oprogramowaniu dekonwolucji, jednocześnie wspominając o osobistych podziękowaniach.
-
Prelegent humorystycznie przyznaje, że jest wielu kreatywnych ludzi przyczyniających się do tej dziedziny.
Transcription
I challenged the internet to unblur this heavily blurred image to reveal the secret pattern of numbers written underneath, and promised a video shout-out to whoever could do it first! Many a catgirl tried, but only one actually pulled it off! Or did she? How does one bring back seemingly degraded, missing information in a picture? Is it even possible? Are the world's Japanese vloggers safe? For that matter, how does one blur an image in the first place? What is blur? Where am I? Images are made of pixels, which are a set of three color values, each of which is just a number of some range. And numbers can be altered via something philosophers call arithmetic. Add an amount to all the pixels, the picture gets brighter. Subtract an amount, the picture gets darker. Multiply by 2, twice as bright, if you're in linear gamma. Multiply by 0.4, it's darker again, I got you! But that's basic adjustments. We can do more elaborate image processing by changing the value of each pixel in a unique way based on the pixels around it, using another bunch of pixels, a pattern or function of points that are spread out. A point spread function, a PSS. For example, add the values of all the immediate neighbors. Wait, first divide all of them by 9, because there's 9 of them, and then add them. Okay, it didn't do much, but if we march the point spread function box across every pixel in the image and do that, we get box blur! The crappiest kind of blur, but it's a start. We can use different distributions in this, let's just call it kernel, of values, as long as they add up to 1. If we arrange it in an unpopped pimple pattern, we get a much nicer, smoother kind of blur. Gaussian blur. By the way, you don't have to think of it as marching the kernel across. It's also kind of like putting kernels over all the pixels, multiplying each one by the pixel, then adding them all together. And this process is not just for blurs, it works for all sorts of image filters. You can sharpen, find edges, and just imagine the trippy possibilities when the function in the kernel varies depending on what part of the image it's in! Whoa. When we mush the image with the kernel this way, in terms of numbers, what's happening is called convolution. But I'll let the math people explain that. All I know is it's a tedious, computationally expensive process. If the image is big, and especially if the kernel is big, and the kernel is allowed to be as big or bigger than the image, it takes frickin' forever to convolve. Humans only live like 700,000 hours. There are tricks we can do to speed it up. For instance, if the function happens to be separable, we could take just a one-dimensional slice of the kernel, convolve that, then take the other dimension and convolve the convoluted thing with that. So it's like doing just twice instead of square of the n root... I'll let the math people... It's way less work is the point. Still, when I go to filter, blur, blur, I don't just want it to happen pretty fast, I want it now! Luckily, there's an even more efficient way to calculate a filter. It involves a furrier, I mean fourier, I mean fourier, transform. Joseph Gordon Fourier was an 18th century French guy obsessed with hotness of things. Somehow, this led him to discover that any periodic function is actually a sum of a series of basic sine and cosine functions. Later, other people figured out that actually any non-repeating wave is actually made up of a bunch of sine waves, actually. There's literally no squiggle you can draw that couldn't be transformed into these. That's crazy. An image is a 2D function. A digital image is a discrete sampling of the function at the pixel locations, and this can be handled super efficiently by a discrete version of the fourier transform called discrete fourier transform, which we can do fast using an algorithm called fast fourier transform. Well, the math people can. The devil numbers! But once we get them to get a computer to do it for us, we can break any picture down into its component frequencies, which allows us to accomplish things we never dreamed of before. If you wish to make a bowl of borscht less salty, you must first invent a universe in which you've already done that. But what if we could put the bowl through a mathematical machine? One that separates back out the cabbage, the beets, the bouillon cubes, even the not yet butchered cow that made the sour cream. In this ingredient domain, reducing the amount of salt could be done with a flick of the wrist. Oh no! Square me! Someone help! What was a tedious convolution process in the spatial domain, in the frequency domain becomes simple multiplication. The kernel can be applied to the image everywhere all at once, just like that. But what good is it unless we can turn it back into the original form of the signal, a viewable picture? Well, we can, through an inverse of a discrete fourier transform process called... Wait. Wait. If multiplying the fourier transform of the image by the fourier transform of the kernel blurs the image, then wouldn't taking the fourier transform of that blurred image and doing some hypothetical operation with the kernel that's like the opposite of multiplication undo the blur? If only there was a... Ah, so this is who I obligated myself to give a shout-out to. M. Nurson, huh? What a special kitty, they broke the mold when they made her- oh wait, never mind, there's a bunch of them. So did this kid just perform sophisticated image deconvolution with her bare hands? Because yes, in principle it does work the way I explained, but the reason you don't see everything getting easily unblurred all the time is because it's not that easy in practice. For one thing, you need to know the exact kernel function and its size, and the blurred image can't be altered in any way. The slightest rescaling or crop changes its relationship to the kernel and throws the whole process off. Even imperceptible tweaks to the blurred image can ruin it. The frequency domain is like an opposite world. Big broad contrasts are barely noticeable, while tiny subtle details are huge. Microscopic noise or compression artifacts end up massive and can overwhelm the deconvoluted image. Of course, there are mathematical approaches to tackling these challenges. There's Wiener deconvolution, which tries to cleverly attenuate the noise in the frequency domain. Oh look, it's the limit of my ability to comprehend and explain things. It actually exists right here. If you need more, if you're so smart and have the time and energy to dive deeper, then you should have no problem continuing onward. Be my guest. Go frolic with your math people friends. Imagine imaginary numbers together. Good luck. For the rest of us, there's always cheating. Like what Emerson did. That's right. You can get the details on her channel, but basically she recreated my grid of numbers pixel for pixel and used a boosted up difference mat to manually try out different digits in each spot until each blurry blob matched. Is it an extremely clever approach to this specific challenge? Yeah, but it's not unblurring. It's a reproduction based on a guess, and it was only possible because I provided every bit of helpful data. This method could never be used to unblur a unique image like for example, this go ahead. I dare you internet. It's a very compromising picture and a clue to my mysterious origins. There are brilliant people out there teaching these concepts, advancing them, making free open source deconvolution software while giving away files for 3d printing your own microscope at home. And I'm supposed to give a personal shout out to some Photoshop savvy, furry geometry dash addict. I don't think so. If I shouted out every cat child I come across, we'd be here all day. I'd have to shout out Sonia and Riesel and Mochi and Fluffles and Phantom and Sonic and Squirrel and Sophia and Archer and Chopper and Masha and Charlie and Ash and Risa and Bessie and Simba and Sima and