My Question is related to OpenCV / Matplotlib only. However, to understand the problem bear with me for a few lines of ML / Computer vision side of stuff : 

I am working on a Image segmentation problem on floor plan dataset. I would be using Fully Convolutional Networks (FCN) for the same. 

Now, FCNs require for an image, a corresponding segmented image. 
For example : 

[![image and its groundtruth](https://i.stack.imgur.com/ZIwQc.png)](https://i.stack.imgur.com/ZIwQc.png)

The image on the left is actual image, while image on the right is the proper "ANNOTATION" of the image. Essentially, every object (class) is completely filled with its own colour - car, road, buildings, etc. 

Now, in my case, I'm working with floor plan data. An example floorplan image looks like this : 

[![Example floorplan image](https://i.stack.imgur.com/yxNMB.jpg)](https://i.stack.imgur.com/yxNMB.jpg)

The relevant entities in such images are walls, doors, etc.

**Problem** I have gotten data annotated for a HUGE bunch of such images, however it is not annotated in the above form. Walls are annotated as **simple lines --- which means they're 1px thick only** and do not actually fill the area/thickness of the walls in actual image. See the following example : 

[![Annotated Data I have](https://i.stack.imgur.com/whUl8.jpg)](https://i.stack.imgur.com/whUl8.jpg)

See the 2 lines representing walls on top left in above image. While wall is thick, what I have as annotated data is just those pink 1px thick lines.

However, what I would require is actually filled region of walls completely. For example : 

[![Ground truth I want](https://i.stack.imgur.com/6AozO.jpg)](https://i.stack.imgur.com/6AozO.jpg)

What I want to do now is, programmatically, convert these lines to filled regions, i.e., based on having data about lines for every wall, I wish to create a filled version of walls inside which these lines reside. 

So, essentially the question is this : 
**If I have a thin line inside a rectangular region, can I somehow get the whole rectangular region that it is representing? If I can I could fill it with its colour and I can annotate the way it's needed.**

Some assumptions we can make : 
- Lines will always be representing the walls inside which they are
- Walls would usually be thicker lines only having some dark colour compared to rest of the image

It would be very difficult and expensive to get data annotated again, hence I'm asking this in case this could be programmatically achieved. 

I have very thin knowledge of opencv and matplotlib and hence this could be a newbie question. It might be a very very simple thing to do. In such a case, please let me know the algorithm, or function I need to read up on. 

Thanks.