load clown
whos
imshow(X)
imshow(X,[])
imagesc(X)
Y = X;
Y(101:200,:) = zeros(100,320);
imagesc(Y)
Y(:,221:320) = 255*ones(200,100);
imagesc(Y)
imshow(Y,[])
Y = X;
Y = Y(1:2:end,1:2:end);
size(Y)
imagesc(Y)
Y = Y(1:2:end,1:2:end);
size(Y)
imagesc(Y)
imread('mandril.png')
X = imread('mandril.png');
size(X)
imshow(X,[])
X1 = X(:,:,1);
imagesc(X1)
X2 = X(:,:,2);
figure(2); imagesc(X2); colormap('gray')
X3 = X(:,:,3);
figure(3); imagesc(X3); colormap('gray')
XX = (X1+X2+X3)/3;
figure; imagesc(XX); colormap('gray')
X = imread('peppers.bmp');
imagesc(X)
whos X
X = double(X);
whos X
close all
X_updown = X(end:-1:1,:);
imagesc(X)
imagesc(X); colormap('gray')
imagesc(X_updown); colormap('gray')
size(X)
size(X_updown)
help meshgrid
size(X)
[X,Y] = meshgrid(1:512,1:512);
Z = double(imread('peppers.bmp'));
mesh(X,Y,Z)
Z = zeros(512,512);
Z(100:412,100:412) = ones(313,313);
imagesc(Z)
[X,Y] = meshgrid(1:512,1:512);
mesh(X,Y,Z)