Optimal Pose and Shape Estimation for Category-level 3D Object Perception