I bought IP Camera which seems to have no brand on the box but it works fine when I check it through the browser. I wnat to use it to grab from it some frames. On the box it is said that it allowes me to grab data as mjpeg stream but in reality I can't do that. I did it before with other ip camera and all worked fine - til now.
This is my code - if it help you to solve or show me the way.
#include <OpenCV/cv.h>
#include <OpenCV/highgui.h>
CvCapture *kamera = NULL;
CvMemStorage *pamiec = NULL;
CvSeq *zakreslenia = NULL;
IplImage *klatka = 0;
IplImage *szary = 0;
char *nazwa1 = "Orginalna klatka";
char *nazwa2 = "Po zmianach";
int main()
{
kamera = cvCaptureFromFile("http://kni:blashyrkh@83.15.3.69:80/image.jpg");kamerki w systemie
if(kamera!=NULL)
{
cvNamedWindow(nazwa1,CV_WINDOW_AUTOSIZE);
cvNamedWindow(nazwa2,CV_WINDOW_AUTOSIZE);
pamiec = cvCreateMemStorage(0);
while((klatka=cvQueryFrame(kamera)) != NULL)
{
szary = cvCreateImage(cvGetSize(klatka),8,1);
cvCvtColor(klatka,szary,CV_BGR2GRAY);
cvSmooth(szary, szary, CV_GAUSSIAN_5x5,9,9,0,0);
cvCanny(szary,szary,0,20,3);
zakreslenia = cvHoughCircles(szary,pamiec,CV_HOUGH_GRADIENT,2,szary->height/4,100,100,0,1000);
cvShowImage(nazwa1,klatka);
cvShowImage(nazwa2,szary);
if(cvWaitKey(1)==(char)27)break;
}
cvReleaseImage(&szary);
cvReleaseImage(&klatka);
cvReleaseMemStorage(&pamiec);
cvDestroyWindow(nazwa1);
cvDestroyWindow(nazwa2);
cvReleaseCapture(&kamera);
cvWaitKey(0);
}
return 0;//bo jestem miły dla systemu i informuję go o braku błędów
}
I've got no idea what to do - shall I return that cam to store or write custom app to grab the frames somehow ?
I thought that it could work with image.jpg/cachebust=117434456&a on the end but it doesn't change anything
Camera is assigned to ip 83.15.3.69 with login kni and pass blashyrkh so you're allowed to check it.
Waiting for you response...