extract the corners of a box