error using ginput in matlab code

조회 수: 4 (최근 30일)
Sat m
Sat m 2013년 4월 26일
this is my code, and evevrytime i compile it, it shows error using ginput
%%Read in two images
l = imread('pic410.bmp');
r = imread('pic430.bmp');
%%display image pair side by side
[ROWS, COLS, CHANNELS] = size(l);
disimg = [l r];
image(disimg);
% number of control points
Nc = 10;
% Total Number of test points
Nt = 4;
%%After several runs, you may want to save the point matches
%%in files (see below and then load them here, instead of
%%clicking many point matches every time you run the program
%%load pl.mat pl;
%%load pr.mat pr;
%%interface for picking up both the control points and
%%the test points
cnt = 1;
hold;
while(cnt <= Nc+Nt)
%%size of the rectangle to indicate point locations
dR = 50;
dC = 50;
%%pick up a point in the left image and display it with a rectangle....
%%%if you loaded the point matches, comment the point picking up (3 lines)%%%
[X, Y] = ginput(1);
Cl = X(1); Rl = Y(1);
pl(cnt,:) = [Cl Rl 1];
%%and draw it
Cl= pl(cnt,1); Rl=pl(cnt,2);
rectangle('Curvature', [0 0], 'Position', [Cl Rl dC dR]);
%%and then pick up the correspondence in the right image
%%%if you loaded the point matches, comment the point picking up (three lines)%%%
[X, Y] = ginput(1);
Cr = X(1); Rr = Y(1);
pr(cnt,:) = [Cr-COLS Rr 1];
%%draw it
Cr=pr(cnt,1)+COLS; Rr=pr(cnt,2);
rectangle('Curvature', [0 0], 'Position', [Cr Rr dC dR]);
%plot(Cr+COLS,Rr,'r*');
drawnow;
cnt = cnt+1;
end
this is the error
Error using ginput (line 112)
Interrupted by figure deletion
Error in a4 (line 35)
[X, Y] = ginput(1);
please let me know who to solve this

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Exploration에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by