|
Re: Multi-threading issue?
Here are some things to try:
1) Try a smaller image size (k160x120). This will vastly reduce the amount of data flowing through the system (camera->cRIO->jpeg decompress->B&W conversion->findTargets, and cRIO->dashboard too).
2) Experiment with different threshold settings for the CurveOptions in Target. Try changing 45 -> 100, but watch what happens to accuracy. This will speed up findTargets.
3) Double check how many frames per second the camera itself is sending. The cRIO may be able to process 2-15 fps, so there's not much point in generating more frames than needed. There is not a Java interface to max fps, but you can use the web interface.
4) Limit how many fps YOU are trying to process:
As a start, you can set the bar low at 2 fps (or 500ms). Then you can time how long your image processing took, subtract that from 500, then sleep for the remainder. That will leave CPU time for other robot tasks. If the other suggestions work out for you you can try for more fps.
|