So I am currently using a Prosilica GC 640 camera to track a mouse ball along a surface. The camera is running at 200 fps, and 493X493 resolution, and I have the Count Objects VI, tracking the ball with the parameters I specify (max/min size, brightness), and then output the pixel coordinates of the center to a text file. I am currently running into two problems due to inefficiencies in my code:
1) If I try to run the program twice, the array I'm storing the position data to before it gets written to the text file doesn't clear itself and the second run just starts at the point where the first run left off. I'm sure there is a better way to get the data into an array/clear the array between runs.
2) When the program writes the data to a file, I have it write the frame number, x position, and y position of the center of the ball. However it frequently will only record say every 4 frames of position, but the camera is still acquiring at full speed. If I take down the "ExposureTimeAbs" parameter in the measurement and automation explorer settings, it will record a bit faster, but the darker image makes it harder to recognize the ball. I'm sure there might be a more efficient way to buffer/record the data so that I get the position at the full desired rate of 200 fps, any tips on this would be appreciated.
I'm posting my code and a screenshot of what the images look like.
Also the code is set up so that it only takes pictures if you hold down the capture button, so its not recording images non-stop.
Thanks,
-Ted