LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Image processing high speed

Hi everyone,

I am trying to take 250 fps with a Ximea camera during 30 minutes, it works but the next step is processing the images. I would like to save an array with the pixels that exceed a threshold, I am using a .dll coding in C which does it. Now, I will tell my problems:

- I have tried to take a photo, get the array and save it but it is slow (around 30 ms), and I get 50 fps.

- I have tried to take a photo, save it in a queue and in a different loop processing the image. It would work but I will have the same problem because I will take data during 30 minutes so the size of the queue would be huge.

- One step in my loop is converting the image in grayscale which it takes around 4 ms (I would like to take a photo directly in grayscale but I think it is not possible).

 

(Cameras work with a hardware trigger)

 

 

 

Download All
0 Kudos
Message 1 of 6
(790 Views)
  • Calling thread in Call Library Function is set to "Run in UI thread". It causes loop jitter. Can you change the setting to "Run in any thread"?
  • I know you have already tried Producer/Consumer Design Pattern, we want to take a look at the VI. We cannot give you valuable advice by attached VI.
  • You should remove Coercion Dot
  • Don't put "Initialize Array" function into the loop. It always allocate new memory space and would cause memory leak problem.

Any way, I want to see your Design Pattern Code.

Emboar
Certified LabVIEW Developer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

GCentral
0 Kudos
Message 2 of 6
(709 Views)

@Emboar_Dymax wrote:
  • Don't put "Initialize Array" function into the loop. It always allocate new memory space and would cause memory leak problem.

It's very unlikely that this causes a new memory allocation for every iteration. The compiler will recognize this and bring the allocation outside the loop. Or reuse the memory over each iteration, which comes down to the same thing.

 

Just for the idea of it being faster, I would bring it outside the loop. But it might very well not make any difference at all.

 

Why on earth would this create a memory leak? LabVIEW handles this perfectly. There will be no leak.

Message 3 of 6
(672 Views)

wiebe, thank you for your pointing. Because I had a memory leak problem in similar case, I concluded that was caused by the function.

Emboar
Certified LabVIEW Developer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

GCentral
0 Kudos
Message 4 of 6
(652 Views)

If all you need is just simple convent, consider use FPGA to do the job?

 

I'm using flexrio cameralink module1483 with flexrio controller, I can deal with 19200fps@128*128 when my post process is not too complex.

0 Kudos
Message 5 of 6
(643 Views)

IIRC, the IMAQ reference is documented. It points to data. I think you can get a pointer to the IMAQ data and pass that to the DLL. That would avoid a data copy (or two, maybe even three).

 

See NI-IMAQ Images and IMAQ Vision Images in C.

0 Kudos
Message 6 of 6
(619 Views)