Search

CN-121170844-B - Method for detecting color compliance of credentials and clothing

CN121170844BCN 121170844 BCN121170844 BCN 121170844BCN-121170844-B

Abstract

The invention discloses a method for detecting the color compliance of a certificate and clothing, which belongs to the technical field of image processing, and comprises the steps of firstly, executing human image analysis and human face detection on an input user image, generating an expansion candidate region, and cutting to obtain a local image and a local human image analysis mask map; the method comprises the steps of positioning a clothing region, processing the clothing region through corrosion, partitioning and specific region elimination, sequentially executing illumination normalization automatic white balance and optical antialiasing operation on a local image, finally calculating color characteristics according to the non-zero pixel duty ratio of an accurate clothing mask map, combining the processed image and mask, obtaining a color characteristic vector according to a fusion strategy, and returning to an empty vector when shielding. The invention can improve the accuracy and the robustness of light-colored clothing detection, eliminate the influence of illumination and interference areas, adapt to different scenes and meet the requirements of compliance detection of colors of credentials-illuminated clothing.

Inventors

  • CHEN SUQI
  • ZENG FAN
  • HUANG WANTING
  • GU JING

Assignees

  • 广州像素数据技术股份有限公司

Dates

Publication Date
20260505
Application Date
20250903

Claims (10)

  1. 1. A method for detecting color compliance of a credential garment, comprising the steps of: Performing face detection operation on the user image to obtain a face detection frame, generating an expansion candidate region according to the face detection frame, and respectively cutting the user image and the face resolution mask image according to the expansion candidate region to obtain a local image and a local face resolution mask image; positioning a clothes region based on the local portrait analysis mask map to obtain an initial clothes mask map, performing corrosion operation on the initial clothes mask map to obtain an accurate clothes mask map, performing partitioning operation on the accurate clothes mask map to obtain a clothes internal mask and a clothes edge mask, and performing specific region elimination operation on the accurate clothes mask map; Sequentially performing illumination normalization operation, automatic white balance operation and optical antialiasing operation on the partial image to obtain a partial image with normalized illumination and chromaticity; If the non-zero pixel duty ratio in the accurate clothes mask map does not meet the preset condition, calculating color characteristics of a clothes edge area and an internal area based on the local image with normalized illumination and chromaticity, the clothes internal mask and the clothes edge mask, and processing the color characteristics according to a fusion strategy to obtain a final color characteristic vector, wherein the color characteristic vector is used for judging whether the clothes color of the certificate is compliant.
  2. 2. The method of claim 1, wherein the step of generating the extended candidate region comprises: calculating the width and the height of the human face according to the human face detection frame; in the horizontal direction, calculating the maximum expandable range of the user image in the horizontal direction of the face detection frame, and taking a smaller value of half of the face width and the boundary distance as the actual expansion width; And in the vertical direction, expanding the face height of the face detection frame upwards by a preset proportion, expanding the face height of another preset proportion downwards, and ensuring that the expansion does not exceed the image boundary to obtain the expansion candidate region.
  3. 3. The method of claim 1, wherein the step of partitioning the exact garment mask map comprises: Performing corrosion operation and Gaussian blur operation on the accurate clothes mask map to obtain a temporary mask map; defining an area with a pixel value of a preset value in the temporary mask map as an internal area to obtain the internal mask of the garment; Subtracting the garment interior mask from the exact garment mask map to obtain the garment edge mask.
  4. 4. The method of claim 1, wherein the step of performing the excluding the specific area operation comprises: And executing an elimination operation on the clothing part extending below the face detection frame so as to reduce interference of the interior overlapping color on the color analysis of the whole clothing.
  5. 5. The method of claim 1, wherein the step of performing the illumination normalization operation comprises: Performing Retinex-CLAHE joint enhancement operation, converting the local image from BGR to CIE-Lab space, separating brightness channels, performing contrast-limiting self-adaptive histogram equalization operation on the brightness channels, recombining the processed brightness channels with other original channels, and converting the brightness channels back to BGR space; Executing global Gamma correction operation on the result of the Retinex-CLAHE joint enhancement operation; the method comprises the steps of performing local index mapping operation on a result of global Gamma correction operation, extracting a brightness channel as a guide map, determining an adaptive radius according to a preset proportion of the maximum side length of an image, performing rapid guide filtering operation to obtain a brightness shade, constructing local gain factors by using an index function, applying high gain to a shade region and low gain to a highlight region, and mapping new brightness back to a three-channel according to a preset ratio to keep chromaticity unchanged.
  6. 6. The method of claim 1, wherein the step of performing the automatic white balancing operation comprises: calculating global average values of all channels on a BGR color space of the local image subjected to illumination normalization operation, and calculating average gray values; applying a scale factor to each channel, wherein the scale factor is the ratio of the average gray value to the global average value of the corresponding channel; and performing point-by-point truncation operation on the three-channel floating point pixel values subjected to channel gain correction, forcibly setting a value smaller than a preset lower limit as a preset lower limit, forcibly setting a value larger than a preset upper limit as a preset upper limit, and converting the result into an unsigned integer with preset digits.
  7. 7. The method of claim 1, wherein the step of performing the optical antialiasing operation comprises: the blurring process is performed using a gaussian kernel image of a preset size to suppress potential ringing artifacts and quantization noise.
  8. 8. The method of claim 1, wherein the step of calculating the color signature comprises: converting the local image with normalized illumination and chromaticity from BGR space to CIE-Lab space; calculating average brightness, green-red value, blue Huang Zhi of the garment edge region and the inner region in CIE-Lab space according to the garment inner mask and the garment edge mask; And combining the HSV main color of the edge area of the clothes to obtain the color characteristic.
  9. 9. The method for detecting color compliance of a credential garment of claim 1, wherein the fusion strategy comprises: If the average brightness of the clothes edge area is smaller than a preset brightness threshold value and the brightness value in the HSV space is smaller than the preset brightness threshold value, taking the average brightness of the clothes edge area as the final average brightness; Under other conditions, the average brightness of the edge area of the clothes and the average brightness of the inner area are subjected to equal-weight linear fusion to obtain final average brightness; and for the green-red value and blue Huang Zhi, performing equal-weight linear fusion on the corresponding values of the edge area and the inner area of the clothes to obtain a final green-red value and blue Huang Zhi.
  10. 10. The method for detecting color compliance of a credential garment as in claim 1, further comprising: if the initial clothes mask map does not have non-zero pixels, judging that no clothes area exists or is completely blocked by other foreground, and returning to the empty color feature vector; If the non-zero pixel duty ratio in the accurate clothes mask diagram meets the preset condition, judging that the clothes region is completely blocked by the edge of the certificate, the arm or other foreground, and returning an empty color feature vector, wherein the empty color feature vector is used for indicating that the condition of detecting the clothes color compliance is not met.

Description

Method for detecting color compliance of credentials and clothing Technical Field The invention relates to the technical field of image processing, in particular to a method for detecting the color compliance of a credential garment. Background The certificate is used as an important carrier of personal legal identity mark, and the quality of the certificate directly influences the anti-counterfeiting performance and verification efficiency of the certificate. Credential illumination is required to meet stringent imaging specifications, where there are some credential illumination standards that clearly dictate the color of clothing that light-colored (e.g., white, light pink, light blue, etc.) clothing must not be worn. Along with rapid development of science and technology, self-shooting mobile phone software of credentials is presented, a user shoots face pictures by himself and uploads the face pictures to a server through a network, and the server automatically judges whether the credentials meet specifications. In the prior art, an attempt is made to solve the problem by HSV color space threshold analysis, the method utilizes facial key points and color threshold information to extract the pixel ratio of a global clothes region exceeding a specific threshold value so as to judge whether the clothes region belongs to light-colored clothes, but the edge segmentation failure and statistical judgment errors exist due to the fact that the neck and the collar region of a part of users are similar in skin color, and the color information value of the clothes can be offset due to illumination change of a shooting environment. Disclosure of Invention The invention aims to provide a method for detecting the color compliance of a credential garment, which improves the accuracy and the robustness of light-colored garment detection by combining a portrait analysis result and fine color feature analysis. In order to achieve the above purpose, the present invention provides the following technical solutions: in a first aspect, the present invention provides a method for detecting color compliance of a credential garment, comprising the steps of: Performing face detection operation on the user image to obtain a face detection frame, generating an expansion candidate region according to the face detection frame, and respectively cutting the user image and the face resolution mask image according to the expansion candidate region to obtain a local image and a local face resolution mask image; positioning a clothes region based on the local portrait analysis mask map to obtain an initial clothes mask map, performing corrosion operation on the initial clothes mask map to obtain an accurate clothes mask map, performing partitioning operation on the accurate clothes mask map to obtain a clothes internal mask and a clothes edge mask, and performing specific region elimination operation on the accurate clothes mask map; Sequentially performing illumination normalization operation, automatic white balance operation and optical antialiasing operation on the partial image to obtain a partial image with normalized illumination and chromaticity; If the non-zero pixel duty ratio in the accurate clothes mask map does not meet the preset condition, calculating color characteristics of a clothes edge area and an internal area based on the local image with normalized illumination and chromaticity, the clothes internal mask and the clothes edge mask, and processing the color characteristics according to a fusion strategy to obtain a final color characteristic vector, wherein the color characteristic vector is used for judging whether the clothes color of the certificate is compliant. In one possible implementation, the step of generating the extended candidate region includes: calculating the width and the height of the human face according to the human face detection frame; in the horizontal direction, calculating the maximum expandable range of the user image in the horizontal direction of the face detection frame, and taking a smaller value of half of the face width and the boundary distance as the actual expansion width; And in the vertical direction, expanding the face height of the face detection frame upwards by a preset proportion, expanding the face height of another preset proportion downwards, and ensuring that the expansion does not exceed the image boundary to obtain the expansion candidate region. In one possible implementation, the step of partitioning the precise garment mask map includes: Performing corrosion operation and Gaussian blur operation on the accurate clothes mask map to obtain a temporary mask map; defining an area with a pixel value of a preset value in the temporary mask map as an internal area to obtain the internal mask of the garment; Subtracting the garment interior mask from the exact garment mask map to obtain the garment edge mask. In one possible implementation, the step of performing the operatio