How do I measure a distance in a pic and get access of those pixel in that line.

2 次查看(过去 30 天)
I'm currently working on a project needs to batch process some image. I need to locate the line in the image which is the shortest distance from left to right and get access to those pixels on that line. can anyone help me? very urgent!

回答(1 个)

Image Analyst
Image Analyst 2017-8-16
Try improfile() to manually draw a line and get the pixel values under it along with the coordinates, from which you can get the distance.
If you want to automatically find it, then find the left and right sides, then use pdist2().
Let me know if you need help.

Community Treasure Hunt

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

Start Hunting!

Translated by