How to adjust TEXT in "regionprops" ?

1 view (last 30 days)
I am using "regionprops" with "Perimeter" property. The following outcome I have achieved:
How I can move these texts below each related white line and add unit to it, i.e., 283.04 cm.
Mentioned below is the used code:
score= ([j.Perimeter]/(2*3.7));
figure, imshow(binaryImage);
for cnt = 1:length(j)
Kindly guide.

Accepted Answer

Matt J
Matt J on 19 Apr 2022
Edited: Matt J on 19 Apr 2022
The question doesn't seem to have anything to do with regionprops really, just with your call to text().
figure, imshow(binaryImage);
for cnt = 1:length(j)
num2str(score(cnt))+" cm",'FontSize',12,'color','red');
  1 Comment
Abdul Hannan Qureshi
Abdul Hannan Qureshi on 19 Apr 2022
I apologize, I dont have programming background, so missed that technical aspect. Thank you for correcting me.
Issue resolved.

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 19 Apr 2022
For what it's worth, see the attached demo. It explains how the blobs are numbered (labeled), which is a confusing topic for many people.

Community Treasure Hunt

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

Start Hunting!