Accurate crop row detection is an important foundation for agricultural machinery to realize autonomous operation. In this paper, a real-time soybean-corn crop row detection method based on GD-YOLOv10n-seg with PCA fitting is proposed. Firstly, the dataset of soybean-corn crop row was established, and the image was labeled by line label. Then, an improved model GD-YOLOv10n-seg model was constructed by integrating GhostModule and DynamicConv into the YOLOv10n-segmentation model. The experimental results show that the improved model performs better in MPA and MiOU, and the model size is reduced by 18.3%. The crop row center line of the segmentation results is fitted by PCA, the fitting accuracy reaches 95.08%, the angle deviation is 1.75°, and the overall processing speed is 57.32FPS. This study can provide an efficient and reliable solution for agricultural autonomous navigation operations such as weeding and pesticide application under soybean-corn compound planting mode.