Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

use Low-Level Functions grab using IMAQ on 64-bit win7 OS

I am having trouble writing a C++ program to acquire a sequence of images into memory and save them onto my computer. My computer has 8GB of memory running Windows7 64bit.I try to use the LLGrab program.I create a buffer list for the camera. I create the buffer, and set the zeroeth entry in the buffer list to it. I further set that first and only entry such that the camera will stop

acquiring data after filling it with an image . Then  “lock” the buffer into memory, and configure the camera to use this new buffer list.

imgCreateBufList( 1, &bid_ );

 imgCreateBuffer( sid_, FALSE, buflen_,(void**)&buf_ );

imgSetBufferElement( bid_, 0, IMG_BUFF_ADDRESS,(unsigned long)buf_);

imgSetBufferElement( bid_, 0, IMG_BUFF_SIZE, buflen_ );

imgSetBufferElement( bid_, 0, IMG_BUFF_COMMAND,IMG_CMD_STOP );

imgMemLock( bid_ );

imgSessionConfigure( sid_, bid_ );

imgSessionAcquire(Sid, TRUE, NULL);

The problem is how can I copy the data from the buffers?i have used imgSessionCopyBufferByNumber to copy image data,but it don`t work.can i use which function?

0 Kudos
Message 1 of 2
(3,251 Views)

If you are allocating the image buffer directly there, you already have the buffer (buf) and don't need to copy it --- you can just directly reference it (zero-copy). There is some hand-shaking with the driver you might need to do in certain circumstances to protect the buffer from being overridden while you access it, but if you are only acquiring a one-shot sequence then you probably can avoid it.

 

Eric

0 Kudos
Message 2 of 2
(3,245 Views)