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)
Any way, I want to see your Design Pattern Code.
- 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.
Why on earth would this create a memory leak? LabVIEW handles this perfectly. There will be no leak.
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.