A new method of weed recognition based on the invariant moments was proposed in this paper. Firstly, the area of the soybean leaf was located from the complicated image background. Secondly, the features of soybean leaf were obtained by Hu invariant moments, which are the invariability of the translation, the ratio and the rotation, and have lower computational complexity. Finally, the soybean leaf was recognized by the nearest neighbor classifier, and other image information were identified to weed. Experimental results proved that the weed recognition method was effective on the different environment, and could location the weed rapidly, reliably and accurately. The correct rate of the weed recognition was 90.5% in the ordinary environment, the average cost time was 670ms.