Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem is that you aren't actually passing in image data for the <code>image1</code> and <code>image2</code> arguments. You're just passing character strings containing the image file names <code>'keyframe1.jpg'</code> and <code>'keyframe2.jpg'</code>.</p> <p>You need to load the image data from the files first using <a href="http://www.mathworks.com/help/techdoc/ref/imread.html" rel="nofollow">IMREAD</a>, then pass the image data to <code>im_reg_MI</code>. Assuming the images are in the current working directory, you would do something like this:</p> <pre><code>image1 = imread('keyframe1.jpg'); image2 = imread('keyframe2.jpg'); [h,im_matched,theta,I,J] = im_reg_MI(image1,image2,0,1); </code></pre> <p><strong>EDIT:</strong></p> <p>There seems to be an additional error within <code>im_reg_MI</code> that occurs if <code>image21</code> (the rotated version of <code>image2</code>) is the same size or smaller than <code>image1</code> for one or more of its dimensions. If <code>m1</code> were less than or equal to <code>m</code> and/or <code>n1</code> were less than or equal to <code>n</code>, then one or both of the loops for <code>i</code> or <code>j</code> would never be entered since <code>1:step:(m1-m)</code> and/or <code>1:step:(n1-n)</code> would <a href="http://www.mathworks.com/help/techdoc/ref/colon.html" rel="nofollow">create an empty vector</a>. Thus, the inner loop code would never be run and <code>h</code> would never be created.</p> <p><strong>And one extra note...</strong></p> <p>I noticed that the function <code>im_reg_MI</code> appears to treat the two images as 2-D, which means they must be <a href="http://www.mathworks.com/help/techdoc/creating_plots/f2-10709.html#f2-175" rel="nofollow">intensity images</a> (i.e. grayscale or binary image data). If you're dealing with <a href="http://www.mathworks.com/help/techdoc/creating_plots/f2-10709.html#f2-155" rel="nofollow">indexed</a> or <a href="http://www.mathworks.com/help/techdoc/creating_plots/f2-10709.html#f2-12468" rel="nofollow">RGB</a> image data, I don't think <code>im_reg_MI</code> is going to handle them properly.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload