% zadaci za kolokvijum iz Raclab 2, jun 2017 clear clc % 1. zadatak % I=imread('cameraman.tif'); % I=double(I); % I2=I(1:128,:); % I3=I2.^0.3; % I4=I2.^1.8; % subplot(1,3,1), imshow(I2,[]), title('Orig') % subplot(1,3,2), imshow(I3,[]), title('gama 0.3') % subplot(1,3,3), imshow(I4,[]), title('gama 1.8') % 2. zadatak % I=imread('cameraman.tif'); % I8=bitget(I,8); % I7=bitget(I,7); % I6=bitget(I,6); % I5=bitget(I,5); % I4=bitget(I,4); % I3=bitget(I,3); % I2=bitget(I,2); % I1=bitget(I,1); % % I678=128*I8+64*I7+32*I6; % % imgDiff=(I-I678).^2; % myMSE=(1/65536)*sum(sum(imgDiff)); % myPSNR=20*log10(255/sqrt(myMSE)); % 3. zadatak % I=imread('cameraman.tif'); % I2=I(1:128,:); % I3=imnoise(I2,'salt & pepper', 0.04); % I4=ordfilt2(I3, 1, ones(5)); % I5=ordfilt2(I3, 25, ones(5)); % I6=ordfilt2(I3, 13, ones(5)); % subplot(2,3,1), imshow(I2) % subplot(2,3,2), imshow(I3) % subplot(2,3,4), imshow(I4) % subplot(2,3,5), imshow(I5) % subplot(2,3,6), imshow(I6)