VideoCamera
- class machinevisiontoolbox.Sources.VideoCamera(id=0, rgb=True, **kwargs)[source]
Iterate images from a local video camera
- Parameters:
id (int) – Identity of local camera
kwargs – options applied to image frames, see
convert
Connect to a local video camera. For some cameras this will cause the recording light to come on.
The resulting object is an iterator over the frames from the video camera. The iterator returns
Image
objects.Example:
>>> from machinevisiontoolbox import VideoCamera >>> video = VideoCamera(0) >>> for im in video: >>> # process image
alternatively:
>>> img = video.grab()
- Note:
The value of
id
is system specific but generally 0 is the first attached video camera.- References:
Robotics, Vision & Control for Python, Section 11.1.3, P. Corke, Springer 2023.
- Seealso:
Methods
Get camera property
Grab single frame from camera
Release the camera
Set camera property
Attributes
Camera frame rate
Height of video frame
Shape of video frame
Width of video frame