and? that worked for you?
Main Topics
Browse All Topicshello! i want to access an ip camera like an axis 206 mjpeg stream with the open CV facedetect demo. i am not able to get access to any ip camera under windows, the blobtracker in example works fine for me under linux with an axis camera but not under windows.
has anybody already written something to access mjpeg ip cams with open cv in windows ?
thanks guys
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: vhpgomesPosted on 2008-04-24 at 10:43:04ID: 21433327
You'll need to grab the image from the camera using another library. Since I never owned an Ip camera, I cant point out one that will surely work... browsing the Axis official site, I found that they have an SDK (http://www.axis.com/techs up/cam_ser vers/dev/a ctivex.htm )... hope its easy to use.
,HEIGHT), IPL_DEPTH_8U, N_CHANNELS );
ffer,WIDTH *HEIGHT*N_ CHANNELS);
Once you are able to get the frames, you'll need to change the code of the facedetect example a bit:
Coment out the code where it opens a camera, or a video, since you won't be using highgui to grab frames:
#if 0 // We wont be using highgui to capture the frames
if( !input_name || (isdigit(input_name[0]) && input_name[1] == '\0') )
capture = cvCaptureFromCAM( !input_name ? 0 : input_name[0] - '0' );
else
capture = cvCaptureFromAVI( input_name );
#endif
Then you'll need to change the 'if' where he checked if a cvCapture were successfully created:
// if( capture )
becomes:
if(true)
Then change the following code:
if( !cvGrabFrame( capture ))
break;
frame = cvRetrieveFrame( capture );
if( !frame )
break;
to:
/*** grab here the frame from the camera using another library, and put it in a char* buffer ***/
if(failed_to_grab)
break;
if(!frame)
frame = cvCreateImage(cvSize(WIDTH
memcpy(frame->imageData,bu
And voila, everything should work... of course you need to set the right WIDTH, HEIGHT and N_CHANNELS from what you get of your camera... and this is surelly not optimized, but should get you started...
Hope this helps