|
Re: TrackTwoColors execution time
Another aspect that will effect the CPU loading is how often you are calling the TrackTwoColors() routine. The number of images per second that are retrieved from the camera is set at the StartCameraTask() call. Once you have a new image and process it once, if you keep calling TrackTwoColors() you will not only chew up CPU time, but you will keep getting the same answer back (you're checking the same image). If the camera task is a lower priority than the main task (I don't know) then the constant vision processing in the main loop may be backlogging the camera task. Regardless, it's a whole lot of useless CPU hogging.
We made a 'newImageAvailable()' function, which uses the GetImage() function (which returns a timestamp) to determine when a new image is available. So we only have to do our version of the TrackTwoColors() call once per new image. With a 160x120 image size, we easily do 15 frames per second. We could maybe do more but haven't tried.
Steve C.
|