Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT PR for discussion #382

Closed
wants to merge 11 commits into from
Closed

DRAFT PR for discussion #382

wants to merge 11 commits into from

Conversation

jeremykubica
Copy link
Contributor

Makes several fundamental changes to the KBMOD core search:

  • Shifts all predictions to be 0 centered instead of 0.5 centered for a pixel.
  • Uses floor instead of int to convert from predicted position to pixel index (matters for pixels off the negative side of the grid)
  • Removes pixel interpolation functions (add and get)
  • Makes final stamps non-interpolated.

Comment on lines -150 to +151
int current_x = x + int(curr_trj.vx * curr_time + 0.5);
int current_y = y + int(curr_trj.vy * curr_time + 0.5);
int current_x = x + (int)(floor(curr_trj.vx * curr_time));
int current_y = y + (int)(floor(curr_trj.vy * curr_time));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor question: From the earlier discussion, it seems the "+ 0.5" is used so that the int casting will round the result rather than truncate/floor it.

We should definitely be consistent about whichever we do, but out of curiosity is there a reason to prefer flooring over rounding?

Copy link
Collaborator

@wilsonbb wilsonbb Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After writing that, I'm realizing that I shouldn't have used truncate/floor interchangeably since they are only equivalent operations for positive values, but I'm still curious about the round vs floor question

@jeremykubica
Copy link
Contributor Author

Closing this for now since the Eigen change went in. We can revisit pieces of this as needed.

@jeremykubica jeremykubica deleted the PixelPos branch November 3, 2023 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants