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

Update CropRunner predict_crop_size to use newer distance approximation #32

Open
misaugstad opened this issue Nov 16, 2023 · 1 comment
Assignees

Comments

@misaugstad
Copy link
Member

A couple years ago, we ran an updated set of regressions to approximate the distance of a label from the camera, taking into account factors such as zoom level and the height of the panorama. This hasn't been incorporated into predict_crop_size() yet! I imagine that it would marginally improve the sizes of the crops, and it would also create more consistency across Project Sidewalk tools.

The code is in the following file in Project Sidewalk, with other helpful links at the line directed to from the link:
https://github.com/ProjectSidewalk/SidewalkWebpage/blob/develop/public/javascripts/SVLabel/src/SVLabel/label/Label.js#L13

@misaugstad misaugstad self-assigned this Nov 16, 2023
@misaugstad
Copy link
Member Author

Even if we don't do that, we should at least update it to account for different panorama sizes. I updated this for a partner we're working with yesterday, so I'm pasting it below. Just did some simple algebra to figure out what the function would look like when we aren't assuming that panos have a height of 6656 pixels!

// Old version
distance = max(0, 19.80546390 + 0.01523952 * old_pano_y)

// New version
distance = max(70.52258646 - 101.43424512 * (pano_y / pano_height), 0)

// New version using pitch instead of pano_y if we want
distance = max(70.52258646 - 101.43424512 * ((90 - pitch) / 180), 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant