title: How to perform matching by MSER and HOG in Matlab
body: <p>I wanted to know if there is any full implementation of image-matching by MSER and HOG in Matlab. Currently I am using <a href="http://www.vlfeat.org/overview/mser.html" rel="nofollow">VLFeat</a> but found difficulties when performing the image matching. Any help?</p>
  
  <p>Btw, I've tried the below code in VLFeat -Matlab environment but unfortunately the matching can't be performed. </p>
  
  <pre><code>%Matlab code
  %
  pfx = fullfile(vl_root,'figures','demo') ;
  randn('state',0) ;
  rand('state',0) ;
  figure(1) ; clf ;
  
  Ia = imread(fullfile(vl_root,'data','roofs1.jpg')) ;
  Ib = imread(fullfile(vl_root,'data','roofs2.jpg')) ;
  
  Ia = uint8(rgb2gray(Ia)) ;
  Ib = uint8(rgb2gray(Ib)) ;
  
  [ra,fa] = vl_mser(I,'MinDiversity',0.7,'MaxVariation',0.2,'Delta',10) ;
  [rb,fb] = vl_mser(I,'MinDiversity',0.7,'MaxVariation',0.2,'Delta',10) ;
  
  [matches, scores] = vl_ubcmatch(fa, fb);
  
  figure(1) ; clf ;
  imagesc(cat(2, Ia, Ib));
  axis image off ;
  vl_demo_print('mser_match_1', 1);
  
  figure(2) ; clf ;
  imagesc(cat(2, Ia, Ib));
  
  xa = ra(1, matches(1,:));
  xb = rb(1, matches(2,:)) + size(Ia,2);
  ya = ra(2, matches(1,:));
  yb = rb(2,matches(2,:));
  
  hold on ;
  h = line([xa ; xb], [ya ; yb]);
  set(h, 'linewidth', 1, 'color', 'b');
  
  vl_plotframe(ra(:,matches(1,:)));
  rb(1,:) = fb(1,:) + size(Ia,2);
  vl_plotframe(rb(:,mathces(2,:)));
  axis image off ;
  
  vl_demo_print('mser_match_2', 1);
  
  %%%%%%
  </code></pre>