I am using PointGrey GIGe Camera and their FlyCapture SDK to read the camera frames. Then I use OpenCV to track objects seen by the camera. However, my application crashes (no error) whenever the camshift() OpenCV function is called. I tried to read the images from a video file recorded using the same camera, and it works fine. So my suspicion is that there is something fishy going on in the conversion of camera frames from FlyCapture format to OpenCV image format. Here is how I do the conversion:
IplImage* img;
fc2Image convertedImage;
// here I load a frame into convertedImage (converted from RAW8 to RGB)
...
// here I convert to opencv IplImage
memcpy(img->imageData, convertedImage.pData, convertedImage.dataSize);
Whenever I feed the img variable to my code, the camshift() call crashes my program. Anybody experienced this before? Many thanks!