workaround for opencv 2.4.3 bug with contours