Firstly, I computed partial derivative of image with respect to x and y by convolving it with x and y filter. Then, I computed sum of squares of two partial dericative (dx, dy), which is im_dx**2 + im_dy**2. After that, gradient descent was computed by taking square root of it. Finally, I binarized the gradient descent to make edge detection easier. Threshold for binarzing was 0.25
Partial derivative of image (dx) |
Partial derivative of image (dy) |
Gradient Magnitude of image |
Binarized Graident Magnitude of image |
In this part, we will convolve the image first by with gaussian filter. This will blur the image, and therefore can reduce noise in binarized gradient magnitude.
Blurred Cameraman Image |
|
Partial derivative of blurred image (dx) |
Partial derivative of blurred image (dy) |
Gradient Magnitude |
Binarized Graident Magnitude |
Since image is blurred by convolving with gaussian filter, Binarized gradient magnitude of blurred
image contains much less noise than previous one.
Partial derivative of gaussian filter (dx) |
Partial derivative of gaussian filter (dy) |
Convolution of original image and dx of gaussian filter |
Convolution of original image and dy of gaussian filter |
Gradient Magnitude |
Binarized Graident Magnitude |
Single convolution and double convolution gave us same result.
Original |
Blurred |
Sharpened |
Original |
Blurred |
Sharpened |
From this tiger image, we can see that sharpened tiger has more clear eyebrows ans whisker.
Aligned_cat |
Aligned_derek |
|
High-Pass |
Low-Pass |
Hybrid |
Aligned_human |
Aligned_samoyed |
|
High-Pass |
Low-Pass |
Hybrid |
I tried with several sigma values for high pass and low pass filter. For both filters, kernel size was 3*sigma. As I increased sigma value for high pass filter, high pass filtered image became more clear as shown below.
Sigma: 1 |
Sigma: 5 |
For low pass filter, as I increased sigma value, low pass filtered image became more blurred as shown below.
Sigma: 1 |
Sigma: 10 |
Even though I blurred samoyed image with high sigma value, black nose and mouth of samoyed did not get lighter. Hence, in the hybrid image, we can still see black nose and mouth of samoyed from a close distance.
Human Fourier |
Samoyed Fourier |
High Pass Human Fourier |
Low Pass Samoyed Fourier |
Hybrid Fourier |
Aligned_lion |
Aligned_woman |
|
High-Pass |
Low-Pass |
Hybrid |
Lion Fourier |
Woman Fourier |
High Pass Lion Fourier |
Low Pass Woman Fourier |
Hybrid Fourier |
depth0 |
depth1 |
depth2 |
depth3 |
depth4 |
depth0 |
depth1 |
depth2 |
depth3 |
depth4 |
depth0 |
depth1 |
depth2 |
depth3 |
depth4 |
depth0 |
depth1 |
depth2 |
depth3 |
depth4 |
gray |
colored |
Banner |
Hulk |
Rooney |
Ronaldo |
This project was really fun. Out of many parts, I enjoyed hybrid image and multiresolution blending the most. It was interesting to learn that we can see low frequency image from long distance. Making a hybrid image with two images that I chose was really fun. Also, for multireolution blending, it was cool to blend two images without using photoshop. Out of three images that I blended, I liked rona1d0 (Cristiano Ronaldo with jersey number 10) the most.
tiger:https://psprices.com/region-pt/game/2604569/minefield-angry-tiger-face-gamer-avatar
human:https://kottke.org/18/12/ai-generated-human-faces-that-look-amazingly-real
samoyed:https://pixels.com/featured/portrait-of-samoyed-dog-on-white-background-sergey-taran.html
lion:https://www.redbubble.com/i/art-board-print/Lion-face-by-Wallfower/36562357.JUXJO
woman:https://dc-dermdocs.com/human-face-and-golden-ratio/
banner:https://twitter.com/rbbhulk
hulk:https://wallpapersafari.com/w/aR06SF
rooney:https://www.besoccer.com/new/watch-rooney-shirt-swap-rejected-on-pitch-by-ex-man-city-player
ronaldo:https://www.independent.co.uk/sport/football/cristiano-ronaldo-shirt-number-manchester-united-b1913375.html