how can i measure the longest point of my lightning image?
Show older comments

5 Comments
darova
on 8 Apr 2019
What do you mean longest point
Neptune16
on 8 Apr 2019
Matt J
on 8 Apr 2019
Maybe? You don't know?
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
Accepted Answer
More Answers (1)
darova
on 8 Apr 2019
1 vote
Draw black (0,0,0) line you want to calculate the length

See attached script
6 Comments
Neptune16
on 9 Apr 2019
darova
on 9 Apr 2019
Did you draw black line (0;0;0) ?

Neptune16
on 9 Apr 2019
darova
on 9 Apr 2019
When you draw black line (color - (0;0;0), look in paint for example) script takes only black pixels

Then imfil() function clears single pixels we dont want

From thick line we get thin with bwmorph()

Using again bwmorph() to get clear line

Find nonzero indices (coordinates) to get a curve
Image Analyst
on 9 Apr 2019
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
on 9 Apr 2019
thank you
Categories
Find more on Morphological Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
