我已经完成了静态图像的数字板提取,即存储在matlab工作文件夹中的图像。现在希望实时检查程序功能,这意味着,我想使用相机捕获汽车图像并将其作为输入提供给matlab程序。我怎么能这样做?有人可以帮助我吗?
答案 0 :(得分:0)
为此,值得查看Image Acquisition Toolbox工具箱,该工具箱设计用于您所描述的相机Feed。
这样做的一种方法是使用getsnapshot函数从视频Feed中返回单个图像帧。
使用这种方式,您可以将您开发的当前代码保存在目录中的静态图像上(前提是它足够快,可以按照您调用的采样率getsnapshot
工作)。
即。
之类的东西numberOfFramesCaptured = 0; % Initialize frame counter
obj = videoinput('matrox', 1); % Create hardware input from camera
% Run loop until 100 frames have been captured
while(numberOfFramesCaptured < 100)
frame = getsnapshot(obj); % Get a single frame
checkNumberPlateImage(frame); % Call your image processing function
numberOfFramesCaptured = numberOfFramesCaptured + 1; % Increment frame counter
pause(x); % Change the delay between each frame that is captured by x seconds
end