The invention relates to a
bristle number and integrity detection method based on pixel features and a self-adaptive threshold value, which comprises the following steps of: firstly, acquiring an initial image through the combination of bottom main backlight and side auxiliary backlight, then converting a
color image into a grey-scale image, performing
smoothing processing, positioning by adopting a morphological opening operation and eliminating reflective interference, and finally obtaining a
bristle number and integrity detection result. The method comprises the following steps: performing four-direction
edge detection fusion, brightening an image to four corners, calculating edge definition, outputting a qualified brightened image after optimization, performing block calculation on the image to calculate four-direction gradient and characteristic related parameters of each pixel, subtracting a mean
noise map from the brightened image to obtain an illumination uniform correction image, determining a threshold value by adopting an between-class
variance method, and outputting a final correction image. Bristles and background pixels are distinguished, connected domain detection statistics is carried out on the finally judged white pixels, and the number and integrity of the bristles are judged; the method effectively resists the detection of the white pixels of the bristles caused by the interference such as
light reflection and uneven illumination, and can adaptively adjust the parameters to adapt to the detection of the bristles of different materials and specifications.