Find a path between two points

4 ビュー (過去 30 日間)
Chris
Chris 2013 年 11 月 6 日
編集済み: Alex Taylor 2013 年 11 月 6 日
I'm doing some image processing for biology research. I'm looking at images of a larva that bends into different shapes as it moves around. I'm able to binarize the images and automatically locate the head and tail. However, I need a way to draw a line between the head and the tail that follows the body of the larva, so I can calculate its curvature.
So the data is a 640 x 480 matrix of zeros, with an elongated and curved field of ones somewhere in the middle that represents the larva. In addition there are two points [A, B] located at either end of the field of ones, which correspond to head and the tail. How can I get Matlab find for example the shortest distance along the ones between A and B? (It doesn't have to be the shortest distance, it's just one way of constraining the question.) A polynomial or spline won't do because the larva often bends 360 degrees or more.
Thanks!! Chris
  1 件のコメント
Doug Hull
Doug Hull 2013 年 11 月 6 日
have you skeletonized the larva (even if invertebrate!) The bwmorph command might be what you are looking for, use 'skel' option.

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

採用された回答

Alex Taylor
Alex Taylor 2013 年 11 月 6 日
編集済み: Alex Taylor 2013 年 11 月 6 日
Check out bwdistgeodesic/greythresh, as shown in Steve's post:
Both of these functions require the Image Processing Toolbox. bwdistgeodesic is intended exactly for this type of binary constrained shortest path problem.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBiological and Health Sciences についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by