Filters and Frequency
Mengyang Zhang
Finite Difference Operator
part 1.1
To calculate the partial derivatives of of D_x and D_y, I first turned these two vectors into a 2d matrix of [[1, -1]] for D_x and [[1],[-1]] for D_y.
Then apply the scipy.signal.convolve2d with the original picture
To calculate the gradient, the magnitude of the gradient is (dx ** 2 + dy ** 2) ** 1/2
partial derivative in dx
partial derivative in dy
gradient magnitude
edge Images
part 1.2
Compared with the previous ones, the DoG filters gives us more smooth edges, since guassian itself is a low-pass filter and blur the images
It also shows less noise compared with the previous one, since guassian will blur the noises
partial derivative in dx
partial derivative in dy
gradient magnitude
DoG filters ones
partial derivative in dx
partial derivative in dy
gradient magnitude
part 2.1 Image Sharpening
The process is to blur the image with the gaussian first and get low frequecies
Then substract it from the original image to get higher frequecy part.
Add the higher frequecies part onto the original image to get the sharpening effect.
taj
sharpened taj
etch
sharpened taj
berkeley
sharpened berkeley
part 2.2 hybrid images
In order to hybrid two images:
Blur one images with the guassian filters
Subtract the blurred image2 from the original image2 to get the higher frequecy part
Combine the two modified images
FFT analysis for the previous 3 pictures
Peng again
Me again
lol lol
More examples here
Part 2.3 Guassian and Laplacian Stacks
Guassian Stack production process:
First layer is the original image.
Use guassian blur the previous layer repeatedly
Laplacian Stack production process:
Get the guassian stacks for the original image first
Each layer of the laplacian stack is the result of subtract two adjacent gaussian layers
The last layer is the last layer of the gaussian stack
Mask for the orange and apple are a 2d matrix with the same shape, and left half 0, and the other half 1, or vice versa
General multiresolution process
calculate laplacian stacks for the images
calculate the guassian stacks for the masks
combine them for each level
add the laplacian stacks to get the final image
Lakers and moon