Training method of high-light processing model, image processing method and device

By training a specular processing model and combining a specular detection network and a texture restoration network with a learning network, the problem of texture destruction in specular processing is solved, generating high-quality specular-free images and optimizing the specular removal and texture restoration effects.

CN116563359BActive Publication Date: 2025-12-05XIAOMI TECH (WUHAN) CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310501294.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-27
Publication Date
2025-12-05
Estimated Expiration
2043-04-27

AI Technical Summary

Technical Problem

Existing technologies tend to damage image textures during highlight processing, resulting in poor texture restoration and affecting image information recognition.

Method used

By training a specular processing model, using a specular detection network, a learning network, and a texture inpainting network, sample specular images and real non-spectral images are obtained. A specular mask image is generated and subtracted from it. The background texture features are learned by combining the output of the learning network to guide the texture inpainting network to perform texture inpainting. Finally, the model parameters are optimized through the target loss function.

Benefits of technology

It generates high-quality, textured, specular-free images, improves the training effect of specular processing models, and optimizes the effects of specular removal and texture restoration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116563359B_ABST
    Figure CN116563359B_ABST
Patent Text Reader

Abstract

The application provides a high-light processing model training method, an image processing method and device. The method comprises: obtaining a sample high-light image and a real non-high-light image corresponding to the sample high-light image; inputting the sample high-light image into a high-light processing model; adding a learning network between a high-light detection network and a texture repair network in the model, so that the learning network learns global target background texture features of high-light areas and non-high-light areas based on an output of the high-light detection network, and uses the target background texture features to guide the texture repair network to perform texture repair, to reconstruct nonlinear changes of the high-light areas, generate a predicted non-high-light image, and train the high-light processing model based on differences between the first non-high-light image and the real non-high-light image and differences between the predicted non-high-light image and the real non-high-light image, so that the trained high-light processing model can output a high-quality non-high-light image with rich texture.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and in particular to a high-light processing model training method, an image processing method and device. BACKGROUND

[0002] With the popularity of electronic devices, users often use electronic devices (such as mobile phones) to take pictures. When the mobile phone shooting is irradiated by strong environmental light, local high-light reflection phenomenon will occur. High-light reflection will affect the recognition of useful information such as document text and patterns, and bring users a poor visual experience. Therefore, it is of great significance to perform high-light processing on images in the case that information recognition is weakened by high-light reflection but is still visually recognizable.

[0003] In related technologies, high-light processing will damage the texture of the image, and the texture repair is poor. SUMMARY

[0004] The present application aims to at least solve one of the technical problems in the related art to some extent.

[0005] To this end, the present application proposes a high-light processing model training method, an image processing method and device, which improves the effect of high-light processing model training.

[0006] An embodiment of the present application proposes a high-light processing model training method, comprising:

[0007] obtaining a sample high-light image and a real non-high-light image corresponding to the sample high-light image;

[0008] inputting the sample high-light image into a high-light detection network of a high-light processing model to obtain a high-light mask image;

[0009] subtracting the sample high-light image and the high-light mask image to obtain a first non-high-light image without texture repair;

[0010] inputting the first non-high-light image, the high-light mask image and the sample high-light image into a learning network of the high-light processing model to obtain a target background texture feature map;

[0011] inputting the target background texture feature map into a texture repair network of the high-light processing model to obtain a predicted non-high-light image after texture repair;

[0012] performing model training on the high-light processing model according to the difference between the first non-high-light image and the real non-high-light image, and according to the difference between the predicted non-high-light image and the real non-high-light image, to obtain a trained high-light processing model.

[0013] Another aspect of the present application provides an image processing method, comprising:

[0014] obtaining a high-light image to be processed;

[0015] inputting the high-light image into a trained high-light processing model, so that the high-light processing model performs high-light elimination and texture reconstruction on the high-light image to obtain a high-light-free image; wherein the high-light processing model is trained by the model training device of the preceding aspect to obtain the trained high-light processing model.

[0016] Another aspect of the present application provides a training device of a high-light processing model, comprising:

[0017] an obtaining module configured to obtain a sample high-light image and a real high-light-free image corresponding to the sample high-light image;

[0018] an identifying module configured to input the sample high-light image into a high-light detection network of a high-light processing model to obtain a high-light mask image;

[0019] a processing model configured to subtract the sample high-light image and the high-light mask image to obtain a first high-light-free image without texture repair;

[0020] a learning module configured to input the first high-light-free image, the high-light mask image and the sample high-light image into a learning network of the high-light processing model to obtain a target background texture feature map;

[0021] a repair module configured to input the target background texture feature map into a texture repair network of the high-light processing model to obtain a predicted high-light-free image after texture repair;

[0022] a training module configured to perform model training on the high-light processing model according to a difference between the first high-light-free image and the real high-light-free image, and according to a difference between the predicted high-light-free image and the real high-light-free image, to obtain a trained high-light processing model.

[0023] Another aspect of the present application provides an image processing device, comprising:

[0024] an obtaining module configured to obtain a high-light image to be processed;

[0025] a processing module configured to input the high-light image into a trained high-light processing model, so that the high-light processing model performs high-light elimination and texture reconstruction on the high-light image to obtain a high-light-free image; wherein the high-light processing model is trained by the model training device of the preceding aspect to obtain the trained high-light processing model.

[0026] In another aspect, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the program, the method as described in the foregoing method embodiments is implemented.

[0027] In another aspect, a non-transitory computer-readable storage medium is provided, having a computer program stored thereon, when the program is executed by a processor, the method as described in the foregoing method embodiments is implemented.

[0028] In another aspect, a computer program product is provided, having a computer program stored thereon, when the program is executed by a processor, the method as described in the foregoing method embodiments is implemented.

[0029] The training method of the highlight processing model, the image processing method and the device provided by the present application, the sample highlight image and the real highlight-free image corresponding to the sample highlight image are obtained, the sample highlight image is input into the highlight processing model, a learning network is added between the highlight detection network and the texture repair network in the model, so that the learning network learns the global target background texture features of the highlight area and the highlight-free area based on the output of the highlight detection network, and the target background texture features are used to guide the texture repair network to perform texture repair, so as to reconstruct the nonlinear change of the highlight area, generate a high-quality and texture-rich predicted highlight-free image, and based on the difference between the first highlight-free image and the real highlight-free image, and the difference between the predicted highlight-free image and the real highlight-free image, the highlight processing model is trained to obtain the trained highlight processing model, so that the highlight processing model obtained by training can output a high-quality and texture-rich highlight-free image, and the effect of model training is improved.

[0030] Additional aspects and advantages of the present application will be in part apparent and in part pointed out hereinafter. BRIEF DESCRIPTION OF DRAWINGS

[0031] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the following description, taken in conjunction with the accompanying drawings, in which:

[0032] Figure 1 A flowchart of a training method of a highlight processing model provided by an embodiment of the present application;

[0033] Figure 2 A schematic diagram of a sample highlight image provided by an embodiment of the present application;

[0034] Figure 3 A flowchart of another training method of a highlight processing model provided by an embodiment of the present application;

[0035] Figure 4 A structural schematic diagram of a high-light processing model provided for an embodiment of the present application.

[0036] Figure 5 A structural schematic diagram of a U-shaped network provided for an embodiment of the present application.

[0037] Figure 6 A flowchart of a training method of another high-light processing model provided for an embodiment of the present application.

[0038] Figure 7A A structural schematic diagram of a learning network provided for an embodiment of the present application.

[0039] Figure 7B A schematic diagram of a test scene provided for an embodiment of the present application.

[0040] Figure 8 A flowchart of an image processing method provided for an embodiment of the present application.

[0041] Figure 9 A schematic diagram of a high-light processing scene provided for an embodiment of the present application.

[0042] Figure 10 A structural schematic diagram of a training device of a high-light processing model provided for an embodiment of the present application.

[0043] Figure 11 A structural schematic diagram of an image processing device provided for an embodiment of the present application.

[0044] Figure 12 A block diagram of an electronic device provided for an embodiment of the present application. DETAILED DESCRIPTION

[0045] Embodiments of the present application are described in detail below with reference to the accompanying drawings, in which the same or similar components or components having the same or similar functions are denoted by the same or similar reference numerals throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to explain the present application, and should not be understood as limiting the present application.

[0046] The training method of a high-light processing model, the image processing method and device of an embodiment of the present application are described below with reference to the accompanying drawings.

[0047] Figure 1 A flowchart of a training method of a high-light processing model provided for an embodiment of the present application.

[0048] The execution subject of the training method of the high-light processing model in the embodiment of the application is a training device of the high-light processing model. The device can be arranged in an electronic device, which can be a server or a terminal device. The embodiment is not limited.

[0049] As shown in Figure 1 , the method can include the following steps:

[0050] In step 101, a sample high-light image and a real non-high-light image corresponding to the sample high-light image are obtained.

[0051] The sample high-light image refers to an image containing a high-light region. The high light in the image is usually caused by diffuse reflection and specular reflection, that is, the sample high-light image includes high light caused by diffuse reflection and specular reflection. The diffuse reflection reflects the properties of the illuminated object, and the specular reflection reflects the properties of the light.

[0052] The generation method of the sample high-light image can be implemented in the following manner:

[0053] As an implementation manner, real images are collected through network search, for example, real cards such as ID cards, social security cards, etc. Further, as an implementation manner, the real image and the high-light picture are fused through image processing software to obtain a fused image containing high light, that is, the sample high-light image. As another fusion manner, Poisson fusion can be used to realize high-light fusion. As an example, as shown in Figure 2 , it is a sample high-light image obtained by fusing a clear ID card image with a high-light cover mask.

[0054] It should be noted that the sample high-light image obtained by fusion can include multiple high-light regions with different positions and / or high-light intensities. The target fusion region of the high-light mask contains at least one of the contents such as text, texture, and portrait, so that the model obtained by training can be applicable to the application requirements of various scenes. The embodiment of the application is not limited.

[0055] As another implementation manner, a sample high-light image containing high light is obtained by taking a picture in a scene with strong light or a specially built high-light scene.

[0056] In step 102, the sample high-light image is input into the high-light detection network of the high-light processing model to obtain a high-light mask image.

[0057] In the embodiment of the present application, the high light processing model includes a high light detection network, a learning network and a texture repair network. The high light detection network is used to identify the high light area in the input sample high light image to obtain the high light distribution in the sample high light image. The high light distribution includes the position and intensity of the high light in the background area. The intensity of the high light indicates the degree of covering information by the high light. The greater the intensity of the high light, the stronger the degree of covering information. According to the high light distribution in the sample high light image, a high light mask image is generated. The high light mask image is a gray image. The gray value of the non-high light area is 0, that is, black. The gray value of the high light area is determined based on the intensity of the high light to correspond to the gray value, that is, a value between 0 and 255, which is displayed as gray or white corresponding to the gray value.

[0058] Step 103, subtracting the sample high light image and the high light mask image to obtain a first high light-free image without texture repair.

[0059] In the embodiment of the present application, the sample high light image contains a high light area, and the high light mask image includes the position and intensity of the high light. Subtracting the sample high light image and the high light mask image obtains a first high light-free image without texture repair. As an implementation manner, subtracting each pixel unit in the sample high light image and the corresponding pixel unit in the high light mask image obtains the first high light-free image. The first high light-free image is a high light-free image without texture repair.

[0060] Step 104, inputting the first high light-free image, the high light mask image and the sample high light image into the learning network of the high light processing model to obtain a target background texture feature map.

[0061] In the embodiment of the present application, the learning network is connected between the high light detection network and the texture repair network, that is, a learning network is added between the high light detection network and the texture repair network. The input of the learning network includes the output of the high light detection network. Based on the input first high light-free image, the texture features of the high light-free area are learned to obtain a first background texture feature map. Based on the input high light mask image and sample high light image, the texture features of the high light area are learned to obtain a second background texture feature map. The first background texture feature map and the second background texture feature map are fused to obtain a target background texture feature map, thereby guiding the subsequent texture repair network to perform texture repair.

[0062] Step 105, inputting the target background texture feature map into the texture repair network of the high light processing model to obtain a predicted high light-free image after texture repair.

[0063] In the embodiment of the present application, the texture repairing network is based on the input target background texture feature map. Since the target background texture feature map includes the background texture features of the highlight area and the background texture features of the non-highlight area, the nonlinear change of the highlight area can be reconstructed, thereby generating a high-quality and rich-texture highlight-free image.

[0064] In step 106, the highlight processing model is trained according to the difference between the first highlight-free image and the real highlight-free image, and according to the difference between the predicted highlight-free image and the real highlight-free image, to obtain the trained highlight processing model.

[0065] In the embodiment of the present application, the target loss function is determined according to the difference between the first highlight-free image and the real highlight-free image, and according to the difference between the predicted highlight-free image and the real highlight-free image, that is, the loss value of the highlight detection network and the loss value of the texture repairing network are included in the target loss function. Therefore, the model parameters of the highlight processing model are adjusted according to the target loss function, to obtain the trained highlight processing model.

[0066] It should be noted that the steps 101 to 106 need to be repeatedly executed for multiple times, and different sample highlight images can be used each time, so that the training is stopped when the loss function is less than a threshold, or the training is stopped when the number of repeated executions is greater than a threshold. The highlight processing model obtained after the last model parameter adjustment is used as the trained highlight processing model.

[0067] In the training method of the highlight processing model, a sample highlight image and a real highlight-free image corresponding to the sample highlight image are obtained, the sample highlight image is input into a highlight detection network of the highlight processing model to obtain a highlight mask image, the sample highlight image and the highlight mask image are subtracted to obtain a first highlight-free image without texture repair, the first highlight-free image, the highlight mask image and the sample highlight image are input into a learning network of the highlight processing model to obtain a target background texture feature map, the target background texture feature map is input into a texture repair network of the highlight processing model to obtain a predicted highlight-free image after texture repair, and the highlight processing model is trained according to the difference between the first highlight-free image and the real highlight-free image and according to the difference between the predicted highlight-free image and the real highlight-free image, so as to obtain the trained highlight processing model. The learning network is added between the highlight detection network and the texture repair network, so that the learning network learns the global background features containing the highlight area and the highlight-free area based on the output of the highlight detection network, as the input of the texture repair network, to guide the texture repair network to perform texture repair to reconstruct the nonlinear change of the highlight area, thereby generating a predicted highlight-free image with high quality and rich texture. The highlight processing model is trained according to the difference between the first highlight-free image and the real highlight-free image and according to the difference between the predicted highlight-free image and the real highlight-free image, so as to obtain the trained highlight processing model, so that the highlight processing model obtained by training can output a highlight-free image with high quality and rich texture.

[0068] Based on the above embodiments, Figure 3 Another flowchart of a training method of a highlight processing model provided by the embodiments of the present application is shown in FIG. 6. Figure 3 As shown in FIG. 6, the method comprises the following steps:

[0069] In step 301, a sample highlight image and a real highlight-free image corresponding to the sample highlight image are obtained.

[0070] In step 301, a sample highlight image and a real highlight-free image corresponding to the sample highlight image are obtained.

[0071] In step 302, the sample highlight image is input into a highlight detection network of the highlight processing model to obtain a highlight mask image.

[0072] As an example, Figure 4 A structure diagram of a highlight processing model provided by the embodiments of the present application is shown in FIG. 5. Figure 4 As shown in FIG. 5, the highlight processing model comprises a highlight detection network, a learning network and a texture repair network, wherein the output of the highlight detection network is input into the learning network, and the output of the learning network is input into the texture repair network. The output of each network can refer to the explanation and description of the foregoing embodiments, and the principle is the same, which will not be repeated here.

[0073] wherein the highlight detection network is a U-shaped network, including an encoder and a decoder, as an example, as shown in FIG. 2, wherein the encoder includes a plurality of processing layers, each of which includes two convolutional layers and a pooling layer, wherein the pooling layer adopts maximum pooling. The decoder includes a plurality of processing layers, each of which includes a basic layer and two convolutional layers. As shown in FIG. 2, the respective processing layers of the encoder and the corresponding processing layers of the decoder adopt a skip connection manner, so that the low-dimensional features and the high-dimensional features can be fused to improve the processing effect. Similarly, the texture repair network is also a U-shaped network, including an encoder and a decoder, and the network structure is the same as that of the highlight detection network, which will not be described here. Figure 5 Figure 5 As shown in FIG. 2, the respective processing layers of the encoder and the corresponding processing layers of the decoder adopt a skip connection manner, so that the low-dimensional features and the high-dimensional features can be fused to improve the processing effect. Similarly, the texture repair network is also a U-shaped network, including an encoder and a decoder, and the network structure is the same as that of the highlight detection network, which will not be described here.

[0074] Step 303, subtracting the sample highlight image and the highlight mask image to obtain a first highlight-free image without texture repair.

[0075] Step 304, inputting the first highlight-free image, the highlight mask image and the sample highlight image into the learning network of the highlight processing model to obtain a target background texture feature map.

[0076] Step 305, inputting the target background texture feature map into the texture repair network of the highlight processing model to obtain a predicted highlight-free image after texture repair.

[0077] Wherein, steps 303 to 305 can refer to the explanation and description of the foregoing embodiments, which have the same principle and will not be described here.

[0078] Step 306, determining a target loss function according to the difference between the first highlight-free image and the real highlight-free image, and according to the difference between the predicted highlight-free image and the real highlight-free image.

[0079] In an implementation manner of the embodiment of the application, the first loss function of the highlight detection network is determined according to the difference between the first highlight-free image and the real highlight-free image, the second loss function of the texture repair network is determined according to the difference between the predicted highlight-free image and the real highlight-free image, and the first loss function and the second loss function are weighted and synthesized according to the set first weight coefficient to obtain the target loss function. In the embodiment of the application, the loss function is optimized, so that the loss function includes not only the output loss of the highlight detection network, but also the output loss of the texture repair network, which realizes the simultaneous optimization of the highlight detection network and the texture repair network, and improves the optimization effect of the highlight processing model.

[0080] ​In the determination of the first loss function, as an implementation manner, a first content difference between the first highlight-free image and the real highlight-free image and a first texture difference between the first highlight-free image and the real highlight-free image are determined, a second weight coefficient is obtained, and the first content difference and the first texture difference are weighted and synthesized according to the second weight coefficient to obtain the first loss function of the highlight detection network. In the embodiment of the present application, the first highlight-free image is determined based on the highlight mask image output by the highlight detection network, and the first loss function contains the content loss and the texture structure loss of the image between the first highlight-free image and the real highlight-free image. The highlight detection network is guided based on the first loss function to keep similarity in the content and the texture structure of the image at the same time, thereby improving the accuracy of parameter adjustment of the highlight detection network.

[0081] For the determination of the second loss function, as an implementation manner, a second content difference between the predicted highlight-free image and the real highlight-free image and a second texture difference between the predicted highlight-free image and the real highlight-free image are determined, a third weight coefficient is obtained, and the second content difference and the second texture difference are weighted and synthesized according to the third weight coefficient to obtain the second loss function of the texture repair network. In the embodiment of the present application, the predicted highlight-free image is output by the texture repair network, and the second loss function contains the content loss and the texture structure loss of the image between the predicted highlight-free image and the real highlight-free image. The texture repair network is guided based on the second loss function to keep similarity in the content and the texture structure of the image at the same time, thereby improving the accuracy of parameter adjustment of the texture repair network

[0082] In an implementation manner of the embodiment of the present application, the content loss can be measured by using a Charbonnier penalty function, and the latter uses a structure similarity index measure (SSIM) to evaluate.

[0083] In the embodiment of the present application, the target loss function Loss can be represented as:

[0084]

[0085]

[0086] Loss = Loss1 + a * Loss2.

[0087] In the embodiment of the present application, the target loss function Loss can be represented as: pre1 is the first highlight-free image, I gt is the real highlight-free image, λ1 is the second weight coefficient, λ2 is the third weight coefficient, I pre2For predicting the image without highlight, a is a first weight coefficient, and ε is a set value, usually 0.001.

[0088] It should be noted that the content loss calculated by the Charbonnier penalty function and the texture loss calculated by the SSIM function in Loss1 are both calculated in the red-green-blue (RGB) space, while the content loss calculated by the Charbonnier penalty function in Loss2 is calculated in the color space CIE-Lab space, and the texture loss calculated by the SSIM function is calculated in the RGB space. Since the CIE-Lab space is more consistent with the human visual system, using the content loss calculated in the CIE-Lab space in the background texture repair process can reduce the color difference problem caused by texture repair.

[0089] In step 307, the model parameter of the highlight processing model is adjusted according to the target loss function to obtain a trained highlight processing model.

[0090] In the embodiments of the present application, the model parameter of the highlight processing model is adjusted according to the target loss function to obtain a trained highlight processing model. Through multiple iterations of training, the parameter adjustment of the highlight processing model is realized, and finally the training of the model is completed. The target loss function is a weighted superposition of two loss functions for joint optimization, thereby guiding the network to maintain similarity in image content and image texture structure, and optimizing the highlight elimination and texture repair effect.

[0091] In the training method of the highlight processing model according to the embodiments of the present application, the target loss function of the highlight processing model includes a first loss function corresponding to the highlight detection network and a second loss function corresponding to the texture repair network. The target loss function is a weighted superposition of the two loss functions for joint optimization of the highlight processing model, thereby guiding the highlight processing model to maintain similarity in image content and image texture structure, so that the highlight processing model obtained by training can optimize the highlight elimination and texture repair effect.

[0092] Based on the above embodiments, the present application provides another training method of a highlight processing model, Figure 6 The flowchart of another training method of a highlight processing model provided by the embodiments of the present application is shown in Figure 6 The method includes the following steps:

[0093] In step 601, a sample highlight image and a real highlight-free image corresponding to the sample highlight image are obtained.

[0094] In step 602, the sample highlight image is input into the highlight detection network of the highlight processing model to obtain a highlight mask image.

[0095] Step 603, subtracting the sample highlight image and the highlight mask image to obtain a first highlight-free image which is not subjected to texture repair.

[0096] The steps 601 to 603 can refer to the foregoing explanation in the foregoing embodiments, and the principle is the same, which will not be described here again.

[0097] Step 604, inputting the first highlight-free image into the first feature extraction layer of the learning network to perform feature extraction to obtain a first background texture feature map.

[0098] As an example, FIG. 7 is a structural schematic diagram of a learning network provided by an embodiment of the present application, as shown in FIG. 7, the learning network includes a first feature extraction layer, a second feature extraction layer and a third feature extraction layer, wherein the input of the first feature extraction layer is the first highlight-free image, and the output is the first background texture feature map. The first background texture feature map carries the background texture features of the highlight-free area.

[0099] Step 605, inputting the highlight mask image and the sample highlight image into the second feature extraction layer of the learning network to perform processing to obtain a second background texture feature map.

[0100] The input of the second feature extraction layer is the highlight mask image and the sample highlight image, the highlight mask image contains the position and intensity of the highlight area, and the second feature extraction layer is used for feature extraction to obtain the second background texture feature map, and the second background texture feature map carries the background texture features of the highlight area.

[0101] As an implementation manner, the second feature extraction layer includes a first feature extraction sub-layer and a second feature extraction sub-layer, the highlight mask image is input into the first feature extraction sub-layer to perform feature extraction to obtain a highlight feature map, wherein the highlight feature map contains the position feature of the highlight and the intensity feature of the highlight, the sample highlight image is input into the second feature extraction sub-layer to perform feature extraction to obtain a sample feature map, and then, each pixel unit in the sample feature map is multiplied with a corresponding pixel unit in the highlight feature map to obtain the second background texture feature map. As an implementation manner, the gray value of each pixel unit in the sample feature map is multiplied with the gray value of the corresponding pixel unit in the highlight feature map, so that the background texture features of the non-highlight area are removed, and the background texture features of the highlight area are retained.

[0102] It should be noted that the pixel unit includes at least one pixel point.

[0103] Step 606, fusing the first background texture feature map and the second background texture feature map to obtain a target background texture feature map.

[0104] In the embodiments of the present application, the first background texture feature map and the second background texture feature map are fused through a fusion function in a selective fusion block (SFB) to obtain a target background texture feature map.

[0105] As an example, taking Figure 7A as an example, the first feature extraction layer includes one convolutional layer, the convolutional kernel of the convolutional layer is 3, the output channel is 48, the convolutional step is 1, S represents a Sigmoid operator, represents a pixel point multiplication operation. The highlight detection network learns the corresponding highlight distribution from the sample highlight image I highlight to obtain the highlight mask image I hd , and generates the corresponding image de-highlighting result, that is, the first highlight-free image I hd , by subtracting I hr , that is, the highlight area texture feature. I hd , I hr and I highlight are input, the highlight distribution is learned from I hd , and the network extracts accurate background texture information from I highlight to obtain the second background texture feature map f ti , that is, the highlight area texture feature, to assist the repair of the background texture. In combination with Figure 7A , the expression process of the target background feature map can be represented as:

[0106]

[0107] f hr =F B (I hr );

[0108] f ALM =F SFB (f ti ,f hr )。

[0109] Wherein, F R is a feature embedding function of the second feature extraction sub-layer, including two convolutional layers, for learning the embedded expression of I highlight . F R (·) is the first feature extraction layer, including one convolutional layer, for extracting the feature information f hr of I hr . F M (·) is a mask generation function of the first feature extraction layer, including three convolutional layers and a Sigmoid operator, which can obtain the highlight position and intensity information in I highlight . The method of pixel point multiplication is used to obtain I highlightbackground texture information f in the embedding representation of the input image ti , which assists the background texture reconstruction process. SFB (·) denotes the fusion function in the Selective Fusion Block (SFB), which is equivalent to the SFB module in the original paper of the dynamic correlation module. The final ALM output is the enhanced background feature representation f ALM ALM The texture reconstruction subnetwork then takes f ALM as input and achieves high-quality texture reconstruction through an encoder-decoder U-shaped network.

[0110] Step 607: input the target background texture feature map into the texture repair network of the highlight processing model to obtain a predicted highlight-free image after texture repair.

[0111] Among them, step 607 can refer to the explanation and description of the foregoing embodiments, and the principle is the same, which will not be repeated here.

[0112] Step 608: model training is performed on the highlight processing model according to the difference between the first highlight-free image and the real highlight-free image, and according to the difference between the predicted highlight-free image and the real highlight-free image, to obtain a trained highlight processing model.

[0113] Among them, step 608 can refer to the explanation and description of the foregoing embodiments, and the principle is the same, which will not be repeated here.

[0114] As an example, as shown in Figure 7B , the highlight image in the test set is input into the trained highlight processing model to obtain each image in Figure 7B From the figure, it can be seen that after processing by the highlight processing model, the texture of the highlight area is reasonably repaired and the color information of the non-highlight area is maintained.

[0115] In the training method of the highlight processing model of the embodiments of the present application, a two-stage neural network model is used, that is, two U-shaped networks, namely a highlight detection network and a texture repair network, are used to respectively complete the image highlight detection and image texture repair tasks, and a learning network is used after the highlight detection network to learn the background texture features of the highlight area and the highlight-free area, respectively, thereby guiding the subsequent texture repair network to perform texture repair. In the loss function of the model, the loss functions of the two networks are weighted and superimposed for joint optimization, thereby guiding the network to maintain similarity in image content and image texture structure, optimizing the highlight elimination and texture repair effect, so that the trained highlight processing model has good highlight elimination and texture repair capabilities.

[0116] Based on the above embodiments, Figure 8 A flowchart of an image processing method provided by the embodiments of the present application is shown inFigure 8 As shown in the method comprises the following steps:

[0117] Step 801, obtaining a high light image to be processed.

[0118] Wherein, the high light image contains high light in the image, wherein the cause of the high light can refer to the explanation in the foregoing embodiments, the principle is the same, and details are not repeated here.

[0119] Step 802, inputting the high light image into the trained high light processing model to make the high light processing model perform high light elimination and texture reconstruction on the high light image to obtain a high light-free image.

[0120] Wherein, the high light processing model is trained by the model training method described in the foregoing method embodiments to obtain the trained high light processing model, wherein the training method of the high light processing model can refer to the explanation in the foregoing embodiments, the principle is the same, and details are not repeated here.

[0121] Inputting an ID portrait picture with high light and still visible text texture under high light into the high light processing model can output a portrait picture after eliminating high light, restoring text texture information and color information, realizing reasonable repair of texture in the high light area and maintaining color information in the non-high light area.

[0122] As an example, as shown in the left image in Figure 9 , the high light image is input into the trained high light processing model to perform high light elimination and texture repair to obtain a high light-free image Figure 9 , which is the right image in Figure 9 , realizing high light elimination, high-precision texture repair, and color restoration.

[0123] In the image processing method of the embodiment of the application, the high light processing model trained by the training method of the foregoing embodiments can maintain similarity in image content and image texture structure when processing the high light image, optimizing the high light elimination and texture repair effect, and improving the color difference problem.

[0124] In order to realize the foregoing embodiments, the embodiment of the application further provides a high light processing model training device.

[0125] Figure 10 A structural schematic diagram of a high light processing model training device provided by the embodiment of the application.

[0126] As shown in Figure 10 , the device can include:

[0127] The acquisition module 1001 is configured to acquire a sample high light image and a real high light-free image corresponding to the sample high light image.

[0128] The identification module 1002 is configured to input the sample highlight image into a highlight detection network of the highlight processing model to obtain a highlight mask image.

[0129] The processing model 1003 is configured to subtract the sample highlight image and the highlight mask image to obtain a first highlight-free image without texture repair.

[0130] The learning module 1004 is configured to input the first highlight-free image, the highlight mask image and the sample highlight image into a learning network of the highlight processing model to obtain a target background texture feature map.

[0131] The repair module 1005 is configured to input the target background texture feature map into a texture repair network of the highlight processing model to obtain a predicted highlight-free image after texture repair.

[0132] The training module 1006 is configured to perform model training on the highlight processing model according to a difference between the first highlight-free image and the real highlight-free image and according to a difference between the predicted highlight-free image and the real highlight-free image, to obtain the trained highlight processing model.

[0133] Further, in an implementation form of the embodiment of the present application, the training module 1006 is specifically configured to:

[0134] determine a target loss function according to the difference between the first highlight-free image and the real highlight-free image and according to the difference between the predicted highlight-free image and the real highlight-free image;

[0135] perform model parameter adjustment on the highlight processing model according to the target loss function, to obtain the trained highlight processing model.

[0136] In an implementation form of the embodiment of the present application, the training module 1006 is specifically configured to:

[0137] determine a first loss function of the highlight detection network according to the difference between the first highlight-free image and the real highlight-free image, determine a second loss function of the texture repair network according to the difference between the predicted highlight-free image and the real highlight-free image, and perform weighted synthesis on the first loss function and the second loss function according to a set first weight coefficient, to obtain the target loss function.

[0138] In an implementation form of the embodiment of the present application, the training module 1006 is specifically configured to:

[0139] determine a first content difference between the first highlight-free image and the real highlight-free image, and a first texture difference between the first highlight-free image and the real highlight-free image; obtain a second weight coefficient set; and perform weighted synthesis on the first content difference and the first texture difference according to the second weight coefficient, to obtain a first loss function of the highlight detection network.

[0140] In an implementation manner of the embodiment of the present application, the training module 1006 is specifically configured to:

[0141] determine a second content difference between the predicted highlight-free image and the real highlight-free image, and a second texture difference between the predicted highlight-free image and the real highlight-free image; obtain a third weight coefficient set; and perform weighted synthesis on the second content difference and the second texture difference according to the third weight coefficient, to obtain a second loss function of the texture repair network.

[0142] In an implementation manner of the embodiment of the present application, the learning module 1004 is specifically configured to:

[0143] perform feature extraction on the first highlight-free image by inputting the first highlight-free image into a first feature extraction layer of the learning network, to obtain a first background texture feature map; wherein the first background texture feature map carries background texture features of a highlight-free area; perform processing on the highlight mask image and the sample highlight image by inputting the highlight mask image and the sample highlight image into a second feature extraction layer of the learning network, to obtain a second background texture feature map; wherein the second background texture feature map carries background texture features of a highlight area; and perform fusion on the first background texture feature map and the second background texture feature map, to obtain the target background texture feature map.

[0144] In an implementation manner of the embodiment of the present application, the second feature extraction layer includes a first feature extraction sub-layer and a second feature extraction sub-layer, and the learning module 1004 is specifically configured to:

[0145] perform feature extraction on the highlight mask image by inputting the highlight mask image into the first feature extraction sub-layer, to obtain a highlight feature map; wherein the highlight feature map includes position features and intensity features of highlights; perform feature extraction on the sample highlight image by inputting the sample highlight image into the second feature extraction sub-layer, to obtain a sample feature map; and perform pixel-by-pixel element multiplication on each pixel unit in the sample feature map and a corresponding pixel unit in the highlight feature map, to obtain the second background texture feature map.

[0146] In an implementation manner of the embodiment of the present application, the processing model 1003 is specifically configured to:

[0147] Subtract each pixel unit in the sample highlight image and a corresponding pixel unit in the highlight mask image to obtain the first highlight-free image.

[0148] It should be noted that the foregoing explanation of the method embodiments also applies to the device of this embodiment, which will not be described here again.

[0149] In the training device of the highlight processing model, the sample highlight image and the corresponding real highlight-free image are obtained, the sample highlight image is input into the highlight detection network of the highlight processing model to obtain a highlight mask image, the sample highlight image and the highlight mask image are subtracted to obtain a first highlight-free image that has not been subjected to texture repair, the first highlight-free image, the highlight mask image and the sample highlight image are input into the learning network of the highlight processing model to obtain a target background texture feature map, the target background texture feature map is input into the texture repair network of the highlight processing model to obtain a predicted highlight-free image after texture repair, and the highlight processing model is trained according to the difference between the first highlight-free image and the real highlight-free image and according to the difference between the predicted highlight-free image and the real highlight-free image to obtain a trained highlight processing model. By adding the learning network between the highlight detection network and the texture repair network, the learning network learns the global background features containing the highlight area and the highlight-free area based on the output of the highlight detection network, as the input of the texture repair network, to guide the texture repair network to perform texture repair to reconstruct the nonlinear change of the highlight area, thereby generating a predicted highlight-free image with high quality and rich texture. The highlight processing model is trained according to the difference between the first highlight-free image and the real highlight-free image and according to the difference between the predicted highlight-free image and the real highlight-free image to obtain a trained highlight processing model, so that the highlight processing model obtained by training can output a highlight-free image with high quality and rich texture.

[0150] To implement the above embodiments, an image processing device is further provided in the embodiments of the present application.

[0151] Figure 11 A structural schematic diagram of an image processing device provided in the embodiments of the present application.

[0152] As shown in Figure 11 The device can include:

[0153] The acquisition module 1101 is configured to acquire a highlight image to be processed.

[0154] The processing module 1102 is configured to input the high-light image into a trained high-light processing model to perform high-light elimination and texture reconstruction on the high-light image by using the trained high-light processing model to obtain a high-light-free image.

[0155] It should be noted that the foregoing description of the method embodiments also applies to the device of this embodiment, which will not be described here.

[0156] In the image processing method of the embodiments of the present application, the high-light processing model trained by the training method of the above embodiments can maintain similarity in image content and image texture structure when processing the high-light image, thereby optimizing the high-light elimination and texture repair effect and improving the color difference problem of the repair.

[0157] To implement the above embodiments, the present application further provides an electronic device, including a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method as described in the foregoing method embodiments.

[0158] To implement the above embodiments, the present application further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement the method as described in the foregoing method embodiments.

[0159] To implement the above embodiments, the present application further provides a computer program product having a computer program stored thereon, wherein the computer program is executed by a processor to implement the method as described in the foregoing method embodiments.

[0160] Figure 12 A block diagram of an electronic device provided by an embodiment of the present application is shown. For example, the electronic device 800 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0161] Referring to Figure 12 , the electronic device 800 can include one or more of the following components: a processing component 803, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0162] The processing component 803 generally controls the overall operations of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 803 can include one or more processors 820 to execute instructions and to complete all or part of steps of the above-described methods. In addition, the processing component 803 can include one or more modules to facilitate the interaction between the processing component 803 and other components. For example, the processing component 803 can include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 803.

[0163] The memory 804 is configured to store various types of data to support operations of the electronic device 800. Examples of these data include instructions to operate any application programs or methods on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like. The memory 804 can be implemented by any type of volatile or nonvolatile memory devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disc, or optical disc.

[0164] The power component 806 provides power to various components of the electronic device 800. The power component 806 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.

[0165] The multimedia component 808 includes a screen to provide an output interface between the electronic device 800 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes the touch panel, the screen can be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense a touch, a slide, and a gesture on the touch panel. The touch sensor can not only sense a boundary of a touching or a sliding action, but also detect duration and pressure related to the touching or sliding action. In some embodiments, the multimedia component 808 includes a front camera and / or a back camera. The front camera and / or the back camera can receive external multimedia data when the electronic device 800 is in an operating mode, such as a shooting mode or a video mode. Each of the front camera and the back camera can be a fixed optical lens system or have a focal length and optical zoom capability.

[0166] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC) that is configured to receive an external audio signal when the electronic device 800 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0167] The I / O interface 812 provides an interface between the processing component 803 and peripheral interface modules, which can be a keypad, a click wheel, buttons, and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.

[0168] The sensor component 814 includes one or more sensors for providing status assessments of various aspects of the electronic device 800. For example, the sensor component 814 can detect an open / closed position of the electronic device 800, relative positioning of components, such as a display and a keypad of the electronic device 800, a change of position of the electronic device 800 or a component of the electronic device 800, presence or absence of user contact with the electronic device 800, orientation or acceleration / deceleration of the electronic device 800, and a temperature change of the electronic device 800. The sensor component 814 can include a proximity sensor configured to detect presence of a nearby object without any physical touch. The sensor component 814 can further include a light sensor, such as a CMOS or CCD image sensor, for use in an imaging application. In some embodiments, the sensor component 814 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0169] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 4G, or 5G, or a combination thereof. In an example embodiment, the communication component 816 receives broadcast signals or broadcast-related information from an external broadcasting management system via a broadcasting channel. In an example embodiment, the communication component 816 further includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technology.

[0170] In exemplary embodiments, the electronic device 800 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements, for performing the above-described methods.

[0171] In exemplary embodiments, a non-transitory computer-readable storage medium including instructions, such as the memory 804 including instructions, is also provided, which can be executed by the processor 820 of the electronic device 800 to accomplish the above-described methods. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, etc.

[0172] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Also, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in one or more embodiments or examples. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the specification and the features of the different embodiments or examples, without contradiction.

[0173] In addition, the terms "first", "second", etc. are used only for the purpose of description and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "a plurality of" is at least two, for example, two, three, etc., unless otherwise explicitly specified.

[0174] Any process or method descriptions or descriptions of the flow diagrams described herein or otherwise described in the specification can be understood as representing the modules, segments, or portions of code that include executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of the present application includes additional implementation in which the functions are performed in different orders, in substantially simultaneous fashion, or in reverse order, depending on the functionality involved, as would be understood by those skilled in the art.

[0175] The logic and / or steps represented in the flowcharts and / or described herein, for example, can be considered as a sequence of executable instructions stored in a computer readable medium, which can be executed by an instruction execution system, apparatus or device, such as a computer-based system, a processor-based system, or other system that can fetch the instructions from the instruction execution system, apparatus or device and execute the instructions, or a combination of them. For the purposes of this specification, a "computer readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus or device. The computer readable medium can be a computer readable storage medium or a computer readable signal medium. The computer readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, a portable computer diskette (magnetic), a RAM (random access memory), a ROM (read only memory), an EPROM (erasable programmable ROM), EEPROM (electrically erasable programmable ROM), a storage

[0176] It should be understood that aspects of the application can be implemented in hardware, software, firmware or a combination thereof. In the above embodiments, various steps or methods can be implemented in software or firmware that is stored in memory and executed by a suitable instruction execution system. As such, in some embodiments, specifically configured hardware can be used to implement at least some of the functionality described herein. In another embodiment, software or firmware can be used to implement at least some of the functionality described herein, which would be processed by a general purpose computer or processor. Specifically, any of the following technologies, or combinations thereof, can be used to implement at least some of the functionality described herein: discrete logic circuits having logic gates for implementing logic functions upon data signals, application specific integrated circuits having logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and others.

[0177] Those of skill in the art would understand that information and signals can be represented using any of a variety of technologies and techniques. For example, data, instructions, commands, information, signals, bits, symbols, and chips that can be referenced throughout the above description can be represented by voltages, currents, electromagnetic waves, magnetic fields or particles, optical fields or particles, or any combination thereof.

[0178] In addition, each of the functional units in the various embodiments of the present application can be integrated in one processing module, or each of the units can be physically present separately, or two or more units can be integrated in one module. The integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium.

[0179] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.

Claims

1. A method for training a high-light processing model, characterized in that, The method comprises the following steps: obtaining a sample highlight image and a real non-highlight image corresponding to the sample highlight image; inputting the sample highlight image into a highlight detection network of a highlight processing model to obtain a highlight mask image; subtracting the sample highlight image and the highlight mask image to obtain a first non-highlight image without texture repair; inputting the first non-highlight image, the highlight mask image and the sample highlight image into a learning network of the highlight processing model to obtain a target background texture feature map; inputting the target background texture feature map into a texture repair network of the highlight processing model to obtain a predicted non-highlight image after texture repair; performing model training on the highlight processing model according to the difference between the first non-highlight image and the real non-highlight image and the difference between the predicted non-highlight image and the real non-highlight image to obtain the trained highlight processing model.

2. The method of claim 1, wherein, The method of performing model training on the highlight processing model according to the difference between the first non-highlight image and the real non-highlight image and the difference between the predicted non-highlight image and the real non-highlight image to obtain the trained highlight processing model comprises the following steps: determining a target loss function according to the difference between the first non-highlight image and the real non-highlight image and the difference between the predicted non-highlight image and the real non-highlight image; performing model parameter adjustment on the highlight processing model according to the target loss function to obtain the trained highlight processing model.

3. The method of claim 2, wherein, The method of determining a target loss function according to the difference between the first non-highlight image and the real non-highlight image and the difference between the predicted non-highlight image and the real non-highlight image comprises the following steps: determining a first loss function of the highlight detection network according to the difference between the first non-highlight image and the real non-highlight image; determining a second loss function of the texture repair network according to the difference between the predicted non-highlight image and the real non-highlight image; performing weighted synthesis on the first loss function and the second loss function according to a set first weight coefficient to obtain the target loss function.

4. The method of claim 3, wherein, The method of determining a first loss function of the highlight detection network according to the difference between the first non-highlight image and the real non-highlight image comprises the following steps: determining a first content difference between the first non-highlight image and the real non-highlight image and a first texture difference between the first non-highlight image and the real non-highlight image; obtaining a set second weight coefficient; performing weighted synthesis on the first content difference and the first texture difference according to the second weight coefficient to obtain the first loss function of the highlight detection network.

5. The method of claim 3, wherein, The method of determining a second loss function of the texture repair network according to the difference between the predicted non-highlight image and the real non-highlight image comprises the following steps: determining a second content difference between the predicted non-highlight image and the real non-highlight image and a second texture difference between the predicted non-highlight image and the real non-highlight image; obtaining a set third weight coefficient; According to the third weight coefficient, the second content difference and the second texture difference are weighted and synthesized to obtain a second loss function of the texture repair network.

6. The method of claim 1, wherein, The inputting of the first non-highlight image, the highlight mask image and the sample highlight image into the learning network of the highlight processing model to obtain the target background texture feature map comprises: The first background texture feature map is obtained by inputting the first non-highlight image into a first feature extraction layer of the learning network for feature extraction, wherein the first background texture feature map carries background texture features of a non-highlight region; The second background texture feature map is obtained by inputting the highlight mask image and the sample highlight image into a second feature extraction layer of the learning network for processing, wherein the second background texture feature map carries background texture features of a highlight region; The target background texture feature map is obtained by fusing the first background texture feature map and the second background texture feature map.

7. The method of claim 6, wherein, The second feature extraction layer comprises a first feature extraction sub-layer and a second feature extraction sub-layer, and the inputting of the highlight mask image and the sample highlight image into the second feature extraction layer of the learning network for processing to obtain the second background texture feature map comprises: The highlight feature map is obtained by inputting the highlight mask image into the first feature extraction sub-layer for feature extraction, wherein the highlight feature map comprises position features of highlights and intensity features of highlights; The sample feature map is obtained by inputting the sample highlight image into the second feature extraction sub-layer for feature extraction; The second background texture feature map is obtained by performing pixel-by-pixel point multiplication on each pixel unit in the sample feature map and a corresponding pixel unit in the highlight feature map.

8. The method according to any one of claims 1 to 7, wherein, The first non-highlight image which has not been subjected to texture repair is obtained by subtracting the sample highlight image from the highlight mask image, comprising: Each pixel unit in the sample highlight image is subtracted from a corresponding pixel unit in the highlight mask image to obtain the first non-highlight image.

9. An image processing method characterized by, The method comprises: acquiring a highlight image to be processed; inputting the highlight image into a trained highlight processing model, so that the highlight processing model performs highlight elimination and texture reconstruction on the highlight image to obtain a non-highlight image; wherein the highlight processing model is trained by using the model training method according to any one of claims 1-8 to obtain the trained highlight processing model.

10. An apparatus for training a high-light processing model, comprising: The method comprises: an acquisition module configured to acquire a sample highlight image and a real non-highlight image corresponding to the sample highlight image; an identification module configured to input the sample highlight image into a highlight detection network of a highlight processing model to obtain a highlight mask image; a processing model configured to subtract the sample highlight image from the highlight mask image to obtain a first non-highlight image which has not been subjected to texture repair; a learning module configured to input the first non-highlight image, the highlight mask image and the sample highlight image into a learning network of the highlight processing model to obtain a target background texture feature map; and a highlight processing model configured to perform highlight elimination and texture reconstruction on the highlight image to obtain a non-highlight image. The repair module is configured to input the target background texture feature map into a texture repair network of the highlight processing model to obtain a predicted highlight-free image after texture repair. The training module is configured to perform model training on the highlight processing model according to a difference between the first highlight-free image and the real highlight-free image, and according to a difference between the predicted highlight-free image and the real highlight-free image, to obtain the trained highlight processing model.

11. An image processing apparatus characterized by comprising: The method comprises: The acquisition module is configured to acquire a highlight image to be processed. The processing module is configured to input the highlight image into a trained highlight processing model, so that the highlight processing model performs highlight elimination and texture reconstruction on the highlight image to obtain a highlight-free image; wherein the highlight processing model is trained by using the model training device in claim 10 to obtain the trained highlight processing model.

12. An electronic device, comprising: The computer program is executed by the processor to implement the method in any one of claims 1-8, or to implement the method in any one of claim 9.

13. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the method in any one of claims 1-8, or to implement the method in any one of claim 9.

Citation Information

Patent Citations

  • Method and a device for eliminating a highlight area of a microsurgery image

    CN109801239A

  • Multi-resolution deep network image highlight removing method based on divide-and-conquer

    CN111179196A