フィルターのクリア

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 Center および File ExchangeVector Fields についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by