initial structure implemented

docs -> _docs
This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-12-01 14:20:56 +02:00
parent 9134c5db06
commit abc26d5c20
360 changed files with 3881 additions and 101 deletions
+35
View File
@@ -0,0 +1,35 @@
import numpy as np
from models.core import CameraParameters
class CameraModel:
def __init__(self, params: CameraParameters):
self._params = params
self._K: np.ndarray | None = None
@property
def intrinsic_matrix(self) -> np.ndarray:
if self._K is None:
fx = self._params.focal_length * self._params.resolution_width / self._params.sensor_width
fy = self._params.focal_length * self._params.resolution_height / self._params.sensor_height
cx, cy = self._params.get_principal_point()
self._K = np.array([
[fx, 0, cx],
[0, fy, cy],
[0, 0, 1]
], dtype=np.float64)
return self._K
def project(self, points_3d: np.ndarray) -> np.ndarray:
raise NotImplementedError
def unproject(self, points_2d: np.ndarray, depth: float) -> np.ndarray:
raise NotImplementedError
def undistort_points(self, points: np.ndarray) -> np.ndarray:
raise NotImplementedError
def get_fov(self) -> tuple[float, float]:
raise NotImplementedError