필터 지우기
필터 지우기

Indicate a new quiver for each lopp

조회 수: 1 (최근 30일)
승곤 유
승곤 유 2022년 5월 12일
댓글: Matt J 2022년 5월 12일
Hi I'm writing the code below and I'm wondering and I'm going to ask! I want to show a new quiver for each loop, but what do I need to change?
for q = 1:2:length(str2num)
a = char(str2num(q))
b = char(str2num(q+1))
imagea = imread(a)
imageb = imread(b)
size(imagea);
size(imageb);
for i=1:(w_xcount)
for j=1:(w_ycount)
max_correlation=0;
test_xmin=xgrid(i)-w_width/2;
test_xmax=xgrid(i)+w_width/2;
test_ymin=ygrid(j)-w_height/2;
test_ymax=ygrid(j)+w_height/2;
x_disp=0;
y_disp=0;
test_ima=imagea(test_xmin:test_xmax,test_ymin:test_ymax);
test_imb=imageb((test_xmin-x_disp_max):(test_xmax+x_disp_max),(test_ymin-y_disp_max):(test_ymax+y_disp_max));
correlation=normxcorr2(test_ima,test_imb);
[xpeak,ypeak]=find(correlation==max(correlation(:)));
%re-scaling
xpeak1=test_xmin+xpeak-wsize(1)/2-x_disp_max;
ypeak1=test_ymin+ypeak-wsize(2)/2-y_disp_max;
dpx(i,j)= xpeak1-xgrid(i);
dpy(i,j)= ypeak1-ygrid(j);
end
quiver(-dpx,dpy)
end
end

채택된 답변

Matt J
Matt J 2022년 5월 12일
....
quiver(-dpx,dpy); hold on
end
end
hold off
  댓글 수: 4
Matt J
Matt J 2022년 5월 12일
You can direct the plot to appear in the axis "ax" of your choice with the syntax,
Matt J
Matt J 2022년 5월 12일
Or, perhaps,
....
figure; quiver(-dpx,dpy);
end
end

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by