Open kevinlinxc opened 4 months ago
I noticed it was because your code only checks the four cardinal directions, I wrote this code to check more points:
# if not all((self.img[icx-r,icy], self.img[icx+r,icy],
# self.img[icx,icy-r], self.img[icx,icy+r])):
# return False
subdivide = 10
for i in range(360//subdivide):
theta = np.deg2rad(i * subdivide)
x, y = icx + r * np.cos(theta), icy + r * np.sin(theta)
if not self.img[int(x),int(y)]:
return False
It works but it does take longer to process. I tried speeding it up using numpy and scipy but it wasn't really working properyl.
Hi, I'm passing in a blank picture and some of the circles overlap:
Is there any way to prevent this? I would prefer if they were all tangent. By the way, very nice project, exactly what I was looking for.