For autonomous robots equipped with a camera, terrain classification is essential in finding a safe pathway to a destination. Terrain classification is based on learning, but the amount of data cannot be infinite. This paper presents a self-supervised classification approach to enable a robot to learn the visual appearance of terrain classes in various outdoor environments by observing moving objects, such as humans and vehicles, and to learn about the terrain, based on their paths of movement. We verified the performance of our proposed method experimentally and compared the results with those obtained using supervised classification. The difference in error rates between self-supervised and supervised methods was about 0-11%.