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:
![1](https://user-images.githubusercontent.com/12991962/192161840-d955b17b-91e2-48c2-9d4f-e01c8dfba744.png)
When I merge with this method:
I get this result:
![2](https://user-images.githubusercontent.com/12991962/192161868-4f9b8f3d-af28-478f-afa3-54855397d634.png)
But if I remove a point from the closest pairs iteratively like this:
I get this output:
![3](https://user-images.githubusercontent.com/12991962/192161893-95ee64e8-defb-45e7-a2a2-0c56c2814b82.png)
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: