How could I calculate leaf area in R starting from a picture taken knowing pixel resolution, focal length and...
up vote
0
down vote
favorite
I am looking for an automated way to measure leaf area from a picture taken by a general camera. I would like to use my phone camera since it would make the job easier. I can use ImageJ but I believe there could be a faster way to do it.
So far I know the following features:
- pixel resolution ( 3042 x 4032 )
- focal length of the camera ( 26 mm equivalent )
- camera sensor ( 7.01 mm x 5.79 mm )
- height of camera ( 25 cm )
I'm asking for R because I have been working on it for a while and I wouldn't change software.
I tried some packages such as EBIimage and magick but I didn't go that far. I can load a picture but I cannot work out any calculation from number of pixel.
Anyone ever tried to do something similar in R?
Please comments and answers would be very appreciated.
Thank you.
r image-processing area
add a comment |
up vote
0
down vote
favorite
I am looking for an automated way to measure leaf area from a picture taken by a general camera. I would like to use my phone camera since it would make the job easier. I can use ImageJ but I believe there could be a faster way to do it.
So far I know the following features:
- pixel resolution ( 3042 x 4032 )
- focal length of the camera ( 26 mm equivalent )
- camera sensor ( 7.01 mm x 5.79 mm )
- height of camera ( 25 cm )
I'm asking for R because I have been working on it for a while and I wouldn't change software.
I tried some packages such as EBIimage and magick but I didn't go that far. I can load a picture but I cannot work out any calculation from number of pixel.
Anyone ever tried to do something similar in R?
Please comments and answers would be very appreciated.
Thank you.
r image-processing area
Please provide a minimal reproducible example.
– Christoph
Nov 21 at 19:42
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am looking for an automated way to measure leaf area from a picture taken by a general camera. I would like to use my phone camera since it would make the job easier. I can use ImageJ but I believe there could be a faster way to do it.
So far I know the following features:
- pixel resolution ( 3042 x 4032 )
- focal length of the camera ( 26 mm equivalent )
- camera sensor ( 7.01 mm x 5.79 mm )
- height of camera ( 25 cm )
I'm asking for R because I have been working on it for a while and I wouldn't change software.
I tried some packages such as EBIimage and magick but I didn't go that far. I can load a picture but I cannot work out any calculation from number of pixel.
Anyone ever tried to do something similar in R?
Please comments and answers would be very appreciated.
Thank you.
r image-processing area
I am looking for an automated way to measure leaf area from a picture taken by a general camera. I would like to use my phone camera since it would make the job easier. I can use ImageJ but I believe there could be a faster way to do it.
So far I know the following features:
- pixel resolution ( 3042 x 4032 )
- focal length of the camera ( 26 mm equivalent )
- camera sensor ( 7.01 mm x 5.79 mm )
- height of camera ( 25 cm )
I'm asking for R because I have been working on it for a while and I wouldn't change software.
I tried some packages such as EBIimage and magick but I didn't go that far. I can load a picture but I cannot work out any calculation from number of pixel.
Anyone ever tried to do something similar in R?
Please comments and answers would be very appreciated.
Thank you.
r image-processing area
r image-processing area
edited Dec 3 at 13:54
Caleb Kleveter
7,04773767
7,04773767
asked Nov 21 at 19:34
Gianmarco
1
1
Please provide a minimal reproducible example.
– Christoph
Nov 21 at 19:42
add a comment |
Please provide a minimal reproducible example.
– Christoph
Nov 21 at 19:42
Please provide a minimal reproducible example.
– Christoph
Nov 21 at 19:42
Please provide a minimal reproducible example.
– Christoph
Nov 21 at 19:42
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Use calibrators.
- Take three (or more) sheets of paper with different area.
- Then take pictures of the sheets at the same distance (25 cm)*.
- Calculate the pixel area of each sheet.
- Divide metric area by pixel area of each sheet. Let's call this number k.
- Calculate the average k.
- Calculate the metric area of the leaf by using this formula: metric_area = k * pixel_area.
*You can also use calibrators for different distances from the leaf. That's a bit more complicated, but probably more precise than calculating.
Be aware that lens with focal length of 26mm will have some distortion on the edges of the image. You would be better off if you used 50 mm or more lens. Otherwise, always center the leaf on the image and leave some space around the leaf.
That's how I would do it. I would use Python and scikit-image instead of R, I find it easier and better documented for image analysis.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Use calibrators.
- Take three (or more) sheets of paper with different area.
- Then take pictures of the sheets at the same distance (25 cm)*.
- Calculate the pixel area of each sheet.
- Divide metric area by pixel area of each sheet. Let's call this number k.
- Calculate the average k.
- Calculate the metric area of the leaf by using this formula: metric_area = k * pixel_area.
*You can also use calibrators for different distances from the leaf. That's a bit more complicated, but probably more precise than calculating.
Be aware that lens with focal length of 26mm will have some distortion on the edges of the image. You would be better off if you used 50 mm or more lens. Otherwise, always center the leaf on the image and leave some space around the leaf.
That's how I would do it. I would use Python and scikit-image instead of R, I find it easier and better documented for image analysis.
add a comment |
up vote
0
down vote
Use calibrators.
- Take three (or more) sheets of paper with different area.
- Then take pictures of the sheets at the same distance (25 cm)*.
- Calculate the pixel area of each sheet.
- Divide metric area by pixel area of each sheet. Let's call this number k.
- Calculate the average k.
- Calculate the metric area of the leaf by using this formula: metric_area = k * pixel_area.
*You can also use calibrators for different distances from the leaf. That's a bit more complicated, but probably more precise than calculating.
Be aware that lens with focal length of 26mm will have some distortion on the edges of the image. You would be better off if you used 50 mm or more lens. Otherwise, always center the leaf on the image and leave some space around the leaf.
That's how I would do it. I would use Python and scikit-image instead of R, I find it easier and better documented for image analysis.
add a comment |
up vote
0
down vote
up vote
0
down vote
Use calibrators.
- Take three (or more) sheets of paper with different area.
- Then take pictures of the sheets at the same distance (25 cm)*.
- Calculate the pixel area of each sheet.
- Divide metric area by pixel area of each sheet. Let's call this number k.
- Calculate the average k.
- Calculate the metric area of the leaf by using this formula: metric_area = k * pixel_area.
*You can also use calibrators for different distances from the leaf. That's a bit more complicated, but probably more precise than calculating.
Be aware that lens with focal length of 26mm will have some distortion on the edges of the image. You would be better off if you used 50 mm or more lens. Otherwise, always center the leaf on the image and leave some space around the leaf.
That's how I would do it. I would use Python and scikit-image instead of R, I find it easier and better documented for image analysis.
Use calibrators.
- Take three (or more) sheets of paper with different area.
- Then take pictures of the sheets at the same distance (25 cm)*.
- Calculate the pixel area of each sheet.
- Divide metric area by pixel area of each sheet. Let's call this number k.
- Calculate the average k.
- Calculate the metric area of the leaf by using this formula: metric_area = k * pixel_area.
*You can also use calibrators for different distances from the leaf. That's a bit more complicated, but probably more precise than calculating.
Be aware that lens with focal length of 26mm will have some distortion on the edges of the image. You would be better off if you used 50 mm or more lens. Otherwise, always center the leaf on the image and leave some space around the leaf.
That's how I would do it. I would use Python and scikit-image instead of R, I find it easier and better documented for image analysis.
answered Nov 21 at 20:21
Tilen K
112
112
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53419350%2fhow-could-i-calculate-leaf-area-in-r-starting-from-a-picture-taken-knowing-pixel%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please provide a minimal reproducible example.
– Christoph
Nov 21 at 19:42