function [ iXMinDist ] = AsymmetricDistanceComputationWDist(iXQ, YCDistMat, nRecall) %UNTITLED Summary of this function goes here % Detailed explanation goes here kk=size(YCDistMat,2); mm=size(YCDistMat,3); %imgSz=size(YSetMat,1); %subImgSz=imgSz/mm; Ntests=size(YCDistMat,1); 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 DistMat=squeeze(YCDistMat(ii,:,:)); 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