2_.png

5 件のコメント

darova
darova 2019 年 4 月 8 日
What do you mean longest point
Neptune16
Neptune16 2019 年 4 月 8 日
form the red point to any of these orange point maybe.
12331.png
Matt J
Matt J 2019 年 4 月 8 日
Maybe? You don't know?
Neptune16
Neptune16 2019 年 4 月 8 日
編集済み: Neptune16 2019 年 4 月 8 日
no, I mean is there any automatic methods that the code will find the longest point as I mark with orange colour above.
Matt J
Matt J 2019 年 4 月 8 日
編集済み: Matt J 2019 年 4 月 8 日
The straight line distance from red to orange, or the distance when walking along the lightning fork? If the latter, there are several implementations of Dijkstra's algorithm on the file exchange

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

 採用された回答

Image Analyst
Image Analyst 2019 年 4 月 8 日

3 投票

One way to find the longest spine might be to compute the skeleton and endpoints with bwmorph(). Then compute distance between all identified endpoints with bwdistgeodesic(). See Steve's Image Processing blog
Then find out which pair of endpoints had the longest distance.

1 件のコメント

Neptune16
Neptune16 2019 年 4 月 29 日
hello and good day, sir @imageanalyst. I have posted a new question 5 days ago. I would like to ask you a favour to help me with it. kindly please see the latest question I've asked in my profile. thank you for your time and consederation.

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

その他の回答 (1 件)

darova
darova 2019 年 4 月 8 日

1 投票

Draw black (0,0,0) line you want to calculate the length
longest.png
See attached script

6 件のコメント

Neptune16
Neptune16 2019 年 4 月 9 日
I had tried your coding, sir. but the outcome is not the same as yours.
Untitled.png
darova
darova 2019 年 4 月 9 日
Did you draw black line (0;0;0) ?
Untitled.png
Neptune16
Neptune16 2019 年 4 月 9 日
what do you mean "Draw black (0,0,0) line you want to calculate the length" , sir?
darova
darova 2019 年 4 月 9 日
When you draw black line (color - (0;0;0), look in paint for example) script takes only black pixels
Capture1.PNG
Then imfil() function clears single pixels we dont want
Capture2.PNG
From thick line we get thin with bwmorph()
Capture3.PNG
Using again bwmorph() to get clear line
Capture4.PNG
Find nonzero indices (coordinates) to get a curve
Image Analyst
Image Analyst 2019 年 4 月 9 日
If you're going to draw a black line with paint, then you might as well use imfreehand() in MATLAB. I think he was looking for an automatic way, like me (below) or Matt J (above in comments section) suggested. That said, sometimes it's more time effective to employ user-assisted image analysis than trying months or years to get an automatic method (luckily this application won't take anywhere near that long).
darova
darova 2019 年 4 月 9 日
thank you

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

製品

リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by