How to calculate the area of single leaf along with its height
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Malini
am 11 Jul. 2023
Kommentiert: Image Analyst
am 17 Aug. 2023
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?![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1431488/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1431488/image.jpeg)
2 Kommentare
Diwakar Diwakar
am 11 Jul. 2023
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']);
Akzeptierte Antwort
Image Analyst
am 12 Jul. 2023
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1432933/image.png)
7 Kommentare
Image Analyst
am 17 Aug. 2023
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]
Weitere Antworten (1)
Vishnu
am 12 Jul. 2023
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
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!