How to get region information
3 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Image Analyst
on 8 Oct 2017
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 Comment
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!