On-orbit autonomous measurement of lunar sampling quantity is a necessary part of autonomous lunar sampling. A kind of lunar sampling device is designed and lunar sampling quantity is automatically measured by image information. According to the feature of small difference between background gray level and targets gray level and the feature of lots of noises existing in the image background, improved maximum between-cluster variance algorithm and connected labeling adaptive de-noising algorithm are proposed to segment sampling region exactly in image. In order to calculate sampling region size and sampling quantity, on-orbit self-calibration using known object size is utilized, which solves the problem of unable obtaining sampling region size directly with just one camera. Testing result shows that on-orbit autonomous measuring results and actual results are coincident. The on-orbit autonomous measuring method is effective, and provides reference for future sampling mission on extraterrestrial celestial bodies.