필터 지우기
필터 지우기

How to calculate the area of single leaf along with its height

조회 수: 4 (최근 30일)
Malini
Malini 2023년 7월 11일
댓글: Image Analyst 2023년 8월 17일
How to calculae the area of single leaf with its height? Since the leaf is rounded and not flat, how to estimate the area of other sides of the leaf?
  댓글 수: 2
Diwakar Diwakar
Diwakar Diwakar 2023년 7월 11일
It's challanging task. still you can make an approximation by assuming the leaf's shape resembles a hemisphere or a portion of a sphere.
Example code:
% Leaf height (in centimeters)
height = 10;
% Radius of the rounded leaf (assuming a hemisphere or a portion of a sphere)
radius = height / 2;
% Calculate the approximate area of the rounded leaf
area = 2 * pi * radius^2;
disp(['The estimated area of the leaf is: ', num2str(area), ' cm^2']);
Malini
Malini 2023년 7월 11일
Thank you Diwakar.

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

채택된 답변

Image Analyst
Image Analyst 2023년 7월 12일
First of all you need to segment the plant, which is easy enough. Then get the skeleton of the leaf with bwskel. Then you need to get the radius at each location along the leaf's skeleton with a distance transform bwdist . Then square it and multiply by pi and sum it up for all points along the skeleton.
A demo for a similar (but not identical) is attached.
  댓글 수: 7
Malini
Malini 2023년 8월 17일
Also my dataset is like this. How to induvidually calculate the leaf area
Image Analyst
Image Analyst 2023년 8월 17일
To get the area of each leaf, you need to make sure they're separated and then threshold to get a mask (binary image). Then you simply do
props = regionprops(mask, 'Area');
allAreas = [props.Area]

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

추가 답변 (1개)

Vishnu
Vishnu 2023년 7월 12일
I understand that you want to get an approximation for the area of a rounded leaf, now since the leaf is rounded the only way to get the approx area is to divide the entire height of the leaf into multiple smaller unit which can be cyllindrical(This is assumption for the approximation). We can then procced to integrate this cyllindrical shell element across the height of the entire leaf with an integral function to get the area of the leaf.
Here is the working code for this approach:
function leafArea = estimateLeafArea(radius, height)
% Define the function representing the leaf shell
leafShell = @(x) sqrt(radius^2 - (radius/height)^2 * x.^2);
% Define the integration limits
lowerLimit = -height/2;
upperLimit = height/2;
% Perform the integration using the integral function
leafArea = integral(leafShell, lowerLimit, upperLimit);
end

태그

Community Treasure Hunt

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

Start Hunting!

Translated by