Problem with Matlab functions
- by appi
HI. I got this matlab functionWhen I ran it, the following error messege showed up. Can anybody give me some hint? Thank you. The code is also shown below.
[h,im_matched,theta,I,J]=im_reg_MI('keyframe1.jpg','keyframe2.jpg', 0, 1)
??? Undefined function or variable "h".
Error in == im_reg_MI at 74
[a, b] = max(h(:));% finding the max of MI and indecises
Below is the code.
[h,im_matched, theta,I,J]=im_reg_MI(image1, image2, angle, step)
[m,n]=size(image1);
[p,q]=size(image2);
[a,b]=size(angle);
im1=round(image1);
for k=1:b
J = rotate_image(angle(k),image2); %rotated cropped IMAGE2
image21=round(J);
[m1,n1]=size(image21);
for i=1:step:(m1-m)
for j=1:step:(n1-n)
im2=image21(i:(i+m-1),j:(j+n-1)); % selecting part of IMAGE2 matching the size of IMAHE1
im2=round(im2);
h(k,i,j)=MI2(im1,im2); % calculating MI
end
end
end
[a, b] = max(h(:));% finding the max of MI and indecises