Skip to content

Add fov_y parameter to equi2pers for accurate vertical-FOV intrinsic matrix#4

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/improve-intrinsic-matrix-formulation
Draft

Add fov_y parameter to equi2pers for accurate vertical-FOV intrinsic matrix#4
Copilot wants to merge 2 commits into
masterfrom
copilot/improve-intrinsic-matrix-formulation

Conversation

Copy link
Copy Markdown

Copilot AI commented May 2, 2026

Implements the TODO from the README:

More accurate intrinsic matrix formulation using vertical FOV for equi2pers

Also completes the documentation TODO for equi2pers.

What changed

New fov_y parameter

All equi2pers entry-points (Equi2Pers, equi2pers, get_bounding_fov) and the underlying create_intrinsic_matrix functions (numpy & torch) now accept an optional fov_y: float = None parameter.

fov_y behaviour
None (default) fy is derived from fov_x and the image aspect ratio — equivalent to the previous square-pixel assumption, fully backward-compatible
provided fy = height / (2 * tan(fov_y / 2)) — lets callers specify vertical FOV directly or model non-square-pixel sensors

The intrinsic matrix now reads:

K = [[fx,  skew, cx],
     [0,   fy,   cy],
     [0,   0,    1 ]]

where fx = width / (2 * tan(fov_x / 2)) and fy is set independently when fov_y is given.

Files changed

  • equilib/numpy_utils/intrinsic.py — add fov_y to create_intrinsic_matrix
  • equilib/torch_utils/intrinsic.py — same, supports torch.Tensor for differentiability
  • equilib/equi2pers/numpy.py — thread fov_y through create_cam2global_matrix, prep_matrices, run, get_bounding_fov
  • equilib/equi2pers/torch.py — same; also includes fov_y in the mode='nearest' grad-warning check
  • equilib/equi2pers/base.py — expose fov_y in Equi2Pers.__init__, equi2pers, and get_bounding_fov
  • tests/test_torch_utils/test_grad.py — add test_intrinsic_matrix_fov_y_gradcheck and test_intrinsic_matrix_fov_y_grad_nonzero
  • tests/test_equi2pers/test_base.py — add test_numpy_fov_y and test_torch_fov_y
  • .readme/equi2pers.md — full parameter documentation and intrinsic matrix explanation
  • README.md — mark both TODOs as done

Copilot AI and others added 2 commits May 2, 2026 01:55
…t; update docs and TODOs

Agent-Logs-Url: https://github.com/jacobsn/equilib/sessions/50b01705-6199-4dc8-8cfa-be72d993dcc6

Co-authored-by: jacobsn <984784+jacobsn@users.noreply.github.com>
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