You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi sorry for the delayed response. This is an unexpected (but interesting) use-case of fast-pair! Is it possible that, without computing the mean of the two closest points, this is in fact the outcome when you remove the closest pairs? Alternatively, what happens if you remove both a and b, and then re-insert b in the iterative case?
When I remove a and b and then re-insert b, it works:
The code:
fp=FastPair()
fp.build(points)
foriinrange(int(len(fp) *0.8)): # remove 80 percent of pointsdist, (a, b) =fp.closest_pair()
fp-=afp-=bfp+=bforpinfp:
plt.plot(p[0], p[1], "b.")
You can also try it with the notebook I shared it is pretty short. I tested this with the latest commit of this repository.
But the problem is; the algorithm should work without removing b and re-inserting b. Looks like there is a problem that may cause instability in other problems as well. I also checked the code but couldn't find it easily.
Instead of merging, removing single points results in the wrong solution. The test image looks like this:
When I merge with this method:
I get this result:
But if I remove a point from the closest pairs iteratively like this:
I get this output:
Do you have any ideas why this is happening? Input image and ipynb can be found here:
fastpair_test.zip
The text was updated successfully, but these errors were encountered: