Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

multi camera acquisition leads to wrong ringbuf-channel mapping

I use a IMAQ 1409 for high-speed acquisition of a multi-camera system (genlocked). Therefor I use a
c-programm with low-level commands. I set up a ring-buffer(4 buffer, each buffer one different camera), so the acquisition is at its highes speed. Unfortunately there is sometimes a frame missing. When this occurs the assignment of the channels to the buffers is not valid anymore, also there is no report of frame-lost.
eg: Start-Configuration
buffer[0] -> Channel 0 -> Camera 1
buffer[1] -> Channel 1 -> Camera 2
buffer[2] -> Channel 2 -> Camera 3
buffer[3] -> Channel 3 -> Camera 4

after frame lost
buffer[0] -> Channel 1 -> Camera 2
buffer[1] -> Channel 2 -> Camera 3
buffer[2] -> Channel 3 -> Camera 4

buffer[3] -> Channel 0 -> Camera 1

Is there any possibility to get for a spezific buffer the associated channel direkt after the acquiring process?
I associate the channels just by getting the last-valid buffer, modulo division by four -> channel-nr -> camera nr. But, as I said, when a frame lost occurs, then the buffer zero has images from camera 2.

best regards
Bernhard
0 Kudos
Message 1 of 2
(3,148 Views)
Hello Bernhard,

The buffer should already be associated with a channel when you create the buffer list. Here is a snippet of code I found for Visual C++ and multiple channels:

/* the following configuration assigns the following to the buffer list
elements:

1) buffer pointer that will contain image
2) size of the buffer for buffer element 0
3) command to go to next buffer or loop when the last element is reached
4) channel assigned to this buffer
*/
for (i = 0; i < NUM_RING_BUFFERS; i++)
{
imgCreateBuffer(Sid, FALSE, bufSize, &ImaqBuffers[i]);
imgSetBufferElement(Bid, i, IMG_BUFF_ADDRESS, (uInt32)ImaqBuffers[i]);

imgSetBufferElement(Bid, i, IMG_BUFF_SIZE, bufSize);
bufCmd = (i == (NUM_RING_BUFFERS - 1)) ? IMG_CMD_LOOP : IMG_CMD_NEXT;
imgSetBufferElement(Bid, i, IMG_BUFF_COMMAND, bufCmd);
imgSetBufferElement(Bid, i, IMG_BUFF_CHANNEL, i);
}

I hope this helped you.

Philip W.
Applications Engineer
0 Kudos
Message 2 of 2
(3,148 Views)