Undefined function or variable "r". Error in ==> NCmatching at 19 [x,i]=max(r);
Show older comments
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
More Answers (0)
Categories
Find more on Downloads in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!