fix the getBbox to work with contours without points