leaf area measuring — R package “EBImage”
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Besides microscopic images in our routine, common photos are frequently taken to measure quantitative plant features, such as leaf area, root length, branch numbers, etc. Scientific software is available for manual processing. For example, to measure the root length, one need to use the cursor to travel along the target, herein the root. Then the software will tell you how many pixels there are between one end of the root to the other. This sounds easy. But when hundreds of files are waiting, you will probably go nuts. And it is hard work for your eyes.
Last time, I applied EBImage to assist in nuclei counting. I’d like to try this R package on some macroscopic phenotyping. Here, I photographed two obviously different-sized leaves. My goal to calculate the ratio of their leaf area. What should I do?
Actually, this task is simpler than nuclei counting, because only two objects need to be taken care of. So, filtering step would be much easier. I use four steps to accomplish this one:
- read the image into R using readImage(), then extract the “blue” channel for further processing;
- extract the pixel intensities using imageData(), and perform the image reverse;
- remove the background containing small intensity values (herein < 0.8), and again adjust the morphological shapes and remove noise;
- use computeFeatures() to retrieve the morphological features, including the leaf area, and layout the resulting image.
The resulting image is shown here, in which the leaf area are masked in read and the numbers are the area size in pixels as I didn’t photographing the bar (oops…). However, I get the ratio of leaf area is around 2.1. And the original code is published elsewhere.
Right now, I don’t know how to separate petioles from blades yet. I guess morphological recognition would do the trick. I’d like to dig it more.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.