License skin color optimization method, system and equipment based on image perception
By building an advanced semantic analysis model and decomposing images into multiple independent layers, the problem of poor optimization of ID photo pictures in the prior art is solved, and more refined and natural color adjustment is achieved, ensuring color accuracy and visual effects.
Patent Information
- Application Number
- CN202411591057.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-08
AI Technical Summary
The existing method of optimizing the image of the ID photo can only uniformly process the images, resulting in poor optimization results and cannot meet the actual optimization needs.
By building an advanced semantic analysis model, complex features of image color distribution are extracted, the image is decomposed into multiple independent layers, and each layer is carefully adjusted to achieve automatic optimization of image adjustment.
More refined and natural color adjustments are achieved, ensuring color accuracy, contrast and overall visual effects, improving efficiency, making the adjustment process more intuitive and easy to control, and meeting the actual optimization needs of ID photos.
Smart Images

Figure CN119579476A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method, system and device for optimizing skin color of a certificate based on image perception. Background Art
[0002] ID photos have strict color requirements due to printing requirements, and during the ID photo collection process, due to lighting conditions, the photos may have color casts or dark colors, which may cause facial color casts. Therefore, it is difficult to directly use the photos taken for ID photo production, and usually the color of the photos needs to be adjusted with the help of tools, such as Photoshop.
[0003] In the existing ID photo optimization methods, when optimizing and adjusting the image, all operations are independent, without a global operation, and the entire image can only be processed uniformly by a single parameter. For example, when the image is dark, brightening the image will cause the grayscale of the image to move upward, which will lead to a decrease in the contrast of the image, poor clarity, and a gray and hazy overall visual effect. It can be seen that the existing ID photo optimization methods cannot meet the actual optimization needs, and the image optimization effect is poor. Summary of the invention
[0004] The present application provides a method, system and device for optimizing skin color of ID photos based on image perception. By constructing an advanced semantic analysis model, the complex features of image color distribution are extracted to achieve more refined and natural color adjustment. The image is decomposed into multiple independent layers, and each layer can be carefully adjusted. Automatic optimization of image adjustment is achieved to ensure color accuracy, contrast and overall visual effect. This not only improves efficiency, but also makes the adjustment process more intuitive and easy to control, meeting the actual optimization needs of ID photos and solving the problem that the existing technology can only process images uniformly, resulting in poor image optimization effect.
[0005] In a first aspect, the present application provides a method for optimizing skin color of a certificate based on image perception, comprising:
[0006] Obtain the ID photo image to be optimized;
[0007] Performing semantic analysis and extraction on the ID photo image through a preset semantic analysis model to obtain deep semantic information, wherein the deep semantic information includes features and context required for adjusting the ID photo image;
[0008] According to the deep semantic information, construct an optimized layer of the ID photo image, wherein the optimized layer includes a color layer and a color scale layer;
[0009] According to the deep semantic information, based on the color layer and the color scale layer, generating corresponding adjustment parameter information;
[0010] Performing skin color optimization adjustment on each color channel in the color layer according to the adjustment parameter information to obtain a color optimization layer, and performing characteristic optimization adjustment on each hue area in the color level layer according to the adjustment parameter information and a preset layered adjustment strategy to obtain a color level optimization layer;
[0011] According to the fusion parameters in the adjustment parameter information, the color optimization layer and the color scale optimization layer are fused to obtain an optimized target ID photo image, and the target ID photo image is an ID photo image that meets preset clarity requirements and brightness requirements.
[0012] Optionally, the performing semantic analysis and extraction on the ID photo image by using a preset semantic analysis model to obtain deep semantic information includes:
[0013] Performing color analysis and color feature extraction on the ID photo image through a preset semantic analysis model to obtain color semantic information, and performing color scale analysis and color scale feature extraction on the ID photo image through the semantic analysis model to obtain color scale semantic information;
[0014] Deep semantic information is generated according to the color semantic information and the color scale semantic information.
[0015] Optionally, based on the deep semantic information, an optimized layer of the ID photo image is constructed, wherein the optimized layer includes a color layer and a color scale layer, including:
[0016] According to the color semantic information, constructing a layer of the ID photo image to obtain a color layer, and according to the color scale semantic information, constructing a layer of the ID photo image to obtain a color scale layer;
[0017] Among them, the color layer includes a color channel, the color channel includes a brightness channel, a first color component channel and a second color component channel, and the color channels are independent of each other. The level layer includes a hue area, the hue area includes a dark area, a midtone area and a highlight area, and the hue areas are independent of each other.
[0018] Optionally, the generating corresponding adjustment parameter information based on the color layer and the color scale layer respectively according to the deep semantic information includes:
[0019] Determining color description information of the ID photo image according to the color semantic information, and determining color scale description information of the ID photo image according to the color scale semantic information;
[0020] According to the color description information, a skin color optimization analysis is performed based on each pixel point in the color layer to obtain a color adjustment parameter; and according to the color scale description information, an adjustment analysis is performed based on each pixel point in the color scale layer to obtain a color scale adjustment parameter;
[0021] The adjustment parameter information is generated according to the preset fusion parameter, the color adjustment parameter and the color scale adjustment parameter.
[0022] Optionally, performing skin color optimization adjustment on each color channel in the color layer according to the adjustment parameter information to obtain a color optimization layer includes:
[0023] Extracting color optimization parameters and color fusion parameters from the color adjustment parameters;
[0024] According to the optimization parameters, skin color optimization is performed on each of the color channels to obtain three skin color optimization layers;
[0025] The three skin color optimization layers are fused using the fusion parameters to obtain a color optimization layer.
[0026] Optionally, the optimizing and adjusting the characteristics of each hue region in the color scale layer according to the color scale adjustment parameter and a preset layered adjustment strategy to obtain a color scale optimized layer includes:
[0027] Extracting tone optimization parameters and tone fusion parameters from the tone scale adjustment parameters;
[0028] According to the tone optimization parameters, shadow enhancement is performed on the dark area, contrast optimization is performed on the midtone area, and overexposure prevention optimization is performed on the highlight area, to obtain a dark area optimization layer after the dark area is optimized, a midtone optimization layer after the midtone area is optimized, and a highlight optimization layer after the highlight area is optimized;
[0029] The dark part optimization layer, the mid-tone optimization layer and the highlight optimization layer are layer-fused according to the tone fusion parameter to obtain a tone level optimization layer.
[0030] Optionally, the step of fusing the color optimization layer and the color scale optimization layer according to the layer fusion parameters in the adjustment parameters to obtain an optimized target ID photo image includes:
[0031] according to Perform layer optimization fusion to obtain an optimized target ID photo image;
[0032] Among them, Dresult is the target ID photo image output after optimization, Dlab is the color optimization layer, θlab is the parameter weight corresponding to the color optimization layer, Dg is the color scale optimization layer, and θg is the parameter weight corresponding to the color scale optimization layer.
[0033] Optionally, before performing semantic analysis and extraction on the ID photo image by using a preset semantic analysis model, the method further includes:
[0034] Acquire a paired picture data set and construct an initial semantic analysis model, wherein the paired picture data set includes paired pictures, and the paired pictures include an original picture and a modified picture corresponding to the original picture;
[0035] Performing color adjustment and image expansion on the original images in the paired image data set by using a lookup table technology to obtain an expanded image data set;
[0036] Using the initial semantic analysis model, the expanded image data set is identified and skin color features in the face area are extracted to obtain a semantic analysis result;
[0037] According to the semantic analysis result, the parameters of the initial semantic analysis model are optimized to obtain a trained semantic analysis model.
[0038] In a second aspect, the present application provides a certificate skin color optimization system based on image perception, comprising:
[0039] An image acquisition module, used to acquire the ID photo image to be optimized;
[0040] A semantic analysis and extraction module, used to perform semantic analysis and extraction on the ID photo image through a preset semantic analysis model to obtain deep semantic information, wherein the deep semantic information includes features and context required for adjusting the ID photo image;
[0041] An optimized layer generation module, used to construct an optimized layer of the ID photo image according to the deep semantic information, wherein the optimized layer includes a color layer and a color scale layer;
[0042] An adjustment parameter information generation module, used to generate corresponding adjustment parameter information based on the color layer and the color scale layer according to the deep semantic information;
[0043] an optimization adjustment module, configured to optimize the skin color of each color channel in the color layer according to the adjustment parameter information to obtain a color optimization layer, and optimize the characteristics of each hue area in the color level layer according to the adjustment parameter information and a preset layered adjustment strategy to obtain a color level optimization layer;
[0044] The layer fusion module is used to fuse the color optimization layer and the color scale optimization layer according to the fusion parameters in the adjustment parameter information to obtain an optimized target ID photo image, wherein the target ID photo image is an ID photo image that meets the preset clarity requirements and brightness requirements.
[0045] In summary, the embodiment of the present application performs semantic analysis and extraction on the acquired ID photo image through a semantic analysis model to obtain deep semantic information including features and context required for adjustment of the ID photo image, and then constructs the color layer and color scale layer of the ID photo image according to the deep semantic information, and generates corresponding adjustment parameter information based on the color layer and the color scale layer according to the deep semantic information, and finally adjusts the skin color of the color layer according to the adjustment parameter information, optimizes the color scale layer according to the adjustment parameters, and merges the color optimization layer and the color scale optimization layer to obtain a target ID photo image that meets the preset clarity and brightness requirements. The present application realizes automatic optimization of image adjustment to ensure color accuracy, contrast and overall visual effect, which not only improves efficiency, but also makes the adjustment process more intuitive and easy to control, meets the actual optimization needs of ID photos, and solves the problem that the prior art can only perform unified processing of images, resulting in poor image optimization effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0048] Figure 1 A flowchart of a method for optimizing skin color of a certificate based on image perception provided in an embodiment of the present application;
[0049] Figure 2 This is a schematic diagram of the steps of a method for optimizing skin color of a certificate based on image perception provided by an optional embodiment of the present application;
[0050] Figure 3 This is a flowchart for optimizing and adjusting ID photo images provided by an optional example of this application;
[0051] Figure 4 It is a flowchart of optimizing and adjusting ID photo images provided by another optional example of this application;
[0052] Figure 5It is a comparison chart of the result after optimizing and adjusting the color cast chart of the ID photo provided in an optional example of this application;
[0053] Figure 6 This is a comparison chart of the results after optimizing and adjusting the brighter image of the ID photo provided in another optional example of this application;
[0054] Figure 7 A structural block diagram of a certificate skin color optimization system based on image perception provided in an embodiment of the present application;
[0055] Figure 8 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0057] To facilitate the understanding of the embodiments of the present application, further explanation will be given below in conjunction with the drawings and specific embodiments. The embodiments do not constitute a limitation on the embodiments of the present application.
[0058] Figure 1 The following is a flow chart of a method for optimizing skin color of a certificate based on image perception provided in an embodiment of the present application. Figure 1 As shown, the method for optimizing skin color of a certificate based on image perception provided in the embodiment of the present application may specifically include the following steps:
[0059] Step 110, obtaining the ID photo image to be optimized.
[0060] Step 120, performing semantic analysis and extraction on the ID photo image through a preset semantic analysis model to obtain deep semantic information.
[0061] The deep semantic information includes the features and context required for adjusting the ID photo image.
[0062] A unified description of steps 110 to 120 is given as follows:
[0063] Specifically, the ID photo image (or ID photo, ID photo picture, etc.) is usually an ID photo containing a face. The ID photo image can be an original image or an image that has been optimized or adjusted in a certain way. This embodiment does not limit this.
[0064] In this embodiment, the semantic analysis model is a pre-trained neural network model capable of parsing complex semantic features from images. This embodiment does not limit the type of neural network model used to construct the semantic analysis model. The deep semantic information includes the features and context required for ID photo image adjustment, and has two types of semantic information. The deep semantic information corresponds to the subsequently constructed color layer and color scale layer, and respectively includes the semantic analysis results corresponding to the color layer and the semantic analysis results corresponding to the color scale layer.
[0065] In a specific implementation, this embodiment can input the ID photo image to be optimized into the semantic analysis model, and extract complex features from the input image through the semantic analysis model, including performing feature analysis and extraction on each pixel of the input image to obtain deep semantic information of the image, and provide necessary features and context for subsequent color optimization and adjustment of each layer of the image. In addition, this embodiment analyzes the input image through the semantic analysis model, and can also generate exclusive operation parameters for each pixel in the image, that is, execute step 130. Therefore, this embodiment analyzes the input image through the semantic analysis model, improves the flexibility and accuracy of subsequent color adjustment, and achieves more refined and natural color adjustment.
[0066] It should be noted that the ID skin color optimization method provided in this application can be used not only to optimize ID photos, but also to optimize other types of images in specific applications, and this embodiment does not limit this.
[0067] In actual implementation, before inputting the ID photo image into the semantic analysis model for analysis and extraction, the semantic analysis model may be trained to improve the model's ability to analyze and extract the input image.
[0068] In an optional embodiment, before the embodiment of the present application performs semantic analysis and extraction on the ID photo image through a preset semantic analysis model, it may also include: obtaining a paired image data set and constructing an initial semantic analysis model, the paired image data set containing paired images, the paired images containing original images and corrected images corresponding to the original images; performing color adjustment and image expansion on the original images in the paired image data set through a lookup table technology to obtain an expanded image data set; using the initial semantic analysis model, identifying and extracting skin color features in the face area of the expanded image data set to obtain a semantic analysis result; and optimizing the parameters of the initial semantic analysis model based on the semantic analysis result to obtain a trained semantic analysis model.
[0069] In actual processing, this embodiment first develops a basic deep neural network model, which aims to extract deep semantic features from images, and uses the deep neural network model as the initial semantic analysis model for model training. In order to train the model, this embodiment prepares a paired picture data set in advance, and each pair of pictures in the data set includes an original picture whose skin color does not meet the standard requirements, and a corrected picture that has been professionally adjusted to meet the standards for making ID photos. In order to increase the diversity of training data, the lookup table (LUT) technology is used to adjust the color of the picture, thereby expanding the data set. Through these paired image data, the network model is trained to identify and extract the characteristics of the skin color of the portrait area in each picture, and generate the parameters required for subsequent image processing steps. By using a diverse and expanded data set for training, the generalization ability of the model is improved, so that the semantic analysis model can adapt to a variety of images and scenes, and maintain excellent adjustment effects in different visual environments.
[0070] Step 130: construct an optimized layer of the ID photo image based on the deep semantic information.
[0071] Wherein, the optimized layer includes a color layer and a color scale layer.
[0072] Step 140: Generate corresponding adjustment parameter information based on the color layer and the tone layer according to the deep semantic information.
[0073] A unified description of steps 130 to 140 is given as follows:
[0074] In a specific implementation, the part of the ID photo image that needs to be optimized and adjusted can be determined based on the deep semantic information. Specifically, this embodiment can determine the optimization and adjustment part based on the image features reflected by the deep semantic information, and then construct the corresponding optimization layer. The optimization layer can be divided into two categories, including but not limited to: color layer (also called Lab color layer or Lab space, etc.) and color scale layer. Among them, both the color layer and the color scale layer can contain multiple independent layers, which will not be described in detail in this embodiment.
[0075] In this embodiment, after constructing the corresponding optimization layer, the adjustment parameter information required for optimizing and adjusting the image can be determined based on the response of the deep semantic information. The adjustment parameter information can include multiple adjustment parameters for optimizing and adjusting each layer. Since the color layer and the tone layer both contain multiple independent layers, there can be multiple adjustment parameters, each corresponding to each layer.
[0076] In actual processing, the prior art also uses commonly used image adjustment tools to operate images, such as Photoshop. However, when using image adjustment tools to adjust images, it is necessary to use color levels, color adjustment tools, etc. in combination, which requires high professional knowledge of the operator. In order to solve the problems existing in the prior art, this embodiment can determine the part of the image that needs to be optimized and adjusted by reasonably analyzing the deep semantic information, and build corresponding layers for the part that needs to be optimized and adjusted. Subsequently, only the established layers need to be adjusted, which improves the universality and adjustment efficiency of image optimization and adjustment, brings great convenience to image optimization and adjustment work, and effectively reduces resource consumption and dependence on professional technicians; of course, in order to improve the overall visual effect and comparison of image optimization, this embodiment can also determine the optimization situation according to the image features represented by the deep semantic information, and directly build all color layers and color level layers, and subsequently only the layers that need to be optimized and adjusted can be processed.
[0077] It should be noted that, in an ID photo image, not every layer may need to be adjusted and optimized. For layers that do not need to be adjusted and optimized, this embodiment can selectively set the corresponding adjustment parameters to empty, so that the layer does not need to be processed.
[0078] In a specific implementation, the adjustment parameter may include a corresponding adjustment value. Taking the brightness layer in the color scale layer as an example, the adjustment parameter corresponding to the brightness layer may be a brightness value, such as the adjusted brightness value is 10% (percentage).
[0079] Step 150, optimizing the skin color of each color channel in the color layer according to the adjustment parameter information to obtain a color optimization layer, and optimizing the characteristics of each hue area in the color scale layer according to the adjustment parameter information and a preset layered adjustment strategy to obtain a color scale optimization layer.
[0080] In a specific implementation, each color channel in the color layer can be understood as an independent layer. Similarly, in this embodiment, each hue area in the color level layer can also be understood as an independent layer. Since the adjustment parameter information includes the adjustment parameters corresponding to each layer, this embodiment can optimize and adjust the adjustment parameters corresponding to the layer.
[0081] Specifically, for the optimization and adjustment of color channels, since each color channel is independent of each other, for each color channel in the color layer, the layer can be adjusted using its corresponding adjustment parameters, including skin color optimization adjustment for each color channel, so that the color adjustment of the ID photo image is more precise and controllable, and a color optimization layer is obtained. Therefore, by making targeted adjustments to each color channel, the color after the adjustment of the color channel meets the requirements of the ID photo.
[0082] For the optimization and adjustment of the hue area, each hue area has corresponding characteristics, and the hue areas are also independent of each other. Therefore, the present embodiment can utilize the adjustment parameters corresponding to the hue area to optimize and adjust the hue area according to the characteristics of the hue area to obtain a color scale optimization layer, thereby ensuring that the image is clear enough, the brightness meets the requirements, and there is no uneven grayscale distribution.
[0083] In actual processing, since each color channel is independent of each other and each hue area is also independent of each other, this embodiment can merge the color channels that have completed optimization adjustment to obtain a color optimization layer, and merge the hue areas that have completed optimization adjustment to obtain a color level optimization layer. This embodiment will not elaborate on this.
[0084] Furthermore, the color layer and the tone level layer are also independent of each other, so the present embodiment can also perform layer fusion on the color optimization layer and the tone level optimization layer, that is, execute step 160 .
[0085] Therefore, by adjusting the color layer and the color level layer, it is ensured that the ID photo image obtained later meets the color requirements and is clear enough.
[0086] Step 160: According to the fusion parameters in the adjustment parameter information, the color optimization layer and the tone optimization layer are fused to obtain an optimized target ID photo image.
[0087] The target ID photo image is an ID photo image that meets preset clarity requirements and brightness requirements.
[0088] In a specific implementation, the adjustment parameter information may include not only adjustment parameters for layer optimization adjustment, but also fusion parameters for fusing the layers. There may be multiple fusion parameters, including but not limited to: parameters for fusing color channels and hue areas, and for fusing color optimization layers and color scale optimization layers. This embodiment uses fusion parameters to fuse the color optimization layer and the color scale optimization layer, and reconstructs a complete image through layer fusion to obtain an optimized target ID photo image. The optimized ID photo image is a target ID photo that meets the color requirements, clarity requirements, and brightness requirements.
[0089] It can be seen that the embodiment of the present application performs semantic analysis and extraction on the acquired ID photo image through the semantic analysis model to obtain deep semantic information including the features and context required for adjusting the ID photo image, and then constructs the color layer and color scale layer of the ID photo image according to the deep semantic information, and generates corresponding adjustment parameter information based on the color layer and the color scale layer according to the deep semantic information, and finally performs skin color adjustment on the color layer and color scale optimization adjustment on the color scale layer according to the adjustment parameter information, and merges the optimized color optimization layer and color scale optimization layer after optimization to obtain the target ID photo image that meets the preset clarity requirements and brightness requirements. Therefore, the embodiment of the present application utilizes a skin color adjustment algorithm combined with a deep algorithm to achieve image perception-based certificate skin color optimization. By constructing an advanced deep neural network model, the complex features of image color distribution are learned, and the semantic analysis model after training the network model is used to extract the deep semantic information of the image, which provides the necessary features and context for color adjustment. The method of image layered processing and fusion is further adopted to achieve automatic optimization of image adjustment, ensure color accuracy, contrast and overall visual effect, which not only improves efficiency, but also makes the adjustment process more intuitive and easy to control, meeting the actual optimization needs of certificate photos, and solving the problem that the existing technology can only perform unified processing of images, resulting in poor image optimization effect.
[0090] Reference Figure 2 , shows a schematic flow chart of a method for optimizing skin color of a certificate based on image perception provided by an optional embodiment of the present application. The method may specifically include the following steps:
[0091] Step 210, obtaining the ID photo image to be optimized.
[0092] Step 220, performing color analysis and color feature extraction on the ID photo image through a preset semantic analysis model to obtain color semantic information, and performing color scale analysis and color scale feature extraction on the ID photo image through the semantic analysis model to obtain color scale semantic information.
[0093] Step 230: generating deep semantic information according to the color semantic information and the color scale semantic information.
[0094] The deep semantic information includes the features and context required for adjusting the ID photo image.
[0095] A unified description of steps 220 to 230 is given as follows:
[0096] In the specific implementation, this embodiment uses layers to operate on various areas of the original ID photo image. To ensure that the ID photo that meets professional needs can be optimized and adjusted, the ID photo image can be input into the semantic analysis model. The semantic analysis model analyzes the ID photo image, analyzes the color part that can be optimized and adjusted from the ID photo image, and describes the color part, including but not limited to: analyzing and describing the color of each pixel area in the color part, extracting skin color features, etc., to obtain color semantic information; similarly, the semantic analysis model can analyze the color level part that can be optimized and adjusted from the ID photo image, and describe the color level part, including but not limited to: analyzing and describing the sensitivity of each pixel area of the ID photo image, etc., to obtain color level semantic information. This embodiment obtains the current description of the image through feature extraction as deep semantic information, and then generates corresponding parameters for adjustment based on the description.
[0097] It should be noted that the steps of extracting color semantic information and color scale semantic information from the ID photo image in this embodiment can be performed in parallel or sequentially, that is, extracting two semantic information at the same time, or extracting them in a preset order, and this embodiment does not impose any restrictions on this.
[0098] Step 240, constructing a layer of the ID photo image according to the color semantic information to obtain a color layer, and constructing a layer of the ID photo image according to the color scale semantic information to obtain a color scale layer.
[0099] Among them, the color layer includes a color channel, the color channel includes a brightness channel, a first color component channel and a second color component channel, and the color channels are independent of each other. The level layer includes a hue area, the hue area includes a dark area, a midtone area and a highlight area, and the hue areas are independent of each other.
[0100] In the specific implementation, in order to make the color adjustment of the ID photo image more accurate and controllable, and ensure the color accuracy, contrast and overall visual effect of the adjusted image, this embodiment divides the ID photo image into two large layers, namely the color layer and the color scale layer. Each large layer can be further divided into three small layers, wherein the color layer can contain three color channels (or color spaces), and the color scale layer can contain three tonal areas. Subsequently, each small layer can be optimized and adjusted.
[0101] In actual implementation, for the color layer, this embodiment divides the color layer into three color spaces for independent operation. The color layer is divided into color spaces for operation because the requirements for image color in most standard documents are based on the Lab color space, and each color channel in the color space can be independent of each other, so that color adjustment is more accurate and controllable. This embodiment generates a Lab color layer and a color scale layer for the ID photo image, including: a brightness channel L (brightness), a first color component channel a (color components from green to red), and a second color component channel b (color components from blue to yellow).
[0102] For the color scale layer, this embodiment divides the ID photo image into three main color tone areas, including: dark area (referred to as dark area), mid-tone area (referred to as mid-tone) and highlight area (referred to as highlight). Each color tone area corresponds to an independent layer, and is specially adjusted according to its own characteristics.
[0103] Therefore, this embodiment subdivides the ID photo image into six layers so that each layer can be independently operated later, thereby ensuring that the color and brightness of the image can be accurately controlled to achieve the desired visual effect.
[0104] Step 250: Determine the color description information of the ID photo image according to the color semantic information, and determine the color scale description information of the ID photo image according to the color scale semantic information.
[0105] In a specific implementation, by interpreting and analyzing the color semantic information, the semantic analysis model can be used to analyze and describe the color space of the ID photo image, and obtain color description information. For example, there is an ID photo image, which causes the skin color to be darker in backlight shooting, but the degree of darkness in each area is inconsistent. The skin color feature is extracted through a neural network, and the feature describes the distribution of the grayscale value of the skin color.
[0106] Similarly, this embodiment can obtain the analysis and description of the color scale part of the ID photo image by the semantic analysis model through the interpretation and analysis of the color scale description information, and obtain the color scale description information. For example, a certain ID photo image may have a serious darkening on the left side of the face, while the darkening on the right side is slightly less severe. Through this feature representation, an adjustment parameter layer of the same size as the original image is generated, which can avoid changing the original image when scaling the image to a fixed size.
[0107] It should be noted that the color description information and the color scale description information can be generated and output by a semantic classification model.
[0108] Step 260, according to the color description information, perform skin color optimization analysis based on each pixel in the color layer to obtain color adjustment parameters, and according to the color scale description information, perform adjustment analysis based on each pixel in the color scale layer to obtain color scale adjustment parameters.
[0109] In this embodiment, the color description information and color scale description information obtained after the model analyzes the ID photo image can be used to determine the specific adjustment parameters for each operation layer. Exemplarily, the adjustment parameters of the L channel, a channel and b channel in the Lab color space, as well as the adjustment parameters of the shadow, midtone and highlight parts in the color scale can be calculated for each operation layer, such as the L channel adjustment parameter can be Fl, the a channel adjustment parameter can be Fa, and the b channel adjustment parameter can be Fb, thereby obtaining the color adjustment parameter; the shadow adjustment parameter can be Fd, the midtone adjustment parameter can be Fm, and the highlight adjustment parameter can be Fh, thereby obtaining the color scale adjustment parameter.
[0110] Step 270: Generate the adjustment parameter information according to the preset fusion parameter, the color adjustment parameter and the color scale adjustment parameter.
[0111] In a specific implementation, the adjustment parameters may mainly include four parts, including but not limited to: descriptive parameters for the ID photo image (such as whether the image is reddish or dark, whether it is not clear enough in grayscale, etc.), adjustment parameters for specific adjustments to each layer of the image (including color adjustment parameters and color scale adjustment parameters), a first fusion parameter for adjusting the fusion of layers, and a second fusion parameter for fusing Lab and color scale.
[0112] Among them, the adjustment parameters include color adjustment parameters and color scale adjustment parameters. The adjustment parameters are specific adjustments to the image, which respectively adjust the Lab channel of the image and the corresponding dark levels, midtones and highlights in the color scale.
[0113] It should be noted that, in this embodiment, the adjustment parameter information can be generated and output by a semantic analysis model.
[0114] Step 280, optimizing the skin color of each color channel in the color layer according to the adjustment parameter information to obtain a color optimization layer, and optimizing the characteristics of each hue area in the color scale layer according to the adjustment parameter information and a preset layered adjustment strategy to obtain a color scale optimization layer.
[0115] In the specific implementation, the neural network can generate exclusive operation parameters for each pixel in the image. When adjusting the layer, it can adjust each pixel area in the original image, obtain the current description of the image through feature extraction, generate the corresponding adjustment parameters according to the description, and then use the adjustment parameters to adjust each channel of the Lab color space and each hue area in the color scale layer. For example, if the face skin in the ID photo is dark, it can analyze and identify which specific skin area needs to be optimized and adjusted, as well as the extent of the image brightness adjustment.
[0116] Refer to Figure 3 and Figure 4 As shown in the ID photo image optimization and adjustment flow chart, the ID photo skin color optimization method provided by this application can be mainly divided into three stages: in the first stage, this application constructs a basic deep neural network model to extract the deep semantic information of the image, providing the necessary features and context for subsequent color adjustment; in the second stage, this application uses the output of the first stage to generate image adjustment parameters. In this stage, the Lab color space and color scale of the image are adjusted; in the third stage, the adjusted Lab color space and color scale layer are fused through fusion parameters to obtain an optimized ID photo image. The optimized ID photo image not only meets the standard requirements of ID photos, but also ensures the clarity and naturalness of the image. In this embodiment, after completing the image adjustment, the image adjustment effect can also be compared, and then the semantic analysis model is continuously optimized to obtain more accurate adjustment parameters.
[0117] In an optional embodiment, the above-mentioned skin color optimization adjustment is performed on each color channel in the color layer according to the adjustment parameter information to obtain a color optimization layer, which may specifically include: extracting color optimization parameters and color fusion parameters from the color adjustment parameters; according to the optimization parameters, optimizing the skin color of each color channel to obtain three skin color optimization layers; and fusing the three skin color optimization layers according to the fusion parameters to obtain a color optimization layer.
[0118] In a specific implementation, the fusion parameters include a first fusion parameter for adjusting the fusion of the layer and a second fusion parameter for fusing Lab and color scale. The first fusion parameter mainly includes two parameters, namely, a parameter for fusing the three adjusted Lab channels and a parameter for fusing the three adjusted hue areas.
[0119] For example, refer to Figure 5 , Figure 5 Figure a is a color cast image of a certificate photo, and figure b is an optimized image obtained after the color layer is optimized and adjusted in this embodiment.
[0120] In an optional embodiment, the above-mentioned optimizing and adjusting the characteristics of each hue area in the hue layer layer according to the hue adjustment parameters and the preset layered adjustment strategy to obtain a hue optimization layer may specifically include: extracting hue optimization parameters and hue fusion parameters from the hue adjustment parameters; according to the hue optimization parameters, respectively performing shadow enhancement on the dark area, performing contrast optimization on the midtone area, and performing anti-overexposure optimization on the highlight area to obtain a dark optimized layer after the dark area is optimized, a midtone optimized layer after the midtone area is optimized, and a highlight optimized layer after the highlight area is optimized; performing layer fusion on the dark optimized layer, the midtone optimized layer, and the highlight optimized layer according to the hue fusion parameters to obtain a hue optimization layer.
[0121] In the specific implementation, the color level adjustment process adopts a layered adjustment strategy. After the image is carefully divided into three main tonal areas, each area corresponds to an independent layer, and special adjustments are made to its own characteristics. Among them, the dark layer enhances the shadow details of the image, the midtone layer optimizes the main contrast of the image, and the highlight layer retains the highlight details of the image to prevent overexposure.
[0122] In the related art, the commonly used white balance correction needs to be adjusted according to the actual shooting environment, and the white balance parameters have a hard correlation with the shooting equipment used. If the shooting environment changes, it is necessary to use a color card to adjust the white balance of the camera, which has the problems of cumbersome operation and high cost consumption. To solve this problem, this embodiment adds color scale adjustment to the layer layering process, mainly to allow the generated image to have a higher dynamic range of grayscale, so that the overall image is clearer and not gray. This embodiment refers to the HDR generation process of photography to shoot multiple photos with different exposures, and synthesizes them into an image with a wider brightness range. The same principle is also used in the process of adjusting the color scale of the picture, and the picture is divided into three layers: dark, midtones and highlights for adjustment. Finally, the three layers are fused together through a fusion layer to adjust the clarity of the picture.
[0123] For example, refer to Figure 6 , Figure 6 Figure a in the middle is a brighter image of the ID photo, and figure b is an optimized image obtained after the color level layer is optimized and adjusted in this embodiment.
[0124] Furthermore, the first fusion parameter and the second fusion parameter are both preset fusion parameters. Since the fusion of layer adjustments is independent of each other between Lab channels, a fusion parameter is required. The first fusion parameter is used to fuse the channel adjustments, and the same processing is applied to the color scale. The second fusion parameter is used to fuse Lab and color scale to ensure that the color of the image is consistent with the ID photo while ensuring that the image is clear enough without uneven grayscale distribution.
[0125] Furthermore, the adjustment of the Lab channel and each hue area can be performed using the following formula:
[0126]
[0127] Among them, Dl...Dh are the intermediate adjustment images generated by applying the adjustment parameters to the original image, Dl is the process image after L color space adjustment, Da is the process image after a color space adjustment, Db is the process image after b color space adjustment, Dd is the process image after dark part adjustment, Dm is the process image after midtone adjustment, and Dh is the process image after bright part adjustment.
[0128] Step 290, according to the fusion parameters in the adjustment parameter information, the color optimization layer and the tone level optimization layer are fused to obtain an optimized target ID photo image.
[0129] The target ID photo image is an ID photo image that meets preset clarity requirements and brightness requirements.
[0130] In the specific implementation, since Lab color adjustment and color scale adjustment are performed independently, this embodiment introduces a parameter fusion weight mechanism to ensure that after each layer is adjusted, the parameters of all adjustment layers are fused so that the final image meets the standard requirements for ID photos. This method can ensure that the adjusted image meets the quality standard at one time, reducing the need for post-processing and improving efficiency.
[0131] In an optional embodiment, the above-mentioned fusion of the color optimization layer and the color level optimization layer according to the fusion parameter in the adjustment parameter information to obtain the optimized target ID photo image may specifically include: Perform layer optimization fusion to obtain the optimized target ID photo image; where Dresult is the target ID photo image output after optimization, Dlab is the color optimization layer, θlab is the parameter weight corresponding to the color optimization layer, Dg is the color level optimization layer, and θg is the parameter weight corresponding to the color level optimization layer.
[0132] In a specific implementation, after adjusting the Lab color space and color scale separately, it is necessary to merge these independent layer effects together, that is, to perform layer fusion. This embodiment outputs the fusion parameters of the Lab color space and the color scale fusion parameters in the network, and finally obtains the adjusted image Dresult by using the operating parameters of the Lab color and color scale fusion. Therefore, this embodiment merges these independent layer effects together after adjusting the Lab color space and color scale separately. Through this fusion strategy, it can ensure that the adjustment effects of each layer are properly reflected in the final image, while avoiding conflicts in color and contrast.
[0133] For the optimization and adjustment process of the image, three steps are designed in the adjustment process of this embodiment: the first step is to generate six adjustment layers of Lab and color scale; the second step is to generate two adjustment layers after Lab and color scale adjustment based on the previous six adjustment layers; the third step is to fuse the Lab and color scale adjustment results, and a total of 9 adjustment layers are designed. This embodiment combines the method of image layering processing and fusion for automatic optimization of image adjustment. By decomposing the image into multiple independent layers, each layer can be carefully adjusted to ensure color accuracy, contrast and overall visual effect. Finally, through the layer fusion operation, all adjusted layers are synthesized into a certificate photo that meets professional needs. The integrated method adopted in this embodiment not only improves efficiency, but also makes the adjustment process more intuitive and easy to control.
[0134] In summary, the embodiment of the present application performs color analysis and color feature extraction on the ID photo image through a semantic analysis model, and performs color scale analysis and color scale feature extraction on the ID photo image to obtain color semantic information and color scale semantic information, and then constructs layers for the ID photo image according to the color semantic information and the color scale semantic information to obtain a color layer and a color scale layer, determines color description information according to the color semantic information, and determines color scale description information according to the color scale semantic information, performs skin color optimization analysis on each pixel in the color layer according to the color description information to obtain color adjustment parameters, and performs adjustment analysis on each pixel in the color scale layer according to the color scale description information to obtain color scale adjustment parameters, and then performs skin color optimization adjustment on each color channel in the color layer according to the color adjustment parameters to obtain a color optimization layer, and, according to the color scale adjustment parameters and a preset layered adjustment strategy, optimizes and adjusts the characteristics of each hue area in the color scale layer to obtain a color scale optimization layer, and finally fuses the color optimization layer and the color scale optimization layer using fusion parameters to obtain an optimized target ID photo image. This application uses convolutional neural network technology to perform Lab color adjustment and color level adjustment on images, which can effectively avoid the problem of using a single fixed parameter to adjust the image, resulting in a lack of layering and poor visual effects. It can also effectively solve the problem that traditional methods need to manually adjust different parameters according to different scenes in multiple scenes. Through this method, images that meet high standards can be generated, whether in terms of color accuracy, contrast or overall visual effects, which can meet the professional needs of making ID photos and improve the efficiency of image optimization processing.
[0135] It should be noted that, for the purpose of simple description, the method embodiments are expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited to the described order of actions, because according to the embodiments of the present application, certain steps may be performed in other orders or simultaneously.
[0136] like Figure 7 As shown, the embodiment of the present application also provides a certificate skin color optimization system 700 based on image perception, including:
[0137] An image acquisition module 710 is used to acquire the ID photo image to be optimized;
[0138] The semantic analysis and extraction module 720 is used to perform semantic analysis and extraction on the ID photo image through a preset semantic analysis model to obtain deep semantic information, where the deep semantic information includes features and context required for adjusting the ID photo image;
[0139] The optimized layer generation module 730 is used to construct the optimized layer of the ID photo image according to the deep semantic information, and the optimized layer includes a color layer and a color scale layer;
[0140] An adjustment parameter information generating module 740 is used to generate corresponding adjustment parameter information based on the color layer and the color scale layer according to the deep semantic information;
[0141] The optimization and adjustment module 750 is used to optimize the skin color of each color channel in the color layer according to the adjustment parameter information to obtain a color optimization layer, and optimize the characteristics of each color tone area in the color level layer according to the adjustment parameter information and a preset layered adjustment strategy to obtain a color level optimization layer;
[0142] The layer fusion module 760 is used to fuse the color optimization layer and the color scale optimization layer according to the fusion parameters in the adjustment parameter information to obtain an optimized target ID photo image, where the target ID photo image is an ID photo image that meets preset clarity requirements and brightness requirements.
[0143] Optionally, the semantic analysis and extraction module 720 includes:
[0144] A color analysis and color feature extraction submodule, used to perform color analysis and color feature extraction on the ID photo image through a preset semantic analysis model to obtain color semantic information;
[0145] A color scale analysis and color scale feature extraction submodule, used to perform color scale analysis and color scale feature extraction on the ID photo image through the semantic analysis model to obtain color scale semantic information;
[0146] The deep semantic information generation submodule is used to generate deep semantic information according to the color semantic information and the color scale semantic information.
[0147] Optionally, the optimized layer generation module 730 includes:
[0148] A color layer construction submodule is used to construct a layer of the ID photo image according to the color semantic information to obtain a color layer;
[0149] The color scale layer construction submodule is used to construct a layer of the ID photo image according to the color scale semantic information to obtain a color scale layer; wherein the color layer includes a color channel, the color channel includes a brightness channel, a first color component channel and a second color component channel, and the color channels are independent of each other; the color scale layer includes a hue area, the hue area includes a dark area, a mid-tone area and a highlight area, and the hue areas are independent of each other.
[0150] Optionally, the adjustment parameter information generating module 740 includes:
[0151] A description information determination submodule, configured to determine the color description information of the ID photo image according to the color semantic information, and to determine the color scale description information of the ID photo image according to the color scale semantic information;
[0152] A skin color optimization analysis submodule, configured to perform skin color optimization analysis based on each pixel in the color layer according to the color description information to obtain color adjustment parameters;
[0153] An adjustment analysis submodule, configured to perform adjustment analysis based on each pixel point in the color scale layer according to the color scale description information to obtain a color scale adjustment parameter;
[0154] The adjustment parameter information generation submodule is used to generate the adjustment parameter information according to the preset fusion parameter, the color adjustment parameter and the color scale adjustment parameter.
[0155] Optionally, the optimization and adjustment module 750 includes:
[0156] A first parameter extraction submodule, used to extract color optimization parameters and color fusion parameters from the color adjustment parameters;
[0157] A skin color optimization submodule, used to optimize the skin color of each color channel according to the optimization parameters to obtain three skin color optimization layers;
[0158] A first layer fusion submodule, used for performing layer fusion on the three skin color optimization layers according to the fusion parameters to obtain a color optimization layer;
[0159] A second parameter extraction submodule, used for extracting a tone optimization parameter and a tone fusion parameter from the tone scale adjustment parameter;
[0160] A color scale layer optimization adjustment submodule is used to perform shadow enhancement on the dark area, contrast optimization on the midtone area, and overexposure prevention optimization on the highlight area according to the color tone optimization parameters, so as to obtain a dark optimized layer after the dark area is optimized, a midtone optimized layer after the midtone area is optimized, and a highlight optimized layer after the highlight area is optimized;
[0161] The second layer fusion submodule is used to perform layer fusion on the dark optimization layer, the mid-tone optimization layer and the highlight optimization layer according to the tone fusion parameter to obtain a tone level optimization layer.
[0162] Optionally, the layer fusion module 760 is specifically used to: Perform layer optimization fusion to obtain the optimized target ID photo image; where Dresult is the target ID photo image output after optimization, Dlab is the color optimization layer, θlab is the parameter weight corresponding to the color optimization layer, Dg is the color level optimization layer, and θg is the parameter weight corresponding to the color level optimization layer.
[0163] Optionally, the image perception-based certificate skin color optimization system 700 further includes:
[0164] A model building module, used to obtain a paired picture data set and build an initial semantic analysis model, wherein the paired picture data set includes paired pictures, and the paired pictures include an original picture and a modified picture corresponding to the original picture;
[0165] An image expansion module, used to perform color adjustment and image expansion on the original image in the paired image data set by using a lookup table technology to obtain an expanded image data set;
[0166] A recognition and extraction module, used to recognize and extract skin color features in the face area of the expanded image data set through the initial semantic analysis model to obtain a semantic analysis result;
[0167] The parameter optimization module is used to optimize the parameters of the initial semantic analysis model according to the semantic analysis result to obtain a trained semantic analysis model.
[0168] It should be noted that the system for optimizing skin color for certificate based on image perception provided in the embodiment of the present application can execute the system for optimizing skin color for certificate based on image perception provided in any embodiment of the present application, and has the corresponding functions and beneficial effects of the execution method.
[0169] In a specific implementation, the above-mentioned ID skin color optimization system based on image perception can be integrated into a device, so that the device can optimize and adjust each layer of the ID photo image according to the adjustment parameters to obtain an ID photo that meets professional needs. As an electronic device, it can improve the optimization and adjustment efficiency of the ID photo skin color, and make the adjustment process more intuitive and easy to control. The electronic device can be composed of two or more physical entities, or it can be composed of one physical entity. For example, the electronic device can be a personal computer (PC), a computer, a server, etc., and the embodiments of the present application do not impose specific restrictions on this.
[0170] like Figure 8As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114; the memory 113 is used to store computer programs; the processor 111 is used to implement the steps of the image perception-based certificate skin color optimization method provided by any of the aforementioned method embodiments when executing the program stored in the memory 113. Exemplarily, the steps of the ID photo skin color optimization method based on image perception may include the following steps: obtaining an ID photo image to be optimized; performing semantic analysis and extraction on the ID photo image through a preset semantic analysis model to obtain deep semantic information, wherein the deep semantic information includes features and context required for adjusting the ID photo image; constructing an optimization layer of the ID photo image based on the deep semantic information, wherein the optimization layer includes a color layer and a tone level layer; generating corresponding adjustment parameter information based on the color layer and the tone level layer based on the deep semantic information; performing skin color optimization adjustment on each color channel in the color layer according to the adjustment parameter information to obtain a color optimization layer, and performing characteristic optimization adjustment on each hue region in the tone level layer according to the adjustment parameter information and a preset layered adjustment strategy to obtain a tone level optimization layer; fusing the color optimization layer and the tone level optimization layer according to the fusion parameters in the adjustment parameter information to obtain an optimized target ID photo image, wherein the target ID photo image is an ID photo image that meets preset clarity requirements and brightness requirements.
[0171] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for optimizing skin color based on image perception as provided in any of the aforementioned method embodiments are implemented.
[0172] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0173] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A method for optimizing skin color of a certificate based on image perception, characterized in that: include: Obtain the ID photo image to be optimized; Performing semantic analysis and extraction on the ID photo image through a preset semantic analysis model to obtain deep semantic information, wherein the deep semantic information includes features and context required for adjusting the ID photo image; According to the deep semantic information, construct an optimized layer of the ID photo image, wherein the optimized layer includes a color layer and a color scale layer; According to the deep semantic information, based on the color layer and the color scale layer, generating corresponding adjustment parameter information; Performing skin color optimization adjustment on each color channel in the color layer according to the adjustment parameter information to obtain a color optimization layer, and performing characteristic optimization adjustment on each hue area in the color level layer according to the adjustment parameter information and a preset layered adjustment strategy to obtain a color level optimization layer; According to the fusion parameters in the adjustment parameter information, the color optimization layer and the color scale optimization layer are fused to obtain an optimized target ID photo image, and the target ID photo image is an ID photo image that meets preset clarity requirements and brightness requirements.
2. The method according to claim 1, characterized in that The method of performing semantic analysis and extraction on the ID photo image by using a preset semantic analysis model to obtain deep semantic information includes: Performing color analysis and color feature extraction on the ID photo image through a preset semantic analysis model to obtain color semantic information, and performing color scale analysis and color scale feature extraction on the ID photo image through the semantic analysis model to obtain color scale semantic information; Deep semantic information is generated according to the color semantic information and the color scale semantic information.
3. The method according to claim 2, characterized in that According to the deep semantic information, an optimized layer of the ID photo image is constructed, wherein the optimized layer includes a color layer and a color scale layer, including: According to the color semantic information, constructing a layer of the ID photo image to obtain a color layer, and according to the color scale semantic information, constructing a layer of the ID photo image to obtain a color scale layer; Among them, the color layer includes a color channel, the color channel includes a brightness channel, a first color component channel and a second color component channel, and the color channels are independent of each other. The level layer includes a hue area, the hue area includes a dark area, a midtone area and a highlight area, and the hue areas are independent of each other.
4. The method according to claim 3, characterized in that The generating corresponding adjustment parameter information based on the color layer and the color scale layer respectively according to the deep semantic information includes: Determining color description information of the ID photo image according to the color semantic information, and determining color scale description information of the ID photo image according to the color scale semantic information; According to the color description information, a skin color optimization analysis is performed based on each pixel point in the color layer to obtain a color adjustment parameter; and according to the color scale description information, an adjustment analysis is performed based on each pixel point in the color scale layer to obtain a color scale adjustment parameter; The adjustment parameter information is generated according to the preset fusion parameter, the color adjustment parameter and the color scale adjustment parameter.
5. The method according to claim 4, characterized in that The step of performing skin color optimization adjustment on each color channel in the color layer according to the adjustment parameter information to obtain a color optimization layer includes: Extracting color optimization parameters and color fusion parameters from the color adjustment parameters; According to the optimization parameters, skin color optimization is performed on each of the color channels to obtain three skin color optimization layers; The three skin color optimization layers are fused using the fusion parameters to obtain a color optimization layer.
6. The method according to claim 4, characterized in that According to the color scale adjustment parameter and the preset layered adjustment strategy, optimizing and adjusting the characteristics of each hue area in the color scale layer to obtain the color scale optimization layer includes: Extracting tone optimization parameters and tone fusion parameters from the tone scale adjustment parameters; According to the tone optimization parameters, shadow enhancement is performed on the dark area, contrast optimization is performed on the midtone area, and overexposure prevention optimization is performed on the highlight area, to obtain a dark area optimization layer after the dark area is optimized, a midtone optimization layer after the midtone area is optimized, and a highlight optimization layer after the highlight area is optimized; The dark part optimization layer, the mid-tone optimization layer and the highlight optimization layer are layer-fused according to the tone fusion parameter to obtain a tone level optimization layer.
7. The method according to claim 1, characterized in that The step of fusing the color optimization layer and the color scale optimization layer according to the fusion parameter in the adjustment parameter information to obtain an optimized target ID photo image includes: according to Perform layer optimization fusion to obtain an optimized target ID photo image; Among them, Dresult is the target ID photo image output after optimization, Dlab is the color optimization layer, θlab is the parameter weight corresponding to the color optimization layer, Dg is the color scale optimization layer, and θg is the parameter weight corresponding to the color scale optimization layer.
8. The method according to any one of claims 1 to 7, characterized in that: Before performing semantic analysis and extraction on the ID photo image by using a preset semantic analysis model, the method further includes: Acquire a paired picture data set and construct an initial semantic analysis model, wherein the paired picture data set includes paired pictures, and the paired pictures include an original picture and a modified picture corresponding to the original picture; Performing color adjustment and image expansion on the original images in the paired image data set by using a lookup table technology to obtain an expanded image data set; Using the initial semantic analysis model, the expanded image data set is identified and skin color features in the face area are extracted to obtain a semantic analysis result; According to the semantic analysis result, the parameters of the initial semantic analysis model are optimized to obtain a trained semantic analysis model.
9. A skin color optimization system for ID cards based on image perception, characterized in that: include: An image acquisition module, used to acquire the ID photo image to be optimized; A semantic analysis and extraction module, used to perform semantic analysis and extraction on the ID photo image through a preset semantic analysis model to obtain deep semantic information, wherein the deep semantic information includes features and context required for adjusting the ID photo image; An optimized layer generation module, used to construct an optimized layer of the ID photo image according to the deep semantic information, wherein the optimized layer includes a color layer and a color scale layer; An adjustment parameter information generation module, used to generate corresponding adjustment parameter information based on the color layer and the color scale layer according to the deep semantic information; an optimization adjustment module, configured to optimize the skin color of each color channel in the color layer according to the adjustment parameter information to obtain a color optimization layer, and optimize the characteristics of each hue area in the color level layer according to the adjustment parameter information and a preset layered adjustment strategy to obtain a color level optimization layer; The layer fusion module is used to fuse the color optimization layer and the color scale optimization layer according to the fusion parameters in the adjustment parameter information to obtain an optimized target ID photo image, wherein the target ID photo image is an ID photo image that meets the preset clarity requirements and brightness requirements.
10. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the steps of the method for optimizing skin color based on image perception for a certificate according to any one of claims 1 to 8 when executing the program stored in the memory.
Citation Information
Patent Citations
Image processing method and device, equipment a and storage medium
CN111127476A
Method and system for toning skin color in image and storage medium thereof
CN111429536A
Image processing method and related device
CN113610723A
Portrait LAB color correction method and device based on convolutional neural network, medium and equipment
CN114612335A
Method and device for detecting skin color area in image
CN115100705A