Skip to content

Commit

Permalink
fix cx,cy calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
jb-ye authored and Jianbo Ye committed May 8, 2024
1 parent 904aa0f commit 02d7430
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions nerfstudio/process_data/realitycapture_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ def realitycapture_to_json(
frame["file_path"] = image_filename_map[basename].as_posix()
# reality capture uses the 35mm equivalent focal length
# See https://en.wikipedia.org/wiki/35_mm_equivalent_focal_length
v = max(width, height) / 36.0
frame["fl_x"] = float(cameras["f"][i]) * v
frame["fl_y"] = float(cameras["f"][i]) * v
frame["cx"] = float(cameras["px"][i]) * v + width / 2.0
frame["cy"] = float(cameras["py"][i]) * v + height / 2.0
scale = max(width, height)
frame["fl_x"] = float(cameras["f"][i]) * scale / 36.
frame["fl_y"] = float(cameras["f"][i]) * scale / 36.
frame["cx"] = float(cameras["px"][i]) * scale + width / 2.0
frame["cy"] = float(cameras["py"][i]) * scale + height / 2.0
frame["k1"] = float(cameras["k1"][i])
frame["k2"] = float(cameras["k2"][i])
frame["k3"] = float(cameras["k3"][i])
Expand Down

0 comments on commit 02d7430

Please sign in to comment.