To address the problems of low productivity and sizeable dispensing positioning errors in manual and semi-automatic dispensing processes in small- and medium-sized electronic enterprises, this study proposes a fully automatic dispensing method based on visual positioning with RJDNEL-type PCBs as the research object. The fully automatic dispensing system is constructed through the construction of a mechanical structure, the selection of optical equipment, and the debugging of the control system. The method is based on optical imaging technology. Firstly, the dispensing area is extracted through image preprocessing; then, the edge is detected by the Sobel operator, and the Hilditch operator optimizes the dispensing sharpness; then, the minimum outer rectangle algorithm is used to calculate the positioning information of the dispensing area by using the relationship between geometric transformations, which provides the database support for the realization of automatic dispensing; finally, the simulated annealing algorithm is adopted to optimize the dispensing path. Through the image acquisition matching experiments and positioning accuracy experimental analysis, it is concluded that the matching success rate is more than 99%, and the image positioning information repeated extraction accuracy error is less than 0.02 mm. Analysis of the total path of dispensing, as well as computing time, was performed as follows: for the complete dispensing process, 20 PCB boards were used; the path optimization of the dispensing path was reduced by 723.4 mm, and the dispensing efficiency was improved by 20% to 30%; after dispensing, the dispensing area measurement was performed on the PCB boards. PCB boards meet the quality requirements of dispensing, and the proposed method for meeting the quality of dispensing at the same time effectively improves the dispensing accuracy and efficiency.