# how to calculate area region growing

조회 수: 9(최근 30일)
mohd akmal masud 2021년 1월 22일
댓글: mohd akmal masud 2021년 1월 23일
Hi all, i use function region growing. my script as below. it work. but how to know the area of the growing?
i used regionprops but error pop up. anyone can help me?
note: the pixel value for my region is 1, and the rest is 0. i want to know the total area of 1 (in red circle).
clc
clear all
figure, imshow(A);
J = regiongrowing(A);
figure,
B = imshow(A+J);
T = regionprops('table', B,'Area','Centroid')
ERROR!!!!
Error using regionprops
Expected input number 2, L, to be one of these types:
uint8, uint16, uint32, int8, int16, int32, single, double, categorical
Error in regionprops (line 235)
validateattributes(L, supportedTypes, supportedAttributes, ...
Error in rg (line 8)
T = regionprops('table', B,'Area','Centroid')

댓글을 달려면 로그인하십시오.

### 채택된 답변

KALYAN ACHARJYA 2021년 1월 22일
B =A+J;
##### 댓글 수: 3표시숨기기 이전 댓글 수: 2
mohd akmal masud 2021년 1월 23일
yes sir KALYAN ACHARJYA, you also many helps me. thank you so much

댓글을 달려면 로그인하십시오.

### 추가 답변(1개)

Image Analyst 2021년 1월 23일
If not, what is this regiongrowing() function you mentioned?
You should just be able to do
props = regionprops(binaryImage, 'Area');
allAreas = [props.Area];
where binaryImage is your segmented image. You can't pass regionprops() the handle to a graphical object. It must be an image, either binary or labeled. See my Image Segmentation Tutorial:
##### 댓글 수: 1표시숨기기 없음
mohd akmal masud 2021년 1월 23일
tq image analyst. it work

댓글을 달려면 로그인하십시오.

R2020b

### Community Treasure Hunt

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

Start Hunting!

Translated by