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

By excluding and white balanced the target object during camera shooting or recording, the problem of image color casting and poor reality caused by excessive pixel occupation of the target object is solved, and the image is improved in color balance and realism.

CN114143526BActive Publication Date: 2025-04-15KUNSHAN QIUTI PHOTOELECTRIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111374693.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-19
Publication Date
2025-04-15
Estimated Expiration
2041-11-19

AI Technical Summary

Technical Problem

When taking pictures or recording videos on the camera, the proportion of feature pixels of the target object is too large, resulting in color castration of the image and affecting the realism of the image.

Method used

By acquiring the original image, the target object is culled using a preset culling factor, the characteristic pixel ratio in the image is reduced, and the processed image is white balanced and processed to obtain a color-corrected image.

Benefits of technology

It effectively reduces the impact of the target object on image color and color temperature statistics, improves the color balance and realism of the image, and solves the problems of image color cast and poor realism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114143526B_ABST
    Figure CN114143526B_ABST
Patent Text Reader

Abstract

The present invention discloses an image processing method, apparatus, terminal device and readable storage medium, wherein the method comprises: obtaining an original image; using a preset elimination factor to eliminate a target object in the original image to obtain a processed image; performing white balance calculation on the processed image to obtain a corresponding white balance gain value; performing white balance processing on the original image according to the white balance gain value to obtain a color-corrected image. The present invention can solve the technical problems of image color cast and poor image realism existing in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image technology, and in particular to an image processing method, apparatus, terminal device and readable storage medium. Background Art

[0002] With the advancement of science and technology and the development of image processing technology, people have higher and higher requirements for images. However, when using a camera to take pictures or record videos of a target object, since the target object occupies a large proportion of the image, the characteristic pixels of the target object occupy too large a proportion of the image, which will affect the camera's statistics of the color and color temperature of the image, thus causing color cast in the image and resulting in poor image realism. Summary of the invention

[0003] The embodiment of the present application solves the technical problems of image color cast and poor image realism existing in the prior art by providing an image processing method.

[0004] On the one hand, the present application provides an image processing method through an embodiment of the present application, the method comprising:

[0005] Acquire an original image, wherein the original image includes a target object;

[0006] Using a preset elimination factor to eliminate the target object in the original image to obtain a processed image;

[0007] Performing white balance calculation on the processed image to obtain a corresponding white balance gain value;

[0008] According to the white balance gain value, white balance processing is performed on the original image to obtain a color corrected image.

[0009] Optionally, before using a preset elimination factor to eliminate the target object in the original image, the method further includes:

[0010] Using at least two preset associated recognition frames to recognize the target object in the original image, to obtain a target object region, wherein the target object region is a region where the recognized target object in the original image is located;

[0011] The using a preset elimination factor to eliminate the target object in the original image to obtain a processed image comprises:

[0012] The target object area in the original image is eliminated using a preset elimination factor to obtain a processed image.

[0013] Optionally, the target object region is an object region identified by a target recognition frame, and the target recognition frame is the last recognition frame of the at least two preset associated recognition frames used to identify the target object in the original image.

[0014] Optionally, the method further comprises:

[0015] Using the preset object statistical factors, feature extraction is performed on the target object area to obtain object feature information.

[0016] Optionally, performing white balance calculation on the processed image to obtain a corresponding white balance gain value includes:

[0017] Using a white balance algorithm to calculate the gain of each color channel component in the processed image to obtain a corresponding white balance gain value;

[0018] The white balance gain value includes a red channel gain value, a green channel gain value and a blue channel gain value.

[0019] On the other hand, the present application provides an image processing device through an embodiment of the present application, the device includes an acquisition module, a processing module, a calculation module and a white balance module, wherein:

[0020] The acquisition module is used to acquire an original image, wherein the original image includes a target object;

[0021] The processing module is used to use a preset elimination factor to eliminate the target object in the original image to obtain a processed image;

[0022] The calculation module is used to perform white balance calculation on the processed image to obtain a corresponding white balance gain value;

[0023] The white balance module is used to perform white balance processing on the original image according to the white balance gain value to obtain a color corrected image.

[0024] For the contents not introduced or described in the embodiments of the present application, please refer to the relevant introduction in the aforementioned method embodiments, which will not be repeated here.

[0025] On the other hand, the present application provides a terminal device through an embodiment of the present application, and the terminal device includes: a processor, a memory, a communication interface and a bus; the processor, the memory and the communication interface are connected through the bus and communicate with each other; the memory stores executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the image processing method as described above.

[0026] On the other hand, the present application provides a computer-readable storage medium through an embodiment of the present application, wherein the computer-readable storage medium stores a program, and when the program is run on a terminal device, the image processing method as described above is executed.

[0027] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: the present application obtains the original image, uses a preset elimination factor to eliminate the target object in the original image to obtain a processed image, then performs white balance calculation on the processed image to obtain a white balance gain value, and finally performs white balance processing on the original image according to the white balance gain value to obtain a color corrected image. In the above scheme, the present application uses a preset elimination factor to eliminate the target object in the original image to reduce the proportion of the characteristic pixels of the target object in the original image, thereby reducing its statistical influence on the image color and color temperature, and further improving the problem of image color cast and poor image realism. In addition, the present application also performs white balance adjustment on the processed image after the elimination process, which further ensures the image effect and solves the technical problems of image color cast and poor image realism existing in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0029] Figure 1 It is a flowchart of an image processing method provided in an embodiment of the present application.

[0030] Figure 2 and Figure 3 It is a schematic diagram of face recognition of two associated recognition frames provided in an embodiment of the present application.

[0031] Figure 4 and Figure 5 It is a schematic diagram of a target object before and after removal provided in an embodiment of the present application.

[0032] Figure 6 and Figure 7 It is a schematic diagram of facial feature extraction under two different facial statistical factors provided in the embodiments of the present application.

[0033] Figure 8 It is a structural schematic diagram of an image processing device provided in an embodiment of the present application.

[0034] Fig. 9 It is a structural diagram of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] The embodiments of the present application provide an image processing method to solve the technical problems of color cast and poor user experience in white balance processing in the prior art.

[0036] The technical solution of the embodiment of the present application is to solve the above-mentioned technical problems, and the overall idea is as follows: obtain an original image, which includes a target object; use a preset elimination factor to eliminate the target object in the original image to obtain a processed image; perform white balance calculation on the processed image to obtain a corresponding white balance gain value; perform white balance processing on the original image according to the white balance gain value to obtain a color corrected image.

[0037] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0038] First of all, the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0039] See also Figure 1 , is a flow chart of an image processing method provided by an embodiment of the present application. Figure 1 The method shown includes the following implementation steps:

[0040] S101: Acquire an original image, where the original image includes a target object.

[0041] The original image described in this application refers to an image that has not been white balanced, such as an original image obtained from a camera module photosensitive chip. The original image includes a target object, such as a human face, a puppy, a kitten, etc. The number of the target objects is not limited, and it can be one or more. This application below takes the target object as a single human face as an example to explain the relevant content.

[0042] S102: Using a preset elimination factor to eliminate the target object in the original image to obtain a processed image.

[0043] The processed image described in this application is an image after the features of the target object in the original image are removed. The preset removal factor is a numerical value set by the system, such as an empirical value set according to user experience, etc. For example, the value of the preset removal factor can be 0 to 2, and its system default value is usually 1.2. When the preset removal factor is 0, it means that the preset removal factor is not effective, that is, there is no need to use the preset removal factor to remove the target object in the original image.

[0044] It should be noted that the present application uses a preset elimination factor to eliminate the features of the target object in the original image, which is intended to reduce the proportion of the characteristic pixels of the target object in the original image, and avoid the camera's color and color temperature statistics of the original image due to too many characteristic pixels of the target object, thereby causing problems such as image color cast and poor image realism. Accordingly, the present application uses a preset elimination factor to eliminate the features of the target object, which is conducive to improving the problems of image color cast and image realism, thereby improving the image effect and improving the user experience.

[0045] Before step S102, the method may further include: the present application may use at least two preset associated identification frames to identify the target object in the original image, and identify the corresponding target object area. The number of the associated identification frames is not limited, and it may be two or more. The size of each of the associated identification frames can be determined according to the actual needs of the system, and the present application does not limit it. The associated identification frames are used to identify the target object in the original image, and there is an association relationship between the associated identification frames. Preferably, the target object area is the object area identified by the target identification frame, and the target identification frame is the last identification frame of the at least two preset associated identification frames used to identify the target object in the original image. The target object area refers to the area where the target object in the original image is located.

[0046] Taking two associated recognition frames as an example, the two associated recognition frames include a first recognition frame and a second recognition frame, and the ratio between the first recognition frame and the target object in the original image (also referred to as the adjustment ratio of the first recognition frame) can range from 50% to 300%, and the system default value is usually 100%. The ratio between the second recognition frame and the first recognition frame (also referred to as the adjustment ratio of the second recognition frame) can range from 20% to 80%, and the system default value is usually 60. It can be understood that the larger the adjustment ratio value of the first recognition frame, the smoother and larger the area of ​​the target object (such as a face) it identifies, but its accuracy will decrease. The smaller the adjustment ratio value of the second recognition frame, the higher the accuracy of the target object features (such as facial features) it identifies, but the ratio value cannot be too small, which is easy to lose the target object data. Accordingly, the present application can calculate the second recognition frame according to the first recognition frame and the preset adjustment ratio, and then use the second recognition frame to identify the target object in the original image to obtain the target object area identified by the second recognition frame.

[0047] For example, see Figure 2 and Figure 3 Schematic diagrams showing two possible scenarios of two associated recognition frames. As shown in the figure, the original image is a face image, that is, the target object in the original image is a target face; the two associated recognition frames specifically include a first recognition frame (shown in the solid line frame) and a second recognition frame (shown in the dotted line frame). Figure 2 In the example, the first recognition frame is twice the size of the face area in the original image, that is, the adjustment ratio of the first recognition frame is 200%; the second recognition frame is 0.6 times the size of the first recognition frame, that is, the adjustment ratio of the second recognition frame is 60%. Accordingly, Figure 2 The object area identified by the second identification frame is the target object area. Figure 3 In the example, the first recognition frame is 1.5 times the face area in the original image, that is, the adjustment ratio of the first recognition frame is 150%; the second recognition frame is 0.4 times the first recognition frame, that is, the adjustment ratio of the second recognition frame is 40%. Figure 3 The object area identified by the second identification frame is the target object area.

[0048] Further, when implementing step S102, the present application may use the preset elimination factor to eliminate the target object area in the original image to obtain a processed image after elimination. For example, taking the preset elimination factor as 1.2 as an example, the present application may multiply the target object area identified by the second recognition frame by 1.2 times to perform feature elimination. Please refer to Figure 4 and Figure 5A possible pixel schematic diagram before and after face data removal is shown. Figure 4 and Figure 5 In the figure, the black area represents the face area.

[0049] In an optional embodiment, the present application may also introduce a preset object statistical factor in the target recognition frame (such as the second recognition frame mentioned above). The present application may use the preset object statistical factor to perform feature extraction on the target object area to obtain corresponding object feature information. Further optionally, the present application may store the object feature information to facilitate post-processing of the object feature information, such as viewing, coloring or rendering. Optionally, the object statistical factor is related to the brightness threshold of the target object area and is in direct proportion. While adjusting the object statistical factor, the present application also changes the brightness threshold of the target object area to obtain more accurate object feature information.

[0050] For example, citing above Figure 2 or Figure 3 In the example shown, the original image is a face image. The present application can introduce a face statistical factor in the second recognition frame to improve the accuracy of obtaining the skin color of the face area, thereby obtaining the face skin color information of the face area more accurately. Figure 6 and Figure 7 A schematic diagram showing facial feature extraction under two possible different facial statistical factors. Figure 6 In the example, the face statistical factor is 4, and its corresponding brightness threshold is 130. Figure 6 The facial skin color information obtained by extracting facial skin color using the facial statistical factor 4 is also shown. Figure 7 In the example, the face statistical factor is 5, and its corresponding brightness threshold is 100. Figure 7 It also shows the facial skin color information obtained by extracting facial skin color using the facial statistical factor 5. Further, the present application can optionally save the extracted facial skin color information to facilitate subsequent post-processing such as skin color change by the user.

[0051] S103: Perform white balance calculation on the processed image to obtain a corresponding white balance gain value.

[0052] The present application may use an automatic white balance (AWB) algorithm to perform gain calculation on each color channel component in the processed image after elimination (specifically, each pixel in the processed image), and specifically, perform gain calculation on the red R channel component, the green G channel component, and the blue B channel component in the processed image to obtain a corresponding white balance gain value. The white balance gain value includes an R gain value (R gain), a G gain value (G gain), and a B gain value (B gain). The AWB algorithm is a system-customized algorithm for white balance calculation, which may include but is not limited to a gray world method, a perfect emission method, a color gamut boundary method, a frame region segmentation method, and a dynamic threshold method.

[0053] S104: Perform white balance processing on the original image according to the white balance gain value to obtain a color corrected image.

[0054] After obtaining the white balance gain value, the present application can use the white balance gain value (specifically, the R gain value, the G gain value, and the B gain value) to perform white balance processing on the original image to correct the color of the original image to achieve a white balance effect and obtain a corresponding color-corrected image.

[0055] By implementing the present application, the present application obtains an original image, uses a preset elimination factor to perform elimination processing on the target object in the original image to obtain a processed image, then performs white balance calculation on the processed image to obtain a white balance gain value, and finally performs white balance processing on the original image according to the white balance gain value to obtain a color corrected image. In the above scheme, the present application uses a preset elimination factor to perform elimination processing on the target object in the original image to reduce the proportion of the characteristic pixels of the target object in the original image, thereby reducing its statistical influence on the image color and color temperature, and then improving the problem of image color cast and poor image realism. In addition, the present application also performs white balance adjustment on the processed image after the elimination process, further ensuring the image effect and solving the technical problems of image color cast and poor image realism existing in the prior art.

[0056] Based on the same inventive concept, another embodiment of the present application provides an apparatus and a terminal device corresponding to the image processing method described in the embodiment of the present application.

[0057] See also Figure 8 , is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application. Figure 8 The device 80 shown includes: an acquisition module 801, a processing module 802, a calculation module 803 and a white balance module 804, wherein:

[0058] The acquisition module 801 is used to acquire an original image, wherein the original image includes a target object;

[0059] The processing module 802 is used to use a preset elimination factor to eliminate the target object in the original image to obtain a processed image;

[0060] The calculation module 803 is used to perform white balance calculation on the processed image to obtain a corresponding white balance gain value;

[0061] The white balance module 804 is used to perform white balance processing on the original image according to the white balance gain value to obtain a color corrected image.

[0062] Optionally,

[0063] The processing module 802 is further configured to use at least two preset associated recognition frames to recognize the target object in the original image to obtain a target object region, where the target object region is a region where the recognized target object in the original image is located;

[0064] The processing module 802 is specifically configured to use a preset elimination factor to perform elimination processing on the target object region in the original image to obtain a processed image.

[0065] Optionally, the target object region is an object region identified by a target recognition frame, and the target recognition frame is the last recognition frame of the at least two preset associated recognition frames used to identify the target object in the original image.

[0066] Optionally, the device 80 further includes an extraction module 805, wherein:

[0067] The extraction module 805 is used to extract features from the target object region using a preset object statistical factor to obtain object feature information.

[0068] Optionally, the calculation module 803 is specifically used for:

[0069] Using a white balance algorithm to calculate the gain of each color channel component in the processed image to obtain a corresponding white balance gain value;

[0070] The white balance gain value includes a red channel gain value, a green channel gain value and a blue channel gain value.

[0071] Optionally, the original image is a face image including a target face, and the processing module 802 is specifically configured to:

[0072] Using at least two preset face recognition frames to recognize a target face in the face image, to obtain a target face region;

[0073] The target face area in the face image is eliminated using a preset elimination factor to obtain a processed image.

[0074] Optionally, the processing module 802 is further specifically configured to:

[0075] Determining a corresponding second face recognition frame based on a preset first face recognition frame and a preset adjustment ratio;

[0076] The target face in the face image is recognized using the second face recognition frame to obtain a target face region.

[0077] Please refer to 9, which is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Fig. 9 The terminal device 90 shown includes: at least one processor 901, a communication interface 902, a user interface 903 and a memory 904. The processor 901, the communication interface 902, the user interface 903 and the memory 904 can be connected via a bus or other means. The embodiment of the present invention takes the connection via a bus 905 as an example.

[0078] The processor 901 may be a general-purpose processor, such as a central processing unit (CPU).

[0079] The communication interface 902 may be a wired interface (e.g., an Ethernet interface) or a wireless interface (e.g., a cellular network interface or a wireless local area network interface) for communicating with other terminals or websites. In an embodiment of the present invention, the communication interface 902 is specifically used to obtain an image or a preset factor, such as obtaining an original image and a preset rejection factor.

[0080] The user interface 903 may be a touch panel, including a touch screen and a touch screen, for detecting operation instructions on the touch panel, or a physical button or a mouse. The user interface 903 may also be a display screen for outputting and displaying images or data.

[0081] The memory 904 may include a volatile memory, such as a random access memory (RAM); the memory may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 904 may also include a combination of the above-mentioned types of memory. The memory 904 is used to store a set of program codes, and the processor 901 is used to call the program codes stored in the memory 904 to perform the following operations:

[0082] Acquire an original image, wherein the original image includes a target object;

[0083] Using a preset elimination factor to eliminate the target object in the original image to obtain a processed image;

[0084] Performing white balance calculation on the processed image to obtain a corresponding white balance gain value;

[0085] According to the white balance gain value, white balance processing is performed on the original image to obtain a color corrected image.

[0086] Optionally, before using the preset elimination factor to eliminate the target object in the original image, the processor 901 is further configured to:

[0087] Using at least two preset associated recognition frames to recognize the target object in the original image, to obtain a target object region, wherein the target object region is a region where the recognized target object in the original image is located;

[0088] The using a preset elimination factor to eliminate the target object in the original image to obtain a processed image comprises:

[0089] The target object area in the original image is eliminated using a preset elimination factor to obtain a processed image.

[0090] Optionally, the target object region is an object region identified by a target recognition frame, and the target recognition frame is the last recognition frame of the at least two preset associated recognition frames used to identify the target object in the original image.

[0091] Optionally, the processor 901 is further configured to:

[0092] Using the preset object statistical factors, feature extraction is performed on the target object area to obtain object feature information.

[0093] Optionally, performing white balance calculation on the processed image to obtain a corresponding white balance gain value includes:

[0094] Using a white balance algorithm to calculate the gain of each color channel component in the processed image to obtain a corresponding white balance gain value;

[0095] The white balance gain value includes a red channel gain value, a green channel gain value and a blue channel gain value.

[0096] Optionally, the original image is a face image including a target face, and the target object in the original image is identified using at least two preset associated identification frames to obtain the target object region includes:

[0097] Using at least two preset face recognition frames to recognize a target face in the face image, to obtain a target face region;

[0098] The using a preset elimination factor to eliminate the target object in the original image to obtain a processed image comprises:

[0099] The target face area in the face image is eliminated using a preset elimination factor to obtain a processed image.

[0100] Optionally, the using at least two preset face recognition frames to recognize the target face in the face image to obtain the target face area includes:

[0101] Determining a corresponding second face recognition frame based on a preset first face recognition frame and a preset adjustment ratio;

[0102] The target face in the face image is recognized using the second face recognition frame to obtain a target face region.

[0103] Since the terminal device introduced in this embodiment is a terminal device used to implement the image processing method in the embodiment of this application, based on the image processing method introduced in the embodiment of this application, a person skilled in the art can understand the specific implementation of the terminal device in this embodiment and its various variations, so how the terminal device implements the method in the embodiment of this application is not described in detail here. As long as a person skilled in the art implements the terminal device used in the image processing method in the embodiment of this application, it belongs to the scope of protection of this application.

[0104] The technical solution in the above-mentioned embodiment of the present application has at least the following technical effects or advantages: the present application obtains the original image, uses a preset elimination factor to eliminate the target object in the original image to obtain a processed image, then performs white balance calculation on the processed image to obtain a white balance gain value, and finally performs white balance processing on the original image according to the white balance gain value to obtain a color corrected image. In the above-mentioned scheme, the present application uses a preset elimination factor to eliminate the target object in the original image to reduce the proportion of the characteristic pixels of the target object in the original image, thereby reducing its statistical influence on the image color and color temperature, and then improving the problem of image color cast and poor image realism. In addition, the present application also performs white balance adjustment on the processed image after the elimination process, which further ensures the image effect and solves the technical problems of image color cast and poor image realism existing in the prior art.

[0105] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0106] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0107] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0108] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0109] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0110] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. An image processing method, characterized in that: The method comprises: Acquire an original image, wherein the original image includes a target object; Using a preset elimination factor to eliminate the target object in the original image to obtain a processed image; using the preset elimination factor to eliminate the target object in the original image to obtain a processed image includes: reducing the proportion of characteristic pixels of the target object in the original image, performing white balance calculation on the processed image, and obtaining a corresponding white balance gain value; using a preset object statistical factor to extract features of the target object area to obtain object feature information, wherein the object statistical factor is proportional to the brightness threshold of the target object area; According to the white balance gain value, white balance processing is performed on the original image to obtain a color corrected image.

2. The method according to claim 1, characterized in that Before using the preset elimination factor to eliminate the target object in the original image, the method further includes: Using at least two preset associated recognition frames to recognize the target object in the original image, to obtain a target object region, wherein the target object region is a region where the recognized target object in the original image is located; The using a preset elimination factor to eliminate the target object in the original image to obtain a processed image comprises: The target object area in the original image is eliminated using a preset elimination factor to obtain a processed image.

3. The method according to claim 2, characterized in that The target object region is an object region identified by a target recognition frame, and the target recognition frame is the last recognition frame of the at least two preset associated recognition frames used to identify the target object in the original image.

4. The method according to claim 1, characterized in that: The performing white balance calculation on the processed image to obtain a corresponding white balance gain value comprises: Using a white balance algorithm to calculate the gain of each color channel component in the processed image to obtain a corresponding white balance gain value; The white balance gain value includes a red channel gain value, a green channel gain value and a blue channel gain value.

5. The method according to claim 2, characterized in that: The original image is a face image including a target face, and the target object in the original image is identified using at least two preset associated identification frames to obtain a target object region including: Using at least two preset face recognition frames to recognize a target face in the face image, to obtain a target face region; The using a preset elimination factor to eliminate the target object in the original image to obtain a processed image comprises: The target face area in the face image is eliminated using a preset elimination factor to obtain a processed image.

6. The method according to claim 5, characterized in that The using at least two preset face recognition frames to recognize the target face in the face image to obtain the target face area includes: Determining a corresponding second face recognition frame based on a preset first face recognition frame and a preset adjustment ratio; The target face in the face image is recognized using the second face recognition frame to obtain a target face region.

7. An image processing device, characterized in that: The device comprises: an acquisition module, a processing module, a calculation module and a white balance module, wherein: The acquisition module is used to acquire an original image, wherein the original image includes a target object; The processing module is used to use a preset elimination factor to perform elimination processing on the target object in the original image to obtain a processed image; the use of the preset elimination factor to perform elimination processing on the target object in the original image to obtain a processed image includes: reducing the proportion of characteristic pixels of the target object in the original image; the calculation module is used to perform white balance calculation on the processed image to obtain a corresponding white balance gain value; using a preset object statistical factor, extracting features from the target object area to obtain object feature information, and the object statistical factor is proportional to the brightness threshold of the target object area; The white balance module is used to perform white balance processing on the original image according to the white balance gain value to obtain a color corrected image.

8. A terminal device, characterized in that: The terminal device includes: a processor, a memory, a communication interface and a bus; the processor, the memory and the communication interface are connected through the bus and communicate with each other; the memory stores executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the image processing method as described in any one of claims 1 to 6 above.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, and when the program is run on a terminal device, the image processing method as described in any one of claims 1 to 6 is executed.

Citation Information

Patent Citations

  • Method and device for improving portrait photo definition

    CN112598580A

  • Automatic white balance method and device based on target recognition

    CN113239756A