How to contour extraction by stroke?

welcome.

please show your effort into solving your task.

related: Contour matching and evaluation criteria?