Line following robot is one of the popular robots commonly used for educational purposes. The most widely used sensors for the robots are photoelectric sensors. However, it is irrelevant, along with the development of autonomous vehicles and robotic vision. Robotic vision is a robot that can obtain information through image processing by the camera. The camera installed on the line following robot aims to detect image-based lines and to navigate the robot to follow the path. This paper proposed a method of image preprocessing along with its robot action for line-following robots. This includes image preprocessing such as dilation, erosion, Gaussian filtering, contour search, and centerline definition to detect path lines and to determine the proper robot action. The implementation of the robot is simulated using Webots simulator. OpenCV and Python are utilized to design line detection systems and robot movements. The simulation result shows that the method is implemented properly, and the robot can follow a different type of path lines such as zigzag, dotted, and curved line. The resolution of the cropped-image frame is the fundamental parameter in detecting path lines.