Here is an image of jackfruit in the wild and I want to segment this.

Finding the maximum contour results in the following image -
Now, it's possible that I try some different parameters to get the perfect segmentation for this particular image. However, I have lots of different images of plants and fruits in the wild.
Therefore, I thought of adding another step to this, i.e. from this segmented image, I find the connected component and that would get me the whole fruit segmented.
I have tried the flood-fill algorithm but to no avail as the fruit itself has a range of pixel values.
