フィルターのクリア

how to show output of the distance between two point?I just find the highest location of white pixel.

1 回表示 (過去 30 日間)
I want to find the distance from the highest point location (highestWhiteRow,thatColumn) to the lastRow,thatColumn.After that,the 1row is equal to 3meter. But i'm got stuck to display the result of distance between that two points.
true
%highest point location
row=find(sum(img8,2)==0,1,'last')+1;
col=find(img8(row,:)~=0);
row=row(ones(size(col)));
Points=[row(:) col(:)];
imshow(img8);
title('Highest Point Location')
hold on
plot(Points(:,2),Points(:,1),'rp','MarkerSize',10)
a=text(Points(1,2),Points(1,1),['This is (',num2str(Points(1,2)),',',num2str(Points(1,1)),')']);
set(a, 'FontName', 'Arial' ,'FontWeight', 'bold', 'FontSize', 12,'Color', 'green');
%highest distance
% Find the distance.
xd=240-Points(:,2);
yd=Points(:,1)-Points(:,1);
distance=sqrt(xd.*xd + yd.*yd);
Dmeter=distance.*3;%one row=3meter
D=text(['Distance is(',num2str(Dmeter),')']); %show result of distance
set(D, 'FontName', 'Arial' ,'FontWeight', 'bold', 'FontSize', 12, 'Color', 'yellow');
  2 件のコメント
Jan
Jan 2015 年 5 月 4 日
The question is not clear. What do you want to show, what does "show" exactly mean (in the command window or as a diagram?)? What does the code demonstrate?
Please edit the question and post any details.
Nurul Najmah
Nurul Najmah 2015 年 5 月 4 日
It shows some error at D=text.....

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by