The threshold processing is intuitive, easy to implement, and fast to compute. Therefore, image threshold processing is at the core of image segmentation. Threshold processing can be divided into global threshold processing and local threshold processing (variable threshold processing ). This article briefly introduces Image Segmentation Based on Moving Average and provides the C language source code.
Moving Average is a local threshold processing method, which is based on the calculation of Moving Average based on the scanning line of an image. Moving Average split reduces illumination deviation and is easy to calculate. The p491 ~ of the third edition of "digital image processing ~ P492 provides a detailed description of the moving average. In particular, it is pointed out that when an object of interest is smaller (or smaller) than the image size, processing Based on the moving average threshold will work well. Printed images and handwritten text images meet this requirement.
The following shows the code for moving average. The tool used is opencv2.0 + vs2008.
# Include <cv. h> # include