Prev: Binarisation
Next: Using Matlab Builder JA
From: Khan on 15 Mar 2010 10:13 > Hello Every body > I am working on a project to search similarities between textures of an image. > I do not know much about matlab, so please explain the following to me as I am confused about it... > > for i = 0:nbdep-1 > a = [max(1,1+i*direction(1)),max(1,1+i*direction(2))]; > b = [min(lign,lign+i*direction(1)),min(colo,colo+i*direction(2))]; > c = [max(1,1-i*direction(1)),max(1,1-i*direction(2))]; > d = [min(lign,lign-i*direction(1)),min(colo,colo-i*direction(2))]; > > covario(i+1) = distance(imag(a(1):b(1),a(2):b(2)),imag(c(1):d(1),c(2):d(2)),dis); > end > > plot(0:nbdep-1,covario); > deriv = sign(covario(1:nbdep-1)-covario(2:nbdep)); > signe = deriv(1:nbdep-2)-deriv(2:nbdep-1); > > signe = signe<0; > signe = [signe, 0,0]; > hold on > > maxiloco = find((signe.*covario)>0); > maxiloco = [1, maxiloco]; > plot(maxiloco, covario(maxiloco),'*') > nbmaxi = size(maxiloco,2); > moyenne = abs(maxiloco(1:nbmaxi-1)-maxiloco(2:nbmaxi)); > moyenne = mean(moyenne(find(moyenne>5))) > > Thanks
|
Pages: 1 Prev: Binarisation Next: Using Matlab Builder JA |