Skip to content

Commit

Permalink
integrated camera_factory in video_input
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksa-M committed Dec 3, 2024
1 parent a0bd731 commit 752233d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions modules/video_input/video_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
"""

from .. import image_and_time
from ..common.modules.camera import camera_device
from ..common.modules.camera import camera_factory


class VideoInput:
"""
Combines image and timestamp together.
"""

def __init__(self, camera_name: "int | str", save_name: str = "") -> None:
self.device = camera_device.CameraDevice(camera_name, 1, save_name)
def __init__(self, camera_option: int, width: int, height: int) -> None:
self.device = camera_factory.create_camera(camera_option, width, height)

def run(self) -> "tuple[bool, image_and_time.ImageAndTime | None]":
"""
Returns a possible ImageAndTime with current timestamp.
"""
result, image = self.device.get_image()
result, image = self.device.run()
if not result:
return False, None

Expand Down

0 comments on commit 752233d

Please sign in to comment.