Image Segmentation with Minimum Spanning Forests (50 points). Develop a Python 3 implementation of the image segmentation algorithm that we explored on the first day of class. Your implementation should include the following parts.
An implementation of Kruskal''s algorithm, with a provision for stopping when the number of trees in the spanning forest reaches the value of a parameter ntrees.