CvCapture *camera= cvCaptureFromFile("rtsp://192.168.1.19:554/0/1:1/main");
if (camera==NULL)
printf("camera is null\n");
else
printf("camera is not null");
cvNamedWindow("img");
while (cvWaitKey(10)!=atoi("q")){
IplImage *img=cvQueryFrame(camera);
cvShowImage("img",img);
}
cvReleaseCapture(&camera);
This is the code I used to access my IP camera. I want this to convert iplimage type to Mat type to do my project HOG human detection. So providing a necessary code in c++ for this would be a big help. I have tried Mat mtx(img); imshow("from IP camera", mtx); to convert didn't work in streaming.