How can I find a continuous path through the central part of an image?

3 ビュー (過去 30 日間)
Scott
Scott 2014 年 2 月 22 日
回答済み: Alex Taylor 2014 年 2 月 24 日
I have data from an experimental setup that yields a light "band" in the central part of the image, unless there is a defect (which is what I'm looking for).
This is shown (after contrast adjustment and conversion to B/W) as a dark (0) stripe through a light central region (1) as shown; a model image but the actual scans often look somewhat close to this:
I am trying to find a way to automatically determine if there's a continuous path from the top to the bottom. The answers I've been able to find often involve fitting lines/splines and these paths may not be well suited to that sort of thing since the defects may vary quite a bit and be very tortuous.
Is there any function/method of going through the picture data (typically 256 x 256 pixels) and determining if there is a contiguous series of zeroes going through the "light" (pixel value = 1) region?

採用された回答

Image Analyst
Image Analyst 2014 年 2 月 22 日
Simply label the image. If the white is in two parts, the number of regions will be 2 or more:
[labeledImage, numberOfRegions] = bwlabel(binaryImage);
  3 件のコメント
Image Analyst
Image Analyst 2014 年 2 月 22 日
What do you actually want to know, such as if there is a path splitting the binary image into two parts, what is the path of the centerline of the black split, what is the width of the black split as it goes along the path, what is the area or perimeter of the black split, or something else?
Scott
Scott 2014 年 2 月 22 日
Once the split (defect) is detected, width is probably next on the list. Being able to overlay some sort of highlight on the path (borders or centerline) would be good for demos too. We could probably work into some error-rejection for too-small paths that result from noise or other fun things.

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

その他の回答 (1 件)

Alex Taylor
Alex Taylor 2014 年 2 月 24 日
Look at bwdistgeodesic for finding constrained geodesic paths.

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by