Image processing method and device
By enhancing and fusing the face image and the overall image in the image, the problem of poor image enhancement effect in the prior art is solved, and better image quality and user experience are achieved.
Patent Information
- Application Number
- CN202411009628.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2025-07-25
AI Technical Summary
In the existing image processing technology, the image enhancement effect is poor and cannot meet the needs of subsequent applications.
By extracting face images and overall images from the image, face enhancement and color enhancement are performed separately, image fusion is performed in parallel, and image processing is performed according to user preference information and parameters.
It has achieved improvements in the quality of face images, while taking into account the global image quality, and the enhancement effect is more in line with user needs and improving user experience.
Smart Images

Figure CN120375437A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technologies, and particularly to an image processing method and apparatus. Background Art
[0002] In existing image processing, the entire image is often globally enhanced, resulting in poor enhancement effects of the image and unable to meet the requirements of subsequent applications. Summary of the Invention
[0003] The present disclosure provides an image processing method and apparatus.
[0004] The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, an image processing method is provided, the method including:
[0006] Extracting an initial first face image from a first image;
[0007] Performing at least one face enhancement on the first face image according to the user's face preference information to obtain a second face image;
[0008] Performing at least one color enhancement on the first image according to the user's image preference parameters to obtain a second image;
[0009] Fusing the second face image and the second image to obtain a target image.
[0010] According to a second aspect of an embodiment of the present disclosure, an image processing apparatus is provided, the apparatus including:
[0011] A face extraction module, configured to extract an initial first face image from a first image;
[0012] A face enhancement module, configured to perform at least one face enhancement on the first face image according to the user's face preference information to obtain a second face image;
[0013] A color enhancement module, configured to perform color enhancement on the first image according to the user's image preference parameters to obtain a second image;
[0014] An image fusion module, configured to fuse the first face image and the second image to obtain a target image.
[0015] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the program, the image processing method provided in the first aspect of the embodiment of the present disclosure is implemented.
[0016] According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, which, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to execute the image processing method provided in the first aspect of the present disclosure.
[0017] According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product, including a computer program, characterized in that when the computer program is executed by a processor, it implements the image processing method provided in the first aspect of the present disclosure.
[0018] According to a sixth aspect of the embodiments of the present disclosure, there is provided a chip system, including a processing unit and an interface circuit. The processing unit obtains program instructions through the interface circuit, and the program instructions are executed by the processing unit. The processing unit is configured to execute the image processing method provided in the first aspect.
[0019] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:
[0020] In an image processing method according to an embodiment of the present disclosure, first, a first face image is extracted from a first image, and the first face image and the first image are respectively enhanced one or more times according to the user's preference. Then, the enhanced second image and the second face image are fused to obtain a final target image. In the embodiments of the present disclosure, enhancing the first face image and the first image in parallel not only realizes local enhancement of the face part of the image, making the quality of the face image better, but also takes into account the overall quality of the image, enabling the features of the target image to be more accurate and intuitive in subsequent applications. Further, image enhancement is performed according to the user's preference, making the final target image more in line with the user's needs and improving the user experience.
[0021] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure, and do not constitute an improper limitation to the present disclosure.
[0023] Figure 1 is a flowchart showing an image processing method according to an exemplary embodiment.
[0024] Figure 2 is a flowchart showing another image processing method according to an exemplary embodiment.
[0025] Figure 3It is a schematic flowchart of another image processing method shown according to an exemplary embodiment.
[0026] Figure 4 It is a schematic flowchart of another image processing method shown according to an exemplary embodiment.
[0027] Figure 5 It is a schematic flowchart of another image processing method shown according to an exemplary embodiment.
[0028] Figure 6 It is a block diagram of the structure of an image processing apparatus shown according to an exemplary embodiment.
[0029] Figure 7 It is a block diagram of the structure of another electronic device shown according to an exemplary embodiment.
[0030] Figure 8 It is a block diagram of the structure of a chip system shown according to some embodiments of the present disclosure. Detailed implementation manners
[0031] In order to enable those of ordinary skill in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0033] Figure 1 It is a schematic flowchart of an image processing method provided for an embodiment of the present disclosure.
[0034] As Figure 1 shown, the image processing method includes but is not limited to the following steps:
[0035] S101, extract an initial first face image from the first image.
[0036] The embodiments of the present disclosure are illustrated by taking the image processing method as being configured in an image processing device. The image processing device can be applied to any electronic device, so that the electronic device can execute the image processing method to enhance the quality of the image. For example, the electronic device can be a terminal device, an image acquisition device, a wearable device, a portable tablet computer, etc.
[0037] In some embodiments, the first image is the original image to be processed, or the first image is a preprocessed image of the original image, for example, a cropped image.
[0038] In some embodiments, the first image can be an image captured in real time by an image acquisition device.
[0039] In some embodiments, the first image can be an image stored locally.
[0040] In some embodiments, the first image can be an image downloaded from the network.
[0041] In some embodiments, after the first image is obtained, face detection can be performed on the first image to determine the region of the face in the first image, and the first face image is extracted from the region.
[0042] In some embodiments, face detection can be performed on the first image based on face geometric features to identify the region where the face is located in the first image. For example, key features of the face, such as the shape and structural relationship of parts such as eyes, nose, and mouth, are extracted for face detection.
[0043] In some embodiments, face detection can be performed on the first image based on a network model. The face detection box in the first image is output by the network model, and the first face image is extracted based on the face detection box, that is, the face region is segmented based on the face detection box to obtain the first face image.
[0044] Optionally, the network module can be a Convolutional Neural Networks (CNN), or a Hidden Markov Model (HMM), or an Active Shape Models (ASM) and an active appearance model (AAM), etc.
[0045] In some embodiments, face detection can be performed by analyzing skin color and texture and other features of the first image.
[0046] S102, according to the user's face preference information, perform at least one face enhancement on the first face image to obtain a second face image.
[0047] In some embodiments, the face preference information may include, but is not limited to: big eyes, thin face, whitening, freckle removal, etc. It can be understood that the face preference information is used to adjust the face area.
[0048] In some embodiments, the face preference information can be input by the user in text or by the user through voice.
[0049] In some embodiments, the historical adjustment operations of the user on the face can be obtained, and the face preference information can be extracted according to the historical adjustment operations.
[0050] In some embodiments, the preset number of times of face enhancement for the first face image can be pre-configured. After the first face image and the face preference information are obtained, the first face image can be enhanced based on the face preference information according to the preset number of times of face enhancement of the first face image to obtain a second face image. For example, the number of times of face enhancement for the first face image can be configured to be 3 times, and the first face image can be continuously enhanced 3 times based on the face preference information to obtain a second face image.
[0051] In some embodiments, after the first face image and the face preference information are obtained, the first face image can be enhanced based on the face preference information, and the quality of the enhanced first face image can be evaluated after the face enhancement. When the quality requirement is not met, the enhanced first face image can be continuously enhanced based on the face preference information until a second face image that meets the quality requirement is obtained. For example, based on a pre-trained face evaluation model, the face image after each enhancement can be input into the face evaluation model to obtain a quality score. If the quality score is lower than the set value, face enhancement needs to be continued.
[0052] S103, perform color enhancement on the first image according to the user's image preference parameters to obtain a second image.
[0053] In some embodiments, the image preference parameters may include, but are not limited to: high contrast, high saturation, etc. It can be understood that the image preference parameters are used to adjust the image.
[0054] In some embodiments, the image preference parameters can be input by the user in text or by the user through voice.
[0055] In some embodiments, the historical image adjustment parameters of the user can be obtained, and the user's image preference parameters can be extracted according to the historical image adjustment parameters.
[0056] In some embodiments, the preset number of times of color enhancement for the first image can be pre-configured. After obtaining the first image and the image preference parameters, the first image can be color-enhanced based on the image preference parameters according to the preset number of times of color enhancement for the first image to obtain a second image. For example, the preset number of times of color enhancement for the first image can be configured to be 5 times, and the first image can be color-enhanced continuously 5 times based on the image preference parameters to obtain a second image.
[0057] In some embodiments, after obtaining the first image and the image preference parameters, the first image can be color-enhanced based on the image preference parameters, and the quality of the enhanced first image can be evaluated after the color enhancement. When the quality requirement is not met, the enhanced first image can be continuously color-enhanced based on the image preference parameters until a second image that meets the quality requirement is obtained. For example, based on a pre-trained image evaluation model, each enhanced image can be input into the image evaluation model to obtain a quality score. If the quality score is lower than the set value, color enhancement needs to be continued.
[0058] S104, fuse the second face image and the second image to obtain a target image.
[0059] After completing the image enhancement of the first face image and the first image respectively, the second face image and the second image can be fused to obtain a target image.
[0060] In some embodiments, the pixel values and pixel positions of the pixels in the second face image can be determined, and the pixel values of the pixels in the second face image can be mapped to the second image according to the pixel positions to obtain a target image.
[0061] Optionally, for any pixel position, obtain the first pixel value at this pixel position in the second face image and the second pixel value at this pixel position in the second image, weight the first pixel value and the second pixel value to obtain the final pixel value at this pixel position, and update it to the second image to obtain a target image.
[0062] In some embodiments, the pixel values and pixel positions of the pixels in the second face image can be determined, and based on the pixel positions, the pixel values of the same pixels in the second image can be replaced to obtain a target image.
[0063] An image processing method according to an embodiment of the present disclosure first extracts a first face image from a first image, performs one or more image enhancements on the first face image and the first image according to the user's preference, and fuses the enhanced second image and the second face image to obtain a final target image. In the embodiment of the present disclosure, the enhancement of the first face image and the enhancement of the first image are performed in parallel, which not only realizes the local enhancement of the face part of the image, making the quality of the face image better, but also takes into account the global quality of the image, enabling the features of the target image to be more accurate and intuitive in subsequent applications. Further, image enhancement is performed according to the user's preference, making the final target image more in line with the user's needs and improving the user experience.
[0064] Figure 2 It is a schematic flowchart of an image processing method provided by an embodiment of the present disclosure.
[0065] As Figure 2 shown, the image processing method includes but is not limited to the following steps:
[0066] S201, obtain the face preference prompt words of the user.
[0067] S202, input the face preference prompt words into a pre-trained large language model, and the large language model obtains the face preference parameters of the user.
[0068] In some embodiments, the large language model can be pre-trained in advance. Further, the user inputs a face preference prompt into the large language model, and the large language model can perform information recognition on the face preference prompt words and extract the face preference parameters of the user. It can be understood that the face preference prompt words are natural languages input by the user, and the large language model can output a second structured text according to the face preference prompt, and the second structured text includes face preference information.
[0069] In some embodiments, the large language model can be pre-trained offline.
[0070] In some embodiments, the face preference information may include but is not limited to: big eyes, thin face, whitening, freckle removal, etc. It can be understood that the face preference information is used to adjust the face area.
[0071] S203, extract an initial first face image from the first image.
[0072] S204, perform at least one face enhancement on the first face image according to the user's face preference information to obtain a second face image.
[0073] In some embodiments, for the i-th face color enhancement, the enhanced face image of the (i - 1)-th time is enhanced according to the face preference information to obtain the enhanced face image of the i-th time, where i is a natural number greater than or equal to 1;
[0074] Further, obtain the first quality evaluation result of the enhanced face image of the i-th time. In response to the first quality evaluation result not meeting the preset face quality requirement, continue the (i + 1)-th face enhancement until the enhanced face image meets the face quality requirement to obtain the second face image. Optionally, determine that the change amount of the first quality evaluation result for multiple consecutive times is less than or equal to the set value, determine that the first quality evaluation result converges, and determine that the enhanced face image meets the face quality requirement to obtain the second face image.
[0075] Optionally, determine the preset number of times of face enhancement for the pre-configured face image, perform face enhancement on the first face image, and in response to the cumulative number of times of face enhancement of the first face image reaching the preset number of times of face enhancement of the first face image, obtain the second face image.
[0076] Optionally, in response to the fact that although the first quality evaluation result does not converge, but the number of face enhancement times reaches the preset number of face enhancement times, stop enhancing the face image continuously to obtain the second face image.
[0077] In some embodiments, obtain the first coding vector of the enhanced face image of the i-th time and the second coding vector of the face preference information. Further, input the first coding vector and the second coding vector into a pre-trained image quality evaluation network, and the image quality evaluation network outputs the first quality evaluation result of the enhanced face image of the i-th time.
[0078] In some embodiments, the image quality evaluation network can be a residual neural network (Residual Neural Network, Resnet) network structure. The input of the image quality evaluation network is the enhanced face image of the i-th time and the user's face preference information, and the output of the image quality evaluation network is a score. For example, the value range of the score can be 0 to 100. Wherein this score represents the first quality evaluation result of the enhanced face image of the i-th time and is used to reflect the image quality situation of the enhanced face image of the i-th time.
[0079] In some embodiments, the image quality evaluation network can include a residual neural network.
[0080] Optionally, the second coding vector corresponding to the user's face preference information can be M-dimensional. For example, word2vec can be used to encode the face preference information.
[0081] In some embodiments, a third encoding vector of the enhanced face image at the (i - 1)-th time and a second encoding vector of the face preference information are obtained. Further, the third encoding vector and the second encoding vector are input into a pre-trained face enhancement network, and the enhanced face image at the i-th time is output by the face enhancement network.
[0082] In some embodiments, the face enhancement network may be a U-Net structure. The input of the face enhancement network is the enhanced face image at the (i - 1)-th time with three RGB channels and the face preference information of the user, and the output of the face enhancement network is an enhanced face image with three RGB channels at the i-th time.
[0083] S205, perform at least one color enhancement on the first image according to the user's image preference parameters to obtain a second image.
[0084] For the optional implementation manner of step S205, reference can be made to Figure 1 step S103 of Figure 3 the optional implementation manners of steps S301 - 303 of Figure 1 and Figure 3 other related parts in the embodiments involved in
[0085] It can be understood that the execution order of step S205 and steps S201 - 204 can be interleaved or executed synchronously, which is not limited herein.
[0086] S206, fuse the second face image and the second image to obtain a target image.
[0087] In the embodiments of the present disclosure, by analyzing the user's face preference information with the help of a large language model, the extraction of face preference information can be made more accurate. Without the need for the user to input structured data, the face image can be adjusted in combination with the user's face preferences, and color enhancement can also be performed according to the user's image preference parameters, making the target image more in line with the user's needs and improving the user experience. Moreover, enhancing the first face image and the first image in parallel not only realizes the local enhancement of the face part of the image, making the quality of the face image better, but also takes into account the global quality of the image, enabling the features of the target image to be more accurate and intuitive in subsequent applications.
[0088] Figure 3 It is a schematic flowchart of a process for image processing provided by the embodiments of the present disclosure.
[0089] As Figure 3 shown, the image processing method includes but is not limited to the following steps:
[0090] S301, obtain the image preference prompt words input by the user.
[0091] S302. Input the image preference prompt into the pre-trained large language model, and obtain the user's image preference parameters from the large language model.
[0092] In some embodiments, the large language model can be pre-trained. Further, the user inputs an image preference prompt into the large language model, and the large language model can identify the information in the image preference prompt and extract the user's image preference parameters therefrom. It can be understood that the image preference prompt is the natural language input by the user, and the large language model can output the first structured text according to the image preference prompt, and the first structured text includes the image preference parameters.
[0093] In some embodiments, the large language model can be pre-trained offline.
[0094] In some embodiments, the image preference parameters may include, but are not limited to, high contrast, high saturation, etc. It can be understood that the image preference parameters are used to adjust the image.
[0095] S303. Perform at least one color enhancement on the first image according to the user's image preference parameters to obtain the second image.
[0096] In some embodiments, for the i-th original image enhancement, perform color enhancement on the (i - 1)-th enhanced image according to the image preference parameters to obtain the i-th enhanced image, where i is a natural number greater than or equal to 1. It can be understood that the i-th enhanced image is the image obtained by performing i times of color enhancement on the original first image.
[0097] Further, obtain the second quality evaluation result of the i-th enhanced image. In response to the second quality evaluation result not meeting the preset image quality requirement, continue to perform the (i + 1)-th original image enhancement until the enhanced image meets the image quality requirement to obtain the second image. Optionally, determine that the change amount of the second quality evaluation result is less than or equal to the set value for multiple consecutive times, determine that the second quality evaluation result converges, determine that the enhanced image meets the image quality requirement, and obtain the second image.
[0098] Optionally, determine the preset number of times of color enhancement of the first image configured in advance, perform color enhancement on the first image, and in response to the cumulative number of times of color enhancement of the first image reaching the preset number of times of color enhancement of the first image, obtain the second image.
[0099] Optionally, although the second quality evaluation result does not converge, but the cumulative number of times of color enhancement of the first image reaches the preset number of times of color enhancement of the first image, stop the iterative enhancement of the first image to obtain the second image.
[0100] In some embodiments, a fourth coding vector of the enhanced image at the i-th time and a fifth coding vector of the image preference parameter are obtained. Further, the fourth coding vector and the fifth coding vector are input into a pre-trained image quality evaluation network, and the image quality evaluation network outputs a second quality evaluation result of the enhanced image at the i-th time.
[0101] In some embodiments, the image quality evaluation network may be a VGG network structure. The input of the image quality evaluation network is the enhanced image at the i-th time and the user's image preference parameter, and the output of the image quality evaluation network is a score. For example, the value range of the score may be 0 to 100. Wherein this score represents the second quality evaluation result of the enhanced image at the i-th time, and is used to reflect the image quality of the enhanced image at the i-th time.
[0102] Optionally, the fifth coding vector corresponding to the user's image preference parameter may be K-dimensional. For example, word2vec can be used to encode the image preference parameter.
[0103] In some embodiments, a sixth coding vector of the enhanced image at the (i - 1)-th time and a fifth coding vector of the image preference parameter are obtained. Further, the sixth coding vector and the fifth coding vector are input into a pre-trained color enhancement network, and the color enhancement network outputs the enhanced image at the i-th time.
[0104] Optionally, the color enhancement network may be a UNet structure. The input is the first image with three RGB channels, and the user's image preference parameter. The output of the color enhancement network is an enhanced image with three RGB channels.
[0105] The optional implementation of step S303 can be referred to Figure 1 the optional implementation of step S103 in Figure 1 and other related parts in the involved embodiments, which will not be elaborated here.
[0106] S304, extract an initial first face image from the first image.
[0107] The optional implementation of step S304 can be referred to Figure 1 the optional implementation of step S101 in Figure 1 and other related parts in the involved embodiments, which will not be elaborated here.
[0108] S305, perform at least one face enhancement on the first face image according to the user's face preference information to obtain a second face image.
[0109] The optional implementation of step S305 can be referred to Figure 1 the optional implementation of step S102 and Figure 3 the optional implementation of steps S201 - 204 inFigure 1 and Figure 3 For other related parts in the embodiments involved herein, they will not be elaborated herein.
[0110] It can be understood that the execution order of steps S304 to S305 and steps S301 to 303 can be interchanged or executed synchronously, and no limitation is made herein.
[0111] S306. Fuse the second face image and the second image to obtain a target image.
[0112] For the optional implementation manners of step S306, reference can be made to Figure 1 the optional implementation manners of step S103 in Figure 1 and other related parts in the embodiments involved herein. They will not be elaborated herein.
[0113] In the embodiments of the present disclosure, by analyzing the user's image preference parameters with the help of a large language model, the extraction of the image preference parameters can be made more accurate. Without the user inputting structured data, the first image can be adjusted in combination with the user's image preference parameters, and the first face image can also be adjusted according to the user's face preference, making the target image more in line with the user's needs and improving the user experience. Moreover, enhancing the first face image and the first image in parallel not only realizes the local enhancement of the face part of the image, making the face image quality better, but also takes into account the global quality of the image, enabling the features of the target image to be more accurate and intuitive in subsequent applications.
[0114] Figure 4 It is a schematic flowchart of an image processing method provided by an embodiment of the present disclosure.
[0115] As Figure 4 shown, the image processing method includes but is not limited to the following steps:
[0116] S401. Obtain the user's face preference prompt words and image preference prompt words.
[0117] For the optional implementation manners of step S401, reference can be made to Figure 2 step S201 in Figure 3 the optional implementation manners of step S301 in Figure 2 and Figure 3 other related parts in the embodiments involved herein. They will not be elaborated herein.
[0118] S402. Input the face preference prompt words into a pre-trained large language model, and obtain the user's face preference information from the large language model.
[0119] For the optional implementation manners of step S402, reference can be made to Figure 2Optional implementation methods of step S202, and Figure 2 Other related parts in the involved embodiments will not be elaborated here.
[0120] S403. Input the image preference prompt into the pre-trained large language model, and obtain the user's image preference parameters from the large language model.
[0121] Optional implementation methods of step S403 can refer to Figure 3 Optional implementation methods of step S302, and Figure 3 Other related parts in the involved embodiments will not be elaborated here.
[0122] S404. Extract the initial first face image from the first image.
[0123] Optional implementation methods of step S404 can refer to Figure 1 Optional implementation methods of step S101, and Figure 1 Other related parts in the involved embodiments will not be elaborated here.
[0124] S405. Perform at least one face enhancement on the first face image according to the user's face preference information to obtain a second face image.
[0125] Optional implementation methods of step S405 can refer to Figure 1 Steps S102 and Figure 2 Optional implementation methods of step S204, and Figure 1 And Figure 2 Other related parts in the involved embodiments will not be elaborated here.
[0126] S406. Perform at least one color enhancement on the first image according to the user's image preference parameters to obtain a second image.
[0127] Optional implementation methods of step S406 can refer to Figure 1 Steps S103 and Figure 3 Optional implementation methods of step S203, and Figure 1 And Figure 2 Other related parts in the involved embodiments will not be elaborated here.
[0128] S407. Fuse the second face image and the second image to obtain a target image.
[0129] Optional implementation methods of step S407 can refer to Figure 1 Optional implementation methods of step S104, and Figure 1 Other related parts in the involved embodiments will not be elaborated here.
[0130] In the embodiments of the present disclosure, by analyzing the user's image preference parameters and face preference information with the help of a large language model, the extraction of image preference parameters and face preference information can be made more accurate, without the need for the user to input structured data. Moreover, the image can be enhanced according to the user's signal, making the target image more in line with the user's needs and improving the user experience.
[0131] Figure 5 It is a schematic flowchart of an image processing method provided by an embodiment of the present disclosure.
[0132] As Figure 5 shown, the image processing method includes, but is not limited to, the following steps:
[0133] Step 501, obtain the face preference prompt word and image preference prompt word input by the user.
[0134] Step 502, call the pre-trained large language model to analyze the prompt words input by the user.
[0135] Step 503, obtain the user's face preference information and image preference parameters from the large language model.
[0136] The above steps 1 to 3 can be executed offline.
[0137] Step 504, start the camera to take a picture to obtain the first image.
[0138] Step 505, determine whether the first image includes a face.
[0139] If the first image includes a face, execute step S506; if the first image does not include a face, execute step S511.
[0140] Step 506, perform face detection on the first image and extract the first face image from it.
[0141] Step 507, obtain the initial quality evaluation result of the first human body image.
[0142] Step S508, determine whether the initial quality evaluation result meets the face quality requirement.
[0143] If the initial quality evaluation result does not meet the face image requirement, execute step S509; if the initial quality evaluation result meets the face image requirement, execute step S511.
[0144] Step 509, perform face enhancement on the first face image based on the face preference information and evaluate the quality of the enhanced face image.
[0145] Step 510, determine whether the first quality evaluation result meets the face quality requirement, or whether the cumulative number of face enhancement times reaches the preset number of face enhancement times.
[0146] If the first quality evaluation result does not meet the face quality requirement and the number of face enhancement iterations does not reach the preset number of face enhancement times, then return to execute step 509 until the first quality evaluation result meets the face quality requirement and / or the number of face enhancement iterations reaches the preset number of face enhancement times to obtain the second face image, and then execute step 513.
[0147] Step S511: Perform color enhancement on the first image based on the image preference parameters and evaluate the quality of the enhanced image.
[0148] Step S512: Determine whether the second quality evaluation result meets the image quality requirement, or whether the cumulative number of color enhancement times reaches the preset number of color enhancement times.
[0149] If the second quality evaluation result does not meet the image quality requirement and the number of color enhancement iterations does not reach the preset number of color enhancement times, then return to execute step 511 until the second quality evaluation result meets the image quality requirement and / or the number of color enhancement iterations reaches the preset number of color enhancement times, and then execute step S513.
[0150] S513: Fuse the second face image and the second image to obtain the target image.
[0151] In the embodiments of the present disclosure, a face can be recognized and located from the first image, the first image can be color-enhanced using a color enhancement model, and the first face image can be face-enhanced using a face enhancement model. Further, the quality of the enhanced image is evaluated through a neural network. After meeting the quality requirements, the enhanced second image and the second face image are obtained. Further, the second image and the second face image are fused to obtain the final target image, which can make the features of the target image more accurate and intuitive in subsequent applications. Further, image enhancement is performed according to the user's preference, so that the final target image better meets the user's needs and improves the user experience.
[0152] The embodiments of the present disclosure also propose a device for implementing any of the above methods. For example, a device is proposed, and the above device includes units or modules for implementing each step executed in any of the above methods.
[0153] It should be understood that the division of the units or modules in the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into a physical entity or physically separated. In addition, the units or modules in the device can be implemented in the form of a processor calling software: for example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or implement the functions of the units or modules of the above device.
[0154] Figure 6 It is a structural block diagram of an image processing device shown according to an exemplary embodiment. The image processing device 600 may include: a face extraction module 601, a face enhancement module 602, a color enhancement image 603, and an image fusion module 604.
[0155] The face extraction module 601 is used to extract an initial first face image from the first image;
[0156] The face enhancement module 602 is used to perform at least one face enhancement on the first face image according to the user's face preference information to obtain a second face image;
[0157] The color enhancement image 603 is used to perform at least one color enhancement on the first image according to the user's image preference parameters to obtain a second image;
[0158] The image fusion module 604 is used to fuse the second face image and the second image to obtain a target image.
[0159] In some embodiments, the image processing device 600 may further include: an acquisition module 605; wherein, the acquisition module 605 is used to acquire the image preference prompt words input by the user; input the image preference prompt words into a pre-trained large language model, and the large language model acquires the user's image preference parameters.
[0160] The acquisition module 605 is further used to acquire the face preference prompt words input by the user; input the face preference prompt words into a pre-trained large language model, and the large language model acquires the user's face preference parameters.
[0161] In some embodiments, the face enhancement module 602 is further used to:
[0162] For the i-th face enhancement, perform face enhancement on the (i - 1)-th enhanced face image according to the face preference information to obtain the i-th enhanced face image, where i is a natural number greater than or equal to 1;
[0163] Obtain the first quality evaluation result of the i-th enhanced face image;
[0164] In response to the first quality evaluation result not meeting the preset face quality requirement, continue to perform the (i + 1)-th face enhancement until the enhanced face image meets the face quality requirement to obtain the second face image.
[0165] In some embodiments, the color enhancement module 603 is further used to:
[0166] For the i-th color enhancement, perform color enhancement on the enhanced image of the (i - 1)-th time according to the image preference parameter to obtain the enhanced image of the i-th time, where i is a natural number greater than or equal to 1, and the enhanced image of the i-th time is the image obtained after the first image undergoes i times of color enhancement;
[0167] Obtain the second quality evaluation result of the enhanced image of the i-th time;
[0168] In response to the second quality evaluation result not meeting the preset image color requirement, continue to perform the (i + 1)-th color enhancement until the enhanced image meets the image color requirement to obtain the second image.
[0169] In some embodiments, the image fusion module 604 is further configured to:
[0170] Determine the preset number of times of image enhancement for the image to be enhanced, where the image to be enhanced is the first face image or the first image;
[0171] In response to the current number of image enhancement iterations of the image to be enhanced reaching the preset number of times of image enhancement, stop continuing the enhancement iteration of the image to be enhanced, and the enhanced image is the second image or the second image.
[0172] In some embodiments, the image fusion module 604 is further configured to:
[0173] In response to the quality evaluation result of the image to be enhanced not meeting the quality requirement, but the current number of image enhancement iterations of the image to be enhanced reaching the preset number of times of image enhancement, stop the enhancement iteration of the image to be enhanced;
[0174] Where the image to be enhanced is the first face image or the first image.
[0175] In some embodiments, the face enhancement module 602 is further configured to:
[0176] Obtain the first coding vector of the enhanced face image of the i-th time and the second coding vector of the face preference information;
[0177] Input the first coding vector and the second coding vector into a pre-trained image quality evaluation network, and output the first quality evaluation result of the enhanced face image of the i-th time by the image quality evaluation network.
[0178] In some embodiments, the face enhancement module 602 is further configured to:
[0179] Obtain the third coding vector of the enhanced face image of the (i - 1)-th time and the second coding vector of the face preference information;
[0180] Input the third coding vector and the second coding vector into a pre-trained face enhancement network, and output the enhanced face image of the i-th time by the face enhancement network.
[0181] In some embodiments, the color enhancement module 603 is further configured to:
[0182] Obtain a fourth coding vector of the enhanced image of the i-th time and a fifth coding vector of the image preference parameter;
[0183] Input the fourth coding vector and the fifth coding vector into a pre-trained image quality evaluation network, and output a second quality evaluation result of the enhanced image of the i-th time by the image quality evaluation network.
[0184] In some embodiments, the color enhancement module 603 is further configured to:
[0185] Obtain a sixth coding vector of the enhanced image of the (i - 1)-th time and the fifth coding vector of the image preference parameter;
[0186] Input the sixth coding vector and the fifth coding vector into a pre-trained color enhancement network, and output the enhanced image of the i-th time by the color enhancement network.
[0187] An image processing method according to an embodiment of the present disclosure first extracts a first face image from a first image, performs one or more image enhancements on the first face image and the first image according to the user's preference, and fuses the enhanced second image and the second face image to obtain a final target image. In the embodiments of the present disclosure, enhancing the first face image and the first image in parallel not only realizes local enhancement of the face part of the image, making the quality of the face image better, but also takes into account the global quality of the image, enabling the features of the target image to be more accurate and intuitive in subsequent applications. Further, performing image enhancement according to the user's preference makes the final target image more in line with the user's needs and improves the user experience.
[0188] Figure 7 It is a schematic structural diagram of an electronic device 700 proposed by an embodiment of the present disclosure. The electronic device 700 may be the image processing device in the above embodiment, or a chip, a chip system, or a processor, etc. that supports the signal device to implement any of the above methods. The electronic device 700 can be used to implement the method described in the above method embodiment, and specific reference can be made to the description in the above method embodiment.
[0189] Such as Figure 7As shown, the electronic device 700 includes one or more processors 701. The processor 701 can be a general-purpose processor or a dedicated processor, etc. For example, it can be a baseband processor or a central processing unit. The baseband processor can be used to process communication protocols and communication data, and the central processing unit can be used to control communication devices (such as base stations, baseband chips, terminal devices, terminal device chips, DUs or CUs, etc.), execute programs, and process program data. Optionally, the electronic device 700 is used to execute any of the above methods. Optionally, one or more processors 701 are used to call instructions to cause the electronic device 700 to execute any of the above methods.
[0190] In some embodiments, the electronic device 700 further includes one or more transceivers 702. When the electronic device 700 includes one or more transceivers 702, the transceiver 702 performs at least one of the communication steps such as sending and / or receiving in the above method, and the processor 701 performs at least one of the other steps. In an alternative embodiment, the transceiver may include a receiver and / or a transmitter, and the receiver and the transmitter may be separate or integrated together. Optionally, terms such as transceiver, transceiver unit, transceiver machine, transceiver circuit, interface circuit, interface, etc. can be replaced with each other, terms such as transmitter, transmitter unit, transmitter machine, transmitter circuit, etc. can be replaced with each other, and terms such as receiver, receiver unit, receiver machine, receiver circuit, etc. can be replaced with each other.
[0191] In some embodiments, the electronic device 700 further includes one or more memories 703 for storing data. Optionally, all or part of the memories 703 may also be outside the electronic device 700. In an alternative embodiment, the electronic device 700 may include one or more interface circuits 704. Optionally, the interface circuit 704 is connected to the memory 702, and the interface circuit 704 can be used to receive data from the memory 702 or other devices, and can be used to send data to the memory 702 or other devices. For example, the interface circuit 704 can read the data stored in the memory 702 and send the data to the processor 701.
[0192] The electronic device 700 described in the above embodiments can be a network device or a terminal, but the scope of the electronic device 700 described in this disclosure is not limited thereto, and the structure of the electronic device 700 can be unrestricted Figure 7Limitations. The electronic device can be a stand-alone device or can be part of a larger device. For example, the electronic device can be: 1) a stand-alone integrated circuit (IC), or chip, or chip system or subsystem; (2) a collection of one or more ICs, optionally, the above IC collection can also include storage components for storing data and programs; (3) an ASIC, such as a modem; (4) a module that can be embedded in other devices; (5) a receiver, a terminal device, a smart terminal device, a cellular phone, a wireless device, a handheld device, a mobile unit, a vehicle-mounted device, a network device, a cloud device, an artificial intelligence device, etc.; (6) others, etc.
[0193] Figure 8 is a schematic structural diagram of the chip system 800 proposed by an embodiment of the present disclosure. For the case where the electronic device can be a chip or a chip system, reference can be made to Figure 8 the schematic structural diagram of the chip system 800 shown, but not limited thereto.
[0194] The chip system 800 includes one or more processors 801. The chip system 800 is used to execute any of the above methods.
[0195] In some embodiments, the chip system 800 further includes one or more interface circuits 802. Optionally, terms such as interface circuit, interface, and transceiver pin can be replaced with each other. In some embodiments, the chip system 800 further includes one or more memories 803 for storing data. Optionally, all or part of the memories 803 can be outside the chip system 800. Optionally, the interface circuit 802 is connected to the memory 803. The interface circuit 802 can be used to receive data from the memory 803 or other devices, and the interface circuit 802 can be used to send data to the memory 803 or other devices. For example, the interface circuit 802 can read the data stored in the memory 803 and send the data to the processor 801.
[0196] In some embodiments, the interface circuit 802 performs at least one of the communication steps such as sending and / or receiving in the above method. The interface circuit 802 performing the communication steps such as sending and / or receiving in the above method means, for example, that the interface circuit 802 performs data interaction between the processor 801, the chip system 800, the memory 803, or the transceiver device. In some embodiments, the processor 801 performs at least one of the other steps.
[0197] The various modules and / or devices described in the embodiments of the virtual device, physical device, chip, etc. can be combined or separated arbitrarily according to the situation. Optionally, some or all of the steps can also be executed by multiple modules and / or devices in cooperation, which is not limited here.
[0198] The present disclosure also provides a storage medium, on which instructions are stored. When the instructions run on an electronic device 700, the electronic device 700 is caused to execute any of the above methods. Optionally, the storage medium is an electronic storage medium. Optionally, the storage medium is a computer-readable storage medium, but not limited thereto, and it may also be other device-readable storage mediums. Optionally, the storage medium may be a non-transitory storage medium, but not limited thereto, and it may also be a transitory storage medium.
[0199] The present disclosure also provides a program product. When the program product is executed by an electronic device 700, the electronic device 700 is caused to execute any of the above methods. Optionally, the program product is a computer program product.
[0200] The present disclosure also provides a computer program. When it runs on a computer, the computer is caused to execute any of the above methods.
[0201] The present disclosure also provides a vehicle, which may include the electronic device 700 to execute any of the above methods.
[0202] Those skilled in the art can also understand that the various illustrative logical blocks and steps listed in the embodiments of the present application can be implemented by electronic hardware, computer software, or a combination of both. Whether such a function is implemented by hardware or software depends on the specific application and the design requirements of the entire system. For each specific application, those skilled in the art can use various methods to implement the described function, but such implementation should not be construed as exceeding the scope protected by the embodiments of the present application.
[0203] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily conceive of other embodiments of the present disclosure. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include known common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0204] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. An image processing method, characterized in that, The method includes: Extracting an initial first face image from a first image; Performing at least one face enhancement on the first face image according to the user's face preference information to obtain a second face image; Performing at least one color enhancement on the first image according to the user's image preference parameters to obtain a second image; Fusing the second face image and the second image to obtain a target image.
2. The method according to claim 1, characterized in that, The method further includes: Obtaining an image preference prompt word input by the user; Inputting the image preference prompt word into a pre-trained large language model, and obtaining the user's image preference parameters by the large language model.
3. The method according to claim 1, wherein The method further includes: Obtaining a face preference prompt word input by the user; Inputting the face preference prompt word into a pre-trained large language model, and obtaining the user's face preference parameters by the large language model.
4. The method according to claim 1, characterized in that The performing at least one face enhancement on the first face image according to the user's face preference information to obtain a second face image includes: For the i-th face enhancement, performing face enhancement on the (i - 1)-th enhanced face image according to the face preference information to obtain the i-th enhanced face image, where i is a natural number greater than or equal to 1; Obtaining a first quality evaluation result of the i-th enhanced face image; In response to the first quality evaluation result not meeting the preset face quality requirement, continuing the (i + 1)-th face enhancement until the enhanced face image meets the face quality requirement to obtain the second face image.
5. The method according to claim 1, characterized in that The performing at least one color enhancement on the first image according to the user's image preference parameters to obtain a second image includes: For the i-th color enhancement, performing color enhancement on the (i - 1)-th enhanced image according to the image preference parameters to obtain the i-th enhanced image, where i is a natural number greater than or equal to 1, and the i-th enhanced image is the image obtained after the first image undergoes i times of color enhancement; Obtaining a second quality evaluation result of the i-th enhanced image; In response to the second quality evaluation result not meeting the preset image color requirement, continuing the (i + 1)-th color enhancement until the enhanced image meets the image color requirement to obtain the second image.
6. The method according to claim 1, characterized in that The method further includes: Determining a preset number of image enhancement times for the image to be enhanced, where the image to be enhanced is the first face image or the first image; In response to the current number of image enhancement iterations of the image to be enhanced reaching the preset number of image enhancement times, stopping the continuous enhancement iteration of the image to be enhanced, and the enhanced image is the second image or the second face image.
7. The method according to claim 4 or 5, characterized in that The method further includes: In response to the quality evaluation result of the image to be enhanced not meeting the quality requirement, but the current number of image enhancement iterations of the image to be enhanced reaching the preset number of image enhancement times, stopping the enhancement iteration of the image to be enhanced; where the image to be enhanced is the first face image or the first image.
8. The method according to claim 4, characterized in that, The method further includes: Obtaining a first coding vector of the i-th enhanced face image and a second coding vector of the face preference information; Input the first encoding vector and the second encoding vector into a pre-trained image quality evaluation network, and output the first quality evaluation result of the enhanced face image at the i-th time by the image quality evaluation network.
9. The method according to claim 4, wherein The process of obtaining the enhanced face image at the i-th time includes: Obtain the third encoding vector of the enhanced face image at the (i - 1)-th time and the second encoding vector of the face preference information; Input the third encoding vector and the second encoding vector into a pre-trained face enhancement network, and output the enhanced face image at the i-th time by the face enhancement network.
10. The method according to claim 5, wherein The method further includes: Obtain the fourth encoding vector of the enhanced image at the i-th time and the fifth encoding vector of the image preference parameter; Input the fourth encoding vector and the fifth encoding vector into a pre-trained image quality evaluation network, and output the second quality evaluation result of the enhanced image at the i-th time by the image quality evaluation network.
11. The method according to claim 5, wherein The process of obtaining the enhanced image at the i-th time includes: Obtain the sixth encoding vector of the enhanced image at the (i - 1)-th time and the fifth encoding vector of the image preference parameter; Input the sixth encoding vector and the fifth encoding vector into a pre-trained color enhancement network, and output the enhanced image at the i-th time by the color enhancement network.
12. An image processing apparatus, characterized in that, The method includes: A face extraction module, configured to extract an initial first face image from a first image; A face enhancement module, configured to perform at least one face enhancement on the first face image according to the user's face preference information to obtain a second face image; A color enhancement module, configured to perform color enhancement on the first image according to the user's image preference parameter to obtain a second image; An image fusion module, configured to fuse the first face image and the second image to obtain a target image.
13. An electronic device, characterized in that, Includes: A memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the image processing method according to any one of claims 1 - 11.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the image processing method according to any one of claims 1 - 11.
15. A computer program product, including a computer program, which when executed by a processor implements the image processing method according to any one of claims 1 - 11.