mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-04-22 22:36:37 +00:00
abc26d5c20
docs -> _docs
19 lines
540 B
Python
19 lines
540 B
Python
from typing import Optional
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class CameraParameters(BaseModel):
|
|
focal_length: float
|
|
sensor_width: float
|
|
sensor_height: float
|
|
resolution_width: int
|
|
resolution_height: int
|
|
principal_point: tuple[float, float] | None = None
|
|
distortion_coefficients: list[float] | None = None
|
|
|
|
def get_principal_point(self) -> tuple[float, float]:
|
|
if self.principal_point:
|
|
return self.principal_point
|
|
return (self.resolution_width / 2.0, self.resolution_height / 2.0)
|
|
|