1. Filters
In class, we have discussed the usage of two different filters, i.e., Gaussian filter and Median filter.
1.
[5] Describe the similarity of two filters in one sentence.
Gaussian filter and Median filter both blurs (and can be used for denoising) the target image since they replace the original pixel value to weighted sum or median sampling the local region’s (itself + neighbors) pixel values.
2.
[5] Describe one key difference of two filters in one sentence.
Gaussian filter consists of sampled 2D gaussian distribution and can be applied by direct convolution operation, but Median filter cannot since it just replaces the pixel with median value of neighbors inside the filter.
3.
[4] Assume we have an image with drastic change in magnitude as below (i.e., checkerboard). Which one of the two filters would preserve the boundaries of black boxes
better? In other words, which one would make the output less blurry?
Median filter would make the output less blurry than Gaussian filter.
4.
[6] Describe the reason in one sentence.
If we assume general small sized (odd-length) filter, unlike Gaussian filters that will show gray values (seems to be blurry) at the boundary between black and white region, Median filters will produce exact white values when applied to white pixels and black values when applied to black pixels which maintains existing patterns in all region.
2. Cross-correlation
Assume we have three image patches whose shapes are identical, i.e., , where and for all .
1.
[8] Calculate cross-corrleation of the patches , .
The cross-correlation is derived by maximizing the similarity of the overlapped region of two images. To find the most similar region of two images , generally we can find which minimizes below.
Roughly we can maximize to find the target and we call this as the cross-correlation of image on template .
However, all of the images have the same size of , the sliding region out of the range (ouside the image) should be modified as below.
This can be seen that it is the same as the result of convolution with itself using zero-padding.
In same sense, we can find the cross correlation of image on template as below.|
Also this can be seen that it is twice the result of convolution with itself using zero-padding.
2.
[8] Calculate normalized cross-correlation , .
Since the cross-correlation can give unwanted result if there exists the region which gives higher value of product sum of two image than exact matching region, we can apply noramlization on the given cross-correlation to handle this problem.
We used to simplify the first row equation to be second row equation.
In the same way, we can calculate normalized cross-correlation of image on template .
3.
[4] Compare the result of two different cross-correlations in one or two sentence.
The original cross-correlation shows , but the normalized cross-correlation shows . The original cross-correlation will fail to find matching region which has pixel values of such as , of the original image region, but the normalized cross-correlation will not.
(Note: For question 2-1 and 2-2, you must show the derivation of your answer to get the full credit.)
3. Fourier Frequency Spectrum
For the outcome of Fourier Transform :
1.
[5] Derive the phase spectrum .
Below figure is the visualization of the output of Fourier transform in 2D coordinate system where -axis indicates real domian and -axis indicates imaginary domain with phase spectrum indicated.
Since the phase spectrum indicates the angle of vector with -axis as above, we can say the result as .
2.
[5] Derive the power spectrum .
Below figure is the visualization of the output of Fourier transform in 2D coordinate system where -axis indicates real domian and -axis indicates imaginary domain with magnitude spectrum indicated.
The magnitude spectrum of the is . Since the power spectrum is the square of the magnitude spectrum, we can say the result as .
4. Gaussian Pyramids
In this question, we are applying Gaussian pyramid to a greyscale image ().
1.
[5] We would like to apply Gaussian smoothing first. If we use 2D Gaussian
filter, how many multiplications are required to obtain blurred image ?
For each pixel in , we can think of applying 2D Gaussian filter on it. Since applying filter on a pixel needs sum of product of neighborhood pixels, we need 25 times of multiplication on each pixel in original image .
Since we have pixels on , we need total times of multiplications which is times.
2.
[5] If we use two 1D Gaussian filters instead of one 2D Gaussian filter, how many
multiplications are required to obtain ?
Consider the case we applying vertical 1D Gaussian filter with size of .
For each row of image we can think of applying 1D Gaussian filter on it. Since applying filter on a row need sum of product of 5 neighborhood rows, we need 5 times of multiplication on each row in original Image .
Since we have rows on , we need total times of multiplication which is times.
Without loss of generality, we can think of applying horizontal 1D Gaussian filter with size of similar as vertical case. Then, we can know this process also needs times of multiplications.
Thus, we totally need times of multiplication in this case.
3.
[5] Can we replace a 2D filter with two 1D filters to compute the Laplacian of an
image? Explain your answer in one sentence.
Since we use Difference of Gaussian (DoG) to compute the Laplacian of an image (because the computation cost of direct Laplacian is expensive) and 2D Gaussian filter can be replaced to two 1D Gaussian filter (vertical, horizontal), we can replace a 2D filter with two 1D filters to compute the Laplacian of an image.
4.
[5] Is multi-resolution correlation more time-efficient than single-resolution correla-
tion for template matching? Explain your answer in one sentence.
Generally, using multi-resolution correlation techniques such as image pyramid can be used to find strong matches between small template and small image which allows to reduce iteratation for finding matches for high resolution images, ultimately reduce time for matching compared to using single-resolution correlation (more time efficient).
(Hint 1: If we apply 2D Gaussian filter to an image , the number of multiplications required to obtain is 81.)
(Hint 2: Think how we actually compute the Laplacian of an image.)
(Note: For question 4-1 and 4-2, assume zero-padding and count as a valid multiplication. You must show the derivation of your answer to get the full credit.)