Shortcuts

mmocr.utils.fill_hole

mmocr.utils.fill_hole(input_mask)[source]

Fill holes in matrix.

Input:
[[0, 0, 0, 0, 0, 0, 0],

[0, 1, 1, 1, 1, 1, 0], [0, 1, 0, 0, 0, 1, 0], [0, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0]]

Output:
[[0, 0, 0, 0, 0, 0, 0],

[0, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0]]

Parameters

input_mask (ArrayLike) – The input mask.

Returns

The output mask that has been filled.

Return type

np.array