Hello Everyone,
Using C++, I'm pulling images from a ZWO ASI 120MM USB 2.0 camera (I think its an older model that uses CCD). However, when the code is looping at full speed some of the images are clipped like below. This happens around every 10 frames. Please ignore the black vertical line.


If I add a 50ms delay between calls to ASIGetImageData(), the problem dissapears. However, I need the highest possible frame rate. How do I call ASIGetImageData() at the fastest possible speed, while avoiding these clipped images?
I do have the CMOS 120MM USB3.0 camera on order. Here is my simplified code:
`int main() {
int iNumofConnectCameras = ASIGetNumOfConnectedCameras();
if (iNumofConnectCameras > 0) {
std::cout << "Connected to the camera(s)\n";
}
else std::cout << "Failed to connect to the camera(s)";
//Initializes and opens the camera
ASIOpenCamera(0);
ASIInitCamera(0);
Sleep(1000);
ASISetROIFormat(0, 640, 480, 1, ASI_IMG_RAW8);
Sleep(1000);
ASIStartVideoCapture(0);
for (int i = 0; i < 1000; ++i) {
if (ASIGetVideoData(0, img_data, size, -1) != ASI_SUCCESS)
{
std::cout << "Error getting image from camera!\n";
};
cv::Mat img = cv::Mat(480, 640, CV_8U, img_data);
cv::imwrite("C:\\Users\\XXXXX\\Desktop\\CameraImages\\img" + std::to_string(i) + ".png", img);
}
ASIStopVideoCapture(0);
if (ASICloseCamera(0) == ASI_SUCCESS)
{
std::cout << "closed\n";
}
return 0;
}`