-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8f5e04
commit 22187a9
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from typing import Optional | ||
|
||
from deps.labeller.benchmarks.detector import LandingPadDetector, BoundingBox | ||
from .camera import CameraProvider | ||
|
||
|
||
class ImageAnalysisDelegate: | ||
""" | ||
Responsible for capturing pictures regularly, detecting any landing pads in | ||
those pictures and then providing the most recent estimate of the landing | ||
pad location from the camera's perspective. | ||
TODO: geolocate the landing pad using the drone's location. | ||
""" | ||
|
||
def __init__(self, camera_provider: CameraProvider, detector: LandingPadDetector): | ||
self.camera_provider = camera_provider | ||
self.detector = detector | ||
|
||
def locate_landing_pad(self) -> Optional[BoundingBox]: | ||
""" | ||
Capture an image and then locate a landing pad, if any, from that | ||
image. Returns None if no landing pad was found. | ||
""" | ||
image = self.camera_provider.capture() | ||
return self.detector.predict(image) |