Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Correlating image with analog data

Hello, I have a gig-e camera (prosilica GE 680) and an FPGA card 7850R. With the FPGA I'm monitoring the trigger out line of the camera that indicates when an exposure takes place. While the camera exposes, I'm accumulating data from an analog line. In the software, some time after that exposure and the gig-e ethernet transfer the software will pick up the image from IMAQ-dx. Of course by then, the next exposure may already have occured so I can't just read the analog data at that moment because it will correspond to the wrong image. Is there a good way to gaurentee the image and the analog data coincide?

 

I'm thinking of elaborate mechanisms to syncronize the camera tick count and the FPGA tick count.  

CLED (2016)
0 Kudos
Message 1 of 8
(4,079 Views)
You can use a "imaq configure list" in conjuction with "Imaq buffer" and rettrive the image accordingly.
0 Kudos
Message 2 of 8
(4,055 Views)

If you have a start trigger that starts both acquisitions together, you should be able to keep the images and data synchronized.  The first image goes with the first data point, second with second, etc.  Just make sure you have a large image buffer so you won't lose any images and you should be fine.

 

Is this short interval or long interval?  Are the images captured at a regular rate, or are they triggered at different intervals?

 

I suppose for longer intervals, you could read the timestamp on the first image and generate a zero timestamp in the FPGA at the same time.  As long as the FPGA timestamp increments in real seconds, the offset should always be the same.  This would be overkill unless you are having problems with missed images though.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 3 of 8
(4,050 Views)

I can't quite figure out which trigger generates the first image. The camera is externally triggered at the moment and so it's been getting triggers for a while before the software gets to it.

 

Even assuming I could watch both the image count and the analog image count, I'm nervous about all the what iffs. Like, what if an image gets lost over the ethernet; I'd then be off by 1 which is unacceptable.

 

I want to be able to support short intervals. Maybe 200 fps. The images are captured at a fairly regular rate.  

CLED (2016)
0 Kudos
Message 4 of 8
(4,034 Views)

Bruce is correct.  Using a start trigger to start both acquisitions will allow you to make sure the analog data capture coincides with the image acquistion.  

Can you control the external trigger so that you know when the first trigger occurs.  If you're using a pulse train as your external trigger, considering gating the trigger. Here is some more information gating counters: http://digital.ni.com/public.nsf/allkb/204538A044431C9B86257377004EB952?OpenDocument

 

I hope this helps!

 

Kristen H.

0 Kudos
Message 5 of 8
(4,015 Views)

Kristen H. wrote:

Bruce is correct.  Using a start trigger to start both acquisitions will allow you to make sure the analog data capture coincides with the image acquistion.  

Can you control the external trigger so that you know when the first trigger occurs.  If you're using a pulse train as your external trigger, considering gating the trigger. Here is some more information gating counters: http://digital.ni.com/public.nsf/allkb/204538A044431C9B86257377004EB952?OpenDocument

 

I hope this helps!

 

Kristen H.


 

I have no problem with synchronizing my analog capture with my digital signal. They are synchronized. My problem is that even though they are synchronized, due to latencies and potential data loss, I am at risk of off by 1 errors where analog capture n gets associated with image n+1.

 

As I said before, I don't have control of the external signal.  I didn't quite understand what you were talking about with gating the trigger. Gating the camera trigger? How does that help me? Gate it with what signal?
Message Edited by InfiniteNothing on 09-22-2009 02:00 PM
CLED (2016)
0 Kudos
Message 6 of 8
(4,012 Views)

You may not have control over the camera trigger, but you can still control the acquisition start trigger.  Route a signal from your FPGA to your framegrabber.  Send a signal from the FPGA when you want to start the acquisition, and use the trigger input on the framegrabber to start the acquisition.  The next camera pulse will be the first image acquired.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 7 of 8
(4,005 Views)
I'm just thinking that over tens of thousands of images and analog measurements, something's going to happen that's going to cause one of the two to be dropped. Ethernet glitch? Triggering the camera too fast? Missed trigger pulse? buffer underrun? etc. Then I'd have analog measurement n associated with image n ± 1 and then analog measurement n+1 would get associated with image n + 1 ± 1 and so forth. Am I being too paranoid?  I guess I was hoping for some other ideas.
Message Edited by InfiniteNothing on 09-22-2009 02:23 PM
CLED (2016)
0 Kudos
Message 8 of 8
(3,999 Views)