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.