Moved object initialization outside of the on camera frame functions