Traditional Canny edge detection is vulnerable to external factors such as ambient noise and light conditions change, which leads to the bad detection effect, and because of needing artificial parameters, the algorithm has low flexibility. In order to improve the detection effect of the traditional algorithm and make better applications to the field of image recognition and so on, a method using the most between-cluster variance method to get the best threshold for image gradient segmentation, can determine the high and low threshold parameters for edge detection dynamically, solve the shortage of the traditional algorithm effectively. The improved algorithm is used to household instrument counter wheel image edge detection, which wipe off the noise, and keep a complete image edge, and improved the efficiency on the basic of achieving good results.