Sign determination of contour lines