Image segmentation for area

2 ビュー (過去 30 日間)
Mohammad Abrar Sohail
Mohammad Abrar Sohail 2021 年 4 月 20 日
回答済み: Mahesh Taparia 2021 年 4 月 23 日
I need to acquire an image using my laptops camera and then segment the green part of the plants from the image and then calculate their area. I’m very new to this so can someone please provide a simple code of how to do it?

回答 (1 件)

Mahesh Taparia
Mahesh Taparia 2021 年 4 月 23 日
Hi
You can 1st segment the plants from the image. To do this, green part is easily segmented by applying the suitable threshold value as it is more likely that the green pixel values tend to be [0 255 0]. Also, you can use some other color space to segment that, for more information on that you can refer this documentation.
After segmentation, you can calculate area of the green part by using regionprops function. You can refer this documentation for that.

Community Treasure Hunt

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

Start Hunting!

Translated by