IIII

Classified in Computers

Written at on English with a size of 2.88 KB.

 
Spatial                       
clear all;
clc;
a=imread('coin.Jpg');
[row col dim]=size(a);
i=1;j=1;
for x=1:10:row;
    for y=1:10:col
    c(i,j)=a(x,y);
    j=j+1;
end
j=1;
i=i+1;
end
figure(1);
subplot(2,2,1);
imshow(a);
figure(2);
subplot(2,2,2);
imshow(c);
figure(3);
imagesc(c);
colormap('gray');
Digital Negative
clc;
a=imread('Cameraman.Jpg');
f=double(a);
[row col dim]=size(f);
b=255;
g=b-a;
subplot(2,2,1);
imshow(a);
title('Original Image');
subplot(2,2,3);
colormap(gray);
imshow(g);
title('Negative Image');
Threshold
clc;
a=imread('coin.Jpg');
c=rgb2gray(a);
f=double(c);
[row col dim]=size(f);
t=input('Enter the threshold value=');
for x=1:1:row
    for y=1:1:col
    if f(x,y)=0;
else
    g(x,y)=255;
end
end
end
subplot(2,2,1);
imshow(a);
title('Original Image');
subplot(2,2,2);
imshow(c);
title('rgb2gray');
subplot(2,2,3);
imshow(g);
title('Threshold Image');
Prewitts mask

clc;

figure(1);

a=imread('ttt.Tiff');

PH=[-1 0 1;-1 0 1;-1 0 1];

PV=[-1 -1 -1;0 0 0;1 1 1];

P=PH+PV;

RH=conv2(a,PH);

imshow(RH);

figure(2);

RV=conv2(a,PV);

imshow(RV);

figure(3);

R=RH+RV;

imshow(R);

figure(4);

RP=conv2(a,P);

imshow(RP);

figure(5);

imshow(a);

figure(6);

p=imnoise(a,'gaussian');

imshow(p);

Bit Plane Slicing 

clc;

clear all;

a=imread('Camera.Tiff');

f=double(a);

[row col dim]=size(f);

r=input('enter number of bit=');

 for x=1:1:row

   for y=1:1:col

    c=dec2bin(f(x,y),8);

    d=c(r);

    w(x,y)=double(d);

    if w(x,y)==49

       w(x,y)=255;

    else

       w(x,y)=0;

     end

   end

end

imshow(uint8(w));

imagesc(w);





Entradas relacionadas: