why ''regioprops area'' doesn't work?

2 vues (au cours des 30 derniers jours)
maria
maria le 17 Jan 2014
Commenté : maria le 18 Jan 2014
i have an image B as below http://tinypic.com/view.php?pic=2aaek9c&s=5#.Utm_VBBYkdU and i label it, becase i want to find the area of each line separately. but when i write B2=bwlabel(B) stats=regionprops(B2,area) it returs '' Error using area (line 42) Must supply Y data or X and Y data as first argument(s).'' can somebody tell me what is wrong? thanks a lot!
  2 commentaires
Bruno Pop-Stefanov
Bruno Pop-Stefanov le 17 Jan 2014
Could you please attach the original image to your question?
Bruno Pop-Stefanov
Bruno Pop-Stefanov le 17 Jan 2014
Also, you have to write the property you want to extract in quotes:
stats = regionprops(B2, 'Area');

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 18 Jan 2014
Look at the documentation for regionprops(). The first arg is the binary or labeled image. The second one can either be a string such as 'area', or a grayscale image. Since you did not put area in quotes, it's assuming that it is a grayscale image, which it most likely is not. Put area in single quotes and you should probably be fine.
  1 commentaire
maria
maria le 18 Jan 2014
thanks it worked :)

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by