Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   How to access Axis camera feed with OpenCV (http://www.chiefdelphi.com/forums/showthread.php?t=125415)

NWChen 29-01-2014 00:29

How to access Axis camera feed with OpenCV
 
Our team had some trouble accessing our IP camera's stream in OpenCV, so here's what we did in case other teams are having similar issues.

We are using OpenCV-2.4.8 and JavaCV-0.7.

Code:

IPCameraFrameGrabber grabber = new IPCameraFrameGrabber("http://YOUR_CAMERA'S_IP_ADDRESS/axis-cgi/mjpg/video.cgi?resolution=480x360&fps=INSERT_FPS_HERE");
grabber.start();

For example, our team (2601) has the following URL:
Code:

http://10.26.1.11/axis-cgi/mjpg/video.cgi?resolution=480x360&fps=100
Hope this helps.

Domenic Rodriguez 29-01-2014 10:34

Re: How to access Axis camera feed with OpenCV
 
My team has also been working with OpenCV (using the official 2.4.7 Java bindings), and we have been using this URL successfully:
Code:

http://10.xx.yy.11/mjpg/video.mjpg
I wonder if there are any differences between the two URLs other than that you can specify camera settings in your URL.

Also, I'm curious as to your decision to use JavaCV now that OpenCV includes Java bindings. Would you say there is an advantage to using JavaCV over the official bindings, or does JavaCV supplement them?

NWChen 29-01-2014 15:31

Re: How to access Axis camera feed with OpenCV
 
Quote:

Originally Posted by DomenicR (Post 1334186)
I wonder if there are any differences between the two URLs other than that you can specify camera settings in your URL.

We tried http://10.xx.yy.11/mjpg/video.mjpg but kept getting errors. This setup uses the M1011 with the DLink Rev A though.

Quote:

Originally Posted by DomenicR (Post 1334186)
Also, I'm curious as to your decision to use JavaCV now that OpenCV includes Java bindings. Would you say there is an advantage to using JavaCV over the official bindings, or does JavaCV supplement them?

We supplemented OpenCV with the JavaCV wrappers, but JavaCV had most of the functions we needed. Team 341's DaisyCV example used JavaCV so this was just a bit more convenient. I don't know about any other advantages.

charr 29-01-2014 22:31

Re: How to access Axis camera feed with OpenCV
 
I'm trying to coax my daughter's team in the direction of OpenCV and wondered if you could share any more pointers or code samples.
Thanks,
Chris

Quote:

Originally Posted by DomenicR (Post 1334186)
My team has also been working with OpenCV (using the official 2.4.7 Java bindings), and we have been using this URL successfully:
Code:

http://10.xx.yy.11/mjpg/video.mjpg
I wonder if there are any differences between the two URLs other than that you can specify camera settings in your URL.

Also, I'm curious as to your decision to use JavaCV now that OpenCV includes Java bindings. Would you say there is an advantage to using JavaCV over the official bindings, or does JavaCV supplement them?


Domenic Rodriguez 30-01-2014 00:34

Re: How to access Axis camera feed with OpenCV
 
Quote:

Originally Posted by charr (Post 1334585)
I'm trying to coax my daughter's team in the direction of OpenCV and wondered if you could share any more pointers or code samples.
Thanks,
Chris

Let me prefix this post by stating that I've only been working with OpenCV for about a month, and am by no means an expert. This will be my team's first year using it. Nevertheless, here are some of the resources I've been using to learn OpenCV:

- The OpenCV documentation and tutorials are well written and a great reference. The first class you will want to learn about is the Mat class (short for Matrix), which is what images are stored as. Then look into the Core, Imgproc, and Highgui modules.
- If you use the Java bindings of OpenCV, then you will want to refer to the Javadocs
- This thread contains links to many valuable resources regarding OpenCV and vision processing.
- The ScreenSteps Live documentation has a section that explains the algorithm that the sample vision code uses. Although it uses NI Vision as opposed to OpenCV, many of the principles still apply.
- DaisyCV, Team 341's 2012 vision code, is an excellent example of an FRC vision system built with OpenCV. Note that it is a SmartDashboard extension and uses WPIJavaCV, which differs a bit from modern OpenCV.

We'll likely be posting our code after the end of the season on GitHub (shameless self plug :rolleyes:), but if you'd like to see a sample of the code I have now to help you get started, send me a PM and I'll see what I can do.

NWChen 30-01-2014 13:45

Re: How to access Axis camera feed with OpenCV
 
Quote:

Originally Posted by DomenicR (Post 1334623)
We'll likely be posting our code after the end of the season on GitHub (shameless self plug :rolleyes:), but if you'd like to see a sample of the code I have now to help you get started, send me a PM and I'll see what I can do.

Same here, I'm no expert either but feel free to PM me. OpenCV samples are in our GitHub repo, mostly gathered across the Internet (the repo's not very well documented - sorry).

You may find it easier to begin with OpenCV-Python or SimpleCV, which have great documentation. Here's a StackOverflow post with a bunch of other good resources.


All times are GMT -5. The time now is 10:40.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi