-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlabseven_two.m
More file actions
39 lines (39 loc) · 1.41 KB
/
labseven_two.m
File metadata and controls
39 lines (39 loc) · 1.41 KB
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
%Title: To study the implemenntation of edge detection filters (Laplace).
%Developed By: Rabi Raj Khadka
%Date: July 3, 2017
%-------------------------------------------------------------------
%Three critical statements
%-------------------------------------------------------------------
close all;
clear variables;
clc;
%-------------------------------------------------------------------
%Image creation
%-------------------------------------------------------------------
a=[150 150 10 150 150 150 150 150;
150 150 10 150 150 150 150 150;
150 150 10 150 150 150 150 150;
10 10 10 10 10 10 10 10 ;
150 150 10 150 150 150 150 150;
150 150 10 150 150 150 150 150;
150 150 10 150 150 150 150 150;];
a=uint8(a);
%Laplace Filter Mask
h=[0 1 0;1 -4 1;0 1 0];
c=conv2(a,h);
figure;imshow(c);
%-------------------------------------------------------------------
%Implementation on specific image
%-------------------------------------------------------------------
x=imread('img\neuromancer.jpg');
x=rgb2gray(x);
x=im2double(x);
y=conv2(x,h,'valid');
%-------------------------------------------------------------------
%Implementation of built in laplace filter on specific image
%-------------------------------------------------------------------
h=fspecial('laplacian');
z=conv2(x,h,'valid');
figure;
subplot(121),imshow(y),title('Laplace filtering on image ');
subplot(122),imshow(z),title('Built in laplace filter ');