30
A picture is worth more than a 1000 words. It can save a life. Arjun Watane

A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Embed Size (px)

Citation preview

Page 1: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

A picture is worth more than a 1000 words. It can save a life.

Arjun Watane

Page 2: A picture is worth more than a 1000 words. It can save a life. Arjun Watane
Page 3: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Gaussian Derivative • I = imread('brain_tumor_mri_1.jpg');• I2 = rgb2gray(I);• • k = fspecial('gaussian', [7 7] , 1); %Gaussian filter kernal• • kdx = conv2(k,[1 0 -1], 'valid');• %figure; surf(kdx);• kdy = conv2(k, [1; 0; -1], 'valid');• %figure; surf(kdy);• • imx = conv2(I2, kdx, 'valid');• imy = conv2(I2, kdy, 'valid');• • figure; imshow(I2);• %figure; imshow(imx);• figure; imshow(imy);• imwrite(imy, 'brainTumorMRI1_GaussianDerivative.jpg');

Page 4: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Gaussian Derivative

Page 5: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Edge Detector

• 6 edge-finding methods– Sobel– Prewitt– Roberts– Laplacian– Zero-Cross– Canny

• Tested on Groceries and a Brain MRI

Page 6: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Edge Detection on Groceries

I5 = imread('groceries.jpg');IBW = rgb2gray(I5);BW = edge(IBW, 'prewitt');figure; imshow(BW);

• Changed “groceries.jpg” with brain_mri_1.• Changed “prewitt” with sobel, canny, roberts,

Log, and zerocross.

Page 7: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Prewitt Edge Detection on Groceries

Page 8: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Canny Edge Detection on Groceries

Page 9: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Roberts Edge Detection on Groceries

Page 10: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Sobel Edge Detection on Groceries

Page 11: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Log Edge Detection on Groceries

Page 12: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Zerocross Edge Detection on Groceries

Page 13: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Edge Detection on Brain MRI (Tumor Detection)

Prewitt

ZeroCrossLoGSobel

RobertsCanny

Page 14: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Adaboost

• Pgm files work better. • Found online jpg to pgm converter.

Page 15: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Adaboost Face Detection

Page 16: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Adaboost Face Detection

Page 17: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Adaboost Face Detection

Page 18: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Harris Corner Detectorim = imread('groceries.jpg');im = rgb2gray(im);k = fspecial('gaussian', [15 15], 1); dx =[-1 0 1; -1 0 1; -1 0 1];%Derivative Masksdy = dx'; %transpose x to make y kdx = conv2(im, dx, 'valid'); %Image Derivativeskdy = conv2(im, dy, 'valid'); kdx2 = kdx.^2; %square every number in the matrixkdy2 = kdy.^2; kdxy = (kdx.*kdy); %multiply every number in the matrix with each other kdx2 = conv2(kdx2, k, 'same');kdy2 = conv2(kdy2, k, 'same');kdxy = conv2(kdxy, k, 'same'); H = [kdx2 kdxy; kdxy kdy2]; M = (kdx2.*kdy2 - kdxy.^2) - .04*(kdx2 + kdy2).^2; %Harris Corner Measure Equation imshow(M);imwrite(M, 'groceriesHarrisCorner.jpg');

Page 19: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Harris Corner Detector

Page 20: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

SVM

Page 21: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

SVM

Page 22: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Bag of Features

Page 23: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Optical Flow

Page 24: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

Optical Flow

Page 25: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

SIFT – Plot Descriptorspfx = fullfile(vl_root, 'data', 'obama3.jpg');I = imread(pfx);image(I); I = single(rgb2gray(I));[f,d] = vl_sift(I); perm = randperm(size(f,2));sel = perm(1:4);%4 represents the # of featuresh1 = 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') ;

Page 26: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

SIFT – Plot Descriptors

Page 27: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

SIFT – Plot Descriptors

Page 28: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

SIFT – Match Descriptor Pointspfx = fullfile(vl_root, 'data', 'obama1.jpg'); %receives, reads, grayscales, and resizes the

image from the vl_root directoryI = imread(pfx);figure; imshow(I);Ia = single(rgb2gray(I));Ia = imresize(Ia, [300 300]); pfx = fullfile(vl_root, 'data', 'obama3.jpg');I = imread(pfx);figure; imshow(I);Ib = single(rgb2gray(I));Ib = imresize(Ib, [300 300]); [fa, da] = vl_sift(Ia); %calculate sift points[fb, db] = vl_sift(Ib);[matches, scores] = vl_ubcmatch(da, db); %matches the points on the imagesm1 = fa(1:2, matches(1,:));m2 = fb(1:2, matches(2,:));m2(1, :) = m2(1,:)+size(Ia,2)*ones(1,size(m2,2)); X = [m1(1,:); m2(1,:)];Y = [m1(2,:); m2(2,:)];c = [Ia Ib];figure; imshow(c,[]);hold on;line(X(:,1:1:15), Y(:,1:1:15)) %draw lines

Page 29: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

SIFT – Match Descriptor Points

Page 30: A picture is worth more than a 1000 words. It can save a life. Arjun Watane

SIFT – Match Descriptor Points