taygunkekec
July 5, 2011, 08:27:35
Hello,
I want to implement the most basic frame difference algorithm which is :
at time N,
New Image = Frame N - Frame N-1
But using my DFK 21BF04, sometimes my new image returns to be total zero which means Frame N and N-1 is totally same.
after opening my camera with C++ API, my code to grab images is this :
void cameracontroller::getRGBImage(int camIndex, IplImage *img)
{
handler[camIndex]->snapImages(1,0);
imageBuffers[camIndex] = handler[camIndex]->getLastAcqMemBuffer();
pixelBasedImageData[camIndex] = (RGB24Pixel*)imageBuffers[camIndex]->getPtr();
copyImageData(img, pixelBasedImageData[camIndex]);
}
And i call this function each step.
What can i do to prevent grabbing same image although i make 2 calls to grab images ?
I want to implement the most basic frame difference algorithm which is :
at time N,
New Image = Frame N - Frame N-1
But using my DFK 21BF04, sometimes my new image returns to be total zero which means Frame N and N-1 is totally same.
after opening my camera with C++ API, my code to grab images is this :
void cameracontroller::getRGBImage(int camIndex, IplImage *img)
{
handler[camIndex]->snapImages(1,0);
imageBuffers[camIndex] = handler[camIndex]->getLastAcqMemBuffer();
pixelBasedImageData[camIndex] = (RGB24Pixel*)imageBuffers[camIndex]->getPtr();
copyImageData(img, pixelBasedImageData[camIndex]);
}
And i call this function each step.
What can i do to prevent grabbing same image although i make 2 calls to grab images ?