This paper describes an image processing-based technique used to measure the volume of residual water in the drinking water bottle for the laboratory mouse. This technique uses a camera to capture the bottle's image and then processes the image to calculate the volume of water in the bottle. Firstly, the Grabcut method separates the foreground and background to avoid the influence of background on image feature extraction. Then Canny operator was used to detect the edge of the water bottle and the edge of the liquid surface. The cumulative probability Hough detection identified the water bottle edge line segment and the liquid surface line segment from the edge image. Finally, the spatial coordinate system is constructed, and the length of each line segment on the water bottle is calculated by using plane analytical geometry. Then the volume of water is calculated. By comparing image processing time, the pixel number of liquid level, and other indexes, the optimal illuminance and water bottle color were obtained. The experimental results show that the average deviation rate of this method is less than 5%, which significantly improves the accuracy and efficiency of measurement compared with traditional manual measurement.