MoGe icon indicating copy to clipboard operation
MoGe copied to clipboard

Normalized camera intrinsics

Open zhangy76 opened this issue 5 months ago • 3 comments

Thank you for open sourcing your great work! I wonder how are the normalized camera instrinsics defined? How can I map it to actual camera instrinsics of an input image?

Thanks

zhangy76 avatar Jul 03 '25 03:07 zhangy76

Hi! The normalized camera intrinsics are defined such that the top-left corner of the image corresponds to (0, 0) and the bottom-right corner corresponds to (1, 1), whereas pixel-space intrinsics define the bottom-right corner as (W, H).

To convert pixel-space intrinsics $c_x, c_y, f_x, f_y$ (i.e. matrix $K$) to normalized ones $c_x', c_y', f_x', f_y'$ (i.e. matrix $K'$):

$$ K' = \begin{bmatrix}f_x' & 0 & c_x' \\ 0 & f_y' & c_y' \\ 0 & 0 & 1\end{bmatrix} = \begin{bmatrix}f_x / W & 0 & c_x / W \\ 0 & f_y / H & c_y / H \\ 0 & 0 & 1\end{bmatrix} = \begin{bmatrix}1 / W & 0 & 0 \\ 0 & 1 / H & 0 \\ 0 & 0 & 1\end{bmatrix} K $$

We choose to work with normalized intrinsics because they are well-defined and invariant to image resolution or resizing. While pixel-space intrinsics are common in OpenCV-based implementations, many people are not consistent with or not even aware of the precise definition of its coordinate system. Whether the integer pixel coordinate $(i, j)$ refers to the center or the corner of the pixel is frequently overlooked.

EasternJournalist avatar Jul 09 '25 06:07 EasternJournalist

Thank you for the reply! Are (H,W) the size of neural network inputs or the original image size? For the current demo of camera intrinsic prediction, are the output normalized or pixel-space?

zhangy76 avatar Jul 09 '25 13:07 zhangy76

Thank you for the reply! Are (H,W) the size of neural network inputs or the original image size? For the current demo of camera intrinsic prediction, are the output normalized or pixel-space?

(H, W) are the original image size. The output camera intrinsics are normalized.

EasternJournalist avatar Jul 11 '25 11:07 EasternJournalist