How to calculate the area of an input image?

2 views (last 30 days)
How can I calculate the area of an input image with .jpg extension? If someone could explain please, it´s for a school project. And its suposed to be done using a scanner.
Mara Pereira
Mara Pereira on 21 Jun 2020
It will be this image, for example.
It is to calculate the area of the green part.

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 21 Jun 2020
  1. Use imsplit() to get the red, green, and blue channel.
  2. The leaf will be dark in the blue channel. Threshold the blue channel to get a mask = blueChannel < 200.
  3. Call bwarea() on the resulting mask.

More Answers (1)

Harsh Raj
Harsh Raj on 24 Jul 2021
@Image Analyst how to convert a wider path(red) in a single line(yellow)?
  1 Comment
Image Analyst
Image Analyst on 24 Jul 2021
@Harsh Raj, this is not an answer to @Mara Pereira's question. It's not even related to leaf segmentation at all. Please post your "Answer" here as a new Question in a new discussion thread after reading this link:
And please explain it better there because I have no idea what you even want. Perhaps include a picture of what you want as an output (there in the new question, not here in your Answer).

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!