clear all; close all; if 0 %ako pracovat s obrazkom po nacitani z jpg suboru ... obr= imread('wpeppers.jpg'); %imageinfo('wpeppers.jpg') subplot(2,3,1), image(obr); colormap(gray(256)); obrg=rgb2gray(obr); subplot(2,3,2), image(obrg); N=512; robr=uint8(zeros(N,N,3)); gobr=uint8(zeros(N,N,3)); bobr=uint8(zeros(N,N,3)); robr(:,:,1)=obr(:,:,1); gobr(:,:,2)=obr(:,:,2); bobr(:,:,3)=obr(:,:,3); subplot(2,3,4), image(robr); subplot(2,3,5), image(gobr); subplot(2,3,6), image(bobr); end figure; %ako pracovat s obrazkom po nacitani z mat suboru ... X=load('woman.mat'); colormap(gray(256)); image(X.X); A=uint8(X.X); if 0 figure; %ked sa chceme pohrat s kontrastom ... colormap(gray(256)); h=imshow(A); hp = impixelinfo; imcontrast(h); end if 0 figure; subplot(2,2,1),imshow(A) B=imresize(A,1/8); subplot(2,2,2),imshow(B) C=imresize(B,8); subplot(2,2,3),imshow(C) D=imfuse(A,C, 'diff'); subplot(2,2,4),imshow(D) end if 0 figure; C=imrotate(A,45); subplot(2,2,3),imshow(C); end if 0 %detektory hrán figure; B = edge(A,'sobel'); C = edge(A,'log'); D = edge(A,'canny'); subplot(2,2,1),imshow(A); subplot(2,2,2),imshow(B); subplot(2,2,3),imshow(C); subplot(2,2,4),imshow(D); end if 0 %kontúry figure; entropy(A) subplot(1,2,1),imshow(A); subplot(1,2,2),imcontour(A); end if 0 %histogram figure; subplot(1,2,1),imshow(A); subplot(1,2,2),imhist(A); end if 0 %histEQ/CLAHE figure; subplot(2,2,1),imshow(A); subplot(2,2,2),imhist(A); %B=adapthisteq(A) B=histeq(A) subplot(2,2,3),imshow(B); subplot(2,2,4),imhist(B); end