Find contours for walls in floor plan images

there is no simple and good solution.

just train a neural network for segmentation, or an “autoencoder” (with skip connections, like a U-net or something) that modifies the input to your liking.