Go to Post The Manual is the "requirements document" for your project. - 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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 23-01-2014, 09:32
theonlydvr theonlydvr is offline
Registered User
FRC #4338
 
Join Date: Jan 2014
Location: United States
Posts: 12
theonlydvr is an unknown quantity at this point
Axis Camera Exception: No Image Available [Answered]

Hey all,

I've recently encountered a problem in saving images from the axis camera (M1101). I setup the camera according to instructions and it is working perfectly fine in every other aspect. I get a stream to the dashboard and it can be successfully pinged. However, when I try to use the getImage() function in my code I get an AxisCameraException saying no image is found even though the SmartDashboard is streaming well.

This is my code (very simple):

Code:
try
{
    Axis.getInstance("10.43.38.11").getImage().write("image.jpg");
}
catch (AxisCameraException ace)
{
    ace.printStackTrace();
}
catch (NIVisionException nive)
{
    nive.printStackTrace();
}
Thanks,

Evan Dastin-van Rijn

Last edited by theonlydvr : 23-01-2014 at 10:50. Reason: Answered
Reply With Quote
  #2   Spotlight this post!  
Unread 23-01-2014, 09:35
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,715
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Axis Camera Exception: No Image Available

Once you get the instance of the camera it takes a few seconds to actually complete the connection, so for about 5-7 seconds after getting the instance no images will be available. Try getting the instance of the camera in robotInit and accessing it from there. We ran into this problem on Tuesday and that fixed it for us.
Reply With Quote
  #3   Spotlight this post!  
Unread 23-01-2014, 09:41
BigJ BigJ is offline
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 945
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Re: Axis Camera Exception: No Image Available

Quote:
Originally Posted by notmattlythgoe View Post
Once you get the instance of the camera it takes a few seconds to actually complete the connection, so for about 5-7 seconds after getting the instance no images will be available. Try getting the instance of the camera in robotInit and accessing it from there. We ran into this problem on Tuesday and that fixed it for us.
This is also what we experienced. When you see something like "ClassName.getInstance()", it's an example of the Singleton Pattern. The first time it is called, the object is constructed, so it takes a little bit of time (see the Lazy Initialization section of the link). calling getInstance() later should be pretty quick, though.
Reply With Quote
  #4   Spotlight this post!  
Unread 23-01-2014, 10:23
theonlydvr theonlydvr is offline
Registered User
FRC #4338
 
Join Date: Jan 2014
Location: United States
Posts: 12
theonlydvr is an unknown quantity at this point
Re: Axis Camera Exception: No Image Available

Thanks so much for the replies!

I am no longer getting the exception however when I ftp to the cRIO (10.43.38.2) in my browser "image.jpg" doesn't show up. Am I correct in thinking the .write() function for Image writes tot he home directory of the cRIO and if not where does it save to?

Thanks,

Evan
Reply With Quote
  #5   Spotlight this post!  
Unread 23-01-2014, 10:49
theonlydvr theonlydvr is offline
Registered User
FRC #4338
 
Join Date: Jan 2014
Location: United States
Posts: 12
theonlydvr is an unknown quantity at this point
Smile Re: Axis Camera Exception: No Image Available

Never mind, I figured it out. I found where the image was saved: 10.43.38.2/ni-rt/system. Thanks for all the help again!
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:59.

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