  As smartphone rooted distractions become commonplace, the lack of compelling
safety measures has led to a rise in the number of injuries to distracted
walkers. Various solutions address this problem by sensing a pedestrian's
walking environment. Existing camera-based approaches have been largely limited
to obstacle detection and other forms of object detection. Instead, we present
TerraFirma, an approach that performs material recognition on the pedestrian's
walking surface. We explore, first, how well commercial off-the-shelf
smartphone cameras can learn texture to distinguish among paving materials in
uncontrolled outdoor urban settings. Second, we aim at identifying when a
distracted user is about to enter the street, which can be used to support
safety functions such as warning the user to be cautious. To this end, we
gather a unique dataset of street/sidewalk imagery from a pedestrian's
perspective, that spans major cities like New York, Paris, and London. We
demonstrate that modern phone cameras can be enabled to distinguish materials
of walking surfaces in urban areas with more than 90% accuracy, and accurately
identify when pedestrians transition from sidewalk to street.
