In order to solve the problem of autonomous vehicles driving safely on the road while searching for optimal paths to avoid traffic congestion and obstruction, this paper establishes an optimal path planning model based on image feature extraction. The model consists of four parts: the selection of key turning points, interpolation between turning points, definition of the evaluation function, and global optimal path search. First, based on the map information provided by the network, an image feature detection algorithm was proposed, and the key turning points of the map route were selected and stored in an open table. Then, based on mechanical analysis theory, the cubic interpolation between two key turning points of the optimal path was defined. This allows the car to drive along a continuous curve with a certain arc radius, enabling it to drive smoothly, effectively avoid obstacles, and ensure safety. Then, an evaluation function is defined as needed, and different evaluation functions are specified for different road sections to avoid excessive local deviations in planning and to reduce the impact of known obstacles on the path. Finally, the cost of the search path is calculated based on the evaluation function. According to the principle of minimum cost, a globally optimal heuristic search algorithm is proposed to find the globally optimal path. Experimental results show that the proposed global optimal path planning algorithm has excellent performance, with an average accuracy of 96.71% and a search speed of 2.78 ms. The model not only provides accurate path planning and fast path selection capabilities but also has strong robustness against interference.