Skip to content

Instantly share code, notes, and snippets.

@juniorhero
Created August 26, 2016 20:21
Show Gist options
  • Save juniorhero/4ab69f387e7af3b262b479055381bff3 to your computer and use it in GitHub Desktop.
Save juniorhero/4ab69f387e7af3b262b479055381bff3 to your computer and use it in GitHub Desktop.
a=imread('lena.png');
subplot(2,2,1);
imshow(a);
[M,N]=size(a);
title 'Original Image';
r1=input('enter value r1: ');
r2=input('enter value r2: ');
for i=1:1:M
for j=1:1:N
if a(i,j)>=r1 && a(i,j)<=r2
b(i,j)=255;
% d(i,j)=255;
else
b(i,j)=a(i,j);
% d(i,j)=0;
end
end
end
% s1=uint8(s);
subplot(2,2,2);
imshow(b);
title 'Output 1';
% subplot(2,2,3);
% imshow(d);
% title 'Output 2';
@juniorhero
Copy link
Author

untitled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment