ErikPeter2000 / CMS_AstroPi

The AstroPi team at the Cambridge Maths School.
4 stars 0 forks source link

Improve Matching Algorithm #17

Closed ErikPeter2000 closed 3 months ago

ErikPeter2000 commented 7 months ago

After today's meeting, Richard suggested that we should improve our speed calculation algorithm, since it is currently minimal.

Goals

Current Ideas

  1. Throughout the program, store an array of calculated speeds with respective "fitness" or confidence score, which are combined into one value via a weighted mean.
  2. Use the Skyfield library to find the location, and gauge whether or not the image contains suitable features. For example, locations containing a coastline should be given a higher score as point matching will have higher chance of success. (Wish we had time for that AI thing...)
  3. By looking at the variation in direction and length of match vectors, we can see how reliable our matching is. We could consider calculating a standard deviation for these lengths and directions, and priorities speed values with a lower match deviation.
  4. If we're storing all speed values, we can detect and omit anomalies in our mean by discarding outliers by percentile or z-score.
  5. Median may be more suitable. We could even decide on the average during runtime, and save both (still outputting the single best value to speed.txt though).
  6. I know bias is bad, but we do already have a pretty close estimate for speed. I'm sure that will help...
  7. Data team can look into other match algorithms such as SIFT, but we can support the Calculation Team. CV2 should be quite flexible.
ErikPeter2000 commented 7 months ago

I have implemented weighted means (1) and anomaly detection by percentiles (4) in this commit.

ErikPeter2000 commented 7 months ago

@YotamLW I seem to be off by 0.4kms^-1 when I use the example images. This may be because of the rotation of the earth. I know that you were working on a corrective formula for this. Maybe you could take a look?