フィルターのクリア

How to get region information

1 回表示 (過去 30 日間)
Siam
Siam 2017 年 10 月 8 日
コメント済み: Image Analyst 2017 年 10 月 9 日
I am thinking to find the length but not sure how to do that.
An example image is shown below:
From Original image I have tried to get some results but I am stuck.
I am looking to find the red marked thread height from the following figure. Any help will be appreciated.

回答 (1 件)

Image Analyst
Image Analyst 2017 年 10 月 8 日
Run along the columns finding the hairs and subtracting from the skeleton
% Preallocate arrays for heights above and below the core skeleton.
hairHeightsAbove = zeros(1, columns);
hairHeightsBelow = zeros(1, columns);
% Loop over all columns, finding distances above and below for each column.
for col = 1 : columns
% Find row of hair sticking above the core skeleton.
hairTopRow = find(hairs(:, col), 1, 'first');
% Find row of hair sticking below the core skeleton.
hairBottomRow = find(hairs(:, col), 1, 'last');
% Find row of the core skeleton.
skeletonRow = find(coreSkeleton(:, col), 1, 'first');
% Compute distances of hair ends to the core skeleton.
hairHeightsAbove(col) = abs(hairTopRow - skeletonRow);
hairHeightsBelow(col) = abs(hairBottomRow - skeletonRow);
end
  1 件のコメント
Image Analyst
Image Analyst 2017 年 10 月 9 日
Post the original gray scale, non-annotated image.

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

Community Treasure Hunt

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

Start Hunting!

Translated by