BONUS

scikit-image has some fairly impressive functionality, despite its relatively lightweight packaging. In fact, one function in particular can replicate almost the entirety of what you did in Q2: skimage.segmentation.slic. Check out its documentation page and see if you can replicate your Q2 results.

You'll need to read in the noisy.png image (included with this assignment), convert it to grayscale, and run the slic function on it. Use the scikit-image documentation (in particular, the io submodule to see how to read in images. Display the image before and after segmentation. Feel free to import any other packages you'll need (e.g. matplotlib), but you have to use scikit-image to read in the image and to segment it.


In [ ]: