Undefined function 'snapshot' for input arguments of type 'double'.

Hi I am using webcam for my project and required snapshot of the video frame. Yet this error kept popping out "Undefined function 'snapshot' for input arguments of type 'double'."
Previously it is without this error but suddenly came out with this error and I cannot solve it.I viewed related post regarding this error by adding the path of the function that i used but still cant. Anyone please lending me a hand :)
% --- Executes on button press in Capture_image.
function Capture_image_Callback(hObject, eventdata, handles)
hMain = getappdata(0,'hMain');
cam = getappdata(hMain,'camera');
bbox = getappdata(hMain,'bbox');
videoPlayer = getappdata(hMain,'videoPlayer');
pointTracker = getappdata(hMain,'pointTracker');
faceDetector = getappdata(hMain,'faceDetector');
set(handles.axes1, 'Units', 'pixels', 'Position', [60, 180, 92, 112]);
img = snapshot(cam);

1 commentaire

Use the debugger to put in a conditional breakpoint after the assignment to cam, stopping if isnumeric(cam) and then run the code. When it stops, look to see what cam has become. In particular has it become the empty matrix?

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by