This invention discloses a method for detecting the compliance of clothing color in ID photos, belonging to the field of
image processing technology. The method first performs portrait
parsing and
face detection on the input user image, generating extended candidate regions and
cropping them to obtain local images and local portrait
parsing mask images. Next, the clothing region is located and processed through
erosion, partitioning, and exclusion of specific regions. Illumination normalization, automatic white balance, and optical anti-
aliasing are then performed on the local image sequentially. Finally, based on the proportion of non-zero pixels in the accurate clothing
mask image, color features are calculated in combination with the processed image and the
mask, and a color
feature vector is obtained according to a fusion strategy. In cases of
occlusion, an empty vector is returned. This invention improves the accuracy and robustness of light-
colored clothing detection, eliminates the influence of illumination and interference areas, adapts to different scenarios, and meets the requirements for compliance detection of clothing color in ID photos.