|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
Re: AxisCamera Question
Quote:
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
Re: AxisCamera Question
Quote:
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
Re: AxisCamera Question
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
|
|||
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|