You're going to have to explain in more detail what you're attempting to do here. Are you just trying to confine this object to an area? Is there a reason your detection areas are so small? The way you're doing it, it's natural that on some frames -- depending on timedelta or where the object is in relation to the detection areas -- your object will move far enough to jump over the detection areas, or even miss them entirely because they weren't in the object's path. It shouldn't matter which behavior you use, your results will likely be the same.