In the contemporary age, creating autonomous vehi- cles is a crucial starting point for the advancement of intelligent transportation systems that rely on sophisticated telecommu- nications network infrastructure, including the upcoming 6g networks. The paper discusses two significant issues, namely, lane detection and obstacle detection (such as road signs, traffic lights, vehicles ahead, etc.) using image processing algorithms. To address issues like low accuracy in traditional image processing methods and slow real-time performance of deep learning-based methods, barriers for smart traffic lane and object detection algorithms are proposed. We initially rectify the distorted image resulting from the camera and then employ a threshold algorithm for the lane detection algorithm. The image is obtained by extracting a specific region of interest and applying an inverse perspective transform to obtain a top-down view. Finally, we apply the sliding window technique to identify pixels that belong to each lane and modify it to fit a quadratic equation. The Yolo algorithm is well-suited for identifying various types of obstacles, making it a valuable tool for solving identification problems. Finally, we utilize real-time videos and a straightforward dataset to conduct simulations for the proposed algorithm. The simula- tion outcomes indicate that the accuracy of the proposed method for lane detection is 97.91% and the processing time is 0.0021 seconds. The proposal for detecting obstacles has an accuracy rate of 81.90% and takes only 0.022 seconds to process. Compared to the conventional image processing technique, the proposed method achieves an average accuracy of 89.90% and execution time of 0.024 seconds, demonstrating a robust capability against noise. The findings demonstrate that the suggested algorithm can be implemented in self-driving car systems, allowing for efficient and fast processing of the advanced network.