필터 지우기
필터 지우기

How to get height and width of region enclosed in the boundaries for use with bwboundaries?

조회 수: 4 (최근 30일)
clc;
clear;
I = imread('../demo.jpg');
imshow(I)
grayImage = rgb2gray(I);
BW = im2bw(I);
imshow(BW)
hold on;
boundaries = bwboundaries(BW);[enter image description here][1]
fprintf('length values is = %i\n ',length(boundaries));
for k=14:14
b = boundaries{k};
fprintf('b values is = %i\n ',b);
img = plot(b(:,2),b(:,1),'r','LineWidth',3);
end

채택된 답변

Matt J
Matt J 2018년 10월 27일
편집: Matt J 2018년 10월 27일
Using regionprops(...,'BoundingBox'), will give the location, height, and width of the bounding box for each of the objects in the image.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by