Undefined function snapshot for input arguments of type 'uint8'?

조회 수: 20 (최근 30일)
Manisha Jaiswal
Manisha Jaiswal 2018년 4월 18일
댓글: Manisha Jaiswal 2018년 4월 18일
I have a code in which I need to use mobile as ipweb cam to take a single image.
url='http://192.168.43.1:8080/shot.jpg';
cam = imread(url);
img= snapshot(cam);
imshow(img);
fullFileName= fullfile('C:\Users\USER\Desktop\final year project\FFF', '.jpg');
imwrite(img,fullFileName);
clear cam;
BUt I am getting an error saying undefined function 'snapshot' for input arguments of type 'uint8'. I am using matlab2014a.

채택된 답변

Jan
Jan 2018년 4월 18일

Did you read the documentation already? doc snapshot. You have to create the "cam" object e.g. by cam = webcam('Logitech'). In your code, the image is obtained by imread(url) already, so simply replace:

cam = imread(url);
img= snapshot(cam);
imshow(img);

by

img = imread(url);
imshow(img);
  댓글 수: 2
Manisha Jaiswal
Manisha Jaiswal 2018년 4월 18일
Thank you for the help.
Manisha Jaiswal
Manisha Jaiswal 2018년 4월 18일
Here, I have created two pushbuttons both of which store images but in different folders. The problem which I am facing is that the first button captures the image correctly but when the second button is pressed, it shows error as:
Error using imread (line 330) Can't read URL "http://192.168.43.1:8080/pic.jpg".

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for IP Cameras에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by