Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Timestamping of images in NI-IMAQdx

Hi guys
Is there any way how to get precise timestamps for the images acquired to the internal buffers of IMAQdx during continuous acquisition?
Vladimir

View my profile on LinkedIn
0 Kudos
Message 1 of 13
(8,252 Views)

Hi Vladimir,

If you are using a GigE Vision camera with IMAQdx there are several pieces of "metadata" that are available with each image. IMAQdx provides these as custom data attached to the image that you can extract with the appropriate Vision functions. This allows you to get a 64-bit timestamp from the camera, number of lines in the image (for linescan apps), and number of lost packets in the image. I have attached some VIs that show how to do this.

I am not sure there is any way to get an accurate timestamp from a firewire camera unless they return that data as part of the image data.

Let me know if this accomplishes what you want.

Thanks,

Eric Gross

 

 

Download All
0 Kudos
Message 2 of 13
(8,240 Views)

Hi Eric

Thanks for your help, but I'm using a Firewire camera. It's interesting to know that GigE Vision supports timestamping.

Vladimir


View my profile on LinkedIn
0 Kudos
Message 3 of 13
(8,229 Views)
Hello Vladimir,

It looks like getting timing information from a firewire camera is camera dependent.  If your camera supports sending this data with each frame then there is probably a way to extract this data.  If not then you will have to do it software timed.  For example you could take a timestamp at the beginning of the acquisition and then determine incremental time values depending on the frame rate.  This will not be extremely accurate but is probably the best way to go.  Best of luck.

Regards,
Mark T
Applications Engineer | National Instruments
0 Kudos
Message 4 of 13
(8,202 Views)
If the Firewire camera support this, do I use the same VI you suggest to obtain the timestamp. Is this timestamp generated by the computer  or by the camera, I want to
calculate the delay between the image is captured and the time I actaully read the image.

Thanks

Cindy

Message Edited by akang on 03-09-2007 09:28 AM

0 Kudos
Message 5 of 13
(8,064 Views)
Eric,

I was referred to this thread when I asked a similar question (http://forums.ni.com/ni/board/message?board.id=170&message.id=233981), and your post with the custom data vis was EXTREMELY helpful. The question I have is one regarding the format of the timestamp. You say in your post that the timestamp is 64 bits, but using your vi I get error 74 (memory or data structure corrupt) when I try to wire a 64 bit unsigned integer to the "unflatten from string". You had wired an unsigned long, which works fine except it overflows and rolls back to 0 every minute or so with the camera I'm using. I'd like to be able to record for ~100 minutes, so I either need a 64 bit number or I need to do something more fancy with the 32 bit number to deal with the rollover. I don't even need all the precision of the 32 bit number, so if there were a way to shift it somehow that would also work (i.e. exchanging 2 or 3 most precise digits for 2 or 3 least precise digits) If you have any suggestions it would be greatly appreciated.

Also, are the keys in the program camera specific?

Ken
0 Kudos
Message 6 of 13
(8,056 Views)
Hi Ken,
 
I'm glad to hear of your success so far. If you check out the previously attached "CustomDataExample Advanced.vi" it will let you browse all the meta data available in the images coming off the camera. Currently all those items are represented by 32-bit values. The timestamp, being 64-bit, is represented by two entries, "IMAQdxTimestampLow" and "IMAQdxTimestampHigh". You can combine these and get the original 64-bit timestamp.
 
Those keys are not camera specific, as all the items currently contained in IMAQdx's metadata is part of the GigE specification and its structure is standardized among all cameras. However, the resolution of that timestamp (and whether it is valid or not) is camera-specific. We don't currently expose the resolution as a readable attribute, but many cameras do so via Genicam attributes. On a Basler scA1390-17gm I have around the attribute "GevTimestampTickFrequency" (following the standard features naming convention)  returns a value of 125,000,000Hz for its timer resolution.
 
Please let me know if you have any more questions,
-Eric G
 
 

Message Edited by BlueCheese on 03-09-2007 01:19 PM

Message 7 of 13
(8,045 Views)
Thanks...it works perfectly!

Ken
0 Kudos
Message 8 of 13
(8,034 Views)
Eric:

How to access the "Genicam attributes" you were talking about in Labview?

Thanks

Cindy
0 Kudos
Message 9 of 13
(7,973 Views)

Hi Cindy,

Genicam attributes for GigE cameras are accessed the same as all attributes under IMAQdx, for both Firewire and GigE cameras. There is a good explanation here: http://forums.ni.com/ni/board/message?board.id=200&message.id=12792

Let me know if you still have questions.

-Eric G

0 Kudos
Message 10 of 13
(7,949 Views)