Skip to content

Commit 5279a14

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3286365 commit 5279a14

File tree

7 files changed

+280
-249
lines changed

7 files changed

+280
-249
lines changed

src/b3d/camera.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def from_array(cls, intrinsics: Array):
3333
def as_array(self):
3434
"""Returns intrinsics as a float array."""
3535
return jnp.array(self)
36-
36+
3737
def downscale(self, factor):
3838
return Intrinsics(
3939
self.width // factor,
@@ -122,7 +122,9 @@ def camera_from_depth(z: DepthImage, intrinsics) -> CameraCoordinates:
122122
unproject_depth = camera_from_depth
123123

124124

125-
def screen_from_camera(xyz: CameraCoordinates, intrinsics, culling=False) -> ScreenCoordinates:
125+
def screen_from_camera(
126+
xyz: CameraCoordinates, intrinsics, culling=False
127+
) -> ScreenCoordinates:
126128
"""
127129
Maps to sensor coordintaes `uv` from camera coordinates `xyz`, which are
128130
defined by $(u,v) = (u'/z,v'/z)$, where
@@ -159,10 +161,12 @@ def screen_from_world(x, cam, intr, culling=False):
159161
"""Maps to screen coordintaes `uv` from world coordinates `xyz`."""
160162
return screen_from_camera(cam.inv().apply(x), intr, culling=culling)
161163

164+
162165
def world_from_screen(uv, cam, intr):
163166
"""Maps to world coordintaes `xyz` from screen coords `uv`."""
164167
return cam.apply(camera_from_screen(uv, intr))
165168

169+
166170
def camera_matrix_from_intrinsics(intr: Intrinsics) -> CameraMatrix3x3:
167171
"""
168172
Returns a 3x3 camera matrix following the OpenCV convention, ie.
@@ -219,6 +223,7 @@ def homogeneous_coordinates(xs, z=jnp.array(1.0)):
219223
"""
220224
return jnp.concatenate([xs, jnp.ones_like(xs[..., :1])], axis=-1) * z[..., None]
221225

226+
222227
homogeneous = homogeneous_coordinates
223228

224229

src/b3d/chisight/sfm/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
from .eight_point import *
22
from .epipolar import *
3-

0 commit comments

Comments
 (0)