plot_matched.m
上传用户:trade789
上传日期:2018-05-10
资源大小:603k
文件大小:1k
源码类别:

2D图形编程

开发平台:

Matlab

  1. %
  2. % Author: 
  3. % Scott Ettinger
  4. % scott.m.ettinger@intel.com
  5. %
  6. % May 2002
  7. %/////////////////////////////////////////////////////////////////////////////////////////////
  8. function [] = plot_matched(p,w,img,num_flag)
  9. if ~exist('num_flag')
  10.     num_flag = 0;
  11. end
  12. figure(gcf);
  13. imagesc(img)
  14. hold on
  15. colormap gray
  16. for i=1:size(p,2)
  17.     x = p(1,i)+1;
  18.     y = p(2,i)+1;
  19.     sz = w(i);
  20.     
  21.     if x>size(img,2)
  22.         x
  23.     end
  24.           
  25.     if num_flag ~= 1
  26.         plot(x,y,'g+');         %draw box around real feature
  27.     else
  28.         plot(x,y,'g+');         %draw box around real feature
  29.         text(x,y,sprintf('%d',i),'color','r');
  30.     end
  31.     
  32.     drawbox(0,sz,x,y,[0 1 0]);
  33. end