Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Missing frames while acquiring series of images with IMAQ Grab Acquire and LabVIEW 2011 (Basler spL8192-70km camera)

I lose some frames, while I acquire series of frames (let's say 100) from my camera after it is triggered by the signal from the generator that also drives scanner mirror. In my case an image is build from those 100 frames (postprocessed). When I put an acquisition of 100 frames in a loop, I get sort of a video of my object and sometimes the image shows larger area of the object in one direction (the direction set by number of frames, so the direction of scanning). After looking at several consecutive images like that I came to the conclusion that the frames that are grabbed by LabVIEW are not evenly spaced in time and that's why I can see larger area, because the scanner could go further. I read that camera frames are evenly spaced in time and the waveform generator works correctly, so there should be something wrong with my code. The same problem occurs when I switch to acquiring from buffers.

Camera Basler spL8192-70km is connected via camera links to a framegrabber NI PCIe-1433, which is triggered by a signal coming from waveform generator from Keysight. I attach my code.

0 Kudos
Message 1 of 8
(4,030 Views)

Hi Sylwia,

 

A few questions for you:

 

1. Do you have an image showing this behavior that you could post here?

2. Does your post processed imsage seem to be missing the same frames every time or is it random?

3. Can you confirm that your Camera Link camera is acquiring all 100 frames, and it's only in post processing that they seem to get lost?

 

Hopefully by answering these questions, we can shed a little more light on this issue.

Thanks,

Rita Prather
Software Product Manager
rita.prather@ni.com
National Instruments
0 Kudos
Message 2 of 8
(3,994 Views)

Hi.

2. To me it looks as if the frames are lost randomly, because different parts of object go missing in different images when I compare them.

1+3. Showing an image would not help, and I think it would confuse everyone, because that's an OCT setup (Optical Coherence Tomography). Let me explain. I have a line scan camera. One frame is an optical spectrum of light coming from one point of my object. By Fourier transforming the spectrum I get a depth profile of my object (so a profile starting in that one point and "going" some depth in the object). If I get such a frame from points on the object that are next to each other and Fourier transform those frames, I get a 2D depth image. So each camera pixel translates to an image pixel in the direction of light propagation in the sample, thus to the depth profile - and I have no problem with that. The problem is that the 100 frames I acquire may not be 100 first frames that camera produces when it's triggered. Those 100 frames I get may be 20 first consecutive frames, then 25th to 50th, then 53-108th - that sums up to 100, but leaves parts of the object unseen (namely the parts of the object corresponding to 21-24th frame and 51-52nd frame) plus, because of that, I see the parts of the object that I shouldn't (namely 101 to 108th frame).

So I get 100 frames each time. Postprocessing is not an issue, because at the beginning and the end of postprocessing I have a 100 (no of frames) by 8192 (no of pixels in the camera) array. And not a one frame repeats itself in the array.

0 Kudos
Message 3 of 8
(3,984 Views)

Your current VI uses the high-level VIs that don't attempt to provide any buffering/guarantees that you aren't skipping images if you don't acquire fast enough. You'd either need to look at the returned buffer numbers or (better yet) use the low-level VIs that let you request specific buffer numbers. This would allow you to leverage a large buffer list to eliminate any gaps in the data.

 

I'm also not clear of your processing requirements in terms of real-time vs post-processing. If you can do everything in post-processing, a sequence-style acqusition (one-shot vs continuous) might be far simpler to work with and more efficient.

 

Eric

0 Kudos
Message 4 of 8
(3,967 Views)

I already tried using buffers, so this low-level continuous sequence-style acquisition (code attached), but the result was the same.

0 Kudos
Message 5 of 8
(3,954 Views)
I think you do not miss any image you just got some delay to acquiring some of image
also I am familiar with oct and it structure your image may be help
you can see one of my work on heidelberg OCT in this link
https://www.linkedin.com/pulse/oct-image-processing-e2e-files-hatef-fouladi?trk=mp-reader-card
also your setup schematic could be helpful for help because I have doubt why you use line scan camera for oct
best regards,
hatef
0 Kudos
Message 6 of 8
(3,940 Views)
also for first test just start to get 100 image from your camera without any other extra code and also after that check time during of your loop in your code i think the problem is there other part of your code make delay for acquiring image in continuous mode
0 Kudos
Message 7 of 8
(3,940 Views)

@sylwia.kolenderska wrote:

I already tried using buffers, so this low-level continuous sequence-style acquisition (code attached), but the result was the same.


This code looks wrong since the buffer number passed into Extract Buffer will go back to 0 on subsequent loop iterations of the loop between the start and stop.

 

I think what would be helpful is if you described in writing what you want your acquisition to look like with regards to your processing (e.g. "Acquire 100 frames, process them, then acquire 100 more").

0 Kudos
Message 8 of 8
(3,920 Views)