Cleared contour Mat and hierarchy