title: image registration fucntions in MATLAB don't work for a simple test
body: <p>I am trying to use MATLAB to do image registration that is based on translation only, so I did a simple test first.</p>
  
  <p>First, I created 2 simple binary images
  <a href="https://i.stack.imgur.com/m1ZPb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m1ZPb.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/scD4p.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/scD4p.png" alt="enter image description here"></a></p>
  
  <p>You can see there is a 20-pixel shift in the vertical direction between those 2 images, then I tried 2 functions to do the registration:</p>
  
  <pre><code>[optimizer,metric] = imregconfig('Monomodal');
  tform = imregtform(img1,img2,'Translation',optimizer,metric);
  img1reg = imregister(img1,img2,'Translation',optimizer,metric);
  </code></pre>
  
  <p>Neither <code>imregtform</code> nor <code>imregister</code> worked; <code>imregtform</code> gave an identity transformation matrix, and the output of <code>imregister</code> "img1reg" was exactly same as the input moving image "img1".</p>
  
  <p>How can I fix this?</p>
  
  <p>Here is the code I used:</p>
  
  <pre><code>img1 = zeros(100, 20);
  img1(35:45,:) = 1;
  img2 = zeros(100, 20);
  img2(55:65,:) = 1;
  [optimizer,metric] = imregconfig('Monomodal');
  tform = imregtform(img1,img2,'Translation',optimizer,metric);
  img1reg = imregister(img1,img2,'Translation',optimizer,metric);
  </code></pre>