VERY SLOW aqcuisition of video frames using snapshot function compared to windows camera
조회 수: 5 (최근 30일)
이전 댓글 표시
Im trying to acquire videos using Matlab and Microsoft webcam with maximum resolution, yet the effective sampling frequency is extremely slow (one order of magnitude) compared to what I can get using conventional recording with the windows program 'camera'. Any ideas???? ( I do have many advantages of being able to to the whole process through MATLAB but need a decent speed though).
The core of my code looks like this:
cam = webcam(1);
cam.Resolution='1920x1080';
cam.WhiteBalance=3000; % 2500 to 10000
cam.Exposure=-13; % 0 to -13
cam.Brightness=30; % 30 to 255 VALOR USADO 160
cam.Sharpness=50; % 0 to 50
cam.Focus=30; % 0 to 40
cam.Contrast=5; % 0 to 10
cam.BacklightCompensation=0; % 0 to 10
cam.Saturation=0; % 0 to 200
cam.Zoom=0; %0 to 317
fileobj_save = VideoWriter(filename_save);
open(fileobj_save)
while tElapsed<=max_time
f=snapshot(cam);
writeVideo(fileobj_save,f);
end
close(fileobj_save)
댓글 수: 1
Augusto Sanches
2019년 2월 13일
Hello, Mario!
I was facing the same issue with the snapshot function. So I downloaded and installed this toolbox:
This will give you access to the 'winvideo' adaptor. So I used imaqhinfo('winvideo') and found the video input constructor of my camera. Using this constructor of your camera, you can start acquiring images using the getSnapshot function. This function worked a way faster for me.
Here they show you how to use the getSnapshot function:
https://www.mathworks.com/help/imaq/examples/acquiring-a-single-image-in-a-loop.html
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Acquisition Support Packages for Hardware Adaptors (Generic Video Interface)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!