solve matlab problems - image processing
I have 6 problems that need to be solved.The images for the problems will be provided. need it done in 4 days max
1. Write a function in Matlab that takes two arguments, a width parameter, w, and a variance parameter, s, and returns a 2D array containing a Gaussian kernel of the desired dimension and variance, the peak of the Gaussian should be in the center of the array. Make sure to normalize the kernel such that the sum of all the elements in the array is 1. Use this function and the conv2 routine to convolve the indoors1 and indoors1-noise arrays with a 5 by5 Gaussian kernel with sigma of 1. Repeat with a 11 by 11 Gaussian kernel with a sigma of 3. Comment on the difference between the two images. Try the same thing with all the other pairs of images (indoors2, outdoors1, outdoors2 and outdoors3). Turn in the resulting images produced from the noisy data only, along with your Matlab code.
2. The Gaussian kernel is separable which means that convolution with a 2D Gaussian can be accomplished by convolving the image with 2 1D Gaussian, one in the x direction and another in the y direction. Repeat the 2 convolutions you did in question 1 using this scheme. you can still use conv2 to convolve the indoor and outdoor images with each of the 1D kernels. Verify that you get the same results that you did in question 1 by computing the maximum difference between the arrays produced with the two methods. Turn in your Matlab code. (You don't have to turn in the images for this part)
3. Convolve an 11 by 11 Gaussian with sigma = 1 with the discrete approximation to the Laplacian kernel given in class. (i.e., [0 1 0; 1 -4 1; 0 1 0] or [1 1 1; 1 -8 1; 1 1 1]) Plot this 2D function using mesh function. Turn in this 3D plot. Do you see why this is referred to as the Mexican hat filter?
4. Implement in Matlab an edge detector based on locating the zero crossings of the Laplacian. More specifically write a routine that first convolves the input image with the Mexican hat kernel you produced in question 3 then searches the output array for locations where the value changes from positive to negative between neighboring pixels and the magnitude of the change is greater than some specified threshold. Test your program on the image outdoors1 and find a threshold value which seems to yield acceptable results.
5. Implement in Matlab the first two steps of the Canny edge extraction algorithm of the text CANNY_ENHANCER, NONMAX_SUPPRESSION. Apply these steps to all of the images then apply an appropriate threshold to the edge strength values to select what you think are the most important edges. Compare the outputs from outdoorsI and outdoorsI_noise, and indoorsJ, and indoorsJ_noise(I= 1,2, J = 1,2,3). Also compare the outputs for outdoors1 between the zero crossing and Canny detectors. Turn in the results along with the Matlab code.
6. Implement in Matlab the third step of the Canny algorithm HYSTERESIS_THRESH. Select two appropriate thresholds for all the images. Turn in the results along with the Matlab code