Given a binary matrix of arbitrary size, I need to find circles which fit into this matrix and only cover "0"-fields and no "-1"-fields.
For this example
1 0 0 0 0 1 1
1 0 0 0 0 0 1
1 0 0 0 0 0 1
1 0 0 0 0 0 1
1 0 0 0 0 1 1
I want to find the following maximal circle (denoted in +
)
1 0 0 + 0 1 1
1 0 + + + 0 1
1 + + + + + 1
1 0 + + + 0 1
1 0 0 + 0 1 1
Actually this is no circle, only an approximation of it. Finding rectangles in such a binary matrix can be done with the help of histograms, see here. Additionally, I try to find smaller circles like this one:
1 0 + 0 0 1 1 1 0 0 0 0 1 1
1 + + + 0 0 1 1 0 0 0 0 0 1
1 0 + 0 0 0 1 or this one 1 0 0 + 0 0 1
1 0 0 0 0 0 1 1 0 + + + 0 1
1 0 0 0 0 1 1 1 0 0 + 0 0 1
Does anybody have a smart idea (like the histogram-approach for rectangles) of how to identify these circles (or its discrete approximations, respectively)?