Seems very likely this is due to the way the code is trying to deal with a box that runs until an edge as an indicator that an animal that is cut off but whose box's centroid is close enough to the image center that the controller isn't driven to move anything.
So, the fix is likely to add something in that bit of the program. Might be as straightforward as to have an AND with "detecting at edge bit" that requires that the centroid of the box is close to the center or perhaps alternatively (if available in that bit of the program) requires that there be no motion command coming from the controller.
Seems very likely this is due to the way the code is trying to deal with a box that runs until an edge as an indicator that an animal that is cut off but whose box's centroid is close enough to the image center that the controller isn't driven to move anything.
So, the fix is likely to add something in that bit of the program. Might be as straightforward as to have an AND with "detecting at edge bit" that requires that the centroid of the box is close to the center or perhaps alternatively (if available in that bit of the program) requires that there be no motion command coming from the controller.