Certificate photo clothes color auditing method and device, computer equipment and storage medium
By using facial landmark detection and HSV color space analysis, the accuracy problem of clothing color detection in ID photos was solved, enabling accurate positioning and judgment of the clothing area in ID photos.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN ARATEK BIOMETRICS TECH CO LTD
- Filing Date
- 2022-09-23
- Publication Date
- 2026-05-29
AI Technical Summary
Current technology struggles to accurately detect the color of clothing in ID photos, often resulting in misjudgments.
Multiple facial landmarks in the ID photo are identified using a facial landmark detection algorithm. Target landmarks in the chin area are then selected. Dividing lines are used to define the middle area based on these target landmarks. The neck area is removed to obtain the clothing area. Finally, the HSV color space is used to determine whether the clothing color is in violation of regulations.
It enables accurate location and judgment of the clothing area in ID photos, improving the accuracy of detection.
Smart Images

Figure CN115830149B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, apparatus, computer equipment, and storage medium for verifying the color of clothing in ID photos. Background Technology
[0002] ID photos typically have certain requirements; for example, users are usually not allowed to wear light-colored clothing. The inventors discovered that existing image detection algorithms often struggle to accurately detect clothing color due to difficulties in locating the clothing area, frequently resulting in false positives. Summary of the Invention
[0003] This invention provides a method, apparatus, computer equipment, and storage medium for verifying the color of clothing in ID photos, aiming to solve the problem in the prior art that it is difficult to accurately detect the color of clothing in ID photos and that misjudgments often occur.
[0004] In a first aspect, the present invention provides a method for verifying the color of clothing in ID photos, comprising:
[0005] Receive a photo of an ID document to be reviewed, and determine multiple facial key points of the photo of the ID document to be reviewed based on a preset facial key point detection algorithm;
[0006] Select multiple target key points corresponding to the chin region from the multiple facial key points;
[0007] Based on multiple target key points, a dividing line is determined in the photo of the document to be reviewed, and the area below the dividing line is determined as the middle area;
[0008] The neck region is determined in the middle region according to a preset color range;
[0009] The neck area in the middle area is deleted to obtain the clothing area;
[0010] Obtain the HSV color space of the clothing area, and determine whether the clothing color of the ID photo to be reviewed belongs to a preset illegal color based on the HSV color space of the clothing area;
[0011] If the color of the clothing in the ID photo to be reviewed is a preset violation color, the ID photo to be reviewed is determined to be non-compliant.
[0012] Secondly, the present invention also provides an apparatus for verifying the color of clothing in ID photos, which includes a unit for performing the above-described method.
[0013] Thirdly, the present invention also provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0014] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the above-described method.
[0015] This invention provides a method, apparatus, computer device, and storage medium for verifying the color of clothing in ID photos. The method includes: determining multiple facial key points in the ID photo to be verified based on a preset facial key point detection algorithm; selecting multiple target key points corresponding to the chin region from the multiple facial key points; determining a dividing line in the ID photo to be verified based on the multiple target key points, and defining the area below the dividing line as the middle region; determining the neck region within the middle region according to a preset color range; deleting the neck region from the middle region to obtain the clothing region; obtaining the HSV color space of the clothing region; determining whether the color of the clothing in the ID photo to be verified belongs to a preset prohibited color based on the HSV color space of the clothing region; if so, determining that the ID photo to be verified is non-compliant, thereby accurately locating the clothing region in the ID photo to be verified, and thus accurately determining the color of the clothing region, resulting in higher accuracy. Attached Figure Description
[0016] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart illustrating a method for verifying clothing color in ID photos, provided as an embodiment of the present invention;
[0018] Figure 2 A flowchart illustrating a method for verifying clothing color in ID photos, provided as another embodiment of the present invention;
[0019] Figure 3 A schematic block diagram of a clothing color verification device for ID photos provided in an embodiment of the present invention;
[0020] Figure 4 A schematic block diagram of a clothing color verification device for ID photos, provided for another embodiment of the present invention;
[0021] Figure 5 A schematic block diagram of a computer device provided for an embodiment of the present invention. Detailed Implementation
[0022] The technical solutions of this invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0023] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0024] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0025] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0026] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrases "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."
[0027] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for verifying clothing color in ID photos according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps S1-S7.
[0028] S1, Receive the ID photo to be reviewed, and determine multiple facial key points of the ID photo to be reviewed based on a preset facial key point detection algorithm.
[0029] In practice, "approved ID photo" refers to an ID photo provided by the user that is awaiting verification of its compliance. Specifically, it can be a photo of the user's ID card, driver's license, social security card, or other documents intended for use in the identification process. The user can input the approved ID photo into the terminal.
[0030] Facial landmark detection algorithms can automatically locate facial landmarks in an input facial image, such as the chin, eyes, nose, ears, neck, lips, and hair.
[0031] Understandably, the ID photo to be reviewed must be a facial image. Therefore, facial key points corresponding to the chin, eyes, nose, ears, neck, lips, and hair in the ID photo to be reviewed can be determined based on a preset facial key point detection algorithm.
[0032] S2, select multiple target key points corresponding to the chin region from the multiple facial key points.
[0033] In practice, to accurately locate the clothing area corresponding to the user's clothing in the ID photo to be reviewed, the chin area corresponding to the user's chin is first located in the ID photo. To locate the chin area, multiple target key points corresponding to the chin area are selected from a plurality of facial key points.
[0034] Specifically, the facial landmark detection algorithm can automatically number the identified landmarks, and the number and number of facial landmarks corresponding to each part are fixed. For example, the number of target landmarks in the chin area is 10, and they are numbered 10-20.
[0035] Therefore, multiple target key points corresponding to the chin region can be selected from multiple facial key points based on the number of the target key points in the chin region.
[0036] In one embodiment, step S2 specifically includes the following steps S21-S22.
[0037] S21, obtain the numbers of multiple target key points in the chin region.
[0038] In practice, the facial landmark detection algorithm can automatically number the identified landmarks, and the number and number of landmarks corresponding to each part of the face are fixed. For example, the number of target landmarks corresponding to the chin area is 10, and the numbering is 10-20.
[0039] S22, based on the number of the multiple target key points in the chin region, select multiple target key points corresponding to the chin region from the multiple facial key points.
[0040] In practice, the number of target key points corresponding to the chin area is 10, numbered 10-20. Therefore, facial key points numbered 10-20 are selected as the target key points corresponding to the chin area.
[0041] S3, determine a dividing line in the photo of the document to be reviewed based on multiple target key points, and define the area below the dividing line as the middle area.
[0042] In practice, dividing lines are determined in the photo of the document to be reviewed based on multiple target key points. The dividing lines are used to divide the area. Specifically, the area below the dividing lines is determined as the middle area.
[0043] In one embodiment, the above steps for determining the dividing line in the photo of the document to be reviewed based on multiple target key points specifically include: fitting a curve or straight line based on multiple target key points, and using the curve or straight line as the dividing line.
[0044] In practice, curve fitting is performed on multiple target key points to obtain a curve, and the curve is used as the dividing line.
[0045] Alternatively, draw a straight line parallel to the top or bottom edge of the ID photo to be reviewed, passing through the target key point with the smallest ordinate among the multiple target key points, and use the straight line as the dividing line.
[0046] S4, determine the neck area in the middle area according to a preset color range.
[0047] In practice, the central area typically includes the neck area and the clothing area. The neck area refers to the region of the user's neck in the photo to be reviewed. The clothing area refers to the region of the user's clothing in the photo to be reviewed.
[0048] Specifically, the color of a user's neck is usually fixed; for example, for people of East Asian descent, the neck color is yellow. Therefore, a color range can be set according to the actual situation so that the user's neck color falls within the specified color range.
[0049] Next, the neck region is determined within the middle region based on the predefined color range.
[0050] In one embodiment, step S4 specifically includes the following steps S41-S42.
[0051] S41, obtain the pixels in the middle region whose color is within the color range as the first target pixels.
[0052] In a specific implementation, in the intermediate region, all pixels of the same color within the color range are selected as the first target pixels.
[0053] In one embodiment, the pixel color in the intermediate region can be characterized by lightness (V). The color range is specifically a lightness range. Lightness is related to the transmittance or reflectance of an object. It typically ranges from 0% (black) to 100% (white). The lower the lightness, the darker the color. In practice, the HSV value (hue H, saturation S, and lightness V) of the pixel is calculated based on the RGB values of the pixels in the intermediate region (i.e., the values of the three components: red (R), green (G), and blue (B)).
[0054] S42, determine the neck region based on all the first target pixels.
[0055] In a specific implementation, the region composed of all the first target pixels is defined as the neck region.
[0056] S5, delete the neck area in the middle area to obtain the clothing area.
[0057] In practice, to avoid interference from the neck region, the neck region in the middle region is deleted to obtain the clothing region, thereby enabling the clothing region to be extracted separately and improving the accuracy of recognition.
[0058] S6, obtain the HSV color space of the clothing area, and determine whether the clothing color of the ID photo to be reviewed belongs to the preset illegal color based on the HSV color space of the clothing area.
[0059] In practice, generally speaking, users are not allowed to wear light-colored clothing in ID photos. Therefore, the first step is to pre-set the prohibited colors according to the ID photo review requirements. The prohibited colors can be represented by the range of brightness.
[0060] Obtain the HSV color space of the clothing area. The HSV color space specifically includes the HSV values (i.e., hue (H), saturation (S), and lightness (V)) of all pixels in the clothing area. In specific implementation, the HSV values (i.e., hue (H), saturation (S), and lightness (V)) of the pixels in the middle area are calculated based on the RGB values (i.e., the values of the three components: red (R), green (G), and blue (B)).
[0061] Based on the HSV color space of the clothing area, determine whether the color of the clothing in the ID photo to be reviewed belongs to a preset prohibited color.
[0062] In one embodiment, the HSV color space of the clothing area includes the brightness of each pixel in the clothing area, and step S6 specifically includes the following steps S61-S64.
[0063] S61, obtain the pixels in the clothing area whose brightness is within a preset brightness range as the second target pixels.
[0064] In a specific implementation, in the clothing area, all pixels whose brightness is within a preset brightness range are selected as the second target pixels.
[0065] The brightness range can be determined by those skilled in the art based on the actual review requirements of the ID photo, and is not specifically limited by this invention.
[0066] S62, determine the proportion of the second target pixels based on the number of the second target pixels and the total number of pixels contained in the clothing area.
[0067] In specific implementation, the number of the second target pixels and the total number of pixels contained in the clothing area are calculated, and the proportion of the second target pixels is determined based on the number of the second target pixels and the total number of pixels contained in the clothing area. It can be understood that the proportion is equal to the number of the second target pixels divided by the total number of pixels contained in the clothing area.
[0068] S63, determine whether the percentage is greater than a preset percentage threshold.
[0069] In specific implementation, it is determined whether the percentage is greater than a preset percentage threshold. The percentage threshold can be set by those skilled in the art according to the actual situation, for example, it can be set to 50%. This invention does not make a specific limitation on this.
[0070] S64, if the percentage is greater than the preset percentage threshold, it is determined that the color of the clothing in the ID photo to be reviewed belongs to the preset illegal color.
[0071] In practice, if the percentage is greater than a preset percentage threshold, the clothing color in the ID photo to be reviewed is determined to be a preset violation color.
[0072] If the percentage is greater than a preset percentage threshold, the clothing color in the ID photo to be reviewed is determined not to be a preset prohibited color. Specifically, clothing color refers to the color of the clothing worn by the user in the ID photo to be reviewed.
[0073] S7. If the color of the clothing in the ID photo to be reviewed is a preset violation color, the ID photo to be reviewed is determined to be non-compliant.
[0074] In practice, if the color of the clothing in the photo to be reviewed is a preset violation color, the photo to be reviewed is determined to be non-compliant.
[0075] By applying the technical solution of this invention, multiple facial key points in the ID photo to be reviewed are determined based on a preset facial key point detection algorithm; multiple target key points corresponding to the chin area are selected from the multiple facial key points; a dividing line is determined in the ID photo to be reviewed based on the multiple target key points, and the area below the dividing line is determined as the middle area; the neck area is determined in the middle area according to a preset color range; the neck area in the middle area is deleted to obtain the clothing area; the HSV color space of the clothing area is obtained, and the color of the clothing in the ID photo to be reviewed is determined to be a preset non-compliant color based on the HSV color space of the clothing area; if so, the ID photo to be reviewed is determined to be non-compliant, thereby accurately locating the clothing area in the ID photo to be reviewed, and thus accurately judging the color of the clothing area, with higher accuracy.
[0076] Figure 2 This is a flowchart illustrating a method for verifying clothing color in ID photos according to another embodiment of the present invention. Figure 2 As shown, the method for verifying the color of clothing in ID photos in this embodiment includes steps S201-S210.
[0077] S201, Receive the ID photo to be reviewed, and determine multiple facial key points of the ID photo to be reviewed based on a preset facial key point detection algorithm.
[0078] In practice, "approved ID photo" refers to an ID photo provided by the user that is awaiting verification of its compliance. Specifically, it can be a photo of the user's ID card, driver's license, social security card, or other documents intended for use in the identification process. The user can input the approved ID photo into the terminal.
[0079] Facial landmark detection algorithms can automatically locate facial landmarks in an input facial image, such as the chin, eyes, nose, ears, neck, lips, and hair.
[0080] Understandably, the ID photo to be reviewed must be a facial image. Therefore, facial key points corresponding to the chin, eyes, nose, ears, neck, lips, and hair in the ID photo to be reviewed can be determined based on a preset facial key point detection algorithm.
[0081] S202, select multiple target key points corresponding to the chin region from the multiple facial key points.
[0082] In practice, to accurately locate the clothing area corresponding to the user's clothing in the ID photo to be reviewed, the chin area corresponding to the user's chin is first located in the ID photo. To locate the chin area, multiple target key points corresponding to the chin area are selected from a plurality of facial key points.
[0083] Specifically, the facial landmark detection algorithm can automatically number the identified landmarks, and the number and number of facial landmarks corresponding to each part are fixed. For example, the number of target landmarks in the chin area is 10, and they are numbered 10-20.
[0084] Therefore, multiple target key points corresponding to the chin region can be selected from multiple facial key points based on the number of the target key points in the chin region.
[0085] Therefore, multiple target key points corresponding to the chin region can be selected from multiple facial key points based on the number of the target key points in the chin region.
[0086] S203, determine a dividing line in the photo of the document to be reviewed based on multiple target key points, and determine the area below the dividing line as the middle area.
[0087] In practice, dividing lines are determined in the photo of the document to be reviewed based on multiple target key points. The dividing lines are used to divide the area. Specifically, the area below the dividing lines is determined as the middle area.
[0088] In one embodiment, the above steps determine the dividing line in the photo of the document to be reviewed based on multiple target key points, specifically including fitting a curve or straight line based on multiple target key points, and using the curve or straight line as the dividing line.
[0089] In practice, curve fitting is performed on multiple target key points to obtain a curve, and the curve is used as the dividing line.
[0090] Alternatively, draw a straight line parallel to the top or bottom edge of the ID photo to be reviewed, passing through the target key point with the smallest ordinate among the multiple target key points, and use the straight line as the dividing line.
[0091] S204, the neck region is determined in the middle region according to a preset color range.
[0092] In practice, the central area typically includes the neck area and the clothing area. The neck area refers to the region of the user's neck in the photo to be reviewed. The clothing area refers to the region of the user's clothing in the photo to be reviewed.
[0093] Specifically, the color of a user's neck is usually fixed; for example, for people of East Asian descent, the neck color is yellow. Therefore, a color range can be set according to the actual situation so that the user's neck color falls within the specified color range.
[0094] Next, the neck region is determined within the middle region based on the predefined color range.
[0095] S205, determine whether the area of the neck region is greater than a preset area threshold.
[0096] In specific implementation, it is determined whether the area of the neck region is greater than a preset area threshold. The area threshold can be set by those skilled in the art according to the actual situation. In this regard, the present invention does not make specific limitations.
[0097] S206, if the area of the neck region is greater than a preset area threshold, the photo of the document to be reviewed is deemed compliant.
[0098] In practice, a larger neck area indicates that the color of the user's clothing is similar to the color of their neck, thus the clothing area is included in the neck area. Since the neck color usually meets the requirements, it can be inferred that the clothing color also meets the requirements. Therefore, if the area of the neck area is greater than a preset area threshold, the photo to be reviewed is deemed compliant.
[0099] S207, if the area of the neck region is not greater than a preset area threshold, delete the neck region in the middle region to obtain the clothing region.
[0100] In practice, if the area of the neck region is not greater than a preset area threshold, it means that the clothing area is not included in the neck region. In this case, to avoid interference from the neck region, the neck region in the middle region is deleted to obtain the clothing region, thereby enabling the clothing region to be extracted separately and improving the accuracy of recognition.
[0101] S208, obtain the HSV color space of the clothing area, and determine whether the clothing color of the ID photo to be reviewed belongs to the preset illegal color based on the HSV color space of the clothing area.
[0102] In practice, generally speaking, users are not allowed to wear light-colored clothing in ID photos. Therefore, the first step is to pre-set the prohibited colors according to the ID photo review requirements. The prohibited colors can be represented by the range of brightness.
[0103] Obtain the HSV color space of the clothing area. The HSV color space specifically includes the HSV values (i.e., hue (H), saturation (S), and lightness (V)) of all pixels in the clothing area. In specific implementation, the HSV values (i.e., hue (H), saturation (S), and lightness (V)) of the pixels in the middle area are calculated based on the RGB values (i.e., the values of the three components: red (R), green (G), and blue (B)).
[0104] Based on the HSV color space of the clothing area, determine whether the color of the clothing in the ID photo to be reviewed belongs to a preset prohibited color.
[0105] S209, if the color of the clothing in the ID photo to be reviewed is a preset non-compliant color, the ID photo to be reviewed is determined to be non-compliant.
[0106] S210, if the color of the clothing in the ID photo to be reviewed is not a preset violation color, the ID photo to be reviewed is determined to be compliant.
[0107] See Figure 3 , Figure 3 This is a schematic block diagram of a clothing color verification device 20 for ID photos provided by the present invention. Corresponding to the above-described clothing color verification method for ID photos, the present invention also provides a clothing color verification device 20 for ID photos. This clothing color verification device 20 includes a unit for performing the above-described clothing color verification method for ID photos, and the clothing color verification device 20 can be configured in a desktop computer, tablet computer, laptop computer, or other terminal. Specifically, the clothing color verification device 20 includes:
[0108] The receiving unit 21 is used to receive the ID photo to be reviewed and determine multiple facial key points of the ID photo to be reviewed based on a preset facial key point detection algorithm.
[0109] The filtering unit 22 is used to filter out multiple target key points corresponding to the chin region from the multiple facial key points;
[0110] The first determining unit 23 is used to determine a dividing line in the photo of the document to be reviewed based on multiple target key points, and to determine the area below the dividing line as the middle area.
[0111] The second determining unit 24 is used to determine the neck region in the middle region according to a preset color range;
[0112] Deletion unit 25 is used to delete the neck area in the middle area to obtain the clothing area;
[0113] The first judgment unit 26 is used to obtain the HSV color space of the clothing area and determine whether the clothing color of the ID photo to be reviewed belongs to a preset illegal color based on the HSV color space of the clothing area.
[0114] The first determination unit 27 is used to determine that the ID photo to be reviewed is non-compliant if the color of the clothing in the ID photo to be reviewed is a preset non-compliant color.
[0115] In one embodiment, the step of filtering out multiple target key points corresponding to the chin region from a plurality of facial key points includes:
[0116] Obtain the IDs of multiple target key points in the chin region;
[0117] Based on the numbering of multiple target key points in the chin region, multiple target key points corresponding to the chin region are selected from multiple facial key points.
[0118] In one embodiment, determining the dividing line in the photo of the document to be reviewed based on a plurality of the target key points includes:
[0119] A curve or straight line is obtained by fitting multiple target key points, and the curve or straight line is used as the dividing line.
[0120] In one embodiment, determining the neck region according to a preset color range in the intermediate region includes:
[0121] In the intermediate region, the pixels whose color falls within the color range are selected as the first target pixels;
[0122] The neck region is determined based on all the first target pixels.
[0123] In one embodiment, the HSV color space of the clothing area includes the brightness of each pixel in the clothing area. The step of determining whether the clothing color in the ID photo to be reviewed belongs to a preset prohibited color based on the HSV color space of the clothing area includes:
[0124] Pixels within the clothing area whose brightness falls within a preset brightness range are selected as the second target pixels;
[0125] The proportion of the second target pixels is determined based on the number of the second target pixels and the total number of pixels contained in the clothing area;
[0126] Determine whether the percentage is greater than a preset percentage threshold;
[0127] If the percentage is greater than a preset percentage threshold, the clothing color in the ID photo to be reviewed is determined to be a preset prohibited color.
[0128] Figure 4 This is a schematic block diagram of a clothing color verification device 20 for ID photos provided in another embodiment of the present invention. Figure 4 As shown, the ID photo clothing color verification device 20 in this embodiment is an addition based on the above embodiment:
[0129] The second judgment unit 28 is used to determine whether the area of the neck region is greater than a preset area threshold.
[0130] The second determination unit 29 is used to determine that the photo of the document to be reviewed is compliant if the area of the neck region is greater than a preset area threshold.
[0131] The third determination unit 210 is used to determine that the ID photo to be reviewed is compliant if the color of the clothing in the ID photo to be reviewed is not a preset non-compliant color.
[0132] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned ID photo clothing color verification device 20 and each unit can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.
[0133] The aforementioned ID photo clothing color verification device 20 can be implemented as a computer program, which can perform functions such as... Figure 5 It runs on the computer device shown.
[0134] Please see Figure 5 , Figure 5 This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 500 can be a terminal or a server. The terminal can be an electronic device with communication functions, such as a smartphone, tablet, laptop, desktop computer, personal digital assistant, or wearable device. The server can be a standalone server or a server cluster composed of multiple servers.
[0135] The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.
[0136] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, it causes the processor 502 to execute a method for verifying the color of clothing in ID photos.
[0137] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.
[0138] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a method for verifying the color of clothing in ID photos.
[0139] The network interface 505 is used for network communication with other devices. Those skilled in the art will understand that the above structure is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. A specific computer device 500 may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements.
[0140] The processor 502 is used to run a computer program 5032 stored in a memory to implement the steps of the method for verifying clothing color in ID photos provided in any of the above method embodiments.
[0141] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0142] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0143] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program causes the processor to perform the steps of the method for verifying clothing color in ID photos provided in any of the above-described method embodiments.
[0144] The storage medium is a physical, non-transient storage medium, such as a USB flash drive, external hard drive, read-only memory (ROM), magnetic disk, or optical disk, or any other physical storage medium capable of storing program code. The computer-readable storage medium can be non-volatile or volatile.
[0145] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0146] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0147] The steps in the method of this invention can be adjusted, combined, or reduced in order according to actual needs. The units in the device of this invention can be combined, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0148] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0149] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0150] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Since these modifications and variations fall within the scope of the claims and their equivalents, this invention also intends to include these modifications and variations.
[0151] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for verifying the color of clothing in ID photos, characterized in that, include: Receive a photo of an ID document to be reviewed, and determine multiple facial key points of the photo of the ID document to be reviewed based on a preset facial key point detection algorithm; Select multiple target key points corresponding to the chin region from the multiple facial key points; Based on multiple target key points, a dividing line is determined in the photo of the document to be reviewed, and the area below the dividing line is determined as the middle area; The neck region is determined within the central region according to a preset color range; The neck area in the middle area is deleted to obtain the clothing area; Obtain the HSV color space of the clothing area, and determine whether the clothing color of the ID photo to be reviewed belongs to a preset illegal color based on the HSV color space of the clothing area; If the color of the clothing in the ID photo to be reviewed is a preset violation color, the ID photo to be reviewed is determined to be non-compliant. The HSV color space of the clothing area includes the brightness of each pixel in the clothing area. Determining whether the clothing color in the ID photo to be reviewed belongs to a preset prohibited color based on the HSV color space of the clothing area includes: Pixels within the clothing area whose brightness falls within a preset brightness range are selected as the second target pixels; The proportion of the second target pixels is determined based on the number of the second target pixels and the total number of pixels contained in the clothing area; Determine whether the percentage is greater than a preset percentage threshold; If the percentage is greater than a preset percentage threshold, the clothing color in the ID photo to be reviewed is determined to be a preset prohibited color.
2. The method for verifying clothing color in ID photos according to claim 1, characterized in that, The step of filtering out multiple target key points corresponding to the chin region from multiple facial key points includes: Obtain the numbers of multiple target key points in the chin region; Based on the numbering of multiple target key points in the chin region, multiple target key points corresponding to the chin region are selected from multiple facial key points.
3. The method for verifying clothing color in ID photos according to claim 1, characterized in that, The step of determining the dividing line in the photo to be reviewed based on multiple target key points includes: A curve or straight line is obtained by fitting multiple target key points, and the curve or straight line is used as the dividing line.
4. The method for verifying clothing color in ID photos according to claim 1, characterized in that, Determining the neck region according to a preset color range in the middle region includes: In the intermediate region, the pixels whose color falls within the color range are selected as the first target pixels; The neck region is determined based on all the first target pixels.
5. The method for verifying clothing color in ID photos according to claim 1, characterized in that, After determining the neck region according to a preset color range in the intermediate region, the method further includes: Determine whether the area of the neck region is greater than a preset area threshold; If the area of the neck region is greater than a preset area threshold, the photo of the document to be reviewed is deemed compliant. If the area of the neck region is not greater than a preset area threshold, proceed to the step of deleting the neck region from the middle region to obtain the clothing region.
6. The method for verifying clothing color in ID photos according to claim 1, characterized in that, The method further includes: If the color of the clothing in the photo to be reviewed is not a preset prohibited color, the photo to be reviewed is deemed compliant.
7. A device for verifying the color of clothing in ID photos, characterized in that, Includes a unit for performing the method as described in any one of claims 1-6.
8. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, can implement the method as described in any one of claims 1-6.