What I would like to do is take an image of several plants and remove the background lines and noise from the image. The end result will then hopefully be able to be turned into a binary image where every 1 value is just part of the plant. Is there any way for me to do this automatically without having to use a manual threshold? One solution I've looked into is just estimating the value of what is not noise and then subtracting, but this results in removing parts of plants. An example image for input is: https://i.sstatic.net/jJVv7.png
I=im2bw(I,graythresh(I));
imshow(I)