I have a number of plants that I want to analyze the stem and they produce skeletons like this one. I want to keep just the main line.
I have tried a number of things like erosion on the source image as to thin the branches and disconnect them from stem, erosion to the point the whole stem were gone and then subtracting the leafs from the original image and also putting black pixels around the branch connections as to disconnect them from stem.
The erosion aproach proved to be inconsistent between images due to difference between plants.
As I’ḿ still learning about classic CV that was all I could think of…
The main problem with the black pixels on the skeleton aproach, is that I don’t know how to reconnect the segments “only of the main line”. I guess I would need something to fill in the line in a way it “goes the right path”
I would think that if would be easier just use mask-rcnn and train it to segment the stem … as I’m already using it somewhere else…
Ideas on how I can solve this problem using classic CV ?
BTW, Iḿ using python for this one.
Thank you