Linear shift between 2 sets of coordinates Linear shift between 2 sets of coordinates numpy numpy

Linear shift between 2 sets of coordinates


I would change @OphirYoktan's suggestion slightly. You have these circles. I assume you know the radius, and you have that radius value for a reason.

Instead of randomly choosing points, filter the master catalog for x,y within radius of your sample. Then compute however many vectors you need to compute for all possible master catalog entries within range of your sample. Do the same thing repeatedly, then collect a histogram of the vectors. Presumably a small number will occur repeatedly, those are the likely true translations. (Ideally, "small number" == 1.)


There are several possible solutionsNote - these are high level pointers, you'll need some work to convert it to working code

The original solution (cross correlation) can be adapted to the current data structure, and should work

A believe that RANSAC will be better in your casebasically it means:create a model based on a small number of data points (the minimal number that are required to define a relevant model), and verify it's correctness using the full data set.

specifically, if you have only translation to consider (and not scale):

  1. select one of your points
  2. match it to a random point in the catalog [you may do "educated guesses", if you have some prior about what translation is more likely]
  3. this matching gives you the translation
  4. verify this translation matches the rest of your points
  5. repeat until you find a good match


I'm assuming here the objects aren't necessarily in the same order in both the photo plate and master catalogue.

Consider the set of position vectors, A, of the objects in the photo plate, and the set of position vectors, B, of the objects in the master catalogue. You're looking for a vector, v, such that for each a in A, a + v is approximately some element in b.

The most obvious algorithm to me would be to say for each a, for each b, let v = b - a. Now, for each element in A, check that there is a corresponding element in B that is sufficiently close (within some distance e that you choose) to that element + v. Once you find the v that meets this condition, v is your shift.