The image is not large enough for the operation.

Edit: I’ve been doing my homework. Would it be better to do image processing on the Classmate PC instead of the cRIO?

Original post here:

For some reason, when I try to track vision targets, the code ends up throwing an exception saying something like “the image is not large enough for the operation.” I would post the full exception, but unfortunately I didn’t save the logs since I last worked with the test robot. I’ll post them as soon as we can.

We were able to successfully track our vision targets for a short period of time, but we’ve been dealing with this issue for the past week where the robot randomly starts throwing an exception. We have determined that this has nothing to do with the robot actually detecting the target, and that the error occurs after about the same amount of time every time. I traced the exception to the assertCleanStatus method of the NIVision.java library, but I can’t figure out what’s causing it. I’m thinking that it might be a memory issue.

Here’s a link to the code we are testing: https://github.com/ianonavy/Tracker-Demo/tree/master/src/edu/wpi/first/wpilibj/trackerdemo

Sorry, it’s sort of a mess as we’re just doing some rapid developing in a separate project before committing to our main robot code.

Any help would be much appreciated.

You may want to flip to the Charts tab on the DS and watch the available memory on the cRIO, in the right-most numeric boxes. Do the boxes continue to drop? Does the exception happen when the largest free block gets pretty small?

If so, that indicates that the images are being leaked or hoarded.

Greg McKaskle