Maximizing webcam FPS using multi-threaded frames withdraw

1 view (last 30 days)
I want to accelerate the webcam frame rate withdraw of the code below, I wasn't able to do that using 'parfor' from parallel computing toolbox, since the new created workers don't have 'cam' object (I think).
Any suggestions how to maximize the frames withdraw ?
Thanks!
clear all; clc;
len = 100;
weblist = webcamlist;
cam = webcam(string(weblist(1,1)));
img = snapshot(cam);
[r, c, ~] = size(img);
vid = zeros(r, c, 3, len);
tic
for i=1:len
vid(:, :, :, i) = snapshot(cam);
end
toc
clear('cam');

Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!