-
Notifications
You must be signed in to change notification settings - Fork 0
/
cv_driver.m
85 lines (69 loc) · 1.93 KB
/
cv_driver.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
%% cv_driver.m
% This is the main file the some computer vision techniques
%Images provided
clear;
close all;
%Initial Image Readings
im_pic1 = imread('pic1.tif');
im_pic2 = imread('pic2.jpg');
bright = imread('brightness.jpg');
bchrome = imread('bchrominance.jpg');
rchrome = imread('rchrominance.jpg');
bcDec2x2 = imread('bcDecimation2.jpg');
bcDec4x4 = imread('bcDecimation4.jpg');
rcDec2x2 = imread('rcDecimation2.jpg');
rcDec4x4 = imread('rcDecimation4.jpg');
%Quantize an image
%Quantize a real number
%Enter real number, # of levels, min value, max value
quantize(241,4,100,240);
quantize(241.1,32,0,255);
%Quantize an image
Enter image & #bits per pixel
quantizeImg(im_pic1,6)
quantizeImg(im_pic1,3)
%Color Transform
colorTransform(im_pic2);
%Decimation
decimation(bchrome,2,2);
decimation(bchrome,4,4);
decimation(rchrome,2,2);
decimation(rchrome,4,4);
%Interpolation
interpolation(bchrome,2,2);
interpolation(bchrome,4,4);
interpolation(rchrome,2,2);
interpolation(rchrome,4,4);
%Image Enhancement
im = imread('racecar.tif');
enhanceImg(im,.6);
enhanceImg(im,2.215);
%Histogram Computation
en1 = imread('enhanced1.tif');
en2 = imread('enhanced2.tif');
histImg(im);
histImg(en1);
histImg(en2);
%Spatial Filtering
spatialFilt(im);
%Frequency Domain Filtering
frDomFilt(im);
%Gradient Base Edge Detection
fig = imread('h2fig1.png');
gradEdgeDetect(fig);
%Sobel Edge Detection
cam = imread('cameraman.png');
sobelEdge(cam);
%Edge Detection with Laplacian of Gaussian (LoG)
LapGauss(cam);
%Template Matching
im_letter = imread('famous.jpg');
im_n = imread('n_famous.jpg');
template_match(im_letter, im_n);
%Harris Corner Detection
im_triangle = imread('noisytriangle.jpg');
im_triangle_rotate = imread('rotatetriangle.jpg');
harris_corner( im_triangle );
%Hough Transform
im_triangle = imread('noisytriangle.jpg');
hough_line(im_triangle); % hough line function