Height of circular shape

2 Ansichten (letzte 30 Tage)
Walaa
Walaa am 30 Sep. 2022
Kommentiert: Walaa am 30 Sep. 2022
I have these two images and I want a code that can be used to determine the height of these nearly circular region can anyone help?

Akzeptierte Antwort

Kevin Holly
Kevin Holly am 30 Sep. 2022
You could use regionprops to find the major axis length. Or did you need the length of the object in the y-direction? What do you mean by height?
Img = imread('segemented cup 1.jpg');
imshow(Img)
size(Img)
ans = 1×2
375 309
rp = regionprops(imbinarize(Img),"MajorAxisLength")
rp = struct with fields:
MajorAxisLength: 124.5538
  1 Kommentar
Walaa
Walaa am 30 Sep. 2022
Thank you ,that what I wanted .

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Image Analyst
Image Analyst am 30 Sep. 2022
Try regionprops and ask for Bounding Box of your binary, segmented image.
props = regionprops(mask, 'BoundingBox');
bb = vertcat(props.BoundingBox); % In case there is more than one blob in the image.
heights = bb(:, 4); % Height along the y direction.
  1 Kommentar
Walaa
Walaa am 30 Sep. 2022
Thanks, your advices are always helping .

Melden Sie sich an, um zu kommentieren.

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by