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

Question about Intrinsic Adjustment Formula in Center-Crop Operation #52

Closed
Rashfu opened this issue Dec 28, 2024 · 1 comment
Closed

Comments

@Rashfu
Copy link

Rashfu commented Dec 28, 2024

Hi,

Thank you for sharing your work! I have a question regarding the adjustment of intrinsic parameters after the center-crop operation in the code.

# Center-crop the image.
images = images[..., :, row : row + h_out, col : col + w_out]

# Adjust the intrinsics to account for the cropping.
intrinsics = intrinsics.clone()
intrinsics[..., 0, 0] *= w_in / w_out  # fx
intrinsics[..., 1, 1] *= h_in / h_out  # fy

From my understanding, when performing a center crop, the intrinsic focal lengths (fx and fy) should scale with the crop ratio. For example, if w_out < w_in (the cropped image is smaller than the original), the focal lengths should decrease accordingly.

Wouldn't the adjustment need to scale by the factor w_out / w_in and h_out / h_in instead of w_in / w_out and h_in / h_out? And if the image is cropped, the new cx and cy should shift relative to the new origin of the cropped image, which is not implemented in the code.

@botaoye
Copy link
Collaborator

botaoye commented Dec 30, 2024

Hi, thank you for your insightful question. Our used intrinsic matric is normalized, therefore the principal point should stay the same and the focal length changes as in the code. We share the same intrinsic format as pixelSplat, a more detailed explanation of the focal length can be found here.

@Rashfu Rashfu closed this as completed Jan 9, 2025
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

No branches or pull requests

2 participants