clear all; close all; %ako pracovat s obrazkom po nacitani z jpg suboru ... obr= imread('wpeppers.jpg'); subplot(4,2,1), image(obr); axis equal colormap(gray(256)); obrg=rgb2gray(obr); subplot(4,2,2), image(obrg); axis equal posx=10 posy=10 OP=obrg(posy:end,posx:end); ONP=obrg(1:(512-posy+1),1:(512-posx+1)); subplot(4,2,3), image(ONP); axis equal subplot(4,2,4), image(OP); axis equal AC=xcorr2(ONP,ONP); max_AC=max(max(abs(AC))); [ACI_ROW,ACI_COL]=find(AC==max_AC) LAC=AC*255.0/max_AC; subplot(4,2,5), image(LAC); axis equal CC=xcorr2(ONP,OP); max_CC=max(max(abs(CC))); [CCI_ROW,CCI_COL]=find(CC==max_CC) LCC=CC*255.0/max_CC; subplot(4,2,6), image(LCC); axis equal DLT=abs(CC-AC); max_DLT=max(max(abs(DLT))); LDLT=DLT*255.0/max_DLT; subplot(4,2,7), image(LDLT(490:520,490:520)); axis equal