0

I have two sets of extracted points (each element of points set include (x,y) coordinates) in two different image (d:database image, q:query image), each set may have a different number of points (d={(xj,yj)}, where j=1:n) and (q={(xi,yi)}, where i=1:m). I have to check those points that they are spatially consistent between two sets. Your help is appreciated. This is the representation of two point sets:

This is d, and red point in the center is object center:

enter image description here

and this is q:

enter image description here

How to find (the indices of matched points in two sets) those points that they have similar positions relative to the center of d? How to match these two sets of points and find those that they are spatially consistent (similar position) relative to the center?

S.EB
  • 1,966
  • 4
  • 29
  • 54
  • So you just want to check if they have similar radii? – user3483203 Mar 06 '18 at 19:09
  • @chrisz I do not have center of `q`, so the points in q should be close enough to the points in `d`, in which we have distance from the center. that means the location of two matched points should be sufficiently close and their difference should be less than a threshold. Thanks – S.EB Mar 06 '18 at 19:17
  • 1
    Then maybe `abs(pi.x - qi.x) < epsilon and abs(pi.y - qi.y) < epsilon`? – user3483203 Mar 06 '18 at 19:18
  • Thanks for your comments. How to set this epsilon to be optimum, as a good start for testing? – S.EB Mar 06 '18 at 19:20
  • Start larger than you think is necessary, then go smaller until you are satisfied with results. – user3483203 Mar 06 '18 at 19:20
  • @rayryeng Thank you very much for your comment, previously, what I did was manually transformed points in `d` with 8 rotations and 8 scaling factor. This is the first time, I am hearing about ICP, is there python package? Thanks a lot once again – S.EB Mar 06 '18 at 20:27
  • 1
    @S.EB This one is one I've used quite often: https://github.com/ClayFlannigan/icp. However, the duplicate link I showed you above has a custom implementation written out using OpenCV and Python. – rayryeng Mar 06 '18 at 20:28
  • @rayryeng thanks for sharing the link, could I ask, as I see in `icp.py` the number of points in A and B should be same? but the number of points in two sets of my problem are not same? In that case, will it work? – S.EB Mar 06 '18 at 20:33
  • @S.EB Ah, OK. You're right. This will not work. I missed that you didn't have matching points. There is a variant called Coherent Point Drift algorithm that does not assume this: https://github.com/siavashk/pycpd – rayryeng Mar 06 '18 at 20:45
  • @rayryeng thanks for your help. I tried to run the [sample code](https://github.com/siavashk/pycpd/blob/master/examples/fishAffine2D.py) , this is a kind of registering two points set and finding the transformation. The output of `reg.register(callback)` is an array with which shows the transformation not the matching points. Or maybe I do not know how to use it. I edited my question, could you please guide me whether `CPD` is applicable to my problem? I want to find the indices of those points that are matching together in two sets. – S.EB Mar 18 '18 at 15:08

0 Answers0