Issues with Properly exiting camera
조회 수: 2 (최근 30일)
이전 댓글 표시
Hey All
I have a uEye 148x camera. Essentially I am doing all the proper deleting and clearing but when I open the app back up it says no device connected. This only happens when it thinks Matlab or python is still using it. I have been able to exit the camera and have the app work via Python but I haven't had much luck with properly exiting via Matlab.
This is my code
% -------------------- INITIALIZE CAMERA --------------------
clc; clear; close all;
% Set up camera
info = imaqhwinfo;
if isempty(info.InstalledAdaptors)
error('No cameras found. Connect a camera and try again.');
end
adaptor = info.InstalledAdaptors{1};
camInfo = imaqhwinfo(adaptor);
deviceID = camInfo.DeviceInfo(1).DeviceID;
vid = videoinput(adaptor, deviceID, camInfo.DeviceInfo(1).SupportedFormats{1});
src = getselectedsource(vid);
% Set camera parameters
% vid.FramesPerTrigger = 1;
% src.Exposure = -6;
% src.Gain = 10;
% adding an itial delay to make sure everything is working as expected
pause(1)
preview(vid)
% Capture initial image
img = getsnapshot(vid);
imshow(img)
closepreview(vid)
stop(vid)
delete(vid)
clear vid
Any help would be much appreciated
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 National Instruments Frame Grabbers에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!