フィルターのクリア

imdistline

1 回表示 (過去 30 日間)
Razvan
Razvan 2011 年 10 月 17 日
Hi
Is it possible to disable the distance label on the line created by imdistline? If the two end points are too close, then sometimes the label is on top of one of the end points...
Thanks,
Razvan

採用された回答

Image Analyst
Image Analyst 2011 年 10 月 17 日
It's in the help, but not a real explicit example like my example for you below:
h = imdistline(gca);
api = iptgetapi(h);
api.setLabelVisible(false);
  3 件のコメント
Razvan
Razvan 2011 年 10 月 17 日
Hmm... for some reason it's not working for me...
I have in my code:
hDist1 = imdistline(hPlotAxes);
hDist2 = imdistline(hPlotAxes);
pause();
api1 = iptgetapi(hDist1);
api1.setLabelVisible(false);
api2 = iptgetapi(hDist2);
api2.setLabelVisible(false);
dist1 = api1.getDistance();
dist2 = api2.getDistance();
Am I doing something wrong here?
Razvan
Razvan 2011 年 10 月 18 日
Nevermind... if I move the pause command after setLabelVisible, then it works.
Thanks

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

その他の回答 (1 件)

norfaizayu
norfaizayu 2012 年 2 月 2 日
can you give me the example of imdistline?i cannot get it how it function.
  1 件のコメント
Razvan
Razvan 2012 年 2 月 2 日
Here is an example:
% load an image
load flujet
imagesc(X);
% set up the measuring tool
h = imdistline(gca);
api = iptgetapi(h);
api.setLabelVisible(false);
% pause -- you can move the edges of the segment and then press a key to continue
pause();
% get the distance
dist = api.getDistance();
% print the result
fprintf('The length of the segment is: %0.2f pixels \n', dist)

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by