In the process of oil exploitation, the water level of an oil well can be predicted and the position of reservoir can be estimated by measuring the water content of crude oil, with reference for the automatic production of high efficiency in the oil field. In this paper, a visual measuring method for water content of crude oil is proposed. The oil and water in crude oil samples were separated by centrifugation, distillation or electric dehydration, and a water–oil layered mixture was formed according to the unequal densities. Then the volume ratio of water and oil was analyzed by digital image processing, and the water content and oil content was able to be calculated. A new method for measuring water content of crude oil based on IGAVD (image grayscale accumulated value difference) is proposed, which overcomes the uncertainty caused by environmental illumination and improves the measurement accuracy. In order to verify the effectiveness of the algorithm, a miniaturization and low-cost system prototype was developed. The experimental results show that the average power consumption is about 165 mW and the measuring error is less than 1.0%. At the same time, the real-time and remote transmission about measurement results can be realized.