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

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

?? extract_grid.m

?? 這是一個(gè)很好的標(biāo)定工具箱
?? M
字號:
function [x,X,n_sq_x,n_sq_y,ind_orig,ind_x,ind_y] = extract_grid(I,wintx,winty,fc,cc,kc,dX,dY,xr,yr,click_mode);

if nargin < 11,
   click_mode = 0;
end;


if nargin < 10,
   xr = [];
   yr = [];
end;


map = gray(256);

minI = min(I(:));
maxI = max(I(:));

Id = 255*(I - minI)/(maxI - minI);

	figure(2);
	image(Id);
   colormap(map);
   
   if ~isempty(xr);
      figure(2);
      hold on;
      plot(xr,yr,'go');
      hold off;
   end;
   
   
   if nargin < 2,
      
		disp('Window size for corner finder (wintx and winty):');
		wintx = input('wintx ([] = 5) = ');
		if isempty(wintx), wintx = 5; end;
		wintx = round(wintx);
		winty = input('winty ([] = 5) = ');
		if isempty(winty), winty = 5; end;
		winty = round(winty);

		fprintf(1,'Window size = %dx%d\n',2*wintx+1,2*winty+1);
      
   end;
   
   
   need_to_click = 1;
   
   color_line = 'g';
   
   while need_to_click,
   
   
   title('Click on the four extreme corners of the rectangular pattern...');
   
   disp('Click on the four extreme corners of the rectangular complete pattern...');
   
   [x,y] = ginput3(4);
   
   [Xc,good,bad,type] = cornerfinder([x';y'],I,winty,wintx); % the four corners
   
   x = Xc(1,:)';
   y = Xc(2,:)';
   
   [y,indy] = sort(y);
   x = x(indy);
   
   if (x(2) > x(1)),
      x4 = x(1);y4 = y(1); x3 = x(2); y3 = y(2);
   else
      x4 = x(2);y4 = y(2); x3 = x(1); y3 = y(1);
   end;
   if (x(3) > x(4)),
      x2 = x(3);y2 = y(3); x1 = x(4); y1 = y(4);
   else
      x2 = x(4);y2 = y(4); x1 = x(3); y1 = y(3);
   end;
   
   x = [x1;x2;x3;x4];
   y = [y1;y2;y3;y4];
   
   
   figure(2); hold on;
   plot([x;x(1)],[y;y(1)],[color_line '-']);
   plot(x,y,['o' color_line ]);
   hx=text((x(4)+x(3))/2,(y(4)+y(3))/2 - 20,'X');
   set(hx,'color',color_line,'Fontsize',14);
   hy=text((x(4)+x(1))/2-20,(y(4)+y(1))/2,'Y');
   set(hy,'color',color_line,'Fontsize',14);
   hold off;
   
   
   % Try to automatically count the number of squares in the grid
   
   n_sq_x1 = count_squares(I,x1,y1,x2,y2,wintx);
   n_sq_x2 = count_squares(I,x3,y3,x4,y4,wintx);
   n_sq_y1 = count_squares(I,x2,y2,x3,y3,wintx);
   n_sq_y2 = count_squares(I,x4,y4,x1,y1,wintx);
   
  
   
   % If could not count the number of squares, enter manually
   
   if (n_sq_x1~=n_sq_x2)|(n_sq_y1~=n_sq_y2),
      
      if ~click_mode,
         
         % This way, the user manually enters the number of squares and no more clicks.
         % Otherwise, he user is asked to click again.
         
         disp('Could not count the number of squares in the grid. Enter manually.');
         n_sq_x = input('Number of squares along the X direction ([]=10) = '); %6
         if isempty(n_sq_x), n_sq_x = 10; end;
         n_sq_y = input('Number of squares along the Y direction ([]=10) = '); %6
         if isempty(n_sq_y), n_sq_y = 10; end; 
         need_to_click = 0;
         
      end;
      
      
   else
               
      n_sq_x = n_sq_x1;
      n_sq_y = n_sq_y1;
      
      need_to_click = 0;
      
   end;
   
   color_line = 'r';
   
	end;

   
   if ~exist('dX')|~exist('dY'),
   
   	% Enter the size of each square
   
   	dX = input(['Size dX of each square along the X direction ([]=30mm) = ']);
  		dY = input(['Size dY of each square along the Y direction ([]=30mm) = ']);
		if isempty(dX), dX = 30; end;
		if isempty(dY), dY = 30; end;
      
   end;
   
   
   % Compute the inside points through computation of the planar homography (collineation)
   
	a00 = [x(1);y(1);1];
	a10 = [x(2);y(2);1];
	a11 = [x(3);y(3);1];
	a01 = [x(4);y(4);1];


	% Compute the planart collineation: (return the normalization matrice as well)
   
   [Homo,Hnorm,inv_Hnorm] = compute_homography ([a00 a10 a11 a01],[0 1 1 0;0 0 1 1;1 1 1 1]);
   
   
	% Build the grid using the planar collineation:

	x_l = ((0:n_sq_x)'*ones(1,n_sq_y+1))/n_sq_x;
   y_l = (ones(n_sq_x+1,1)*(0:n_sq_y))/n_sq_y;
   pts = [x_l(:) y_l(:) ones((n_sq_x+1)*(n_sq_y+1),1)]';
   
   XX = Homo*pts;
	XX = XX(1:2,:) ./ (ones(2,1)*XX(3,:));

   
   % Complete size of the rectangle
   
   W = n_sq_x*dX;
   L = n_sq_y*dY;
   
   
   
   if nargin < 6,
   
   %%%%%%%%%%%%%%%%%%%%%%%% ADDITIONAL STUFF IN THE CASE OF HIGHLY DISTORTED IMAGES %%%%%%%%%%%%%
   figure(2);
   hold on;
   plot(XX(1,:),XX(2,:),'r+');
   title('The red crosses should be close to the image corners');
   hold off;
   
   disp('If the guessed grid corners (red crosses on the image) are not close to the actual corners,');
   disp('it is necessary to enter an initial guess for the radial distortion factor kc (useful for subpixel detection)');
   quest_distort = input('Need of an initial guess for distortion? ([]=no, other=yes) ');
  
   quest_distort = ~isempty(quest_distort);
   
   if quest_distort,
      % Estimation of focal length:
      c_g = [size(I,2);size(I,1)]/2 + .5;
		f_g = Distor2Calib(0,[[x(1) x(2) x(4) x(3)] - c_g(1);[y(1) y(2) y(4) y(3)] - c_g(2)],1,1,4,W,L,[-W/2 W/2 W/2 -W/2;L/2 L/2 -L/2 -L/2; 0 0 0 0],100,1,1);
      f_g = mean(f_g);
      script_fit_distortion;
   end;
   %%%%%%%%%%%%%%%%%%%%% END ADDITIONAL STUFF IN THE CASE OF HIGHLY DISTORTED IMAGES %%%%%%%%%%%%%
   
	else
   	
   	xy_corners_undist = comp_distortion_oulu([(x' - cc(1))/fc(1);(y'-cc(2))/fc(1)],kc);
	 
	 	xu = xy_corners_undist(1,:)';
	 	yu = xy_corners_undist(2,:)';
	 
	 	[XXu] = projectedGrid ( [xu(1);yu(1)], [xu(2);yu(2)],[xu(3);yu(3)], [xu(4);yu(4)],n_sq_x+1,n_sq_y+1); % The full grid
       
      r2 = sum(XXu.^2);       
	 	XX = (ones(2,1)*(1 + kc(1) * r2 + kc(2) * (r2.^2))) .* XXu;
	 	XX(1,:) = fc(1)*XX(1,:)+cc(1);
	 	XX(2,:) = fc(2)*XX(2,:)+cc(2);
       
   end;
    
   
   Np = (n_sq_x+1)*(n_sq_y+1);

   disp('Corner extraction...');
   
   grid_pts = cornerfinder(XX,I,winty,wintx); %%% Finds the exact corners at every points!
   
   grid_pts = grid_pts - 1; % subtract 1 to bring the origin to (0,0) instead of (1,1) in matlab (not necessary in C)
   
   ind_corners = [1 n_sq_x+1 (n_sq_x+1)*n_sq_y+1 (n_sq_x+1)*(n_sq_y+1)]; % index of the 4 corners
   ind_orig = (n_sq_x+1)*n_sq_y + 1;
   xorig = grid_pts(1,ind_orig);
   yorig = grid_pts(2,ind_orig);
   dxpos = mean([grid_pts(:,ind_orig) grid_pts(:,ind_orig+1)]');
   dypos = mean([grid_pts(:,ind_orig) grid_pts(:,ind_orig-n_sq_x-1)]');
   
   
   ind_x = (n_sq_x+1)*(n_sq_y + 1);
	ind_y = 1;

   x_box_kk = [grid_pts(1,:)-(wintx+.5);grid_pts(1,:)+(wintx+.5);grid_pts(1,:)+(wintx+.5);grid_pts(1,:)-(wintx+.5);grid_pts(1,:)-(wintx+.5)];
   y_box_kk = [grid_pts(2,:)-(winty+.5);grid_pts(2,:)-(winty+.5);grid_pts(2,:)+(winty+.5);grid_pts(2,:)+(winty+.5);grid_pts(2,:)-(winty+.5)];

   
   figure(3);
   image(Id); colormap(map); hold on;
   plot(grid_pts(1,:)+1,grid_pts(2,:)+1,'r+');
   plot(x_box_kk+1,y_box_kk+1,'-b');
   plot(grid_pts(1,ind_corners)+1,grid_pts(2,ind_corners)+1,'mo');
   plot(xorig+1,yorig+1,'*m');
   h = text(xorig-15,yorig-15,'O');
   set(h,'Color','m','FontSize',14);
   h2 = text(dxpos(1)-10,dxpos(2)-10,'dX');
   set(h2,'Color','g','FontSize',14);
   h3 = text(dypos(1)-25,dypos(2)-3,'dY');
   set(h3,'Color','g','FontSize',14);
   xlabel('Xc (in camera frame)');
   ylabel('Yc (in camera frame)');
   title('Extracted corners');
   zoom on;
   drawnow;
   hold off;
   
   
   Xi = reshape(([0:n_sq_x]*dX)'*ones(1,n_sq_y+1),Np,1)';
   Yi = reshape(ones(n_sq_x+1,1)*[n_sq_y:-1:0]*dY,Np,1)';
   Zi = zeros(1,Np);
   
   Xgrid = [Xi;Yi;Zi];
   
   
	% All the point coordinates (on the image, and in 3D) - for global optimization:

   x = grid_pts;
   X = Xgrid;
   

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品国产第一综合99久久| 亚洲欧洲日本在线| 国产超碰在线一区| 亚洲午夜日本在线观看| 久久网站最新地址| 欧美日韩国产综合一区二区三区| 国产传媒日韩欧美成人| 一区二区三区在线影院| 国产香蕉久久精品综合网| 欧美美女网站色| 色中色一区二区| 成人中文字幕合集| 麻豆国产欧美日韩综合精品二区 | 欧美中文字幕久久| 国产精一区二区三区| 亚洲国产精品久久人人爱蜜臀| 中文成人av在线| 精品国产免费一区二区三区四区 | 成人免费毛片a| 国产一区二区三区电影在线观看| 午夜国产精品一区| 亚洲精品第一国产综合野| 欧美国产乱子伦| 精品国产一二三| 日韩欧美一区电影| 欧美一区二区三区在线视频 | 国产欧美一区视频| 精品国产乱码久久久久久1区2区| 777a∨成人精品桃花网| 欧美精品色一区二区三区| 欧美亚洲禁片免费| 色婷婷综合久色| 91小宝寻花一区二区三区| www.欧美.com| 成人av电影在线播放| 春色校园综合激情亚洲| 成人a级免费电影| www.欧美日韩| 一本色道亚洲精品aⅴ| 色网站国产精品| 欧美色窝79yyyycom| 欧美中文一区二区三区| 欧美三区免费完整视频在线观看| 在线视频你懂得一区| 色综合久久天天综合网| 在线影院国内精品| 欧美日韩高清在线| 欧美一区二区三区的| 日韩欧美国产综合在线一区二区三区| 欧美一区二区三区免费| 久久综合九色综合97_久久久| 久久网站最新地址| 中文字幕一区在线观看| 亚洲色图丝袜美腿| 亚洲国产精品久久人人爱| 日韩不卡一区二区| 九九在线精品视频| 成人一区二区视频| 色欧美片视频在线观看在线视频| 日本高清无吗v一区| 91麻豆精品国产91久久久使用方法 | 国产校园另类小说区| 亚洲视频一区在线| 亚洲成人免费影院| 精品综合久久久久久8888| 国产成人av网站| 色诱亚洲精品久久久久久| 在线精品视频免费观看| 日韩免费视频一区| 中文字幕高清一区| 香蕉av福利精品导航| 国产在线精品一区在线观看麻豆| 成人av影院在线| 欧美精品第1页| 国产午夜一区二区三区| 一二三区精品视频| 久久国产婷婷国产香蕉| 成人av动漫网站| 4438亚洲最大| 中文字幕亚洲视频| 日产国产欧美视频一区精品| 成人综合在线观看| 欧美美女bb生活片| 国产精品美女久久久久aⅴ国产馆| 一区二区三区毛片| 国产夫妻精品视频| 欧美色图在线观看| 欧美韩日一区二区三区四区| 午夜不卡av免费| 成人午夜私人影院| 91精品国产aⅴ一区二区| 国产精品萝li| 久久国产尿小便嘘嘘| 色美美综合视频| 国产色一区二区| 亚洲大尺度视频在线观看| 国产91精品久久久久久久网曝门| 欧美日韩高清不卡| 中文字幕一区二区三区视频| 麻豆高清免费国产一区| 91在线视频18| 久久久精品2019中文字幕之3| 亚洲国产成人va在线观看天堂 | 欧美日韩一区二区三区高清| 国产欧美日韩精品a在线观看| 视频一区在线播放| 97国产一区二区| 国产欧美日韩精品一区| 国内精品视频666| 91精品福利在线一区二区三区| 国产精品久久久久久久久免费桃花| 日本中文字幕一区| 欧美系列一区二区| 亚洲免费资源在线播放| 国产91精品精华液一区二区三区| 日韩午夜在线影院| 丝袜国产日韩另类美女| 色香蕉久久蜜桃| 亚洲天堂免费在线观看视频| 床上的激情91.| 国产精品乱码人人做人人爱| 国产美女精品人人做人人爽| 欧美成人a在线| 免费观看日韩av| 91精品欧美一区二区三区综合在 | 久久综合色播五月| 麻豆91精品视频| 日韩一区二区三区在线视频| 无码av中文一区二区三区桃花岛| 91久久精品一区二区三| 亚洲精品久久7777| 色狠狠色狠狠综合| 依依成人精品视频| 欧美最新大片在线看| 一区二区三区欧美| 欧美性猛片xxxx免费看久爱| 亚洲自拍与偷拍| 欧美另类变人与禽xxxxx| 一区二区三区高清| 欧美日韩在线精品一区二区三区激情 | 6080日韩午夜伦伦午夜伦| 丝袜a∨在线一区二区三区不卡 | 亚洲视频一区二区在线| 色综合久久天天综合网| 亚洲综合999| 日韩一区二区三免费高清| 久草中文综合在线| 中文字幕巨乱亚洲| 日本韩国一区二区| 亚洲国产毛片aaaaa无费看| 在线播放亚洲一区| 久久精品国产第一区二区三区| 久久久久久一级片| 99久久亚洲一区二区三区青草 | 爽好久久久欧美精品| 日韩三级伦理片妻子的秘密按摩| 经典三级视频一区| 中文字幕成人在线观看| 色噜噜狠狠成人网p站| 亚洲电影一级片| 精品理论电影在线观看| 成人免费视频一区二区| 亚洲一二三四区| 欧美va亚洲va| 97国产一区二区| 日本不卡不码高清免费观看| 日本一区二区三区四区在线视频 | 欧美理论电影在线| 国内外成人在线| 一区二区三区欧美日| 亚洲欧美日韩国产一区二区三区 | 国产大陆a不卡| 国产精品进线69影院| 91成人国产精品| 麻豆91精品视频| 亚洲日本韩国一区| 欧美日韩国产成人在线91| 国产成人午夜片在线观看高清观看| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 国产精品久久久久久久蜜臀| 欧美日韩一区二区三区四区五区| 精品在线你懂的| 亚洲免费在线看| 久久久久亚洲蜜桃| 欧美色电影在线| 不卡一区二区中文字幕| 日韩精品国产精品| 亚洲码国产岛国毛片在线| 精品国产在天天线2019| 在线免费精品视频| 国产成人高清视频| 久久精品噜噜噜成人88aⅴ| 日韩码欧中文字| 久久亚洲二区三区| 欧美另类久久久品| 一本色道久久加勒比精品| 国产一区二区不卡| 爽好久久久欧美精品| 一区二区三区四区中文字幕| 国产日韩欧美一区二区三区综合|