You are on page 1of 4

>> a=[1 2 3 4 5 6 9 8 7]

a=
1 2 3 4 5 6 9 8 7

>> t=0:2:20
t=
0 2 4 6 8 10 12 14 16 18 20

>> b=a+2
b=
3 4 5 6 7 8 11 10 9

>> c=a+b
c=
4 6 8 10 12 14 20 18 16

>> sin(pi/4)
ans =
0.7071

>> y=sin(pi/6)
y=
0.5000

>> y=asin(0.5)
y=
0.5236

>> t=25; x=43; y=15.25; z=8.2


z=
8.2000

>> M=4*x^2+3*y+10
M=
7.4518e+03

>> N=(eps^(2*x))+x
N=
43

>> O=sqrt(1/(x+y)+(i/t+z))
O=
2.8666 + 0.0070i

>> P=4*(eps^(-x/2))*(sin(pi*x))
P=
Inf

A
clear, close all
I=imread('pout.tif');
%% Now call imshow to display I.
imshow(I);

whos

figure, imhist(I)% Display a histogram of I in a new figure.


I2=histeq(I);
figure, imshow(I2)
figure,imhist(I2)% Show the histogram for the new image I2

imwrite(I2,'pout2.png');

imfinfo('pout2.png')

I=imread('rice.png');
imshow(I)

background=imopen(I,strel('disk',15));
%To see the estimated background image, type
imshow(background)

figure, surf(double(background(1:8:end,1:8:end))), zlim([0,255]);


set(gca,'ydir','reverse');

I2=imsubtract(I,background); figure,imshow(I2)
I3=imadjust(I2,stretchlim(I2), [0 1]);
% Display the newly adjusted image.
figure, imshow(I3);

level=graythresh(I3);
bw=im2bw(I3,level);
figure, imshow(bw)

I=imread('rice.png');
J=imread('cameraman.tif');
K=imadd(I,J);
imshow(K)

RGB=imread('kids.tif');
RGB2=imadd(RGB, 50);
subplot(1,2,1); imshow(RGB);
subplot(1,2,2); imshow(RGB2);

rice=imread('rice.png');
background=imopen(rice,strel('disk',15));
rice2=imsubtract(rice, background);
imshow(rice), figure, imshow(rice2);
Z=imsubtract(I,50);

I=imread('rice.png');
J=immultiply(I,1.2);
imshow(I);
figure, imshow(J)

I=imread('rice.png');
background=imopen(I, strel('disk', 15));
Ip=imdivide(I,background);
imshow(Ip,[])
I=imread('rice.png')
I2=imread('cameraman.tif');
K=imdivide(imadd(I,I2), 2); % not recommended
K=imlincomb(.5,I,.5,I2); % recommended

%[1 size(A,1)].
A=magic(5);
x=[19.5 23.5];
y=[8.0 12.0];
image(A,'XData', x, 'YData', y), axis image, colormap(jet(25))

RGB = imread('saturn.png');
I = rgb2gray(RGB);
h = [1 2 1; 0 0 0; -1 -2 -1];
I2 = filter2(h,I);
imshow(I2,[]), colorbar

I=imread('coins.png');
imshow(I)
BW1=edge(I,'sobel');
BW2=edge(I,'canny');
imshow(BW1)
figure, imshow(BW2)
I=imread('coins.png');
imshow(I)
BW=im2bw(I);
imshow(BW)

dim=size(BW)
col=round(dim(2)/2)-90;
row=min(find(BW(:,col)))
imshow(I)
hold on;
plot(boundary(:,2), boundary(:,1),'g','LineWidth',3);

BWfilled=imfill(BW,'holes');
boundaries=bwboundaries(BWfilled);
for k=1:10
b=boundaries{k};
plot(b(:,2), b(:,1),'g','LineWidth',3);
end

I=imread('circuit.tif');
rotI=imrotate(I,33,'crop');
figI=imshow(rotI);
BW=edge(rotI,'canny');
figure, imshow(BW);
I=imread('eight.tif');
imshow(I)
K=rangefilt(I);
figure, imshow(K)

I=imread('peppers.png');
I=I(60+[1:256],222+[1:256],:);% crop the image
figure; imshow(I); title('Original Image');

LEN=31;
THETA=11;
PSF=fspecial('motion',LEN,THETA); % create PSF
Blurred=imfilter(I,PSF,'circular','conv');
figure; imshow(Blurred); title('Blurred Image');

You might also like