Skip to content

Commit 2bc8caa

Browse files
Image Thresholding
1 parent 51730ce commit 2bc8caa

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
%thresholding
2+
%threshold=120
3+
clear all;
4+
a=imread('pout.tif');
5+
[m n]=size(a);
6+
7+
t=input('enter the threshold value');
8+
for i=1:1:m
9+
for j=1:1:n
10+
if (a(i,j)<t)
11+
b(i,j)=0;
12+
else
13+
b(i,j)=255;
14+
end
15+
end
16+
end
17+
subplot(1,2,1)
18+
imshow(a);
19+
subplot(1,2,2)
20+
imshow(b);
21+
Binary file not shown.

0 commit comments

Comments
 (0)