blob: f73aa819570a3048a464045f4ac12cbe9f2e734a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
clc;
close;
//Given image matrix is F
F = [1 2; 5 4]
//Given threshold value = 3
//Thresholded Image after applying Threshold
for i = 1:4
if (F(i) >= 3) then//If the pixel value is >= Threshold value,the output is 1
F(i) = 1;
else
F(i) = 0; //If the pixel value is not >= Threshold value, the output is 0
end
end
disp(F,'F = ','The Threshold Image is ')
|