Image processing method, computer equipment and computer storage medium

By using the color feature and neighborhood confidence fusion processing of target pixel points in image processing, the high cost and low efficiency problems of face segmentation detection in the prior art are solved, and the real-time efficient processing and efficient segmentation effect of the image are achieved.

CN120198686APending Publication Date: 2025-06-24TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510264153.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-06
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

The prior art requires a large number of data sets, high time cost and high complexity training processes, and high computational inference processes in face segmentation detection, resulting in high processing costs and difficult to process in real time.

Method used

By obtaining the original color features of the target pixel point in the image for color adjustment processing, the neighborhood confidence of the target neighborhood to which the target pixel point belongs, and fusing the original color features and the processed color features based on this confidence to obtain the target color features of the target pixel point, and finally output the processed image.

Benefits of technology

Reliance on image segmentation model is reduced, the use of computing resources is reduced, the computing power requirements are low, the image processing cost is reduced, and the real-time efficient processing of images is realized, greatly improving the image processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120198686A_ABST
    Figure CN120198686A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image processing method, computer equipment and a computer storage medium. The original color feature of a target pixel point in the target image and the processed color feature obtained through color adjustment processing are obtained, the neighborhood confidence degree of a target neighborhood to which the target pixel point belongs is determined, and the neighborhood confidence degree represents the credibility degree that the target neighborhood is a region corresponding to the target object; and fusing the original color feature and the processed color feature based on the neighborhood confidence to obtain a target color feature of the target pixel point, and outputting a processed image corresponding to the target image according to the target color feature of each target pixel point of the target image. According to the method, the confidence coefficient that the pixel point is the pixel point corresponding to the target object is evaluated through the color feature of the image pixel point and the color feature of the target object, and the pixel point color feature processing is performed based on the confidence coefficient, so that compared with model training, the image processing cost can be reduced, the image can be efficiently processed in real time, and the image processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing, and in particular, to an image processing method, a computer device, and a computer storage medium. Background Art

[0002] Performing face segmentation detection on an image showing a face to determine the area corresponding to the face in the image, this object detection technology has a wide range of uses. For example, beautification processing can be performed on the face area segmented from the image, such as face whitening, wrinkle removal, etc., to improve the beauty of the face in the image.

[0003] Currently, deep learning models are mainly used to perform object detection and face segmentation on the input image, extract candidate region features and reconstruct the image to achieve the face segmentation effect. However, this requires a large amount of data sets, a high time cost and a high-complexity training process, as well as a high-computation inference process. It is necessary to configure extremely strong computing power and consume a large amount of computing resources for this. The processing cost is high, and it is also difficult to process in real time and obtain real-time processing results. Summary of the Invention

[0004] The embodiments of the present application provide an image processing method, a computer device, and a computer storage medium, which are used to perform object detection segmentation and processing on an image according to the confidence of a pixel point being a pixel point corresponding to a target object, so as to improve the image segmentation and processing efficiency.

[0005] In a first aspect of the embodiments of the present application, an image processing method is provided, and the method includes:

[0006] Obtaining a target image to be processed, where the target image shows a target object to be segmented;

[0007] Obtaining the processed color feature of the target pixel point obtained by performing color adjustment processing on the original color feature of the target pixel point in the target image;

[0008] Determining the neighborhood confidence of the target neighborhood to which the target pixel point belongs; the neighborhood confidence is used to characterize the credibility of the target neighborhood being the area corresponding to the target object;

[0009] Fusing the original color feature and the processed color feature based on the neighborhood confidence to obtain the target color feature of the target pixel point;

[0010] Outputting the processed image corresponding to the target image according to the target color feature of each target pixel point of the target image.

[0011] In a second aspect of the embodiments of the present application, a computer device is provided, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the method of the foregoing first aspect is implemented.

[0012] In a third aspect of the embodiments of the present application, a computer storage medium is provided. Instructions are stored in the computer storage medium, and when the instructions are executed on a computer, the computer executes the method of the foregoing first aspect.

[0013] In a fourth aspect of the embodiments of the present application, a computer program product is provided. When the computer program product runs on a computer device, the computer device executes the method of the foregoing first aspect.

[0014] As can be seen from the above technical solutions, the embodiments of the present application have the following advantages:

[0015] The computer device obtains a target image to be processed. The target image shows a target object to be segmented. The computer device obtains the processed color feature of the target pixel point obtained by performing color adjustment processing on the original color feature of the target pixel point in the target image, determines the neighborhood confidence of the target neighborhood to which the target pixel point belongs, and the neighborhood confidence is used to represent the credibility of the target neighborhood being the corresponding area of the target object. Based on the neighborhood confidence, the original color feature and the processed color feature are fused to obtain the target color feature of the target pixel point, and the processed image corresponding to the target image is output according to the target color feature of each target pixel point of the target image. Therefore, there is no need to train an image segmentation model with a large number of image samples, nor is it necessary to perform a complex model training process. Only the confidence of the pixel point being the pixel point corresponding to the target object is evaluated through the color feature of the image pixel point and the color feature of the target object, and the color feature of the pixel point is processed based on the confidence. Compared with model training, the processing of image pixel points greatly reduces the use of computing resources, has a low computing power requirement, can reduce the processing cost of the image, and the image can be processed in real time and efficiently, greatly improving the processing efficiency of the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a schematic diagram of a network framework in the embodiments of the present application;

[0017] Figure 2 It is a schematic flowchart of a process of an image processing method in the embodiments of the present application;

[0018] Figure 3 It is a schematic flowchart of an alternative implementation manner of the step "calculate the target object confidence of the pixel point according to the boundary value of the color feature of the pixel point and the color feature of the target object" in the embodiments of the present application;

[0019] Figure 4The traversal process of the target pixel points of an exemplary face image in the embodiments of the present application;

[0020] Figure 5 A schematic structural diagram of a computer device in the embodiments of the present application. Detailed implementation manners

[0021] The embodiments of the present application provide an image processing method, a computer device, and a computer storage medium, which are used to perform target detection and segmentation on an image according to the confidence that a pixel point is a pixel point corresponding to a target object, so as to improve the efficiency of image segmentation and processing.

[0022] Please refer to Figure 1 , the network framework in the embodiments of the present application includes:

[0023] A service server 100 and a terminal cluster; the terminal cluster may include: terminal devices 200a, 200b, 200c,..., 200n and other terminal devices.

[0024] Among them, the above service server 100 may be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud databases, cloud services, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal devices (including terminal devices 200a, 200b, 200c,..., 200n) may be intelligent terminals such as smart phones, tablet computers, laptop computers, desktop computers, handheld computers, mobile internet devices (MID), wearable devices (such as smart watches, smart bracelets, etc.), intelligent computers, and intelligent vehicles.

[0025] Among them, the service server 100 can establish communication connections with each terminal device in the terminal cluster, and communication connections can also be established between the terminal devices in the terminal cluster. In other words, the service server 100 can establish communication connections with each terminal device in the terminal devices 200a, 200b, 200c,..., 200n. For example, a communication connection can be established between the terminal device 200a and the service server 100. A communication connection can be established between the terminal device 200a and the terminal device 200b, and a communication connection can also be established between the terminal device 200a and the terminal device 200c. Among them, the above communication connection is not limited to the connection method, and can be directly or indirectly connected through a wired communication method, or can be directly or indirectly connected through a wireless communication method, etc., which can be specifically determined according to the actual application scenario, and the present application does not make any restrictions here.

[0026] It should be understood that Figure 1 each terminal device in the terminal cluster shown can be installed with an application client. When the application client runs on each terminal device, data interaction can be performed with the service server 100 respectively, so that the service server 100 can receive service data from each terminal device (such as user identity data uploaded by the user through the terminal device). Among them, the application client can be an application client with functions of displaying data information such as text, images, audio, and video, such as a music playing application, a KTV software application, a browser application, a social application, an instant messaging application, a live broadcast application, a game application, a short video application, a video application, a shopping application, a novel application, a payment application, etc., and can be specifically determined according to the actual application scenario requirements, and is not limited here. Among them, the application client can be an independent client or an embedded sub-client integrated in a certain client (such as a music application, a KTV software application, etc.), and can be specifically determined according to the actual application scenario, and is not limited here.

[0027] An embodiment of the present application proposes an image processing method, which can be applied to perform object detection and segmentation on an image, and process the target region segmented from the image. For example, in an application scenario, the face region in each frame of the live video stream can be segmented, and the segmented face region can be beautified, such as face whitening, wrinkle removal, etc., to improve the beauty of the face during video live broadcast.

[0028] Of course, the method proposed in the embodiment of the present application is not limited to the above application scenarios, and can also be applied to other scenarios that require object detection and segmentation of images and processing of the segmented target regions, which are not limited here.

[0029] Next, in combination with Figure 1 the network framework and the application scenario of the embodiment of the present application, the image processing method in the embodiment of the present application will be described:

[0030] Please refer to Figure 2 , an embodiment of the image processing method in the embodiment of the present application includes:

[0031] 201. Obtain a target image to be processed, where the target image shows a target object to be segmented;

[0032] The method of this embodiment can be applied to a computer device, and the computer device can be Figure 1The business server 100 or each terminal device in the network framework shown. In some embodiments, the computer device can implement the image processing method provided in this embodiment by running a computer program. For example, the computer program can be a native program or software module in the operating system; it can also be a local (Native) application (APP, Application), that is, a program that needs to be installed in the operating system to run; it can also be a small program, that is, a program that only needs to be downloaded to the browser environment to run; it can also be a small program that can be embedded in any APP. In short, the above computer program can be any form of application program, module or plug-in.

[0033] The computer device can obtain a target image to be processed. The target image can be any image that shows a target object to be segmented. For example, it can be a face image. It is necessary to segment the face area in the face image and perform beautification processing on the face area. The target image can be each frame image in a video stream or independent image data, such as an image captured by a camera.

[0034] 202. Obtain the processed color feature of the target pixel point obtained by performing color adjustment processing on the original color feature of the target pixel point in the target image;

[0035] The target pixel point can be each pixel point in the target image. Each pixel point in the target image can be traversed in sequence to process each pixel point in sequence.

[0036] The computer device can obtain the original color feature of the target pixel point and the processed color feature obtained by processing the original color feature by a preset algorithm. The preset algorithm can perform adjustment processing on the original color feature of the target pixel point to obtain the processed color feature of the target pixel point. Among them, the preset algorithm can be a processing algorithm adopted to achieve a specific image effect. For example, when the target object is a face, the preset algorithm can be a whitening algorithm, a wrinkle-removing algorithm, etc. for beautifying the face image.

[0037] 203. Determine the neighborhood confidence of the target neighborhood to which the target pixel point belongs; the neighborhood confidence is used to characterize the credibility of the target neighborhood being the corresponding area of the target object;

[0038] The computer device can further determine the target neighborhood where the target pixel point is located. For example, it can determine an n×m (n and m can be equal or not equal) size centered on the target pixel point as the target neighborhood. Then, the target neighborhood centered on the target pixel point can include n×m pixel points, including the target pixel point itself. Moreover, the computer device can determine the neighborhood confidence of the target neighborhood according to the color features of each pixel point in the target neighborhood, so as to characterize the credibility of the target neighborhood being the corresponding area of the target object. That is, the higher the neighborhood confidence, the higher the credibility that the target neighborhood is the corresponding area of the target object; conversely, the lower the credibility.

[0039] 204. Based on the neighborhood confidence, fuse the original color feature and the processed color feature to obtain the target color feature of the target pixel point;

[0040] When fusing the original color feature and the processed color feature according to the neighborhood confidence, if the neighborhood confidence represents a higher credibility that the target pixel point is the pixel point corresponding to the target object, then a relatively larger weight can be set for the processed color feature of the target pixel point. That is, the processed color feature has a greater impact on the calculation result of the target color feature of the target pixel point; conversely, a relatively larger weight can be set for the original color feature of the target pixel point. That is, the original color feature has a greater impact on the calculation result of the target color feature of the target pixel point. Therefore, through the neighborhood confidence, the areas of the target object and non-target objects in the target image can be segmented, realizing the target segmentation of the image and the differential processing of the target area and non-target area.

[0041] 205. Output the processed image corresponding to the target image according to the target color feature of each target pixel point of the target image;

[0042] When each target pixel point of the target image completes the above steps of processing, that is, when the target image is completed, the processed image corresponding to the target image can be further output so that the user can view the processing effect of the image.

[0043] In this embodiment, the computer device acquires a target image to be processed, where the target image shows a target object to be segmented, acquires the processed color feature of a target pixel point obtained by performing color adjustment processing on the original color feature of the target pixel point in the target image, determines the neighborhood confidence of the target neighborhood to which the target pixel point belongs, where the neighborhood confidence is used to represent the credibility of the target neighborhood being the corresponding area of the target object, fuses the original color feature and the processed color feature based on the neighborhood confidence to obtain the target color feature of the target pixel point, and outputs the processed image corresponding to the target image according to the target color feature of each target pixel point in the target image. Therefore, there is no need to train an image segmentation model with a large number of image samples, nor is it necessary to perform a complex model training process. Only the confidence that a pixel point is the pixel point corresponding to the target object is evaluated based on the color feature of the image pixel point and the color feature of the target object, and the color feature of the pixel point is processed based on this confidence. Compared with model training, the processing of image pixel points greatly reduces the use of computing resources, has a low computing power requirement, can reduce the processing cost of the image, and the image can be processed in real time and efficiently, greatly improving the processing efficiency of the image. It has particular advantages in the video live broadcast scenario and can quickly and real-time output the processing result of the live video image.

[0044] Based on Figure 2 In the embodiment shown, when determining the neighborhood confidence of the target neighborhood to which the target pixel point belongs, an optional implementation manner is that the computer device calculates the target object confidence of each pixel point in the target neighborhood in the target neighborhood centered on the target pixel point according to the color feature of the pixel point and the boundary value of the color feature of the target object, where the target object confidence is used to represent the credibility of the pixel point being the pixel point corresponding to the target object. Furthermore, the neighborhood confidence of the target neighborhood can be determined according to the target object confidences of multiple pixel points in the target neighborhood.

[0045] For example, for the neighborhood corresponding to a target pixel point in a face image, if the target object confidence of a certain pixel point in the neighborhood is 1, it means that the credibility that the pixel point is the pixel point corresponding to the face area is 100%, and it can be definitely considered that the pixel point is the pixel point corresponding to the face area; if the target object confidence of a certain pixel point is 0, that is, the credibility that the pixel point is the pixel point corresponding to the face area is 0, it can be definitely considered that the pixel point is not the pixel point corresponding to the face area, but the pixel point corresponding to the background area or other areas.

[0046] Among them, the color feature may be a color feature value determined based on any color model. For example, based on the RGB color model, the channel values of the RGB channels of a pixel point can be determined. The boundary value of the color feature of the target object may be the threshold situation shown by the target object in terms of the color feature. For example, the boundary value of the human face skin color may be the upper limit and the lower limit of the channel values corresponding to the RGB channels of the human face skin color, or the threshold of the difference in channel values between different channels.

[0047] After determining the target object confidence degrees of multiple pixel points in the target neighborhood, the neighborhood confidence degree of the target neighborhood can be determined according to the target object confidence degrees of the multiple pixel points in the target neighborhood. The neighborhood confidence degree can characterize the credibility of the color feature of the target neighborhood where the target pixel point is located corresponding to the color feature of the target object. That is, the higher the neighborhood confidence degree of the target neighborhood, the higher the possibility that the target neighborhood is the area corresponding to the target object; on the contrary, it indicates that the possibility that the target neighborhood is the area corresponding to the target object is lower.

[0048] Since the neighborhood confidence degree comprehensively considers the target object confidence degrees of the target pixel point itself and multiple pixel points around it, compared with evaluating the target pixel point only relying on the target object confidence degree of the target pixel point itself, there is a large error. The neighborhood confidence degree can more accurately evaluate the credibility of the target pixel point being the pixel point corresponding to the target object, with a smaller error, and can reduce the interference of image noise on the evaluation result.

[0049] Based on Figure 2 In the optional implementation manner of the shown embodiment, when calculating the target object confidence degree of each pixel point in the neighborhood, the computer device can obtain various types of confidence degrees related to the color feature for each pixel point in the neighborhood, and determine the target object confidence degree of the pixel point according to these various types of confidence degrees. Therefore, as Figure 3 shown, the above step "calculate the target object confidence degree of the pixel point according to the color feature of the pixel point and the boundary value of the color feature of the target object", its specific execution may include:

[0050] 301. Calculate the color feature confidence degree of the pixel point according to the color feature of the pixel point and the boundary value of the color feature of the target object;

[0051] The computer device can calculate the color feature confidence degree of the pixel point according to the color feature of the pixel point and the boundary value of the color feature of the target object. The color feature confidence degree is used to characterize the credibility of the color feature of the pixel point matching the color feature of the target object.

[0052] Among them, the boundary value of the color feature of the target object is also the threshold of the color feature of the target object on the image. For example, the color feature boundary value may be the channel value threshold of the RGB channels of the target object in the image.

[0053] In an alternative embodiment, the color feature boundary values may include a color feature upper limit value and a color feature lower limit value. The upper limit value and the lower limit value may be preset by a person according to the actual color feature situation of the target object in the image. Further, when calculating the color feature confidence of a pixel point based on the color feature of the pixel point and the color feature boundary values of the target object, the relative distance between the color feature of the pixel point and the color feature upper limit value and the color feature lower limit value may be determined, and the color feature confidence of the pixel point may be calculated based on the relative distance.

[0054] For example, let the color feature upper limit value of the target object be edge1 Color , and the color feature lower limit value be edge0 Color . Let the serial number of any pixel point in the neighborhood be (i, j), then its color feature may be set as Color ij . Among them, if the color feature is the channel value corresponding to each of the RGB three channels, the color feature Color ij may specifically include Red ij , Green ij and Blue ij . Correspondingly, edge1 Color and edge0 Color may include the channel boundary values corresponding to each of the above RGB three channels. For example, the channel boundary values corresponding to the Red channel may be expressed as edge1 Red and edge0 Red .

[0055] Further, a calculation method of the relative distance m Color ij between the color feature of the pixel point (i, j) and the color feature upper limit value and the color feature lower limit value may be expressed as follows:

[0056]

[0057] Among them, the expression of the clamp function is as follows:

[0058] clamp(x, minval, maxval) = max(minval, min(x, maxval));

[0059] It can be seen from the expression of the clamp function that when the calculation result is less than or equal to 0, the output value of m Color ij is 0; when the calculation result is greater than or equal to 1, the output value of m Color ij is 1; when When the calculation result is greater than 0 and less than 1, m Color ij The output value of is The calculation result itself of

[0060] Of course, the relative distance m between the color feature of the pixel point and the upper limit value and the lower limit value of the color feature Color ij is not limited to the above calculation method. For example, it can also be Replace the numerator part in with (edge1 Color -Color ij ), or other formula transformation methods, as long as it can represent the relative distance between the color feature of the pixel point and the upper limit value and the lower limit value of the color feature, which is not limited here.

[0061] Furthermore, based on the above relative distance m Color ij The color feature confidence of the pixel point can be calculated, and one calculation method can be expressed as follows:

[0062] α Color ij = 3(m Color ij ) 2 - 2(m Color ij ) 3 ;

[0063] For example, if the color feature includes the channel values corresponding to the three RGB channels, the color feature confidence α of the pixel point (i, j) Color ij can include the color feature confidence α corresponding to the Red channel Red ij , the color feature confidence α corresponding to the Green channel Green ij and the color feature confidence α corresponding to the Blue channel Blue ij .

[0064] Of course, the calculation method of the color feature confidence of the pixel point is not limited to the above example calculation method. For example, it can also be other calculation methods for converting the relative distance m Color ij into confidence, which is not limited here.

[0065] 302. Obtain the color feature offset of the pixel point, and obtain the offset boundary value of the target object at the color feature offset; the color feature offset is used to represent the comparison value between multiple color features of the pixel point;

[0066] The comparison value can be a numerical value representing the difference between multiple color features, such as the difference or ratio between multiple color features.

[0067] For example, if the color features are the channel values corresponding to the three RGB channels respectively, the color feature offset can be the comparison value of the channel values between any two of the three RGB channels. For example, it can be the difference in channel values between the Red channel and the Green channel. Then, the color feature offset RGO of the pixel point (i, j) ij can be expressed as follows:

[0068] RGO ij = Red ij - Green ij ;

[0069] The offset boundary value of the target object in the color feature offset is the threshold value of the color feature offset of the target object. For example, when the color feature offset is the difference RGO in channel values between the Red channel and the Green channel, the offset boundary value of the target object in the color feature offset is also the threshold value of this difference, which can be expressed as the upper limit value edge1 RGO and the lower limit value edge0 RGO .

[0070] 303. Calculate the offset confidence of the pixel point according to the color feature offset of the pixel point and the offset boundary value;

[0071] After obtaining the color feature offset of the pixel point and the offset boundary value, the offset confidence of the pixel point can be calculated according to the color feature offset of the pixel point and the offset boundary value. The offset confidence can be used to represent the credibility of the color feature offset of the pixel point matching the color feature offset of the target object, that is, the greater the offset confidence, the more the color feature offset of the pixel point matches the color feature offset of the target object, that is, the greater the credibility that the pixel point is the pixel point corresponding to the target object.

[0072] In an alternative embodiment, the offset boundary value may include an offset upper limit value and an offset lower limit value. The upper limit value and the lower limit value can be preset by a person according to the actual difference in the color features of the target object in the image. Furthermore, when calculating the offset confidence of the pixel point according to the color feature offset of the pixel point and the offset boundary value, the relative distance between the color feature offset of the pixel point and the offset upper limit value and the offset lower limit value can be determined, and the offset confidence of the pixel point can be calculated according to the relative distance.

[0073] For example, if the color feature offset is the difference RGO between the channel values of the Red channel and the Green channel, the upper limit value of the offset can be set to edge1 RGO and the lower limit value of the offset can be set to edge0 RGO , assuming the serial number of any pixel point in the neighborhood is (i, j), its color feature offset can be set to RGO ij . Furthermore, the relative distance m between the color feature offset of the pixel point (i, j) and the upper limit value and the lower limit value of the offset RGO ij can be calculated as follows:

[0074]

[0075] Of course, the relative distance m between the color feature offset of the pixel point and the upper limit value and the lower limit value of the offset RGO ij is not limited to the above calculation method. For example, it can also be the numerator part in RGO -RGO ij ) replaced, or other formula transformation methods, as long as it can represent the relative distance between the color feature offset of the pixel point and the upper limit value and the lower limit value of the offset, which is not limited here.

[0076] Furthermore, based on the above relative distance m RGO ij the offset confidence of the pixel point can be calculated, and one of its calculation methods can be expressed as follows:

[0077] α RGO ij = 3(m RGO ij ) 2 - 2(m RGO ij ) 3 ;

[0078] Of course, the calculation method of the offset confidence of the pixel point is not limited to the above example. For example, it can also be other calculation methods for converting the relative distance m RGO ij into confidence, which is not limited here.

[0079] 304. Calculate the target object confidence according to the color feature confidence and the offset confidence;

[0080] After calculating the color feature confidence and offset confidence of a pixel, the target object confidence of the pixel can be calculated based on the color feature confidence and offset confidence of the pixel. Optionally, if the color feature includes the channel values corresponding to each of the RGB three channels, and the color feature offset is the difference RGO between the channel values of the Red channel and the Green channel, a calculation method for the target object confidence of the pixel (i, j) can be expressed as follows:

[0081] α skin ij = α Red ij ×α Green ij ×α Blue ij ×α RGO ij ;

[0082] Of course, the target object confidence of a pixel is not limited to the above calculation method. For example, it can also be the weighted sum of the above multiple color feature confidences and offset confidences, or other calculation methods for comprehensively considering the above multiple color feature confidences and offset confidences, which are not limited here.

[0083] Therefore, by comprehensively calculating the target object confidence of a pixel based on multiple color feature confidences and offset confidences, compared with evaluating the credibility of a pixel corresponding to a target object only relying on a single color feature confidence, the accuracy of evaluating the credibility of a pixel corresponding to a target object can be improved, so as to achieve accurate segmentation and detection of the target area of the image and improve the processing accuracy of image partitioning.

[0084] Based on Figure 2 In an optional implementation manner of the illustrated embodiment, when determining the neighborhood confidence of the target neighborhood according to the target object confidences of multiple pixels in the neighborhood, the target object confidences of multiple pixels in the neighborhood can be accumulated, and the accumulated result is the neighborhood confidence of the target neighborhood.

[0085] Another optional implementation manner is that after accumulating the target object confidences of multiple pixels in the neighborhood to obtain the initial neighborhood confidence of the target pixel, a preset confidence compensation threshold can be obtained, and the initial neighborhood confidence can be compensated according to the confidence compensation threshold to obtain the neighborhood confidence of the target neighborhood.

[0086] For example, continuing with the above example, after obtaining the target object confidence α of each pixel (i, j) in the neighborhood skin ij , the target object confidences α of all pixels in the neighborhood can be accumulatedskin ij , the initial neighborhood confidence α of the target pixel point is obtained skin , and its calculation method can be expressed as follows:

[0087]

[0088] Subsequently, α can be calculated through the following formula skin Add confidence compensation to obtain the neighborhood confidence of the target neighborhood where c is the confidence compensation threshold:

[0089]

[0090] Among them, by adding confidence compensation to the initial neighborhood confidence of the target pixel point, the neighborhood confidences of the target neighborhoods to which multiple target pixel points in the target image belong can be evenly distributed, avoiding the situation that the neighborhood confidence of the target neighborhood of individual pixel points is too high or too low, which affects the target segmentation effect of the image. Therefore, the target detection and segmentation effects of the image can be improved, and the processing accuracy of image partition processing can be improved.

[0091] Based on Figure 2 In the optional implementation manner shown in the embodiment, when calculating the original color feature and the processed color feature of the target pixel point according to the neighborhood confidence, the weight of the original color feature and the weight of the processed color feature can be specifically determined according to the neighborhood confidence, and, according to the weight of the original color feature and the weight of the processed color feature, the weighted sum of the original color feature and the processed color feature is calculated to obtain the target color feature of the target pixel point.

[0092] For example, let be the color feature of any pixel point in the target image, and it can be mapped to the super-whitening base color through the super-whitening LUT algorithm The specific implementation process is as follows:

[0093] W = LUT(I);

[0094] Among them, LUT refers to the Look-Up-Table, which is equivalent to a discrete function. Given an input value, an output value can be obtained through the look-up table. The look-up table is called a color look-up table in the color adjustment field. The color look-up table has three components R, G, and B, and the input and output are in a one-to-one correspondence relationship. The output value can be found for each input value according to the corresponding relationship in the look-up table, so as to complete the color conversion. For example, the whitening of the image pixel point color can be realized.

[0095] For example, continuing with the above example, after obtaining the neighborhood confidence of the target neighborhood , it can be based on The original color feature I of the target pixel and the super-whitening base color W are mixed to obtain the target color feature of the target pixel. The specific implementation process is as follows:

[0096]

[0097] Among them, an optional way to mix the original color feature I and the super-whitening base color W is to, according to the neighborhood confidence of the target neighborhood Respectively assign weights to the original color feature I and the super-whitening base color W. For example, the weight assigned to the original color feature I is And the weight assigned to the super-whitening base color W is Then the target color feature O of the target pixel can be obtained by calculating the weighted sum between the original color feature I and the super-whitening base color W.

[0098] Therefore, by mixing the original color feature and the processed color feature of the target pixel based on the neighborhood confidence of the target neighborhood to obtain the target color feature of the target pixel, the partition processing of the image can be realized based on the target segmentation detection result, which is beneficial to improving the processing accuracy of the image.

[0099] For example, for the detection, segmentation and processing of the face in the image, using the method of this embodiment, the face area and the foreground and background areas in the image can be accurately distinguished, and the distinction processing is carried out according to the neighborhood confidence. For example, in the face area, the weight ratio of the super-whitening base color W is larger, then the face area is more inclined to the color of the whitening processing effect; while in the background area of the image, the weight ratio of the original color feature I is larger, then the background area is more inclined to the original color, so as to realize the partition processing, and only the face area in the image can be beautified, improving the image processing accuracy and the image processing effect.

[0100] Based on Figure 2 In an optional implementation manner of the shown embodiment, the determination method of the target neighborhood of the target pixel can be: taking the target pixel as the center, determining the serial number of each neighbor pixel of the target pixel according to the preset size of the target neighborhood, and the serial number of the neighbor pixel is used to represent the position number of the neighbor pixel relative to the target pixel. For each neighbor pixel, determine the coordinate offset of the neighbor pixel relative to the target pixel according to the serial number of the neighbor pixel, and offset the coordinate of the target pixel according to the coordinate offset to obtain the coordinate of the neighbor pixel, and determine the neighbor pixel based on the coordinate of the neighbor pixel. Therefore, the target pixel and its multiple neighbor pixels can form a target neighborhood centered on the target pixel.

[0101] For example, assume that the size of the target neighborhood is n×m, and assume that the serial number of each pixel in the neighborhood is (i, j), where Assume n = m = 3, then i ∈ {-1, 0, 1}, j ∈ {-1, 0, 1}, as Figure 4 FIG. Figure 4 shows the traversal process of the target pixel points of an exemplary face image. It can be seen from the figure that when the size of the neighborhood is set to 3×3, the neighborhood includes the target pixel point at the center and 8 neighboring pixel points around the target pixel point. The sequence numbers of each pixel point in the neighborhood can be obtained based on this size as (-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 0), (0, 1), (1, -1), (1, 0), and (1, 1) respectively. The sequence number of a neighboring pixel point can represent the position number of the neighboring pixel point relative to the target pixel point. For example, if the sequence number of a pixel point is (-1, -1), it means that this pixel point is located at the upper left corner of the target pixel point; if the sequence number of a pixel point is (1, 1), it means that this pixel point is located at the lower right corner of the target pixel point.

[0102] After determining the sequence number of each pixel point in the target neighborhood, the corresponding coordinate offset can be determined according to the sequence number of the pixel point. Let the coordinate of the target pixel point be The coordinate offset for each traversal is set as (△u i , △v j ), where △u i = a×i, △v j = a×bj, a is a preset baseline offset, and b is the size ratio of the input image.

[0103] For example, for the pixel point with the sequence number (-1, -1), the coordinate offset calculated according to the above formula is △u i = -a, △v j = -a×b. Therefore, the coordinate (u, v) of the target pixel point can be added with this offset to obtain the coordinate of this pixel point as (u - a, v - a×b), and then the position of this pixel point in the target image can be determined according to this coordinate. By analogy, the positions of other multiple pixel points in the target image can be obtained, and then the target neighborhood centered on the target pixel point can be determined.

[0104] In this embodiment, each target pixel point in the target image can be traversed to sequentially execute multiple processing steps for each pixel point. For example, as Figure 4 shown, for each target pixel point of the target image, the corresponding neighborhood can be determined and the neighborhood confidence can be calculated, and the color feature of the target pixel point can be processed according to the neighborhood confidence to complete the process of pixel point traversal.

[0105] In another alternative embodiment, after determining the neighboring pixel points based on the coordinates of the neighboring pixel points, it is also possible to determine whether the multiple color features of the neighboring pixel points conform to the difference rule between the multiple color features of the target object. If they do not conform to the difference rule, it can be accurately determined that the neighboring pixel point is not the pixel point corresponding to the target object, and thus the confidence of the neighboring pixel point in the target object can be directly determined to be zero. If they conform to the difference rule, the above steps 203 to 204 can be executed to perform corresponding processing operations on the color features of the target pixel point.

[0106] For example, the difference rule between the channel values of multiple color channels in the face region of the image is that the red channel value Red is greater than both the green channel value Green and the blue channel value Blue. For any pixel point (i, j) in the neighborhood, the and of these multiple channel values can be obtained, and it can be determined whether Red ij is greater than Green ij and Blue ij at the same time. If so, that is, the color feature of the pixel point conforms to the difference rule of the color feature of the face region, subsequent processing steps can be performed on it.

[0107] If the above conditions are not met, such as Red ij being less than Green ij and / or Red ij being less than Blue ij , that is, the color feature of the pixel point does not conform to the difference rule of the color feature of the face region, it can be determined that it is not the pixel point corresponding to the face region, and its confidence in the target object can be directly determined to be zero.

[0108] Therefore, by judging according to the difference rule of the color features of the target object, it is possible to pre-determine whether the color features of the pixel points in the neighborhood match the color features of the target object. When they do not match, the confidence of the target object of the pixel points can be directly determined to be zero without performing subsequent processing steps, thus reducing the processing operations of the pixel points to a certain extent, saving the consumption of processing resources, and improving the processing efficiency of the pixel points.

[0109] In some alternative embodiments, the method of this embodiment can be applied to the processing of each frame of live image in a live scenario, that is, the target image includes any one or more frames of live images in the sequence of live image frames of the live video stream. When the color feature processing of each target pixel point of the live image is completed according to the method of this embodiment to obtain the target color feature of each target pixel point, the processed image corresponding to each frame of the live image can be output in sequence according to the target color feature of each target pixel point of the live image, so as to realize the image processing of the live video. For example, beautification processing such as whitening and wrinkle removal of human faces in the live video can be realized.

[0110] The computer device in the embodiment of the present application will be described below. Please refer to Figure 5 , an embodiment of the computer device in the embodiment of the present application includes:

[0111] The computer device 500 may include one or more central processing units (CPUs) 501 and a memory 505, and one or more application programs or data are stored in the memory 505.

[0112] Among them, the memory 505 may be volatile storage or persistent storage. The program stored in the memory 505 may include one or more modules, and each module may include a series of instruction operations on the computer device. Further, the central processing unit 501 may be configured to communicate with the memory 505 and execute a series of instruction operations in the memory 505 on the computer device 500.

[0113] The computer device 500 may further include one or more power supplies 502, one or more wired or wireless network interfaces 503, one or more input / output interfaces 504, and / or one or more operating systems, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0114] The central processing unit 501 may execute the operations performed by the computer device in the foregoing Figure 2 and Figure 3 shown embodiments, which will not be elaborated here specifically.

[0115] The embodiment of the present application also provides a computer storage medium. An embodiment includes: instructions are stored in the computer storage medium, and when the instructions are executed on the computer, the computer is caused to execute the operations performed by the computer device in the foregoing Figure 2 and Figure 3 shown embodiments.

[0116] The embodiments of the present application also provide a computer program product. One embodiment includes: when the computer program product runs on a computer device, it causes the computer device to perform the operations performed by the computer device in the foregoing Figure 2 and Figure 3 illustrated embodiments.

[0117] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.

[0118] In several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.

[0119] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0120] In addition, the functional units in each embodiment of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0121] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, read-only memory), random access memories (RAM, random access memory), magnetic disks, or optical discs.

Claims

1. An image processing method, characterized in that: The method comprises: Acquire a target image to be processed, wherein the target image displays a target object to be segmented; Obtaining a processed color feature of the target pixel point obtained by performing color adjustment processing on the original color feature of the target pixel point in the target image; Determine the neighborhood confidence of the target neighborhood to which the target pixel point belongs; the neighborhood confidence is used to characterize the degree of credibility that the target neighborhood is the area corresponding to the target object; The original color feature and the processed color feature are merged based on the neighborhood confidence to obtain a target color feature of the target pixel; Output a processed image corresponding to the target image according to the target color feature of each target pixel point of the target image.

2. The method according to claim 1, characterized in that The determining of the neighborhood confidence of the target neighborhood to which the target pixel point belongs includes: In the target neighborhood centered at the target pixel point, for each pixel point in the target neighborhood, the target object confidence of the pixel point is calculated according to the color feature of the pixel point and the boundary value of the color feature of the target object, wherein the target object confidence degree is used to characterize the credibility of the pixel point being the pixel point corresponding to the target object; The neighborhood confidence of the target neighborhood is determined according to the target object confidence of a plurality of pixels in the target neighborhood.

3. The method according to claim 2, characterized in that The calculating the target object confidence of the pixel point according to the color feature of the pixel point and the boundary value of the color feature of the target object includes: Calculating the color feature confidence of the pixel point according to the color feature of the pixel point and the color feature boundary value of the target object; the color feature confidence is used to characterize the degree of credibility of the color feature of the pixel point matching the color feature of the target object; Obtaining a color feature offset of the pixel point, and obtaining an offset boundary value of the target object in the color feature offset; the color feature offset is used to represent a contrast value between multiple color features of the pixel point; Calculating the offset confidence of the pixel point according to the color feature offset of the pixel point and the offset boundary value; the offset confidence is used to characterize the degree of credibility of the color feature offset of the pixel point matching the color feature offset of the target object; The target object confidence is calculated according to the color feature confidence and the offset confidence.

4. The method according to claim 3, characterized in that The color feature boundary value includes a color feature upper limit value and a color feature lower limit value; The calculating the color feature confidence of the pixel point according to the color feature of the pixel point and the color feature boundary value of the target object includes: Determine the relative distance between the color feature of the pixel point and the upper limit value of the color feature and the lower limit value of the color feature; The color feature confidence of the pixel is calculated according to the relative distance.

5. The method according to claim 3, characterized in that: The offset boundary value includes an offset upper limit value and an offset lower limit value; The calculating the offset confidence of the pixel point according to the color feature offset of the pixel point and the offset boundary value includes: Determine the relative distance between the color feature offset of the pixel point and the upper limit value of the offset and the lower limit value of the offset; The offset confidence of the pixel point is calculated according to the relative distance.

6. The method according to claim 2, characterized in that Determining the neighborhood confidence of the target neighborhood according to the target object confidence of a plurality of pixel points in the target neighborhood includes: Accumulating the target object confidences of a plurality of pixels in the target neighborhood to obtain an initial neighborhood confidence of the target pixel; A preset confidence compensation threshold is obtained, and confidence compensation is performed on the initial neighborhood confidence according to the confidence compensation threshold to obtain the neighborhood confidence of the target neighborhood.

7. The method according to claim 1, characterized in that The fusing the original color feature and the processed color feature based on the neighborhood confidence to obtain the target color feature of the target pixel point includes: Determining the weight of the original color feature and the weight of the processed color feature according to the neighborhood confidence; The weighted sum of the original color feature and the processed color feature is calculated according to the weight of the original color feature and the weight of the processed color feature to obtain the target color feature.

8. The method according to any one of claims 1 to 7, characterized in that: The step of determining the target neighborhood includes: Taking the target pixel as the center, determining the serial number of each neighbor pixel of the target pixel according to the preset size of the target neighborhood; the serial number of the neighbor pixel is used to indicate the position number of the neighbor pixel relative to the target pixel; For each of the neighboring pixel points, determine the coordinate offset of the neighboring pixel point relative to the target pixel point according to the sequence number of the neighboring pixel point, offset the coordinate of the target pixel point according to the coordinate offset to obtain the coordinate of the neighboring pixel point, and determine the neighboring pixel point based on the coordinate of the neighboring pixel point; The target pixel point and its multiple neighboring pixel points constitute the target neighborhood with the target pixel point as the center.

9. The method according to claim 8, characterized in that After determining the neighbor pixel points based on the coordinates of the neighbor pixel points, the method further includes: Determine whether the multiple color features of the neighboring pixel points conform to the difference rule between the multiple color features of the target object; If not, determining that the target object confidence of the neighboring pixel is zero; If so, the step of calculating the target object confidence of the pixel point according to the color feature of the pixel point and the boundary value of the color feature of the target object is performed.

10. The method according to any one of claims 1 to 7, characterized in that: The target image includes any one or more live image frames in a live image frame sequence of a live video stream; Outputting a processed image corresponding to the target image according to the target color feature of each target pixel point of the target image comprises: The processed image corresponding to each frame of the live image is output in sequence according to the target color feature of each target pixel point of the live image.

11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 10 is implemented.

12. A computer storage medium, characterized in that: The computer storage medium stores instructions, and when the instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 10.