A scheme for packaged granary grain quantity intelligent reckoning based on image processing was proposed in this paper. According to the actual scene, the grain bag characteristic outline -- the boundary of the counter-band of light was presented and taken as the analysis object. An algorithm combining Canny operator with image morphological thinning are used to extract the outline. Then, a counting algorithm which integrates mode theory and variance analysis technology is presented for the quantity second-judgment. The experimental results indicate that by accurately extracting the characteristic outline and counting the number of the characteristic outline, the algorithm presents an effective method for grain quantity detection with high recognition precision and efficiency.