This paper proposes an image-based parallel lines distance measurement system (IBPLDMS), which is capable of executing an obstacle-detection and obstacle-avoidance path planning in a dynamic environment. The proposed IBPLDMS contains an image processing unit and an obstacle-avoidance unit. The image processing unit preprocesses captured images for an obstacle-avoidance task, in which the images are processed by the procedures of the grayscale transform, image morphologies, canny edge detection, connected-component labeling, and Hough transform. According to the definition of standard parallel lines, the obstacle-avoidance path for robots can be determined in the real time. Note that for the proposed IBPLDMS, only one webcam and the definition of the standard parallel lines are necessary for preparing for the setup. From the experimental results, we prove the proposed method is effective.