facebookresearch/PoseDiffusion

about intrinsic

Closed this issue · 5 comments

Hello, Thank you for your excellent work!
I wonder if the optical center of intrinsics are fixed as image center like as [width / 2, height / 2]

Hi yes, the principal point is defaulted as the image center. Please note if you are using pixel coordinate, you need to convert them to the normalized coordinate. You can check how to do this in

# PT3D FL PP
original_size_wh = np.array(image.size)
scale = min(original_size_wh) / 2
c0 = original_size_wh / 2.0
focal_pytorch3d = anno["focal_length"] / scale
# mirrored principal point
p0_pytorch3d = -(anno["principal_point"] - c0) / scale
focal_lengths.append(torch.tensor(focal_pytorch3d))
principal_points.append(torch.tensor(p0_pytorch3d))

Thank you for your quick reply!
There is no principal point in the output, so the model only adjust focal_length?

The model only predicts focal_length, and assumes the principal point is the image center (usually this is the truth for daily usage like iphone photos). So you can just use the image center as the principal point in your application.

Thank you for your reply!
If I want to use the fixed principal point and focal_length that are calibrated by chessbord and don't adjust them ine the model , do you have any advice?

Hi you could first try using the predicted rotation and translation with calibrated principal point and focal_length. During GGS, just detach focal_length (remove its gradients) and use the value of your calibrated one. It should not affect too much (but anyway a little).

If you want to have very accurate camera poses, you could try what we have done in vggsfm, where you could optimize camera pose by bundle adjustment with the principal point and focal_length fixed at the same time (you need to assign some flags there).