Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ad7d794

Browse files
Contrast Stretching
1 parent 2bc8caa commit ad7d794

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
3 MB
Binary file not shown.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
%Contrast stretching
2+
%lt=5 and ut=10
3+
close all;
4+
close all;
5+
clc;
6+
a=imread('pout.tif');
7+
subplot(2,1,1);
8+
imshow(a);
9+
[m,n]=size(a);
10+
b=a;
11+
t1=input('enter threshold value1');
12+
t2=input('enter threshold value2');
13+
for i=1:1:m
14+
for j=1:1:n
15+
if(a(i,j)<t1)
16+
b(i,j)=0.5*t1;
17+
else if(a(i,j)<t2 & a(i,j)>t1)
18+
b(i,j)=2*(a(i,j)-t1) + 0.5*t1;
19+
else
20+
b(i,j)=0.5*(a(i,j)-t2) + 2*(t2-t1) + 0.5*t1;
21+
end
22+
end
23+
end
24+
end
25+
subplot(2,1,2)
26+
imshow(b);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /