Suppose that the image consists of one or more objects and background, each having distinct gray-level values. The purpose of thresholding is to separate these areas from each other by using the information given by the histogram of the image.
A useful and helpful blog of reader's interests posts containing high quality and more quantity files in less pages, brought by the Nareddula Rajeev Reddy.
Search, what's on your mind?
Plausible Image Thresholding Matlab Codes
1 comment:
Share to your friends by Share to XShare to FacebookShare to Pinterest
Useful, kindly recommend
Labels:
MATLAB codes
Maintaining significant information of the image
Matlab Code
Input
Output / Results
clear;
% Threshold level parameter alfa:
alfa=0.1;% less than 1/3
[x,map]=gifread('lena.gif');
ix=ind2gray(x,map);
I_max=max(max(ix));
I_min=min(min(ix));
level1=alfa*(I_max-I_min)+I_min;
level2=2*level1;
level3=3*level1;
thix1=max(ix,level1.*ones(size(ix)));
thix2=max(ix,level2.*ones(size(ix)));
thix3=max(ix,level3.*ones(size(ix)));
figure(1);
colormap(gray);
subplot(2,2,1);
imagesc(ix);
title('lena');
subplot(2,2,2);
imagesc(thix1);
title('1');
subplot(2,2,3);
imagesc(thix2);
title('2');
subplot(2,2,4);
imagesc(thix3);
title('3');
Input
![]() |
lena.gif |
Output / Results
![]() |
1 |
![]() |
2 |
![]() |
3 |
No comments:
Share to your friends by Share to XShare to FacebookShare to Pinterest
Useful, kindly recommend
Labels:
MATLAB codes
Improvement of signal-noise ratio of an image
Matlab Code
Input
Output / Results
clear;
% Threshold level parameter alfa:
alfa=0.1;% less than 1/3
[x,map]=gifread('lena.gif');
ix=ind2gray(x,map);
I_max=max(max(ix));
I_min=min(min(ix));
level1=alfa*(I_max-I_min)+I_min;
level2=2*level1;
level3=3*level1;
thix1=max(ix,level1.*ones(size(ix)));
thix2=max(ix,level2.*ones(size(ix)));
thix3=max(ix,level3.*ones(size(ix)));
figure(1);
colormap(gray);
subplot(2,2,1);
imagesc(ix);
title('lena');
subplot(2,2,2);
imagesc(thix1);
title('one');
subplot(2,2,3);
imagesc(thix2);
title('two');
subplot(2,2,4);
imagesc(thix3);
title('three');
Input
![]() |
lena.gif |
Output / Results
![]() |
one |
![]() |
two |
![]() |
three |
No comments:
Share to your friends by Share to XShare to FacebookShare to Pinterest
Useful, kindly recommend
Labels:
MATLAB codes
Percentage level Image Thresholding
Matlab Code
Input
Output / Results
clear;
% Threshold level parameter alfa:
alfa=0.1;% less than 1/3
[x,map]=gifread('lena.gif');
ix=ind2gray(x,map);
I_max=max(max(ix));
I_min=min(min(ix));
level1=alfa*(I_max-I_min)+I_min;
level2=2*level1;
level3=3*level1;
thix1=max(ix,level1.*ones(size(ix)));
thix2=max(ix,level2.*ones(size(ix)));
thix3=max(ix,level3.*ones(size(ix)));
figure(1);
colormap(gray);
subplot(2,2,1);
imagesc(ix);
title('lena');
subplot(2,2,2);
imagesc(thix1);
title('10%');
subplot(2,2,3);
imagesc(thix2);
title('20%');
subplot(2,2,4);
imagesc(thix3);
title('30%');
Input
![]() |
lena.gif |
Output / Results
![]() |
10% |
![]() |
20% |
![]() |
30% |
No comments:
Share to your friends by Share to XShare to FacebookShare to Pinterest
Useful, kindly recommend
Labels:
MATLAB codes
Reduction of the noise effect in an image
Matlab Code
Input
Output / Results
clear;
% Threshold level parameter alfa:
alfa=0.1;% less than 1/3
[x,map]=gifread('lena.gif');
ix=ind2gray(x,map);
I_max=max(max(ix));
I_min=min(min(ix));
level1=alfa*(I_max-I_min)+I_min;
level2=2*level1;
level3=3*level1;
thix1=max(ix,level1.*ones(size(ix)));
thix2=max(ix,level2.*ones(size(ix)));
thix3=max(ix,level3.*ones(size(ix)));
figure(1);
colormap(gray);
subplot(2,2,1);
imagesc(ix);
title('lena');
subplot(2,2,2);
imagesc(thix1);
title('noise effect reduced by one alfa');
subplot(2,2,3);
imagesc(thix2);
title('noise effect reduced by two alfa');
subplot(2,2,4);
imagesc(thix3);
title('noise effect reduced by three alfa');
Input
![]() |
lena.gif |
Output / Results
![]() |
noise effect reduced by one alfa |
![]() |
noise effect reduced by two alfa |
![]() |
noise effect reduced by there alfa |
No comments:
Share to your friends by Share to XShare to FacebookShare to Pinterest
Useful, kindly recommend
Labels:
MATLAB codes
Subscribe to:
Posts (Atom)