This submission provides a way to acquire real-time streaming video from a variety of sources. It is similar in functionality to MATLAB's IP Camera support package, but provides support for a wider range of formats. It is based on JavaCV and supports all formats that are supported by OpenCV and FFMpeg, including h264 and mjpeg streams. USB cameras are supported on Windows and OSX.
The image acquisition is done in a very efficient way that result in almost zero overhead to the main MATLAB thread. This also allows for reading multiple streams at the same time (e.g. stereo vision) and reading images from high resolution (1080p) streams.
% (Axis) IP Camera
cam = HebiCam('http://<ip address>/mjpg/video.mjpg);
% USB camera
clear cam; % make sure device is not in use
cam = HebiCam(1);
% Displaying live images
img = imshow(getsnapshot(cam));
set(img, 'CData', getsnapshot(cam));
% Forced gray-scale acquisition with timestamp
cam = HebiCam(address, 'ImageMode', 'Gray');
[image, frameNumber, timestamp] = getsnapshot(cam);
Florian Enner (2021). HebiRobotics/HebiCam (https://github.com/HebiRobotics/HebiCam), GitHub. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!