Skip to content

basic_bot.commons.camera_opencv

Camera Objects

class Camera(BaseCamera)

This class implements the BaseCamera interface using OpenCV.

Usage:

from basic_bot.commons.camera_opencv import Camera

camera = Camera()
# get_frame() is from BaseCamera and returns a single frame
frame = camera.get_frame()
# you can then used the image frame for example:
jpeg = cv2.imencode(".jpg", frame)[1].tobytes()

frames

@staticmethod
def frames() -> Generator[Union[bytes, np.ndarray], None, None]

Generator function that yields frames from the camera. Required by BaseCamera