I have a list,list whose element is dict.
[{centre: (743), radius: 1105), radius: 41},
{centre: (743, 1106), radius: 48},
{centre: (899, 1443), radius: 48},
{centre: (900, 1442), radius: 40})]
this is a data structure about the center and radius of the circle. I want to remove a circle with a similar center (Abscissa difference of about + 3) (retain a smaller radius)
.def takeXAxis(input):
return input["centre"][0]
def sortCircles(circleDetails):
circleDetails.sort(key=takeXAxis)
def removeClosedCircle(circleDetails):
newCircleDetails = []
for i in range(len(circleDetails)):
j = i + 1
for j in range(len(circleDetails)):
...
then I"m not very good at it. Can someone take a look at it for me?