Functions for lab about structural analysis and contour detection.