How could I calculate leaf area in R starting from a picture taken knowing pixel resolution, focal length and...
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 |
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 '18 at 19:42
add a comment |
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 '18 at 13:54
Caleb Kleveter
7,46284068
7,46284068
asked Nov 21 '18 at 19:34
GianmarcoGianmarco
1
1
Please provide a minimal reproducible example.
– Christoph
Nov 21 '18 at 19:42
add a comment |
Please provide a minimal reproducible example.
– Christoph
Nov 21 '18 at 19:42
Please provide a minimal reproducible example.
– Christoph
Nov 21 '18 at 19:42
Please provide a minimal reproducible example.
– Christoph
Nov 21 '18 at 19:42
add a comment |
1 Answer
1
active
oldest
votes
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 |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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 |
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 |
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 '18 at 20:21
Tilen KTilen K
462
462
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.
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 '18 at 19:42