Image processing method, intelligent terminal and storage medium

By obtaining the probability of each pixel point in the target image and using neural network model and guiding filtering processing, combined with color enhancement technology in different modes, the problem of incoordination of the target type area and other areas is solved, achieving better image processing effect.

CN114723645BActive Publication Date: 2025-08-12SHANGHAI TRANSSION CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210281776.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-22
Publication Date
2025-08-12
Estimated Expiration
2042-03-22

AI Technical Summary

Technical Problem

In the prior art, the processing effects of the target type area and other areas during image processing are not coordinated and natural, resulting in poor processing results.

Method used

By obtaining the probability that each pixel point in the target image belongs to the target type area, using the neural network model for prediction and guidance filtering, combined with the color enhancement processing of different modes, the coordinated processing of the target type area and other areas is achieved.

Benefits of technology

The coordination and naturalness of the processing results of the target type area and other areas are improved, and the image processing effect is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114723645B_ABST
    Figure CN114723645B_ABST
Patent Text Reader

Abstract

This application relates to an image processing method, an intelligent terminal, and a storage medium. The method comprises the following steps: obtaining first image data, the first image data including the probability that each pixel in a target image belongs to a target type region; and performing a first processing on the target image based on the first image data to obtain a processed image. This application uses a probabilistic approach to assess whether each pixel in an image belongs to a target type region, which can make the processing results of the target type region and other regions more coordinated and natural, resulting in better image processing effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, an intelligent terminal, and a storage medium. Background Art

[0002] With the rapid development of terminal technology, the functions of mobile terminals such as mobile phones and tablet computers have been continuously improved, and have gradually become one of the commonly used tools in people's daily life and work.

[0003] During the process of conceiving and implementing this application, the inventors discovered that there are at least the following problems: in some implementations, when processing image colors, the entire image is processed identically, resulting in poor processing effects in target type areas and unnatural and uncoordinated processing results with other areas.

[0004] The preceding description is intended to provide general background information and does not necessarily constitute prior art. Summary of the Invention

[0005] In response to the above technical problems, the present application provides an image processing method, an intelligent terminal and a storage medium, which can make the processing results of the target type area and other areas more coordinated and natural, and achieve better image processing effects.

[0006] To solve the above technical problems, the present application provides an image processing method, comprising the following steps:

[0007] S1: Acquire first image data, where the first image data includes a probability that each pixel in a target image belongs to a target type area;

[0008] S2: Performing a first processing on the target image according to the first image data to obtain a processed image.

[0009] Optionally, the step S1 includes:

[0010] S11: downsampling the target image to obtain a downsampled image;

[0011] S12: Predicting the probability that each pixel in the downsampled image belongs to the target type area to obtain second image data;

[0012] S13: Using the target image as a guide image, perform guided filtering processing on the second image data to obtain the first image data.

[0013] Optionally, after step S12, the method further includes:

[0014] determining whether the target image contains a target type area according to the second image data;

[0015] If the target type area is included, then the step S13 is executed.

[0016] Optionally, determining whether the target image contains a target type area according to the second image data includes:

[0017] comparing a probability value of each pixel point corresponding to the downsampled image in the second image data with a preset probability threshold;

[0018] The pixel points whose probability value is greater than or equal to the preset probability threshold are accumulated to obtain the total pixel points corresponding to the target type area;

[0019] Calculate the ratio of the total pixel points corresponding to the target type area to the total pixel points of the downsampled image;

[0020] If the ratio is greater than or equal to a preset ratio threshold, it is determined that the target image contains a target type area.

[0021] Optionally, after step S12, the method further includes:

[0022] If the target type area is not contained, the target image is subjected to a second process to obtain a processed image.

[0023] Optionally, the step S2 includes:

[0024] S21: performing color enhancement processing on the target image based on the first mode to obtain a first enhanced image, and performing color enhancement processing on the target image based on the second mode to obtain a second enhanced image;

[0025] S22: Performing color fusion on the first enhanced image and the second enhanced image according to the first image data to obtain a processed image.

[0026] Optionally, the target type area is a skin area, or other preset type areas (such as face, sky, moon, sun, landscape, building, car, television, etc.).

[0027] Optionally, performing color enhancement processing on the target image based on the first mode to obtain a first enhanced image includes at least one of the following:

[0028] Identifying a background type of the target image, and performing color enhancement processing on the entire target image or a background region thereof according to a color mapping table corresponding to the background type to obtain a first enhanced image;

[0029] Color enhancement processing is performed on the entire target image or the background area according to a preset background color mapping table to obtain a first enhanced image.

[0030] Optionally, performing color enhancement processing on the target image based on the second mode to obtain a second enhanced image includes at least one of the following:

[0031] Identifying the skin color type of the target image, and performing color enhancement processing on the entire target image or the skin area according to a color mapping table corresponding to the skin color type to obtain a second enhanced image;

[0032] Color enhancement processing is performed on the entire target image or the skin area according to a preset skin color mapping table to obtain a second enhanced image.

[0033] Optionally, the step S22 includes:

[0034] S221: Obtain a probability that a target pixel in the target image belongs to a target type area, a first RGB value of the corresponding pixel in the first enhanced image, and a second RGB value of the corresponding pixel in the second enhanced image;

[0035] S222: Fusing the first RGB value and the second RGB value according to the probability to obtain a fused RGB value of the target pixel;

[0036] S223: Perform image color filling according to the fused RGB values of each pixel of the target image to obtain a processed image.

[0037] This application also provides another image processing method, comprising the following steps:

[0038] S10: Determine whether the target image contains a target type area;

[0039] S20: If the target type region is included, performing a first processing on the target image according to the probability that each pixel in the target image belongs to the target type region to obtain a processed image.

[0040] Optionally, before step S20, the method further includes:

[0041] Downsampling the target image to obtain a downsampled image;

[0042] Predicting the probability that each pixel in the downsampled image belongs to the target type area to obtain target image data;

[0043] The target image is used as a guide image, and guided filtering processing is performed on the target image data to obtain the probability that each pixel point in the target image belongs to the target type area.

[0044] Optionally, the step S20 includes:

[0045] S201: performing color enhancement processing on the target image based on a first mode to obtain a first enhanced image, and performing color enhancement processing on the target image based on a second mode to obtain a second enhanced image;

[0046] S202: Performing color fusion on the first enhanced image and the second enhanced image according to the probability that each pixel in the target image belongs to the target type area to obtain a processed image.

[0047] Optionally, the step S202 includes:

[0048] Obtaining a probability that a target pixel in the target image belongs to a target type area, a first RGB value of a corresponding pixel in the first enhanced image, and a second RGB value of a corresponding pixel in the second enhanced image;

[0049] Fusing the first RGB value and the second RGB value according to the probability to obtain a fused RGB value of the target pixel;

[0050] The image is filled with color according to the fused RGB values of each pixel of the target image to obtain a processed image.

[0051] The present application also provides a smart terminal, which includes: a memory and a processor, wherein the memory stores an image processing program, and when the processing program is executed by the processor, the steps of the image processing method described in any one of the above items are implemented.

[0052] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned image processing methods are implemented.

[0053] As described above, the image processing method, intelligent terminal, and storage medium of the present application include the following steps: obtaining first image data, the first image data including the probability that each pixel in the target image belongs to a target type region; and performing a first processing on the target image based on the first image data to obtain a processed image. The present application uses a probabilistic approach to evaluate whether each pixel in the image belongs to the target type region, which can make the processing results of the target type region and other regions more coordinated and natural, and achieve better image processing effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for describing the embodiments. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without inventive work.

[0055] Figure 1 A schematic diagram of the hardware structure of an intelligent terminal for implementing various embodiments of the present application;

[0056] Figure 2 A communication network system architecture diagram provided in an embodiment of the present application;

[0057] Figure 3 is a flowchart of an image processing method according to the first embodiment;

[0058] Figure 4 FIG. 1 is a flowchart of an image processing method according to the second embodiment.

[0059] The purpose of this application, its features, and advantages will be further described in conjunction with the embodiments and with reference to the accompanying drawings. The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and the accompanying text are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of this application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0060] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0061] It should be noted that, in this document, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined by their explanation in the specific embodiment or further combined with the context of the specific embodiment.

[0062] It should be understood that although the terms "first," "second," "third," etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are used solely to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the term "if," as used herein, may be interpreted as "upon," "when," or "in response to a determination." Furthermore, as used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It should be further understood that the terms "comprising" and "including" indicate the presence of the recited features, steps, operations, elements, components, items, types, and / or groups, but do not preclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, items, types, and / or groups. The terms "or," "and / or," "including at least one of the following," etc., as used herein, may be interpreted as inclusive, meaning any one or any combination. For example, “comprising at least one of the following: A, B, C” means “any of the following: A; B; C; A and B; A and C; B and C; A and B and C”; and for another example, “A, B or C” or “A, B and / or C” means “any of the following: A; B; C; A and B; A and C; B and C; A and B and C”. An exception to this definition will occur only when a combination of elements, functions, steps or operations are inherently mutually exclusive in some manner.

[0063] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless clearly stated herein, the execution of these steps is not strictly limited in order, and they can be performed in other orders. Moreover, at least a portion of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0064] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to the determination" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)," depending on the context.

[0065] It should be noted that in this article, step codes such as S1 and S2 are used for the purpose of expressing the corresponding content more clearly and concisely, and do not constitute a substantial restriction on the order. When implementing the step, those skilled in the art may execute S2 first and then S1, etc., but these should all be within the scope of protection of this application.

[0066] It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.

[0067] In the subsequent description, the use of suffixes such as "module", "component" or "unit" to represent elements is only for the purpose of facilitating the description of the present application and has no specific meaning. Therefore, "module", "component" or "unit" can be used interchangeably.

[0068] Smart terminals can be implemented in various forms. For example, the smart terminals described in this application may include smart terminals such as mobile phones, tablet computers, laptop computers, PDAs, portable media players (PMPs), navigation devices, wearable devices, smart bracelets, pedometers, etc., as well as fixed terminals such as digital TVs and desktop computers.

[0069] The subsequent description will be made using a smart terminal as an example. It will be understood by those skilled in the art that, in addition to components specifically used for mobile purposes, the configuration according to the embodiments of the present application can also be applied to fixed-type terminals.

[0070] See also Figure 1 , which is a schematic diagram of the hardware structure of a smart terminal for implementing various embodiments of the present application. The smart terminal 100 may include: an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an A / V (audio / video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will understand that Figure 1 The structure of the smart terminal shown in the figure does not constitute a limitation on the smart terminal. The smart terminal may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0071] The following combination Figure 1 A detailed introduction to each component of the smart terminal:

[0072] The RF unit 101 can be used to send and receive information or receive signals during calls. Specifically, it receives downlink information from the base station and transmits it to the processor 110 for processing. It also transmits uplink data to the base station. Typically, the RF unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, and more. Furthermore, the RF unit 101 can communicate with the network and other devices via wireless communication. The above-mentioned wireless communications may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution), TDD-LTE (Time Division Duplexing-Long Term Evolution) and 5G, etc.

[0073] WiFi is a short-range wireless transmission technology. Smart terminals can help users send and receive emails, browse web pages, and access streaming media through WiFi module 102. It provides users with wireless broadband Internet access. Figure 1 The WiFi module 102 is shown, but it is understandable that it is not an essential component of the smart terminal and can be omitted as needed without changing the essence of the invention.

[0074] The audio output unit 103 can convert audio data received by the RF unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output it as sound when the smart terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Furthermore, the audio output unit 103 can also provide audio output related to a specific function performed by the smart terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, or the like.

[0075] The A / V input unit 104 is used to receive audio or video signals. The A / V input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos captured by an image capture device (e.g., a camera) in video capture mode or image capture mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the GPU 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the RF unit 101 or the WiFi module 102. The microphone 1042 may receive sound (audio data) in operating modes such as phone call mode, recording mode, and voice recognition mode, and may process such sound into audio data. In phone call mode, the processed audio (voice) data may be converted into a format that can be transmitted to a mobile communication base station via the RF unit 101. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to eliminate (or suppress) noise or interference generated during the reception and transmission of audio signals.

[0076] The smart terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Optionally, the light sensor includes an ambient light sensor and a proximity sensor. Optionally, the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 1061 and / or the backlight when the smart terminal 100 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that recognize the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured on the mobile phone, such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be described in detail here.

[0077] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0078] The user input unit 107 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the smart terminal. Optionally, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also known as a touch screen, can collect user touch operations on or near it (such as operations performed by the user using any suitable object or accessory such as a finger, stylus, etc. on or near the touch panel 1071) and drive the corresponding connection device according to a pre-set program. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Optionally, the touch detection device detects the user's touch direction and detects the signal caused by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 110. It can also receive commands sent by the processor 110 and execute them. In addition, the touch panel 1071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may further include other input devices 1072. Optionally, the other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power keys, etc.), a trackball, a mouse, a joystick, etc., and the specifics are not limited here.

[0079] Optionally, the touch panel 1071 may cover the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the processor 110 to determine the type of touch event. The processor 110 then provides a corresponding visual output on the display panel 1061 according to the type of touch event. Figure 1 In the figure, the touch panel 1071 and the display panel 1061 are two independent components to realize the input and output functions of the smart terminal. However, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated to realize the input and output functions of the smart terminal, which is not limited here.

[0080] The interface unit 108 serves as an interface through which at least one external device can be connected to the smart terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from the external device and transmit the received input to one or more components within the smart terminal 100, or may be used to transmit data between the smart terminal 100 and the external device.

[0081] Memory 109 can be used to store software programs and various data. Memory 109 may primarily include a program storage area and a data storage area. Optionally, the program storage area may store an operating system and at least one application required for a function (such as a sound playback function or an image playback function); the data storage area may store data generated based on the use of the mobile phone (such as audio data, a phone book, etc.). Furthermore, memory 109 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0082] Processor 110 is the control center of the smart terminal, connecting all components of the smart terminal using various interfaces and circuits. By running or executing software programs and / or modules stored in memory 109 and accessing data stored in memory 109, it executes various functions of the smart terminal and processes data, thereby providing overall monitoring of the smart terminal. Processor 110 may include one or more processing units; preferably, processor 110 may integrate an application processor and a modem processor. Optionally, the application processor primarily processes the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 110.

[0083] The smart terminal 100 may also include a power supply 111 (such as a battery) to supply power to each component. Preferably, the power supply 111 may be logically connected to the processor 110 through a power management system, thereby managing charging, discharging, and power consumption through the power management system.

[0084] although Figure 1 Not shown, the smart terminal 100 may further include a Bluetooth module, etc., which will not be described in detail here.

[0085] To facilitate understanding of the embodiments of the present application, the communication network system on which the smart terminal of the present application is based is described below.

[0086] See also Figure 2 , Figure 2 A communication network system architecture diagram is provided for an embodiment of the present application. The communication network system is an LTE system of universal mobile communication technology. The LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203 and an operator's IP service 204, which are connected in sequence.

[0087] Optionally, UE201 may be the above-mentioned terminal 100, which will not be described in detail here.

[0088] E-UTRAN 202 includes eNodeB 2021 and other eNodeBs 2022 . Optionally, eNodeB 2021 may be connected to other eNodeBs 2022 via a backhaul (eg, an X2 interface). eNodeB 2021 is connected to EPC 203 , and eNodeB 2021 may provide access from UE 201 to EPC 203 .

[0089] EPC 203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving Gate Way) 2034, a PGW (PDN Gate Way) 2035, and a PCRF (Policy and Charging Rules Function) 2036. Optionally, MME 2031 is a control node that processes signaling between UE 201 and EPC 203, providing bearer and connection management. HSS 2032 provides registers for managing functions such as the Home Location Register (not shown) and stores user-specific information such as service features and data rates. All user data can be sent through SGW2034, PGW2035 can provide IP address allocation and other functions for UE 201, PCRF2036 is the policy and charging control policy decision point for service data flow and IP bearer resources, and it selects and provides available policy and charging control decisions for the policy and charging execution function unit (not shown in the figure).

[0090] The IP service 204 may include the Internet, an intranet, an IMS (IP Multimedia Subsystem), or other IP services.

[0091] Although the above introduction is made using the LTE system as an example, those skilled in the art should know that this application is not only applicable to the LTE system, but can also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA and future new network systems (such as 5G), etc., which are not limited here.

[0092] Based on the above-mentioned smart terminal hardware structure and communication network system, various embodiments of the present application are proposed.

[0093] First embodiment

[0094] Figure 3 FIG. 1 is a flow chart of an image processing method according to the first embodiment. Figure 3 As shown, the image processing method of the present application includes the following steps:

[0095] S1: Acquire first image data, where the first image data includes a probability that each pixel in the target image belongs to a target type area;

[0096] Optionally, the target image can be a picture captured by a camera of the terminal device, or an image previously stored by the terminal device. Optionally, the target type area can be an area of a preset type, or an area of a type set by the user, such as a skin area. Optionally, the probability of a pixel belonging to the target type area can be represented by a floating point number between 0 and 1, where a value closer to 1 indicates a higher probability that the pixel belongs to the target type area, and vice versa.

[0097] Optionally, a neural network model is pre-trained using an image containing a target type region, and the trained neural network model is used to predict the probability that each pixel in the target image belongs to the target type region to obtain the first image data. The neural network model can adopt a deep learning model based on a convolutional neural network (CNN). The model structure adopts an encoder-decoder structure. The encoder part has multiple convolution layers and pooling layers. The convolution layer is used to extract image features while increasing the number of channels, and the pooling layer is used to reduce the size of the feature map. The decoder part upsamples the feature map output by the encoder through deconvolution. After multiple upsampling, the width and height of the feature map are finally restored to be consistent with the model input image, and the number of channels is reduced to 1.

[0098] Optionally, in order to reduce the computational complexity of predicting the probability that a pixel point belongs to a target type region, the target image may be downsampled before performing the prediction operation. Optionally, step S1 includes:

[0099] S11: downsampling the target image to obtain a downsampled image;

[0100] S12: predicting the probability that each pixel in the downsampled image belongs to the target type area to obtain second image data;

[0101] S13: Using the target image as a guide image, performing guided filtering processing on the second image data to obtain first image data.

[0102] Optionally, downsampling is to reduce the original image proportionally or non-proportionally, which can be achieved using methods such as bilinear interpolation or nearest neighbor. For example, the original image of size 4608*3456 can be proportionally downsampled to 512*384, or non-proportionally downsampled to 512*512.

[0103] After obtaining the downsampled image, the trained neural network model is used to predict the probability that each pixel in the downsampled image belongs to the target type area to obtain second image data. The second image data includes the probability that each pixel in the downsampled image belongs to the target type area. The prediction method is the same as described above and will not be repeated here.

[0104] After obtaining the second image data, guided filtering is used to combine the second image data with the target image to obtain the first image data. Guided filtering (or guided filtering) is an image filtering technology that filters the initial image data through a guiding map so that the final output image is generally similar to the initial image data, but the texture part is similar to the guiding map, which can smooth the image and maintain the regional edges, and has the characteristics of fast processing speed. Optionally, the target image is used as the guiding map, the second image data is used as the input data, and the first image data is obtained by guided filtering. At this time, the first image data includes the probability that each pixel in the target image belongs to the target type area, which is more accurate than the second image data.

[0105] Optionally, after step S12, the method further includes:

[0106] determining whether the target image contains a target type area according to the second image data;

[0107] If the target type area is included, step S13 is executed.

[0108] Optionally, after obtaining the second image data, it is possible to first determine whether the target image contains a target type area. If it contains a target type area, it indicates that the target type area and other areas need to be differentially processed. At this time, the target image is used as a guide image to perform guided filtering processing on the second image data to obtain the first image data.

[0109] Optionally, determining whether the target image contains a target type area according to the second image data includes:

[0110] Comparing the probability value of each pixel corresponding to the downsampled image in the second image data with a preset probability threshold;

[0111] The pixel points whose probability value is greater than or equal to the preset probability threshold are accumulated to obtain the total pixel points corresponding to the target type area;

[0112] Calculate the ratio of the total pixel points corresponding to the target type area to the total pixel points of the downsampled image;

[0113] If the ratio is greater than or equal to the preset ratio threshold, it is determined that the target image contains a target type area.

[0114] Optionally, a preset probability threshold is set, and pixel points above the preset probability threshold are considered to belong to the target type area. The pixel points belonging to the target type area are accumulated, and the ratio of the accumulated result to the total pixel points of the downsampled image is calculated. If the ratio is greater than or equal to the preset ratio threshold, it is judged that the target image contains the target type area. Otherwise, it indicates that there is no target type area in the image or the area of the target type area is too small, and the target image is judged not to contain the target type area.

[0115] Optionally, if the target image is not downsampled, it is possible to determine whether the target image contains a target type area based on the first image data, compare the probability value of each pixel point of the downsampled image corresponding to the first image data with a preset probability threshold, accumulate the pixel points whose probability values are greater than or equal to the preset probability threshold, and obtain the total pixel points corresponding to the target type area. Calculate the ratio of the total pixel points corresponding to the target type area to the total pixel points of the target image. If the ratio is greater than or equal to the preset ratio threshold, it is determined that the target image contains a target type area.

[0116] Optionally, after step S12, the method further includes:

[0117] If the target type area is not contained, the target image is subjected to a second process to obtain a processed image.

[0118] Alternatively, if the target image contains a target type region, continue to step S2 and perform the first processing on the target image. Alternatively, if the target image does not contain a target type region, the entire target image may be directly subjected to color enhancement processing without continuing to step S2.

[0119] S2: Performing a first process on the target image according to the first image data to obtain a processed image.

[0120] Optionally, color enhancement processing is performed on the target image based on the probability that each pixel in the first image data belongs to the target type area, so that the processing result of each pixel can be integrated with the processing result corresponding to the target type area and the processing results corresponding to other areas, making the target type area and other areas more coordinated and natural, and the image processing effect better.

[0121] Optionally, step S2 includes:

[0122] S21: performing color enhancement processing on the target image based on the first mode to obtain a first enhanced image, and performing color enhancement processing on the target image based on the second mode to obtain a second enhanced image;

[0123] S22: Perform color fusion on the first enhanced image and the second enhanced image according to the first image data to obtain a processed image.

[0124] Optionally, the first mode corresponds to the target type area, and the second mode corresponds to other areas outside the target type area. The first mode and the second mode are different processing modes. In this way, the target image is color enhanced based on the first mode to obtain a first enhanced image, and the target image is color enhanced based on the second mode to obtain a second enhanced image. After that, each pixel point of the target image will correspond to two processed data. Afterwards, the two processed data are fused according to the probability in the first image data to achieve color fusion of the first enhanced image and the second enhanced image to obtain a processed image.

[0125] Optionally, when the target type area is a skin area, color enhancement processing is performed on the target image based on the first mode to obtain a first enhanced image, including at least one of the following:

[0126] Identifying the background type of the target image, and performing color enhancement processing on the entire target image or the background region according to a color mapping table corresponding to the background type to obtain a first enhanced image;

[0127] Color enhancement processing is performed on the entire target image or the background area according to a preset background color mapping table to obtain a first enhanced image.

[0128] Optionally, a pre-trained scene classification model can be used to classify the target image to obtain the scene of the target image, such as beach, party, indoor, etc., and the scene corresponds to the background type. Then, a color mapping table is selected according to the background type. The color mapping table contains color mapping relationships such as hue, contrast, saturation and brightness. It can be a mapping table configured by the system or a mapping table set and saved by the user. The color mapping table can be stored in a 3D lookup table (3D LUT). After determining the color mapping table, each pixel of the target image is processed as follows: trilinear interpolation is used in the color mapping table according to the RGB value of the pixel to obtain the corresponding converted color, and the first enhanced image is obtained after all pixels are processed. Optionally, the entire target image or the background area can be color enhanced according to a preset background color mapping table to obtain a first enhanced image.

[0129] Optionally, when the target type area is a skin area, color enhancement processing is performed on the target image based on the second mode to obtain a second enhanced image, including at least one of the following:

[0130] Identifying the skin color type of the target image, and performing color enhancement processing on the entire target image or the skin area according to a color mapping table corresponding to the skin color type to obtain a second enhanced image;

[0131] Color enhancement processing is performed on the entire target image or the skin area according to a preset skin color mapping table to obtain a second enhanced image.

[0132] Optionally, a pre-trained skin color classification model can be used to classify the target image and determine the skin color type of the target image. Next, a color mapping table is selected based on the background type. After determining the color mapping table, each pixel of the target image is processed as follows: trilinear interpolation is used in the color mapping table based on the RGB value of the pixel to obtain the corresponding converted color. After all pixels are processed, a first enhanced image is obtained. Optionally, color enhancement processing can be performed on the entire target image or the skin area according to a preset skin color mapping table to obtain a first enhanced image. Optionally, the original skin color in the target image can be left unprocessed and the target image can be used as the second enhanced image.

[0133] Optionally, step S22 includes:

[0134] S221: Obtain a probability that a target pixel in the target image belongs to a target type area, a first RGB value of the corresponding pixel in the first enhanced image, and a second RGB value of the corresponding pixel in the second enhanced image;

[0135] S222: Fusing the first RGB value and the second RGB value according to the probability to obtain a fused RGB value of the target pixel;

[0136] S223: Perform image color filling according to the fused RGB values of each pixel of the target image to obtain a processed image.

[0137] Optionally, the target image can be processed in a third, fourth, and fifth mode based on the probability that the pixel belongs to the target type area. Optionally, the third mode is used to process pixels whose probability of belonging to the target type area is less than or equal to a first threshold, the fourth mode is used to process pixels whose probability of belonging to the target type area is greater than or equal to a second threshold, and the fifth mode is used to process pixels whose probability of belonging to the target type area is greater than the first threshold and less than the second threshold. Finally, the three processed data are fused and spliced to obtain the final color-enhanced image. In this way, different areas of the target image can be processed more specifically, achieving better color enhancement effects while reducing the amount of computation and increasing processing speed.

[0138] Optionally, the processing method of the third mode is the same as that of the first mode, except that only pixels whose probability of belonging to the target type area is less than or equal to the first threshold are processed.

[0139] Optionally, the processing method of the fourth mode is the same as that of the second mode, except that only pixels whose probability of belonging to the target type area is greater than or equal to the second threshold are processed.

[0140] Optionally, in the fifth mode, for a pixel point whose probability of belonging to the target type area is greater than a first threshold and less than a second threshold, the processing process includes:

[0141] performing color enhancement processing on pixels whose probability of belonging to the target type area is less than or equal to a first threshold based on the third mode to obtain first enhanced data, and performing color enhancement processing on pixels whose probability of belonging to the target type area is less than or equal to the first threshold based on the fourth mode to obtain second enhanced data;

[0142] For a pixel whose probability of belonging to the target type area is less than or equal to a first threshold, obtain the probability that the pixel belongs to the target type area, the third RGB value of the corresponding pixel in the first enhanced data, and the fourth RGB value of the corresponding pixel in the second enhanced data;

[0143] The third RGB value and the fourth RGB value are fused according to the probability to obtain a fused RGB value of the corresponding pixel.

[0144] For the processing process of the fifth mode, reference may be made to the above description of steps S21-S22, which will not be repeated here.

[0145] The image processing method of the present application includes the following steps: obtaining first image data, the first image data including the probability that each pixel in a target image belongs to a target type region; and performing a first processing on the target image based on the first image data to obtain a processed image. The present application uses a probabilistic approach to assess whether each pixel in an image belongs to a target type region, which can make the processing results of the target type region more coordinated and natural with those of other regions, protect the target type region, and achieve better image processing results, particularly suitable for scenes with portraits.

[0146] Second embodiment

[0147] Figure 4 FIG. 1 is a flow chart of an image processing method according to the second embodiment. Figure 4 As shown, the image processing method of the present application includes the following steps:

[0148] S10: Determine whether the target image contains a target type area;

[0149] S20: If the target type region is included, performing a first processing on the target image according to the probability that each pixel in the target image belongs to the target type region to obtain a processed image.

[0150] In this way, when it is confirmed that the target image contains a target type area, the target image is processed according to the probability that each pixel in the target image belongs to the target type area, and the processing efficiency is high. Moreover, by using a probabilistic method to evaluate whether each pixel in the image belongs to the target type area, the processing results of the target type area and other areas can be more coordinated and natural, and the image processing effect is better.

[0151] Optionally, when it is confirmed that the target image does not contain the target type area, a second process is performed on the target image to obtain a processed image.

[0152] Optionally, before step S20, the method further includes:

[0153] Downsampling the target image to obtain a downsampled image;

[0154] Predict the probability that each pixel in the downsampled image belongs to the target type area and obtain the target image data;

[0155] Using the target image as a guide map, the target image data is subjected to guided filtering to obtain the probability that each pixel in the target image belongs to the target type area.

[0156] Optionally, step S20 includes:

[0157] S201: performing color enhancement processing on a target image based on a first mode to obtain a first enhanced image, and performing color enhancement processing on the target image based on a second mode to obtain a second enhanced image;

[0158] S202: performing color fusion on the first enhanced image and the second enhanced image according to the probability that each pixel in the target image belongs to the target type area to obtain a processed image.

[0159] Optionally, the target type area is a skin area, and color enhancement processing is performed on the target image based on the first mode to obtain a first enhanced image, including at least one of the following:

[0160] Identifying the background type of the target image, and performing color enhancement processing on the entire target image or the background region according to a color mapping table corresponding to the background type to obtain a first enhanced image;

[0161] Color enhancement processing is performed on the entire target image or the background area according to a preset background color mapping table to obtain a first enhanced image.

[0162] Optionally, the target type area is a skin area, and color enhancement processing is performed on the target image based on the second mode to obtain a second enhanced image, including at least one of the following:

[0163] Identifying the skin color type of the target image, and performing color enhancement processing on the entire target image or the skin area according to a color mapping table corresponding to the skin color type to obtain a second enhanced image;

[0164] Color enhancement processing is performed on the entire target image or the skin area according to a preset skin color mapping table to obtain a second enhanced image.

[0165] Optionally, step S202 includes:

[0166] Obtaining a probability that a target pixel in the target image belongs to a target type area, a first RGB value of the corresponding pixel in the first enhanced image, and a second RGB value of the corresponding pixel in the second enhanced image;

[0167] The first RGB value and the second RGB value are fused according to the probability to obtain the fused RGB value of the target pixel;

[0168] The image is filled with color according to the fused RGB values of each pixel of the target image to obtain the processed image.

[0169] Optionally, the target image can be processed in a third, fourth, and fifth mode based on the probability that the pixel belongs to the target type area. Optionally, the third mode is used to process pixels whose probability of belonging to the target type area is less than or equal to a first threshold, the fourth mode is used to process pixels whose probability of belonging to the target type area is greater than or equal to a second threshold, and the fifth mode is used to process pixels whose probability of belonging to the target type area is greater than the first threshold and less than the second threshold. Finally, the three processed data are fused and spliced to obtain the final color-enhanced image. In this way, different areas of the target image can be processed more specifically, achieving better color enhancement effects while reducing the amount of computation and increasing processing speed.

[0170] Optionally, the processing method of the third mode is the same as that of the first mode, except that only pixels whose probability of belonging to the target type area is less than or equal to the first threshold are processed.

[0171] Optionally, the processing method of the fourth mode is the same as that of the second mode, except that only pixels whose probability of belonging to the target type area is greater than or equal to the second threshold are processed.

[0172] Optionally, in the fifth mode, for a pixel point whose probability of belonging to the target type area is greater than a first threshold and less than a second threshold, the processing process includes:

[0173] performing color enhancement processing on pixels whose probability of belonging to the target type area is less than or equal to a first threshold based on the third mode to obtain first enhanced data, and performing color enhancement processing on pixels whose probability of belonging to the target type area is less than or equal to the first threshold based on the fourth mode to obtain second enhanced data;

[0174] For a pixel whose probability of belonging to the target type area is less than or equal to a first threshold, obtain the probability that the pixel belongs to the target type area, the third RGB value of the corresponding pixel in the first enhanced data, and the fourth RGB value of the corresponding pixel in the second enhanced data;

[0175] The third RGB value and the fourth RGB value are fused according to the probability to obtain a fused RGB value of the corresponding pixel.

[0176] The specific implementation process of the above steps is the same as the implementation process of the relevant steps in the first embodiment, and will not be repeated here.

[0177] An embodiment of the present application further provides an intelligent terminal, comprising: a memory and a processor, wherein an image processing program is stored in the memory, and when the image processing program is executed by the processor, the steps of any of the above methods are implemented.

[0178] An embodiment of the present application further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0179] In the embodiments of the smart terminal and computer-readable storage medium provided in this application, all technical features of any of the above-mentioned image processing method embodiments may be included. The expanded and explained content of the specification is basically the same as that of the various embodiments of the above-mentioned method, and will not be repeated here.

[0180] An embodiment of the present application further provides a computer program product, which includes computer program code. When the computer program code runs on a computer, the computer executes the methods in the various possible implementation modes described above.

[0181] An embodiment of the present application also provides a chip, including a memory and a processor, wherein the memory is used to store computer programs, and the processor is used to call and run the computer programs from the memory, so that a device equipped with the chip executes the methods in the various possible implementation modes as described above.

[0182] It is understood that the above scenarios are merely examples and do not limit the application scenarios of the technical solutions provided in the embodiments of this application. The technical solutions of this application can also be applied to other scenarios. For example, those skilled in the art will appreciate that with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application will also be applicable to similar technical problems.

[0183] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0184] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.

[0185] The units in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.

[0186] In this application, the same or similar terminology, technical solutions and / or application scenario descriptions are generally only described in detail the first time they appear. When they appear again later, they are generally not repeated for the sake of brevity. When understanding the technical solutions and other contents of this application, for the same or similar terminology, technical solutions and / or application scenario descriptions that are not described in detail later, you can refer to the previous relevant detailed descriptions.

[0187] In this application, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0188] The various technical features of the technical solution of this application can be combined arbitrarily. In order to make the description concise, not all possible combinations of the various technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0189] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as mentioned above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the method of each embodiment of the present application.

[0190] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a storage disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state storage disk Solid State Disk (SSD)).

[0191] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. An image processing method, characterized in that: The following steps are involved: S1: Acquire first image data, where the first image data includes a probability that each pixel in a target image belongs to a target type area; S2: performing a first processing on the target image according to the first image data to obtain a processed image; The S2 step comprises: S21: performing color enhancement processing on the target image based on the first mode to obtain a first enhanced image, and performing color enhancement processing on the target image based on the second mode to obtain a second enhanced image; S22: Performing color fusion on the first enhanced image and the second enhanced image according to the first image data to obtain a processed image; The step S22 includes: S221: Obtain a probability that a target pixel in the target image belongs to a target type area, a first RGB value of the corresponding pixel in the first enhanced image, and a second RGB value of the corresponding pixel in the second enhanced image; S222: Fusing the first RGB value and the second RGB value according to the probability to obtain a fused RGB value of the target pixel; S223: Perform image color filling according to the fused RGB values of each pixel of the target image to obtain a processed image.

2. The method according to claim 1, characterized in that The S1 step includes: S11: downsampling the target image to obtain a downsampled image; S12: Predicting the probability that each pixel in the downsampled image belongs to the target type area to obtain second image data; S13: Using the target image as a guide image, perform guided filtering processing on the second image data to obtain the first image data.

3. The method according to claim 2, characterized in that After the step S12, the method further includes: determining whether the target image contains a target type area according to the second image data; If the target type area is included, then the step S13 is executed.

4. The method according to claim 3, characterized in that The determining, based on the second image data, whether the target image contains a target type area includes: comparing a probability value of each pixel point corresponding to the downsampled image in the second image data with a preset probability threshold; The pixel points whose probability value is greater than or equal to the preset probability threshold are accumulated to obtain the total pixel points corresponding to the target type area; Calculate the ratio of the total pixel points corresponding to the target type area to the total pixel points of the downsampled image; If the ratio is greater than or equal to a preset ratio threshold, it is determined that the target image contains a target type area.

5. The method according to claim 3 or 4, characterized in that After the step S12, the method further includes: If the target type area is not contained, the target image is subjected to a second process to obtain a processed image.

6. The method according to claim 5, characterized in that The target type area is a skin area, and further includes at least one of the following: The performing color enhancement processing on the target image based on the first mode to obtain the first enhanced image includes: performing color enhancement processing on the entire target image or a background region according to a preset background color mapping table to obtain the first enhanced image, and / or identifying the background type of the target image and performing color enhancement processing on the entire target image or a background region according to a color mapping table corresponding to the background type to obtain the first enhanced image; The color enhancement processing of the target image based on the second mode to obtain a second enhanced image includes at least one of the following: color enhancement processing of the target image as a whole or a skin area according to a preset skin color mapping table to obtain a second enhanced image, and / or identifying the skin color type of the target image and color enhancement processing of the target image as a whole or a skin area according to a color mapping table corresponding to the skin color type to obtain a second enhanced image.

7. An image processing method, characterized in that: The following steps are involved: S10: Determine whether the target image contains a preset type area; S20: If the target type region is included, performing a first processing on the target image according to the probability that each pixel in the target image belongs to the target type region to obtain a processed image; The step S20 includes: performing color enhancement processing on the target image based on the first mode to obtain a first enhanced image, performing color enhancement processing on the target image based on the second mode to obtain a second enhanced image, and performing color fusion on the first enhanced image and the second enhanced image based on the probability that each pixel in the target image belongs to the target type area to obtain a processed image; The color fusion of the first enhanced image and the second enhanced image to obtain a processed image according to the probability that each pixel in the target image belongs to the target type area includes: Obtaining a probability that a target pixel in the target image belongs to a target type area, a first RGB value of the corresponding pixel in the first enhanced image, and a second RGB value of the corresponding pixel in the second enhanced image; The first RGB value and the second RGB value are fused according to the probability to obtain the fused RGB value of the target pixel; The image is filled with color according to the fused RGB values of each pixel of the target image to obtain the processed image.

8. The method according to claim 7, characterized in that include: Before step S20, the method further includes: downsampling the target image to obtain a downsampled image, predicting the probability that each pixel in the downsampled image belongs to the target type area to obtain target image data, using the target image as a guide image, performing guided filtering on the target image data to obtain the probability that each pixel in the target image belongs to the target type area.

9. An intelligent terminal, characterized in that: The intelligent terminal includes: a memory and a processor, wherein an image processing program is stored in the memory, and when the processing program is executed by the processor, the steps of the image processing method according to any one of claims 1 to 8 are implemented.

10. A computer-readable storage medium, characterized in that The storage medium stores a computer program, which, when executed by a processor, implements the steps of the image processing method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Image processing method and device, electronic device, and storage medium

    CN109544560A

  • Image processing method and device, terminal and computer readable storage medium

    CN111062891A

  • Image extraction method, device and equipment and storage medium

    CN111080670A

  • Image color enhancement method and device, equipment and readable storage medium

    CN112581390A