This study addresses the challenge of scheduling coordination between harvesters and transfer vehicles during the mechanized harvesting of processing peppers. An online detection method for assessing the loading capacity during harvesting was proposed, employing non-contact distance sensors to measure the stacking height of peppers in the hopper in real time. This measurement was used to calculate the loading capacity of the transfer vehicle for peppers. This study compared and analyzed the detection accuracy of ultrasonic, infrared distance, and light detection and ranging sensors to identify the most suitable sensor for detecting the stacking height of peppers, and establish an optimal detection model for the loading capacity of peppers in transfer vehicles. The results indicated that ultrasonic sensors achieved the highest accuracy, with a maximum absolute error of 11.0 mm and a standard deviation of 8.5 mm in detecting the stacking height of peppers. When three symmetrically mounted ultrasonic sensors were used, the maximum error and standard deviation for the mean stacking height under varying lifting speeds were 37.0 mm and 15.5 mm, respectively. The developed model’s relative error in detecting the pepper loading capacity decreased to less than 2% when the fed volume exceeded 0.4 m3. These findings provide a basis for scheduling decisions in the coordination of pepper harvesters and transfer vehicles.