Contour extraction

Use opencv to get contours like the one on the right from the left

welcome.

what have you tried? what research have you done?

I have tried the cv2.findcontours function myself, but it will get all the contours out. Then I draw the outline, and the result is not what I want. My problem can be imagined as many cables are stacked together. The wire frame I drew in the left picture can be understood as the edge of the cable. Now if there are many cables stacked together, how can I extract the wires? What about the inner and outer contours of the area where the cables are stacked?

solving an abstraction, like you show above, might be quite different to your real (cables) one, so that’s a bad idea.
show real images, please.