亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? demo_2.m~

?? Shape registration by shape context: algorithm implemented by matlab and the paper. One of the best
?? M~
字號:
% Shape Context Demo #2% MNIST digits% load in the digit database (only needs to be done once per session)if ~(exist('train_data')&exist('label_train'))   load digit_100_train_easy;%   load digit_100_train_hard;end% choose which two digits to compare:mm=26;nn=27;%%%%%%Define flags and parameters:%%%display_flag=1;affine_start_flag=1;polarity_flag=1;nsamp=100;eps_dum=0.25;ndum_frac=0.25;        mean_dist_global=[];ori_weight=0.1;nbins_theta=12;nbins_r=5;r_inner=1/8;r_outer=2;tan_eps=1.0;n_iter=6;beta_init=1;r=1; % annealing ratew=4;sf=2.5;cmap=flipud(gray);%%%%%% image loading%%%V1=reshape(train_data(mm,:),28,28)';V1=imresize(V1,sf,'bil');V2=reshape(train_data(nn,:),28,28)';V2=imresize(V2,sf,'bil');[N1,N2]=size(V1);if display_flag   figure(1)   subplot(2,2,1)   imagesc(V1);axis('image')   title(int2str(mm))   subplot(2,2,2)   imagesc(V2);axis('image')   title(int2str(nn))   colormap(cmap)   drawnowend%%%%%% edge detection%%%[x2,y2,t2]=bdry_extract_3(V2);nsamp2=length(x2);if nsamp2>=nsamp   [x2,y2,t2]=get_samples_1(x2,y2,t2,nsamp);else   error('shape #2 doesn''t have enough samples')endY=[x2 y2];% get boundary pointsdisp('extracting boundary points...')[x1,y1,t1]=bdry_extract_3(V1);nsamp1=length(x1);if nsamp1>=nsamp   [x1,y1,t1]=get_samples_1(x1,y1,t1,nsamp);else   error('shape #1 doesn''t have enough samples')endX=[x1 y1];if display_flag   subplot(2,2,3)   plot(X(:,1),X(:,2),'b+')   hold on   quiver(X(:,1),X(:,2),cos(t1),sin(t1),0.5,'b')   hold off   axis('ij');axis([1 N2 1 N1])   title([int2str(length(x1)) ' samples'])   subplot(2,2,4)   plot(Y(:,1),Y(:,2),'ro')   hold on   quiver(Y(:,1),Y(:,2),cos(t2),sin(t2),0.5,'r.')   hold off   axis('ij');axis([1 N2 1 N1])   title([int2str(length(x2)) ' samples'])   drawnow	endif display_flag   [x,y]=meshgrid(linspace(1,N2,36),linspace(1,N1,36));   x=x(:);y=y(:);M=length(x);end%%%%%% compute correspondences%%%Xk=X;tk=t1;k=1;s=1;ndum=round(ndum_frac*nsamp);out_vec_1=zeros(1,nsamp);out_vec_2=zeros(1,nsamp);while s   disp(['iter=' int2str(k)])   disp('computing shape contexts for (deformed) model...')   [BH1,mean_dist_1]=sc_compute(Xk',zeros(1,nsamp),mean_dist_global,nbins_theta,nbins_r,r_inner,r_outer,out_vec_1);   disp('done.')   % apply the scale estimate from the warped model to the test shape   disp('computing shape contexts for target...')   [BH2,mean_dist_2]=sc_compute(Y',zeros(1,nsamp),mean_dist_global,nbins_theta,nbins_r,r_inner,r_outer,out_vec_2);   disp('done.')   if affine_start_flag      if k==1	 % use huge regularization to get affine behavior	 lambda_o=1000;      else	 lambda_o=beta_init*r^(k-2);	       end   else      lambda_o=beta_init*r^(k-1);   end   beta_k=(mean_dist_2^2)*lambda_o;   costmat_shape=hist_cost_2(BH1,BH2);   theta_diff=repmat(tk,1,nsamp)-repmat(t2',nsamp,1);%   costmat_theta=abs(atan2(sin(theta_diff),cos(theta_diff)))/pi;   if polarity_flag      % use edge polarity      costmat_theta=0.5*(1-cos(theta_diff));   else      % ignore edge polarity      costmat_theta=0.5*(1-cos(2*theta_diff));   end         costmat=(1-ori_weight)*costmat_shape+ori_weight*costmat_theta;   nptsd=nsamp+ndum;   costmat2=eps_dum*ones(nptsd,nptsd);   costmat2(1:nsamp,1:nsamp)=costmat;%   cvec=hungarian(costmat2);   cvec=hungarian_fast(costmat2);   % update outlier indicator vectors   [a,cvec2]=sort(cvec);   out_vec_1=cvec2(1:nsamp)>nsamp;   out_vec_2=cvec(1:nsamp)>nsamp;   X2=NaN*ones(nptsd,2);   X2(1:nsamp,:)=Xk;   X2=X2(cvec,:);   X2b=NaN*ones(nptsd,2);   X2b(1:nsamp,:)=X;   X2b=X2b(cvec,:);   Y2=NaN*ones(nptsd,2);   Y2(1:nsamp,:)=Y;   % extract coordinates of non-dummy correspondences and use them   % to estimate transformation   ind_good=find(~isnan(X2b(1:nsamp,1)));   n_good=length(ind_good);   X3b=X2b(ind_good,:);   Y3=Y2(ind_good,:);   if display_flag      figure(2)      plot(X2(:,1),X2(:,2),'b+',Y2(:,1),Y2(:,2),'ro')      hold on      h=plot([X2(:,1) Y2(:,1)]',[X2(:,2) Y2(:,2)]','k-');            if 1%	 set(h,'linewidth',1)	 quiver(Xk(:,1),Xk(:,2),cos(tk),sin(tk),0.5,'b')	 quiver(Y(:,1),Y(:,2),cos(t2),sin(t2),0.5,'r')      end      hold off      axis('ij')      title([int2str(n_good) ' correspondences (warped X)'])      axis([1 N2 1 N1])      drawnow	   end      if display_flag      % show the correspondences between the untransformed images      figure(3)      plot(X(:,1),X(:,2),'b+',Y(:,1),Y(:,2),'ro')      ind=cvec(ind_good);      hold on      plot([X2b(:,1) Y2(:,1)]',[X2b(:,2) Y2(:,2)]','k-')      hold off      axis('ij')      title([int2str(n_good) ' correspondences (unwarped X)'])      axis([1 N2 1 N1])      drawnow	   end   [cx,cy,E]=bookstein(X3b,Y3,beta_k);   % calculate affine cost   A=[cx(n_good+2:n_good+3,:) cy(n_good+2:n_good+3,:)];   s=svd(A);   aff_cost=log(s(1)/s(2));      % calculate shape context cost   [a1,b1]=min(costmat,[],1);   [a2,b2]=min(costmat,[],2);   sc_cost=max(mean(a1),mean(a2));      % warp each coordinate   fx_aff=cx(n_good+1:n_good+3)'*[ones(1,nsamp); X'];   d2=max(dist2(X3b,X),0);   U=d2.*log(d2+eps);   fx_wrp=cx(1:n_good)'*U;   fx=fx_aff+fx_wrp;   fy_aff=cy(n_good+1:n_good+3)'*[ones(1,nsamp); X'];   fy_wrp=cy(1:n_good)'*U;   fy=fy_aff+fy_wrp;   Z=[fx; fy]';   % apply the warp to the tangent vectors to get the new angles   Xtan=X+tan_eps*[cos(t1) sin(t1)];   fx_aff=cx(n_good+1:n_good+3)'*[ones(1,nsamp); Xtan'];   d2=max(dist2(X3b,Xtan),0);   U=d2.*log(d2+eps);   fx_wrp=cx(1:n_good)'*U;   fx=fx_aff+fx_wrp;   fy_aff=cy(n_good+1:n_good+3)'*[ones(1,nsamp); Xtan'];   fy_wrp=cy(1:n_good)'*U;   fy=fy_aff+fy_wrp;      Ztan=[fx; fy]';   tk=atan2(Ztan(:,2)-Z(:,2),Ztan(:,1)-Z(:,1));   if display_flag      figure(4)      plot(Z(:,1),Z(:,2),'b+',Y(:,1),Y(:,2),'ro');      axis('ij')      title(['k=' int2str(k) ', \lambda_o=' num2str(lambda_o) ', I_f=' num2str(E) ', aff.cost=' num2str(aff_cost) ', SC cost=' num2str(sc_cost)])      axis([1 N2 1 N1])      % show warped coordinate grid      fx_aff=cx(n_good+1:n_good+3)'*[ones(1,M); x'; y'];      d2=dist2(X3b,[x y]);      fx_wrp=cx(1:n_good)'*(d2.*log(d2+eps));      fx=fx_aff+fx_wrp;      fy_aff=cy(n_good+1:n_good+3)'*[ones(1,M); x'; y'];      fy_wrp=cy(1:n_good)'*(d2.*log(d2+eps));      fy=fy_aff+fy_wrp;      hold on      plot(fx,fy,'k.','markersize',1)      hold off      drawnow   end      % update Xk for the next iteration   Xk=Z;     if k==n_iter      s=0;   else      k=k+1;   endend%%%%%% grayscale warping%%%[x,y]=meshgrid(1:N2,1:N1);x=x(:);y=y(:);M=length(x);fx_aff=cx(n_good+1:n_good+3)'*[ones(1,M); x'; y'];d2=dist2(X3b,[x y]);fx_wrp=cx(1:n_good)'*(d2.*log(d2+eps));fx=fx_aff+fx_wrp;fy_aff=cy(n_good+1:n_good+3)'*[ones(1,M); x'; y'];fy_wrp=cy(1:n_good)'*(d2.*log(d2+eps));fy=fy_aff+fy_wrp;disp('computing warped image...')V1w=griddata(reshape(fx,N1,N2),reshape(fy,N1,N2),V1,reshape(x,N1,N2),reshape(y,N1,N2));   fz=find(isnan(V1w)); V1w(fz)=0;ssd=(V2-V1w).^2;ssd_global=sum(ssd(:));if display_flag   figure(5)   subplot(2,2,1)   im(V1)   subplot(2,2,2)   im(V2)   subplot(2,2,4)   im(V1w)   title('V1 after warping')   subplot(2,2,3)   im(V2-V1w)   h=title(['SSD=' num2str(ssd_global)]);   colormap(cmap)end%%%%%% windowed SSD comparison%%%wd=2*w+1;win_fun=gaussker(wd);% extract sets of blocks around each coordinate% first do 1st shape; need to use transformed coords.win_list_1=zeros(nsamp,wd^2);for qq=1:nsamp   row_qq=round(Xk(qq,2));   col_qq=round(Xk(qq,1));   row_qq=max(w+1,min(N1-w,row_qq));   col_qq=max(w+1,min(N2-w,col_qq));   tmp=V1w(row_qq-w:row_qq+w,col_qq-w:col_qq+w);   tmp=win_fun.*tmp;   win_list_1(qq,:)=tmp(:)';end% now do 2nd shapewin_list_2=zeros(nsamp,wd^2);for qq=1:nsamp   row_qq=round(Y(qq,2));   col_qq=round(Y(qq,1));   row_qq=max(w+1,min(N1-w,row_qq));   col_qq=max(w+1,min(N2-w,col_qq));   tmp=V2(row_qq-w:row_qq+w,col_qq-w:col_qq+w);   tmp=win_fun.*tmp;   win_list_2(qq,:)=tmp(:)';endssd_all=sqrt(dist2(win_list_1,win_list_2));if 0   % visualize paired-up patches   for qq=1:nsamp      im([reshape(win_list_1(qq,:),wd,wd) reshape(win_list_2(b2(qq),:),wd,wd); ...	  reshape(win_list_2(qq,:),wd,wd) reshape(win_list_1(b1(qq),:),wd,wd)])      colormap(cmap)      pause   endend% loop over nearest neighbors in both directions, project in% both directions, take maximumcost_1=0;cost_2=0;for qq=1:nsamp   cost_1=cost_1+ssd_all(qq,b2(qq));   cost_2=cost_2+ssd_all(b1(qq),qq);endssd_local=(1/nsamp)*max(mean(cost_1),mean(cost_2));ssd_local_avg=(1/nsamp)*0.5*(mean(cost_1)+mean(cost_2));if display_flag%   set(h,'string',['local SSD=' num2str(ssd_local) ', avg. local SSD=' num2str(ssd_local_avg)])   set(h,'string',['local SSD=' num2str(ssd_local)])end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
无吗不卡中文字幕| 亚洲6080在线| 精品不卡在线视频| 91精品国产手机| 欧美色偷偷大香| 欧美日韩精品欧美日韩精品一 | 亚洲成人自拍网| 亚洲国产一二三| 天堂成人国产精品一区| 日韩国产成人精品| 麻豆成人av在线| 久久97超碰国产精品超碰| 精一区二区三区| 国产99精品国产| 在线视频综合导航| 欧美一区二区三区日韩| 精品乱人伦小说| 中文在线一区二区| 亚洲老妇xxxxxx| 日韩专区在线视频| 国产精品一区二区在线观看不卡 | 欧美日韩aaaaa| 欧美一区二区三区人| 国产欧美视频一区二区三区| 中文字幕五月欧美| 亚洲大片免费看| 国产传媒欧美日韩成人| 99麻豆久久久国产精品免费优播| 欧美亚洲国产一区二区三区| 欧美一级片在线观看| 国产欧美视频一区二区| 一区二区在线看| 久久国产福利国产秒拍| 99免费精品视频| 日韩精品专区在线影院重磅| 久久久久国产精品人| 一二三四区精品视频| 国产在线精品一区二区三区不卡 | 久久久国产综合精品女国产盗摄| 国产精品美女久久久久高潮| 午夜精品久久久久久久99樱桃| 国内欧美视频一区二区| 91久久一区二区| 国产日韩欧美精品电影三级在线| 亚洲一区二区三区国产| 久久精品国产秦先生| 在线视频欧美精品| 欧美激情一区二区三区不卡| 蜜臀久久99精品久久久久久9| 不卡一区二区三区四区| 精品成人一区二区| 午夜日韩在线观看| 99久久精品免费看国产免费软件| 日韩欧美在线观看一区二区三区| 亚洲精品高清在线| 高清久久久久久| 久久久精品免费网站| 日韩1区2区3区| 91免费精品国自产拍在线不卡| 精品成人免费观看| 天天操天天综合网| 欧美性受xxxx黑人xyx| 国产精品网站导航| 成人教育av在线| 久久欧美中文字幕| 激情六月婷婷久久| 日韩免费一区二区| 日韩成人免费在线| 欧美二区在线观看| 亚洲6080在线| 欧美高清www午色夜在线视频| 尤物视频一区二区| 在线一区二区三区做爰视频网站| 亚洲同性同志一二三专区| 国产91丝袜在线播放0| 久久久噜噜噜久久人人看| 国产在线国偷精品产拍免费yy| 日韩你懂的电影在线观看| 久久av中文字幕片| 久久久久综合网| 成人av网站大全| 国产精品久久久久永久免费观看| 国产a区久久久| 国产精品久久夜| 91在线视频免费观看| 最好看的中文字幕久久| 99re在线精品| 亚洲韩国精品一区| 91精品国产手机| 国产精品资源站在线| 国产欧美日韩精品在线| 99re6这里只有精品视频在线观看| 中文字幕在线观看不卡| 欧美午夜理伦三级在线观看| 亚洲成人一区在线| 2021国产精品久久精品| 成人综合在线观看| 亚洲人成网站在线| 91.com在线观看| 国产综合色在线视频区| 日韩美女久久久| 欧美日韩国产另类一区| 韩国视频一区二区| 亚洲婷婷国产精品电影人久久| 欧美无砖专区一中文字| 美美哒免费高清在线观看视频一区二区 | 精品国产露脸精彩对白| 粉嫩在线一区二区三区视频| 亚洲另类春色国产| 精品精品欲导航| a4yy欧美一区二区三区| 日本va欧美va精品| 国产精品伦理在线| 欧美一区二区播放| proumb性欧美在线观看| 日本91福利区| 成人欧美一区二区三区在线播放| 3d成人动漫网站| 成人av网站免费观看| 理论片日本一区| 一卡二卡三卡日韩欧美| 久久久99久久精品欧美| 欧美亚男人的天堂| 成人动漫一区二区在线| 国产一区二区在线观看视频| 一区二区三区在线观看动漫| 欧美激情综合五月色丁香| 欧美精品在线观看一区二区| 91污片在线观看| 国产乱码字幕精品高清av| 奇米影视7777精品一区二区| 亚洲人123区| 中文字幕一区二区三区不卡| 欧美精品一区二区三区很污很色的| 91成人看片片| 色悠悠亚洲一区二区| 国产成人精品1024| 国产精品中文字幕欧美| 老司机免费视频一区二区| 午夜视频在线观看一区二区三区| 中文字幕在线观看不卡视频| 欧美激情艳妇裸体舞| 久久精品亚洲精品国产欧美kt∨| 91精品国产麻豆国产自产在线| 色综合 综合色| 99re热这里只有精品视频| 不卡区在线中文字幕| 高清在线观看日韩| 成人在线综合网站| 成人性视频免费网站| 成人毛片在线观看| 成人动漫一区二区在线| 成人av一区二区三区| 成人晚上爱看视频| 91丝袜呻吟高潮美腿白嫩在线观看| 懂色av中文一区二区三区| 国产精品一区免费在线观看| 丰满放荡岳乱妇91ww| eeuss鲁片一区二区三区在线观看| 国产精品一区二区三区四区 | 99精品欧美一区二区三区小说 | 91福利在线导航| 欧美亚洲动漫精品| 欧美一区永久视频免费观看| 日韩一二在线观看| 欧美成人乱码一区二区三区| 欧美成人一区二区| 久久亚洲捆绑美女| 国产精品色婷婷| 亚洲精品videosex极品| 亚洲第一会所有码转帖| 日韩精品五月天| 国产一区不卡在线| 成人黄色综合网站| 色狠狠桃花综合| 欧美一区二区视频免费观看| 久久日韩精品一区二区五区| 欧美激情中文不卡| 一区二区不卡在线播放| 久久精品国产99国产| 成人小视频在线观看| 欧美中文字幕久久| 日韩一级完整毛片| 亚洲欧美日韩国产一区二区三区| 亚洲自拍偷拍综合| 国产在线精品一区二区不卡了| 99久久精品国产一区二区三区 | 中文字幕一区二区在线观看| 亚洲宅男天堂在线观看无病毒| 奇米影视一区二区三区小说| 国产成人av资源| 欧美理论在线播放| 国产视频一区二区在线| 亚洲va韩国va欧美va| 国产99久久久精品| 日韩一卡二卡三卡四卡| 亚洲综合色婷婷| 成人福利视频网站| 精品国产一区二区三区久久影院 | 欧美大片在线观看一区|