how to calculate area region growing

5 vues (au cours des 30 derniers jours)
mohd akmal masud
mohd akmal masud le 22 Jan 2021
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
A = im2double(imread('medtest.png'));
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
Instead its type was matlab.graphics.primitive.Image.
Error in regionprops (line 235)
validateattributes(L, supportedTypes, supportedAttributes, ...
Error in rg (line 8)
T = regionprops('table', B,'Area','Centroid')

Réponse acceptée

KALYAN ACHARJYA
KALYAN ACHARJYA le 22 Jan 2021
  3 commentaires
KALYAN ACHARJYA
KALYAN ACHARJYA le 23 Jan 2021
Modifié(e) : KALYAN ACHARJYA le 23 Jan 2021
I have answered about this? As you have already used regionprops functiom, I assumed that you can calculate the area.
"Error using regionprops
Expected input number 2, L, to be one of these types:"
If the problem is not resolved, why you accepted my answer, please unaccept it and accept the Image Analyst answer. Whatever Happy to know that the issue has been resolved.
:)
mohd akmal masud
mohd akmal masud le 23 Jan 2021
yes sir KALYAN ACHARJYA, you also many helps me. thank you so much

Connectez-vous pour commenter.

Plus de réponses (1)

Image Analyst
Image Analyst le 23 Jan 2021
You accepted an answer, so is it solved already?
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 commentaire
mohd akmal masud
mohd akmal masud le 23 Jan 2021
tq image analyst. it work

Connectez-vous pour commenter.

Catégories

En savoir plus sur Modify Image Colors dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by