keypoints to bbox: piecewise linear formulation