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
@@ -0,0 +1,5 @@
from .base import SequentialVisualOdometryBase
from .sequential_visual_odometry import SequentialVisualOdometry
__all__ = ["SequentialVisualOdometryBase", "SequentialVisualOdometry"]
@@ -0,0 +1,39 @@
from abc import ABC, abstractmethod
import numpy as np
from models.processing import RelativePose, Matches
class SequentialVisualOdometryBase(ABC):
@abstractmethod
async def compute_relative_pose(
self, prev_image: np.ndarray, curr_image: np.ndarray
) -> RelativePose:
pass
@abstractmethod
async def extract_keypoints(
self, image: np.ndarray
) -> tuple[np.ndarray, np.ndarray]:
pass
@abstractmethod
async def match_features(
self,
keypoints1: np.ndarray,
descriptors1: np.ndarray,
keypoints2: np.ndarray,
descriptors2: np.ndarray,
) -> Matches:
pass
@abstractmethod
async def estimate_motion(
self, matches: Matches, camera_matrix: np.ndarray
) -> RelativePose:
pass
@abstractmethod
def is_tracking_good(self, pose: RelativePose) -> bool:
pass
@@ -0,0 +1,34 @@
import numpy as np
from .base import SequentialVisualOdometryBase
from models.processing import RelativePose, Matches
class SequentialVisualOdometry(SequentialVisualOdometryBase):
async def compute_relative_pose(
self, prev_image: np.ndarray, curr_image: np.ndarray
) -> RelativePose:
raise NotImplementedError
async def extract_keypoints(
self, image: np.ndarray
) -> tuple[np.ndarray, np.ndarray]:
raise NotImplementedError
async def match_features(
self,
keypoints1: np.ndarray,
descriptors1: np.ndarray,
keypoints2: np.ndarray,
descriptors2: np.ndarray,
) -> Matches:
raise NotImplementedError
async def estimate_motion(
self, matches: Matches, camera_matrix: np.ndarray
) -> RelativePose:
raise NotImplementedError
def is_tracking_good(self, pose: RelativePose) -> bool:
raise NotImplementedError