Go to Post We build because we can. - Danaca [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-03-2012, 11:02
Steve Warner Steve Warner is offline
Controls / Programming
FRC #0234 (Cyber Blue)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Indiana
Posts: 43
Steve Warner is an unknown quantity at this point
AxisCamera Question

I have a very basic question about how AxisCamera works. If GetImage() is not being called, or not being called very often, do images being read from the camera accumulate in the cRIO memory? Or does each new image overwrite the previous one? If they accumulate the cRIO would eventually run out of memory whereas if they overwrite that would not be a problem. I was trying to explain this to a student and was not exactly sure how it worked.
  #2   Spotlight this post!  
Unread 12-03-2012, 13:26
Jay Meldrum's Avatar
Jay Meldrum Jay Meldrum is offline
Registered User
FRC #0067 (H.O.T.)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2003
Location: Michigan
Posts: 42
Jay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud of
Re: AxisCamera Question

From my experience in using this, each time you call GetImage() it overwrites the previous image stored in memory. The previous image will not be overwritten until GetImage() is called again.

This way you can perform multiple analysis/transforms on the image even if the image isn't "fresh".

Last edited by Jay Meldrum : 12-03-2012 at 13:33.
  #3   Spotlight this post!  
Unread 12-03-2012, 14:14
Steve Warner Steve Warner is offline
Controls / Programming
FRC #0234 (Cyber Blue)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Indiana
Posts: 43
Steve Warner is an unknown quantity at this point
Re: AxisCamera Question

Are you saying that an image is retrieved from the camera with each call to GetImage? I thought that images were constantly being received from the camera, stored in cRIO memory and that GetImage only picked up the latest one.
  #4   Spotlight this post!  
Unread 12-03-2012, 14:23
Jay Meldrum's Avatar
Jay Meldrum Jay Meldrum is offline
Registered User
FRC #0067 (H.O.T.)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2003
Location: Michigan
Posts: 42
Jay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud of
Re: AxisCamera Question

Quote:
Originally Posted by Steve Warner View Post
Are you saying that an image is retrieved from the camera with each call to GetImage?
Correct, the cRIO will only store an image from the camera when the GetImage function is called.

Be careful how often you call the GetImage function, this can lead to clogging up your cRIO.

The driver station works differently, it constantly receives a feed from the camera.

Last edited by Jay Meldrum : 12-03-2012 at 14:26.
  #5   Spotlight this post!  
Unread 12-03-2012, 20:57
Steve Warner Steve Warner is offline
Controls / Programming
FRC #0234 (Cyber Blue)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Indiana
Posts: 43
Steve Warner is an unknown quantity at this point
Re: AxisCamera Question

Okay, so if for any reason we want to stop image processing, we can stop calling GetImage. Thanks for your help.
  #6   Spotlight this post!  
Unread 13-03-2012, 08:39
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: AxisCamera Question

The descriptions here are pretty accurate, but it changed this year. To go into a bit more detail, in vision processing, there is an icon to the left that retrieves the mjpg stream as the images come in and posts them to anyone that has the same notifier. The big loop will call Get Image and process the latest -- notifiers don't queue. If you set the vision enable global to false, not only will you not call get image, but the refcount system in the Get MJPG will also stop retrieving images. After about fifteen second seconds, the camera will stop sending them entirely.

At that point, simply enabling will result in an error 66 inside the mjpg code. If you intend to enable and disable the camera during the match, you may need a version that handles that error.

Greg Mckaskle
  #7   Spotlight this post!  
Unread 13-03-2012, 09:52
Jay Meldrum's Avatar
Jay Meldrum Jay Meldrum is offline
Registered User
FRC #0067 (H.O.T.)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2003
Location: Michigan
Posts: 42
Jay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud of
Re: AxisCamera Question

Quote:
Originally Posted by Greg McKaskle View Post
The big loop will call Get Image and process the latest -- notifiers don't queue. If you set the vision enable global to false, not only will you not call get image, but the refcount system in the Get MJPG will also stop retrieving images. After about fifteen second seconds, the camera will stop sending them entirely.

At that point, simply enabling will result in an error 66 inside the mjpg code.
Greg, I'm not sure if I completely follow you. In the C++ world, the above would only happen if you were to run the deconstructor ~AxisCamera, correct?

If you do not run GetImage() for 15 seconds, you can run it again and still get a new image; at least that's what I've seen from experience.
  #8   Spotlight this post!  
Unread 13-03-2012, 11:21
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 992
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: AxisCamera Question

In C++ and Java, images are constantly acquired by a background task and written into a buffer. Calls to GetImage() read from that buffer into an IMAQ image (this includes decoding the JPEG).

Not calling GetImage() when you are not doing anything with the output will reduce your processing burden by eliminating the JPEG decoding step.
  #9   Spotlight this post!  
Unread 13-03-2012, 15:48
Steve Warner Steve Warner is offline
Controls / Programming
FRC #0234 (Cyber Blue)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Indiana
Posts: 43
Steve Warner is an unknown quantity at this point
Re: AxisCamera Question

RufflesRidge that goes back to my original question. When GetImage is not being called, are those images that are constantly being acquired filling up memory or does each new one overwrite the previous one?
  #10   Spotlight this post!  
Unread 13-03-2012, 15:51
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 992
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: AxisCamera Question

Quote:
Originally Posted by Steve Warner View Post
RufflesRidge that goes back to my original question. When GetImage is not being called, are those images that are constantly being acquired filling up memory or does each new one overwrite the previous one?
They overwrite the previous ones. You can verify this by constructing an AxisCamera object by calling GetInstance(), but then never calling GetImage(). If the images were filling up, you would see the memory indicator on the DS Charts tab rapidly dwindle to 0 before your code crashed.
  #11   Spotlight this post!  
Unread 13-03-2012, 17:30
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: AxisCamera Question

I was referring to the LV GetImage implementation. If no clients are enabled, it stops reading. I'm not that familiar with the Java and C++ implementation.

Greg Mckaskle
Closed Thread


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 01:40.

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