-
Notifications
You must be signed in to change notification settings - Fork 9
/
Demo.m
54 lines (42 loc) · 1004 Bytes
/
Demo.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
%% Written by Muhammet Balcilar, France
% all rights reverved
clear all
clc
addpath('docde')
filename = 'Inputs/124084.jpg';
image = imread(filename);
%% Region Growing method
[Region1 Region2 Region3 Region4]=RegionGrowing(image);
figure; imshow(uint8(image));
hold on;
DrawLine(Region1);
hold off;
title('Scale 1');
figure; imshow(uint8(image));
hold on;
DrawLine(Region2);
hold off;
title('Scale 2');
figure; imshow(uint8(image));
hold on;
DrawLine(Region3);
hold off;
title('Scale 3');
figure; imshow(uint8(image));
hold on;
DrawLine(Region4);
hold off;
title('Scale 4');
%% Region merging method
% method has two parameters minimum adjacent pixel which means connected
% regions has at least this number of pixel connected
mnadj=10;
% threshold value to make decision to merge two region or nor
RMThresh=3.5;
RegionResult=RegionMerging(image,Region1,mnadj,RMThresh);
% figure results
figure; imshow(uint8(image));
hold on;
DrawLine(RegionResult);
hold off;
title('Final segmentation');