Undefined function or variable "r". Error in ==> NCmatching at 19 [x,i]=max(r);

function [i,j]=NCmatching(g1,g2) [pipei_height,pipei_width]=size(g2); [yuantu_height,yuantu_width]=size(g1); figure,imshow(g1,[]); hold on; tic for i=1:yuantu_height-pipei_height for j=1:yuantu_width-pipei_width temp_picture=imcrop(g1,[j,i,pipei_width-1,pipei_height-1]); r(i,j)=corr2(temp_picture,g2); end end [x,i]=max(r); [y,j]=max(max(r)); i=i(j); plot(j:j+pipei_width,i,'r'); plot(j:j+pipei_width,i+pipei_height,'r'); plot(j,i:i+pipei_height,'r'); plot(j+pipei_width,i:i+pipei_height,'r'); toc figure; imshow(g2,[]);
g1=imread('A1.jpg'); g2=imread('B2.jpg'); NCmatching(g1,g2)

 Accepted Answer

It appears that you have downloaded image_matching.rar from http://en.pudn.com/downloads243/sourcecode/graph/texture_mapping/detail1134577_en.html
Any problems with that code should be addressed to the author.
I cannot download the source myself as it requires a login.

More Answers (0)

Categories

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!