フィルターのクリア

how to plot rectangles on characters of an image in gui?

1 回表示 (過去 30 日間)
malek el pikho
malek el pikho 2014 年 4 月 20 日
回答済み: Image Analyst 2014 年 4 月 20 日
in the calback i wrote img=imread(..... axes(handles.axes1) imshow(img) hold on; X=mat{j}.X;%coordines of the rectangle Y=mat{j}.Y;
plot(X,Y,'r+'); hold on; plot(X,Y,'r'); plot([X(length(X)) X(1)],[Y(length(Y)) Y(1)],'r');
but i had no rectangle

回答 (1 件)

Image Analyst
Image Analyst 2014 年 4 月 20 日
Assuming that X and Y are the coordinates of the 5 corners, try
plot(X,Y,'r+-');
instead of all those other plots. If X and Y are just 2 elements long like the left/right or top/bottom, do
xBox = [X(1), X(2), X(2), X(1), X(1)]; % 5 corners of the box.
yBox = [Y(1), Y(1), Y(2), Y(2), Y(1)]; % 5 Corners of the box.
plot(X,Y,'r+-');

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by