Find distances in image
Show older comments
I have already found the distance between the centroid to A as well as B, and I have tried couple of ways to find C and D but still can't get it. How can do this? I really need help on this. Thank you.

5 Comments
Image Analyst
on 19 Dec 2018
Look at your distances plot.
- C is 1400
- D is 500
- A is about 1300, and
- B is about 650.
Evelynn Tan
on 19 Dec 2018
Image Analyst
on 19 Dec 2018
D, A, and B are plotted on the graph with the line() function. They are plotted on the image with plot(). C is a little tricky since it's at the start of the graph. If you know for a fact that the widest part of the mouth is always the left most pixel, then you can just find out if the distances(1) or distances(end) is greater, and that will be the C distance. If C is not the outermost peak, then it should be found by findpeaks() just like A is.
Evelynn Tan
on 19 Dec 2018
Image Analyst
on 19 Dec 2018
Yes. Just use plot() like the others. You can help us to help you if you upload your original binary image (not a screenshot again) and the code you used.
Answers (1)
Categories
Find more on Image Type Conversion in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!