Figure 1: We have an image of Derek Zoolander that has been corrupted. Using Fourier transforms and a Gaussian filtering technique, we will experiment with various filter sizes to see if we can clean up the image.
Figure 2: The logarithm of the Fourier transformed image to show the frequency content of the original image of one of the color channels. The original image is RGB which has 3 channels (one for red, one for blue and one for green), so our technique requires us to separate each channel, transform it, filter it, and put it back together. The channels are all very similar as the noise is essentially normally distributed across each channel equally, so you can imagine the other two by just seeing the one.
Figure 3: The filter we will use. Two dimensional Gaussian filter, very standard for EDA and a great place to start. We take the transformed content matrix, and multiply (element by element) by the filter matrix. What happens when we do this? The maximum value in our filter is 1, the minimum is 0. Notice in our transformed image (figure 2) that most of the content is centered in the middle. We take our filter, center it over that cluster of data, then multiply. It then keeps the majority of the center frequencies, because the filter at that point is either 1 or close to it. The filter then decays toward the edges, and sets the rest to zero (at the same that the Gaussian decays).
Figures 4 & 5: Results with varying success. The Gaussian does a great job of blurring the image, but doesn't really bring a whole lot of clarity to the final result.
Figure 6: Another color image of Derek, this time with a very specific area of corruption. We will use the heat equation to diffuse this specific area, bringing clarity to the corruption.
Figure 7: The heat equation (http://en.wikipedia.org/wiki/Heat_equation) we will use to diffuse the image. The heat equation says that heat diffuses through time into neighboring less "hot" areas, reaching an equilibrium. We can use this method to see image values (that are really just represented in a matrix as double precision values) as "heat values" allowing them to diffuse into neighboring areas, mixing the noise. For our specific case, we will use the ODE45 command in Matlab to run our simulation with a right hand side equation function that we build and pass in.
Figure 8: We need to narrow down the area we wish to diffuse, so we experiment with matrix indices to find the correct area. We don't want to diffuse the entire image, and sending that much data to ODE45 is unnecessary.
Figure 9 & 10: Results with varying success. The main variable we tweak here is the time stepping. How long do we let the simulation go before we stop it? The longer it goes, the more time the diffusion has work, but too long can cause weird boundary anomalies, which will lead to a rough blend into the diffused area. For spot treating in areas where the results require a uniform texture, this is a fairly successful approach.












