1 | initial version |
Very clear that it will give error...
CvCapture* cvCaptureFromCAM(int index)
Initializes capturing a video from a camera. Parameter: index – Index of the camera to be used. If there is only
one camera or it does not matter what camera is used -1 may be passed.
The function cvCaptureFromCAM() allocates and initializes the
CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).
To release the structure, use ReleaseCapture.
2 | No.2 Revision |
Very clear that it will give error...
CvCapture* cvCaptureFromCAM(int index)
Initializes capturing a video from a camera. Parameter: index – Index of the camera to be used. If there is only
one camera or it does not matter what camera is used -1 may be passed.
The function cvCaptureFromCAM() allocates and initializes the
CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).
To release the structure, use ReleaseCapture.
3 | No.3 Revision |
Very clear that it will give error...
CvCapture* cvCaptureFromCAM(int index)
Initializes capturing a video from a camera. Parameter: index – Index of the camera to be used. If there is only
one camera or it does not matter what camera is used -1 may be passed.
The function cvCaptureFromCAM() allocates and initializes the
CvCapture structure for reading a video stream from the camera. Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394).
To release the structure, use ReleaseCapture.
try that LINK
p.p. code, found somewhere... for example:
//MJPEG network stream to OpenCV 2
#include "opencv/cv.h"
#include "opencv/highgui.h"
#include <iostream>
int main(int, char**) {
cv::VideoCapture vcap;
cv::Mat image;
const std::string videoStreamAddress = "pi.pi.pi.pi";
if(!vcap.open(videoStreamAddress)) {
std::cout << "Error opening video stream or file" << std::endl;
return -1;
}
for(;;) {
if(!vcap.read(image)) {
std::cout << "No frame" << std::endl;
cv::waitKey();
}
cv::imshow("Output Window", image);
if(cv::waitKey(1) >= 0) break;
}
}
4 | No.4 Revision |
Very clear that it will give error...
CvCapture* cvCaptureFromCAM(int index)
Initializes capturing a video from a camera. Parameter: index – Index of the camera to be used. If there is only
one camera or it does not matter what camera is used -1 may be passed.
try that LINK
p.p. code, found somewhere... for example:
//MJPEG network stream to OpenCV 2
#include "opencv/cv.h"
#include "opencv/highgui.h"
#include <iostream>
int main(int, char**) {
cv::VideoCapture vcap;
cv::Mat image;
const std::string videoStreamAddress = "pi.pi.pi.pi";
"ip.ip.ip.ip";
if(!vcap.open(videoStreamAddress)) {
std::cout << "Error opening video stream or file" << std::endl;
return -1;
}
for(;;) {
if(!vcap.read(image)) {
std::cout << "No frame" << std::endl;
cv::waitKey();
}
cv::imshow("Output Window", image);
if(cv::waitKey(1) >= 0) break;
}
}