123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- function [ iXMinDist ] = AsymmetricDistanceComputation(CSubSetMat, iXQ, YSetMat, nRecall)
- %UNTITLED Summary of this function goes here
- % Detailed explanation goes here
- kk=size(CSubSetMat,2);
- mm=size(CSubSetMat,3);
- imgSz=size(YSetMat,1);
- subImgSz=imgSz/mm;
- Ntests=size(YSetMat,2);
- DistMat=zeros(kk,mm);
- iXMinDist=zeros(Ntests,nRecall);
- for ii=1:Ntests
- for jj=1:mm
- DistMat(:,jj)=EuclideanDistancesMat(YSetMat((jj-1)*subImgSz+1:jj*subImgSz,ii),CSubSetMat(:,:,jj));
- end
- DistVec = SumCentroidsDistances(DistMat,iXQ);
- [~, iXMinDisttemp] = sort (DistVec);
- maxRec=size(iXMinDisttemp,2);
- if maxRec >= nRecall
- iXMinDist(ii,:)=iXMinDisttemp(:, 1:nRecall);
- else
- ouch=size(iXMinDisttemp,1);
- iXMinDist(ii,:)=[iXMinDisttemp, zeros(1,nRecall-maxRec)];
- end
- pp=double(ii/Ntests*100);
- if(pp<10)
- %fprintf('\b\b\b\b\b\b %2.2f%%',pp);
- else
- %fprintf('\b\b\b\b\b\b\b %2.2f%%',pp);
- end
- end
- % for rr=1:Ntests
- % for ii=1:Ntr
- % SEucDist=0;
- %
- % for jj=1:m
- % SEucDist=SEucDist+dEucXCent(iYQ(rr,jj),ii,jj)^2;
- % end
- % TEucDist(ii)=sqrt(SEucDist);
- % end
- % pp=rr/Ntests*100;
- % if(pp<10)
- % fprintf('\b\b\b\b\b\b%2.2f %%',pp);
- % else
- % fprintf('\b\b\b\b\b\b\b%2.2f %%',pp);
- % end
- % [~,indMin]=min(TEucDist);
- % iXMinDist(rr)=indMin;
- % end
- end
|