Schematic overview of the contact detection method, from a side view. The red curve corresponds to the red scanline from the bottom-left image and represents distance from the workspace surface. The blue curve corresponds to the median of the
scanline. As the scan progresses from left to right, more samples from the scanline are included in the median computation.