当我尝试将PointGrey BlackFly摄像机作为GigE或WinVideo imaq.VideoDevice打开时,如果摄像机已经在FlyCapture2中打开,如何防止Matlab锁定?
我的代码
if ~ exist('videoDevice','var')
videoDevice = imaq.VideoDevice('winvideo', 2, 'RGB24_1288x728');
end95%的时间块和挂Matlab,如果相机已经打开在FlyCapture2。
系统: Windows 7 Enterprise,64位,Matlab2016a,FlyCapture2 2.9.3或2.10
发布于 2016-08-22 21:04:28
我认为您不能同时激活FlyCapture2和图像获取工具箱。
我能给您的最好建议是在Matlab中打开设备之前检查FlyCapture2进程是否正在运行。
测试FlyCapture2是否正在运行:
[status, result] = system('tasklist /FI "imagename eq Point Grey FlyCap2.exe" /fo table /nh');结果(运行时):
Point Grey FlyCap2.exe 46820 Console 3 43,232 K您可以显示警告消息和/或终止FlyCap2.exe进程:
[status, result] = system('tasklist /FI "imagename eq Point Grey FlyCap2.exe" /fo table /nh');
if (~isempty(strfind(result, 'FlyCap2.exe')))
%Display warning, and wait for user to press OK.
waitfor(warndlg('FlyCap2.exe process is running'));
%Terminate FlyCap2.exe process.
system('taskkill /f /im "Point Grey FlyCap2.exe"');
end
%Open device...
if ~ exist('videoDevice','var')
videoDevice = imaq.VideoDevice('winvideo', 2, 'RGB24_1288x728');
end

https://stackoverflow.com/questions/39078661
复制相似问题