Removed test code... maskM = maskM >= 3; This caused Apparent method contour creation to fail.