11-08-2019 08:45 AM
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)
11-10-2019 06:56 PM
Any way, I want to see your Design Pattern Code.
11-11-2019 07:21 AM
@Tepig 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.
11-11-2019 07:41 PM
11-11-2019 09:20 PM
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.
11-12-2019 02:51 AM
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).