-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
As with all good things, I've been tempted to rewrite the API and implementation and change things massively.
The primary changes being:
- Extract the image processing from the
BaseCamera
into primary functions - Remove the
ImageFileCamera
andMarkerCamera
. Replace with aprocess_image
function, a more genericprocess_frame
function, and some form ofget_marker_image
.VideoFileCamera
will probably stay as-is, as that still makes a bit of sense as a "camera", - Ensure these new methods are part of the public API
- Remove
get_visible_markers
. It's an additional API to maintain (and variants of the below) with little to no benefit ([marker.id for marker in camera.process_frame()]
works absolutely fine).
API examples
def process_image_eager(file: Path, marker_dict, detector_params: CalibrationParameters, marker_size: int) -> Generator[EagerMarker, None, None]: ...
def process_image(file: Path, marker_dict, detector_params: CalibrationParameters, marker_size: int) -> Generator[Marker, None, None]: ...
def process_frame(data: ndarray, marker_dict, detector_params: CalibrationParameters, marker_size: int) -> Generator[Marker, None, None]: ...
def process_frame_eager(data: ndarray, marker_dict, detector_params: CalibrationParameters, marker_size: int) -> Generator[EagerMarker, None, None]: ...
def get_marker_image(border_size: int, marker_id: int, marker_size: int, border_colour: Tuple[int, int, int]) -> ndarray: ...
- Lots of the options to the above are shared, I wonder if it's worth having a struct to collect them together, similar to
CalibrationParameters
.?
Metadata
Metadata
Assignees
Labels
No labels