error using webcam
이전 댓글 표시
i want to track redobjects,i have code for it and it detects redobjects,but wen i use cam to take picture i get an error
error is
Error using ==> end
Incorrect cell or structure reference involving "end".
Most likely cause is a reference to multiple elements of a cell or
structure followed by additional subscript or structure references.
Error in ==> getCameraInfo at 4
camera_id = camera_info.DeviceInfo.DeviceID(end);
the code for getCameraInfo is
function [camera_name, camera_id, resolution] = getCameraInfo(a)
camera_name = char(a.InstalledAdaptors(end));
camera_info = imaqhwinfo(camera_name);
camera_id = camera_info.DeviceInfo.DeviceID(end);
resolution = char(camera_info.DeviceInfo.SupportedFormats(end));
can anyone suggest please
채택된 답변
추가 답변 (1개)
Daniel Shub
2011년 10월 18일
I am not sure, but following on from Walter ...
Are you sure you want
camera_info.DeviceInfo.DeviceID(end)
and not
camera_info(end).DeviceInfo.DeviceID
or
camera_info.DeviceInfo(end).DeviceID
or similarly for your comment to Walter. Instead of
a.InstalledAdaptors(end)
try
a(end).InstalledAdaptors
I am just guessing here. The output of whos or even better a description of the class and size of each object (and the nested objects) would make it easier to diagnose.
카테고리
도움말 센터 및 File Exchange에서 Video Formats and Interfaces에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!