How to connect SJCAM SJ4000 as a webcam to MATLAB
6 次查看(过去 30 天)
显示 更早的评论
Hi, I have just bought a SJCAM action camera, model SJ4000.
It is able to function as a normal webcam on the PC. Hence, I tried connecting it to MATLAB as a webcam so that I can acquire images through MATLAB for an image processing project, however, the following error showed up:
P.S.: I have installed the MATLAB Support Package for USB Webcams and have updated the SJ4000 camera to its latest firmware.
>> webcamlist
ans =
cell
'J1455 '
>> cam = webcam('J1455 ')
Warning: The following error was caught while executing
'matlab.webcam.internal.WebcamController' class destructor:
Struct contents reference from a non-struct array object.
Error in matlab.webcam.internal.WebcamController/delete
Error in matlab.webcam.internal.WebcamController
Error in webcam (line 159)
matlab.webcam.internal.WebcamController(devName, devID);
> In matlab.webcam.internal.WebcamController
In webcam (line 159)
Error. The format exposed by the webcam is not supported.
I have tried connecting other webcams (BisonCam, NB Pro and Logitech C170 webcam) to MATLAB and has managed to get them working, but not for this SJ4000 camera.
I would like to know what's the solution to this error, your help is much much appreciated!
2 个评论
Grzegorz Wieczorek
2017-4-24
I managed it that way:
>> webcamlist
ans =
2×1 cell array
'Chicony USB 2.0 Camera'
'J1455 '
>> obj = videoinput('winvideo', 2);
>> obj.SelectedSourceName = 'input1';
>> obj = videoinput('winvideo', 2, 'MJPG_1920x1080');
>> preview(obj)
And it worked for me.
回答(1 个)
Eugene Lipunov
2022-12-13
imaqhwinfo
% choose the source by index vidid, get vid
vid = videoinput ('winvideo', vidid);
% optional: src = getselectedsource (vid);
preview (vid);
% loop to get snapshots (do not close preview)
img = getsnapshot (vid);
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!