MATLAB: Hi! I want to know how can I measure the height of the plant in the given picture

color classificationcomputer visionComputer Vision Toolboxdigital image processingImage Processing Toolboximage segmentation

I have attached my picture and I have many pictures of the same plant captured over time.but the angle of all the pictures is same,its because camera is held onto a pole which looks over these plants. From this image,I want to know the height of the plant by calculating the distance between the camera and yellow spot minus the distance between camera and red spot(i.e. plant height=dist(camera,yellow spot)-dist(camera,red spot)). I have gone through the matlab documentation and many papers, but I could not figure out how can I get the distance between the camera and those red and yellow spots in the image. Please somebody explain me. I have been struggling over it for many days.

Best Answer

This is not possible in general. For example, what if the plants had grown so much that the entire image is green? Or even if a single row is just solid green, like you have? There is no way to know the height of the plants in a case like that. You can only do that if you have separated (non-overlapping) plants and a spatially calibrated camera system: https://www.mathworks.com/products/computer-vision/features.html#camera-calibration
Since you don't have that, I therefore suggest you use an alternate measurement that should correlate pretty well with plant height, and that is the area fraction of green. See my File Exchange for color segmentation demos or see the Color Thresholder App on the Apps tab of the tool ribbon.
Related Question