120 likes | 242 Vues
This report covers various image processing techniques implemented in MATLAB, focusing on the analysis of the "sun_dragon.jpg" image. It includes extracting HSV channels—Red, Green, and Blue—using simple MATLAB commands. The report also explores Laplacian of Gaussian and Gaussian filtering to enhance image features. Additionally, it examines the derivatives of filtered images, gradient magnitude, and non-maximal suppression. Further, the implementation of the Lucas-Kanade optical flow algorithm is discussed, assessing its efficiency compared to hierarchical approaches.
E N D
CFU REU Week 1 Report Shelby Thompson
Session 2 Homework 1 For the first homework, I first read into MatLab a picture (the one on the right). I read this in with the simple MatLab command imread (sun_dragon.jpg); I then proceeded to get the picture representations of the hsv (hue, saturation, and value) channels.
Session 2 Homework 1 The image to the left represents the red hsv channel of the original picture. It is created using the command: rI1=I2(:,:,1); to create and assign the picture to a variable, and figure;imshow(rI1); to show it.
Session 2 Homework 1 Continued The image to the right represents the green hsv channel of the original picture. It is created using the command: gI1=I2(:,:,2); to create and assign the picture to a variable, and figure;imshow(gI1); to show it.
Session 2 Homework 1 Continued The image to the left represents the blue hsv channel of the original picture. It is created using the command: bI1=I2(:,:,3); to create and assign the picture to a variable, and figure;imshow(bI1); to show it.
Session 2 Homework 1 Continued The image to the right represents the Laplacian of Gaussian using separability. It is achieved using this code: LoG=edge(rgb2gray(imread('sun_dragon.jpg')),'log', 0.5, 0.05); figure;imshow(LoG);
Session 2 Homework 1 Continued The image to the left represents the Guassian filtered smoothed version of the original image. It is achieved using the code: hg=fspecial('gaussian',[35 35],50); I3=conv2(rgb2gray(imread('sun_dragon.jpg')),hg,'same'); figure;imshow(uint8(I3));
Session 2 Homework 1 Continued The image to the right represents the derivative of the filtered image. It is achieved using this code: gaussder=conv2(fspecial('gaussian',[35 35],50),[1 0 -1],'valid'); figure;surf(gaussder); gaussI1=conv2(rgb2gray(imread('sun_dragon.jpg')),gaussder); figure;imshow(gaussI1);
Session 2 Homework 1 Continued The image to the left represents the magnitude of the gradient. It is achieved using the code: gradMag=sqrt(vergradI2.^2+horgradI2.^2); figure;imshow(uint8(gradMag));
Session 2 Homework 1 Continued The image to the right represents the non-maximal suppression of the image. It is achieved using this code: imSup=edge(rgb2gray(imread('sun_dragon.jpg')),'canny'); figure;imshow(imSup);
Session 3 Homework 2 Homework 2 focused highly on using SIFT on images. I performed the SIFT using this code: pfx = fullfile(vl_root,'data', 'Derpy.png') ; I = imread(pfx) ; image(I) ; I = single(rgb2gray(I)) ; [f,d] = vl_sift(I) ; perm = randperm(size(f,2)) ; sel = perm(1:50) ; h1 = vl_plotframe(f(:,sel)) ; h2 = vl_plotframe(f(:,sel)) ; set(h1,'color','k','linewidth',3) ; set(h2,'color','y','linewidth',2) ; h3 = vl_plotsiftdescriptor(d(:,sel),f(:,sel)) ; set(h3,'color','g'); fc = [100;100;10;-pi/8]; [f,d] = vl_sift(I,'frames',fc); fc = [100;100;10;0]; [f,d] = vl_sift(I,'frames',fc,'orientations'); In order to get the image on the right.
Session 5 Homework 4 Homework 4 focused on Optical Flow, specifically the Lucas-Kanade algorithm. I first implemented the Lucas-Kanade algorithm and examined the results on two images of a car. I then implemented a Hierarchical Lucas-Kanade algorithm on two images of a table. I examined both algorithms and decided the regular Lucas-Kanade algorithm is much more efficient, as it takes a much shorter time to run than the Hierarchical Lucas-Kanade. The image below is the image of the car generated by the algorithm.