Go to Post Everyone needs to please stop now before Karthik starts singing. - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-05-2016, 18:37
TheModMaster8's Avatar
TheModMaster8 TheModMaster8 is offline
Active Alumni
FRC #5492 (Robo Jockeys)
Team Role: Alumni
 
Join Date: Apr 2015
Rookie Year: 2009
Location: USA, Kentucky
Posts: 119
TheModMaster8 is a jewel in the roughTheModMaster8 is a jewel in the roughTheModMaster8 is a jewel in the rough
Need help loading Axis Camera feed in Java

So I'm trying to do a little vision project and I'm stuck at how to import the live camera feed into java run on eclipse Kepler. I have OpenCV and, wpilib installed correctly. I can't get the Axis Camera "location" to work, (note I'm not using wpilib workspace at all, I made a project folder with openCV)

I have the Camera's IP set to 192.168.0.90 and it works on a web browser,
However I don't know how to initialize the camera correctly in java
Any help would be welcomed.
__________________
2009-2011: (FLL) Robot Builder / Operator
2012: (FRC Team 2783) Fabrication / HumanPlayer / FLL Ref
2013: (FRC Team 2783) Fabrication / HumanPlayer / FLL Ref
2014: (FRC Team 2783) Fabrication Student Lead / HumanPlayer / FLL Ref
2015: (FRC Team 2783) Fab Student, Teacher / HumanPlayer / Backup Driver / FLL Ref / FLL Mentor of 6 Teams
2016: (FRC Team 5492) Fabrication Student Lead / Driver / FLL Mentor of Crestwood Elementary
Past Alliance:(2783, 1208, 4154)(2783, 1002, 4265)(2783, 1182, 3868)(2783, 451, 4028)(2783, 1208!, 1288)(5492, 63, 1014) I Will Never Forget


Reply With Quote
  #2   Spotlight this post!  
Unread 01-07-2016, 12:25
pblankenbaker pblankenbaker is offline
Registered User
FRC #0868
 
Join Date: Feb 2012
Location: Carmel, IN, USA
Posts: 102
pblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of light
Re: Need help loading Axis Camera feed in Java

We have some Java code available on github that provides some examples of opening a video feed using the OpenCV methods.

The project can be found at:

https://github.com/frc868/2016-Vision

In particular the FrameGrabber.java class (https://github.com/frc868/2016-Visio...meGrabber.java).
  • The open(String url, int devId, int width, int height) method demonstrates the OpenCV methods we use to connect to the video capture device.
  • The run() method within the CaptureThread class (also in FrameGrabber.java) demonstrates opening and reading in frames.

We did find that determining the correct URL for cameras was a bit tricky. For the Axis M1103 at IP 10.8.68.11, we ended up using:

http://10.8.68.11/mjpg/video.mjpg

This seemed to have lower latency than using the H264 encoding available at:

rtsp://10.8.68.11:554/axis-media/media.amp?videocodec=h264

Finally, setting up your OpenCV environment can be tricky. If the necessary libraries aren't found, you can easily find yourself in a situation where you can grab still images just fine from the camera just fine, but are unable to grab a live stream.

Hope that helps.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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