How can I automate Matlab to measure specific regions in an image?
조회 수: 1 (최근 30일)
이전 댓글 표시
I want to make Matlab to measure these distances (red lines) automatically for every image I insert it. These measured distances will be introduced in an equation to measure some parameter. Is this possible?
댓글 수: 0
채택된 답변
Image Analyst
2019년 12월 24일
I would go down each line of your binary image getting the centroids.
[rows, columns] = size(binaryImage);
xCentroids = zeros(rows, 8); % for the 8 blobs.
for row = 1 : rows
props = regionprops(binaryImage(row, :), 'Centroid')
xy = vertcat(props.Centroid);
xCentroids(row, :) = xy(1:8:, 1)
end
To find the bumps, you might call bwmorph(binaryImage, 'skel', inf) and then call regionprops again with the row number where the bumps are known to appear, assuming they're in the same place (row) each time.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!