Image detection method for granularity of granular stems

The invention discloses an image detection method for granularity of granular stems by using a matlab image processing method. The image detection method comprises the following steps of (1) taking an object with a known area S0 as a reference material, putting the object on a non-transparent white background plate; (2) randomly choosing 30 granular stems, arranging the chosen granular stems on the background plate without overlapping, opening light sources at four comers under an environment with uniform light conditions, adjusting focal lengths by a digital camera to make a lens surface of the camera in parallel with the background plate, taking pictures above the background plate, acquiring pretreated images; (3) opening the acquired pretreated images in matlab, marking the images, carrying out binarization processing on the pretreated images by using a matlab program; and (4) refining and median filtering the binarized image edges, filling holes to obtain pixels of the reference material and a granularity standard object of the granular stems, and calculating an average value (D) of the granularity of the granular stems. The method is an accurate, objective, concise and efficient method for evaluating the granularity of the granular stems.