I was myself facing the need of a function that could compute the contours of an image and give me the polygones without the need to make an actual figure and extract the curves from the contour ...
Learn how to create contour plots in Python using NumPy’s meshgrid and Matplotlib. This step-by-step tutorial shows you how to generate grids, compute functions over them, and visualize data ...