The gradient magnitude is calculated by taking the square root of the sum squared derivatives (dx, dy). Clearly, this requires calculating the derivative which luckily can be easily done by convolving with the derivative filters. ([1, -1] and it's transpose). I have included all of the images generated of this process.
We now blur the photo before doing the same as before. The main difference here is that there is less noise when we calculate the gradient magnitude.
Just for the folks at home who don't know how to sharpen a photo the process is as follows. Take the low frequencies (aka blur it) and subtract this by the original to get the high frequencies. From this add some weighted high frequencies to original and you are chilling.
I actually used the unsharp mask filter which is the following equation (sorry i dont know how to import latex so it's in comic sans). f * ((1+a)e - a g) Where a is alpha, f is the original picture and g is a gaussian kernel and e is the unit impulse
The next part is a blurred photo that is then sharpened. We can see that the results are not as good as the original photo, but much better than some blurry photo.
These are hybrid images. You should look at them from a long distance and then up close. It's cooler that way. As an example, here's Derek and his cat. (Note I also cropped the final results)
The following shows the log magnitude of Fourier transform for some image.
I did this in color for fun, so here's some quick analysis. I personally like when the high frequencies is b&w.
A Gaussian pyramid is a very nifty thing where you downsample and blur a photo repeatedly. I did not make a pyramid but I did make a stack by blurring some black & white/color image by some gaussian kernel for some N amount of levels. (The kernel sigma is effectively doubled each time since I am blurring an already blurred photo. I could have increased it further but I thought that would be a little overkill.) Below I have an example of a level 3 Gaussian stack in b&w and color.
The Laplacian pyramid is the same except it uses the gaussian pyramid to find the bandpass (mid frequencies). For B&W and color I just calculated the gaussian stack (I did not make any pyramids) and subtracted the next layer in the stack by the current for N levels. I also tried to normalize the pictures because the Laplacian outputs were a little gross looking. Below I have an example of a level 3 Laplacian stack in b&w and color.
This is part of a whole oraple thing, we'll get to specifics later. Also I got left and right mixed up but just ignore that
WE HAVE MADE IT!!! Now we are going to blend 2 photos together. For regular credit there is a black and white oraple but also a color one because it is much cooler.
I'm going to show the Laplacian for this next one.
The most important thing I learnt this project was that working with frequencies wasn't boring. It was super fun to make all of these pictures! I am a lot better at debugging visually now too ): I also think I understand convolution now. (The verdict is out on that one though.)
Image of Troy from the disney channel; All animal crossing full body images (flora, chrissy, francine, cranston) from here; horse picture from here kim petras photo from pitchfork's coverage of the Met Gala; oski from californiagoldenblogs (i did the painting though)