hi everybody,
i'm trying to get a sequence of images with the vision functions.
with imaqEasyAcquire() everthing works fine and i get one camera image.
but with:
imaqSetupSequence (sid, images, nbOfImages, skipCount, IMAQ_NO_RECT);
imaqStartAcquisition (sid);
i get only black picture when i try to save one image of the sequence to a .png
my second idea was to check the status of acquisition before saving my image - that produced an endless loop...
//imgSessionStatus (sid, &acqInProgress, &bufNum); /* here is the mentioned check of acquisition status */
// while(acqInProgress){cout<<acqInProgress<<endl;}
I am not familiar with the imaq API, but right away I see two problems
that would explain your black image and your infinite loop.
First, you are passing myImage in the call to imaqWritePNGFile, but it seems your aquired images are actually in the images array. Try passing images[0] instead and see if you get a reasonable .png.
Secondly, you need to push your call to imgSessionStatus into your loop. Right now, you call it once, and loop forever because you never update acqInProgress. Try this:
do
{
imgSessionStatus (sid, &acqInProgress, &bufNum);
cout<<acqInProgress<<endl; }
while(acqInProgress);
ok, i found the problem...
i opened the resulting .png with gimp and ms paint instead of using this damn ms photo editor --> now everthing is fine
again, thank you for your reply,
malte