mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-04-23 01:16:38 +00:00
initial structure implemented
docs -> _docs
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
from .base import GlobalPlaceRecognitionBase
|
||||
from .global_place_recognition import GlobalPlaceRecognition
|
||||
|
||||
__all__ = ["GlobalPlaceRecognitionBase", "GlobalPlaceRecognition"]
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
from abc import ABC, abstractmethod
|
||||
import numpy as np
|
||||
|
||||
from models.core import GPSPoint
|
||||
from models.satellite import TileCandidate
|
||||
from models.processing import AlignmentResult
|
||||
|
||||
|
||||
class GlobalPlaceRecognitionBase(ABC):
|
||||
@abstractmethod
|
||||
async def extract_global_descriptor(self, image: np.ndarray) -> np.ndarray:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def search_candidates(
|
||||
self,
|
||||
descriptor: np.ndarray,
|
||||
search_center: GPSPoint,
|
||||
search_radius: float,
|
||||
top_k: int = 10,
|
||||
) -> list[TileCandidate]:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def verify_candidate(
|
||||
self, uav_image: np.ndarray, satellite_image: np.ndarray
|
||||
) -> AlignmentResult:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def index_tile(
|
||||
self, tile_image: np.ndarray, tile_id: str, gps_center: GPSPoint
|
||||
) -> bool:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def build_index_for_area(
|
||||
self, nw: GPSPoint, se: GPSPoint, zoom: int
|
||||
) -> int:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def get_indexed_tile_count(self) -> int:
|
||||
pass
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
import numpy as np
|
||||
|
||||
from .base import GlobalPlaceRecognitionBase
|
||||
from models.core import GPSPoint
|
||||
from models.satellite import TileCandidate
|
||||
from models.processing import AlignmentResult
|
||||
|
||||
|
||||
class GlobalPlaceRecognition(GlobalPlaceRecognitionBase):
|
||||
async def extract_global_descriptor(self, image: np.ndarray) -> np.ndarray:
|
||||
raise NotImplementedError
|
||||
|
||||
async def search_candidates(
|
||||
self,
|
||||
descriptor: np.ndarray,
|
||||
search_center: GPSPoint,
|
||||
search_radius: float,
|
||||
top_k: int = 10,
|
||||
) -> list[TileCandidate]:
|
||||
raise NotImplementedError
|
||||
|
||||
async def verify_candidate(
|
||||
self, uav_image: np.ndarray, satellite_image: np.ndarray
|
||||
) -> AlignmentResult:
|
||||
raise NotImplementedError
|
||||
|
||||
async def index_tile(
|
||||
self, tile_image: np.ndarray, tile_id: str, gps_center: GPSPoint
|
||||
) -> bool:
|
||||
raise NotImplementedError
|
||||
|
||||
async def build_index_for_area(
|
||||
self, nw: GPSPoint, se: GPSPoint, zoom: int
|
||||
) -> int:
|
||||
raise NotImplementedError
|
||||
|
||||
async def get_indexed_tile_count(self) -> int:
|
||||
raise NotImplementedError
|
||||
|
||||
Reference in New Issue
Block a user