The invention relates to a method for recognizing inline crops and weeds of seedling stage in farmland, belonging to the technical field of agriculture. The method realizes recognizing of the inline crops and weeds by utilizing a central processing unit system to take left and right images, divide soil background, reestablish three-dimensional images, intercept height information, fit pixel histograms and match recognized crops, wherein the central processing unit is provided with a left camera and a right camera, and receives signals input by the left camera and the right camera. In order to reduce the computational effort of stereo matching to improve the instantaneity of image processing, the invention reasonably and organically combines the division result of step 2 with step 3, i.e. only carrying stereo matching on green objects recognized from the soil background in step 2, omitting soil image parts having a known distance with the cameras, thus greatly reducing the computational effort of stereo matching, obviously quickening the recognition speed and obviously improving the instantaneity of future applications; and the steps after stereo matching effectively ensure the recognition rate.