By transplanting MJPG-Streamer to ARM, you can send the video stream of the USB camera to the computer browser through the HTTP protocol.
But how to get video streams for opencv for video image processing? In fact, it is very simple. You only need to pass the video flow URL address to the CVCAPTUREFROMFILE function.
Here you need to pay attention to a question is to add behind the URL?dummy=param.MJPG, otherwise OpenCV will prompt to find the decoder.
The code is given below:
#include “stdafx.h”
#include “cv.h”
#include “highgui.h”
int main()
{
CvCapture* capture = cvCaptureFromFile(“http://192.168.1.101:8080/?action=stream?dummy=param.mjpg“);
IplImage* frame;
cvNamedWindow(“frame”);
while(frame = cvQueryFrame(capture))
{
cvShowImage(“frame”,frame);
cvWaitKey(33);
}
cvReleaseCapture(&capture);
cvDestroyAllWindows();
return 0;
}