I need idea to write a algorithm that will fill "holes" in my matrix.
Matrix looks like on this picture (white squares have FALSE values and black squares have TRUE values):

I need matrix to look like this:

Any idea how to find this holes in matrix and fill them with black squares (i.e. assign TRUE values to those matrix members)?
p.s. My matrix is quite large and I have a lot of matrices to examine.



















