Why is getsnapshot on videoinput object much slower than vid.snapshot on webcam object?
15 views (last 30 days)
Show older comments
MathWorks Support Team
on 13 May 2019
Edited: MathWorks Support Team
on 24 Dec 2023
When I call "getsnapshot" on a "videoinput" object, why is it much slower than calling "vid.snapshot" on a "webcam" object?
Accepted Answer
MathWorks Support Team
on 23 Dec 2023
Edited: MathWorks Support Team
on 24 Dec 2023
"webcam" and "videoinput" have different design and implementation. When using "webcam" the camera starts streaming video as soon as the object is created. The "snapshot" function only grabs the latest frame from the stream. The camera will continue streaming until "webcam clear" is called.
When using "videoinput" the camera does not start streaming when the "videoinput" object is created. If the camera is not already streaming video "getsnapshot" will start it and then grab the latest frame. The timing overhead is due to the camera start taking additional time.
If you are looking for a low latency version of the "getsnapshot" function, can configure the "videoinput" in manual trigger mode and then start (or preview) the camera.
Please see this example for more information on how to accomplish this workflow:
0 Comments
More Answers (0)
See Also
Categories
Find more on Image Acquisition Support Packages for Hardware Adaptors (Generic Video Interface) in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!