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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? demo_2.m

?? Shape registration by shape context: algorithm implemented by matlab and the paper. One of the best
?? M
字號(hào):
% 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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲天堂久久久久久久| 日韩精品中文字幕一区| 国产精品不卡一区二区三区| 丁香五精品蜜臀久久久久99网站 | 91日韩在线专区| 国产精品久久久久永久免费观看| 精品久久人人做人人爰| 久久91精品国产91久久小草| 久久蜜桃av一区精品变态类天堂| 国产传媒一区在线| 国产精品大尺度| 欧美在线高清视频| 日本系列欧美系列| 久久久久国产精品麻豆| 99这里只有精品| 亚洲综合男人的天堂| 欧美日本乱大交xxxxx| 美女在线视频一区| 欧美激情在线观看视频免费| 一本大道久久a久久综合婷婷| 亚洲一区二区欧美激情| 8v天堂国产在线一区二区| 加勒比av一区二区| 亚洲色图欧洲色图| 日韩一区二区三区视频| 懂色av一区二区三区免费观看| 亚洲另类在线视频| 欧美成人福利视频| 91香蕉视频污在线| 美国av一区二区| 国产精品三级电影| 欧美精品色综合| 国产91精品一区二区麻豆亚洲| 一区二区三区精品视频| 精品少妇一区二区| 在线视频国内自拍亚洲视频| 极品销魂美女一区二区三区| 亚洲精品一二三四区| 欧美不卡一二三| 色嗨嗨av一区二区三区| 麻豆成人免费电影| 亚洲综合一二三区| 国产日韩欧美综合一区| 欧美日本韩国一区二区三区视频 | 亚洲午夜精品久久久久久久久| 日韩欧美第一区| 色婷婷久久久亚洲一区二区三区| 久久精品国产成人一区二区三区 | 亚洲品质自拍视频| 精品国产乱码久久久久久免费 | 美女视频黄久久| 亚洲欧美激情小说另类| 久久久精品免费观看| 在线成人av影院| 91碰在线视频| 国产成人鲁色资源国产91色综 | 欧美色网一区二区| 成人aaaa免费全部观看| 精品在线一区二区| 午夜精品视频在线观看| 亚洲欧美一区二区三区孕妇| 久久夜色精品一区| 日韩欧美黄色影院| 555www色欧美视频| 欧美色大人视频| 日本精品免费观看高清观看| 成人黄页毛片网站| 高清不卡在线观看av| 精品一区二区三区在线视频| 日韩二区在线观看| 午夜久久久影院| 亚洲一区二区三区四区五区黄| 国产精品成人一区二区艾草| 国产欧美一区视频| 国产天堂亚洲国产碰碰| 久久亚洲二区三区| 精品对白一区国产伦| 精品播放一区二区| www激情久久| 久久久电影一区二区三区| 精品国产凹凸成av人网站| 日韩免费成人网| 精品日韩在线一区| 久久精品免费在线观看| 久久久久久免费网| 亚洲国产精品99久久久久久久久 | 91精品国产综合久久精品| 欧美午夜片在线观看| 欧美日韩不卡视频| 这里只有精品免费| 精品久久久久香蕉网| 精品成a人在线观看| 国产日韩欧美在线一区| 国产精品久久网站| 一区二区三区精品在线观看| 亚洲成人自拍偷拍| 美女网站色91| 国产乱码精品一区二区三 | 99精品视频一区| 91在线一区二区| 欧洲一区二区av| 制服.丝袜.亚洲.中文.综合| 精品福利一区二区三区| 欧美极品少妇xxxxⅹ高跟鞋| 亚洲婷婷综合色高清在线| 亚洲成人在线免费| 韩国成人精品a∨在线观看| 丰满少妇在线播放bd日韩电影| 91视频观看视频| 欧美美女黄视频| 337p粉嫩大胆噜噜噜噜噜91av| 欧美韩日一区二区三区| 亚洲一区中文在线| 久久99久久99精品免视看婷婷 | 成人免费福利片| 日本韩国一区二区三区视频| 日韩视频永久免费| 中文字幕亚洲区| 亚洲123区在线观看| 国产一区在线观看麻豆| 色噜噜狠狠色综合欧洲selulu| 日韩亚洲欧美成人一区| 国产精品久久久久一区二区三区共| 亚洲国产婷婷综合在线精品| 精品一区中文字幕| 91美女视频网站| 精品国精品国产| 一二三四区精品视频| 国产盗摄女厕一区二区三区| 欧美性色黄大片手机版| 国产欧美日韩综合精品一区二区| 亚洲一区二区三区在线| 国产在线观看免费一区| 欧美三级韩国三级日本一级| 国产欧美一区二区在线| 人人精品人人爱| 色综合视频在线观看| 久久精品欧美一区二区三区不卡 | 激情综合网av| 91国偷自产一区二区三区成为亚洲经典 | 中文字幕中文字幕在线一区 | 一区二区三区四区不卡视频| 国产真实乱对白精彩久久| 欧美色图片你懂的| 国产精品毛片a∨一区二区三区 | 国产最新精品免费| 4438亚洲最大| 亚洲国产精品久久不卡毛片| 99热在这里有精品免费| 国产午夜亚洲精品午夜鲁丝片| 天天亚洲美女在线视频| 一本大道av一区二区在线播放| 久久精品一二三| 九九在线精品视频| 日韩一区二区免费在线电影| 亚洲一区在线播放| 色域天天综合网| 中文字幕av一区二区三区| 精品一区二区免费视频| 欧美一级在线免费| 日韩精品久久久久久| 色噜噜狠狠色综合中国| 亚洲少妇30p| 成人黄色一级视频| 国产精品美女一区二区三区| 国产福利一区二区三区在线视频| 精品国产91久久久久久久妲己| 欧美bbbbb| 精品久久久久久久人人人人传媒| 日韩专区中文字幕一区二区| 欧美理论电影在线| 五月天丁香久久| 51午夜精品国产| 日本强好片久久久久久aaa| 欧美美女视频在线观看| 日韩和欧美一区二区三区| 欧美疯狂做受xxxx富婆| 视频一区免费在线观看| 91精品国产综合久久福利| 日韩av一二三| 精品日韩99亚洲| 国产成人精品亚洲日本在线桃色| 久久久久久日产精品| 成人午夜伦理影院| 亚洲天堂成人在线观看| 欧美午夜在线一二页| 视频在线观看一区二区三区| 日韩精品一区在线| 国产成人8x视频一区二区| 国产精品久久久久一区| 色哟哟亚洲精品| 首页国产欧美久久| 久久久久久久免费视频了| 成人高清免费在线播放| 一区二区视频在线看| 91精品国产一区二区三区香蕉| 精品中文av资源站在线观看| 欧美经典一区二区| 欧美日韩一区二区三区四区五区 | jlzzjlzz亚洲日本少妇|