Using computer vision technology to accurately identify weeds and crops, positioning weed and spraying of weedcide has become a hotspot of precision agriculture. To determine the optimal threshold in image automatic segmentation and solve one-dimensional histogram without obvious peak and valley distribution, image segmentation method based on two-dimensional histogram and Improved Adaptive Genetic Algorithm is proposed. In the method, the genetic algorithm carries on the global optimization to get the threshold rapidly, and the computational method for crossover probability and mutation probability of the Adaptive Genetic Algorithm is improved. The Improved Adaptive Genetic Algorithm can preserve the multifamily of population and the astringency of the algorithm, and can overcome the problems of poor astringency and premature occurrence in Simple Genetic Algorithm. The result shows that the proposed approach greatly enhances the speed of thresholding and has better immunity to Salt and Pepper Noise.