A video image beautification method and device

By using Gaussian model in video software to calculate the probability value of the skin area of ​​each pixel point in the video image and beautify it based on this probability value, the problem of portraits that are unreal after skin grinding in the prior art is solved, and a higher level is achieved Quality video beautification effect.

CN113763258BActive Publication Date: 2025-02-25BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110138700.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-01
Publication Date
2025-02-25
Estimated Expiration
2041-02-01

AI Technical Summary

Technical Problem

During the skin grinding process, existing video software is not accurate enough to identify the skin area, resulting in the portrait after skin grinding, which reduces the video quality.

Method used

The Gaussian model is used to beautify the multi-frame image in the video. By calculating the probability value of each pixel point being a skin area, and beautifying the image based on this probability value, a more realistic portrait is obtained.

Benefits of technology

In the case where the prior art inaccurate identification of skin areas can be smoother beautify the skin and non-skin areas in the video image, improve the video quality, and obtain a more realistic portrait.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113763258B_ABST
    Figure CN113763258B_ABST
Patent Text Reader

Abstract

The present invention discloses a video image beautification method and device, and relates to the field of computer technology. A specific implementation of the method includes: for multiple frames of first images in a video, respectively executing: according to a Gaussian model, determining the probability value of each pixel point in the first image being a skin area, wherein the probability value is positively correlated with the beautification degree of the corresponding pixel point; and according to the probability value, beautifying the first image to obtain a beautified second image. This implementation can beautify the skin area and non-skin area in the video image more smoothly, obtain a more realistic portrait, and thus improve the quality of the video.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a video image beautification method and device. Background Art

[0002] With the development of hardware processing technology and network transmission technology, video software has gradually emerged. At the same time, users are no longer satisfied with only beautifying static portrait images. More and more users will choose the real-time skin smoothing function when using video software to shoot videos or make video calls to beautify their image in dynamic videos.

[0003] When performing skin smoothing on a person in a video, existing video software performs skin smoothing on the identified skin area, but does not perform skin smoothing on the non-skin area. However, since the existing technology does not accurately identify the skin area, the person in the video obtained after skin smoothing is not realistic enough, thereby reducing the quality of the video. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a video image beautification method and device, which can determine the probability value of each pixel in each of the multiple frames of first images in the video is a skin area according to a Gaussian model, wherein the probability value is positively correlated with the beautification degree of the corresponding pixel point, and then beautify the first image according to the probability value to obtain a beautified second image. In this way, when the existing technology is not accurate enough in recognizing the skin area, the beautification of the skin area and non-skin area in the video image can be smoother, and a more realistic portrait can be obtained, thereby improving the quality of the video.

[0005] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for beautifying a video image is provided.

[0006] A video image beautification method according to an embodiment of the present invention includes:

[0007] For the first images of multiple frames in the video, execute respectively:

[0008] Determine, according to the Gaussian model, a probability value that each pixel point in the first image is a skin area, wherein the probability value is positively correlated with the beautification degree of the corresponding pixel point;

[0009] The first image is beautified according to the probability value to obtain a beautified second image.

[0010] Optionally,

[0011] The method further includes:

[0012] Determine whether the pixel values ​​of the first image are in the first color space, and if not, convert the pixel values ​​of the first image into the first color space.

[0013] Optionally,

[0014] Determining the probability value of each pixel point in the first image being a skin area according to the Gaussian model includes:

[0015] According to the chromaticity information of the pixel values ​​of the first image in the first color space, the probability value of each pixel in the first image is calculated using the Gaussian model.

[0016] Optionally,

[0017] The mean and variance of the chromaticity information are calculated, the mean and variance are used as inputs of the Gaussian model, and the output of the Gaussian model is used as a probability value; wherein the probability value is distributed in the range of 0 to 1.

[0018] Optionally,

[0019] The first color space is a YCrCb space, and the chromaticity information is the values ​​of a blue chromaticity component Cb and a red chromaticity component Cr.

[0020] Optionally,

[0021] After determining the probability value of each pixel point in the first image being a skin area, the method further includes:

[0022] According to the probability value corresponding to each pixel point, the weight value of the pixel point is determined, and the weight value is positively correlated with the probability value;

[0023] A first grayscale weight map corresponding to the first image is generated according to the weight value corresponding to each pixel in the first image.

[0024] Optionally,

[0025] The method further includes:

[0026] For each frame of the first image, execute:

[0027] A second grayscale weight map corresponding to the first image is generated according to the first grayscale weight map corresponding to the first image and the first grayscale weight maps corresponding to other images located before the first image in the video.

[0028] Optionally,

[0029] Beautify the first image according to the probability value to obtain a beautified second image, including:

[0030] A beautified second image is generated according to the second grayscale weight map, the preprocessed image of the first image, and the first image.

[0031] To achieve the above objective, according to another aspect of an embodiment of the present invention, a video image beautification device is provided.

[0032] A video image beautification device according to an embodiment of the present invention includes a probability determination module and a beautification module; wherein:

[0033] The probability determination module is used to respectively perform the following steps for the first images of the multiple frames in the video: determining the probability value of each pixel in the first image being a skin area according to the Gaussian model, wherein the probability value is positively correlated with the beautification degree of the corresponding pixel;

[0034] The beautification module is used to beautify the first image according to the probability value to obtain a beautified second image.

[0035] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device for beautifying video images is provided.

[0036] An electronic device for beautifying a video image according to an embodiment of the present invention comprises: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement a method for beautifying a video image according to an embodiment of the present invention.

[0037] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided.

[0038] A computer-readable storage medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, a video image beautification method according to an embodiment of the present invention is implemented.

[0039] An embodiment of the above invention has the following advantages or beneficial effects: it can determine the probability value of each pixel in each of the multiple frames of first images in the video being a skin area according to the Gaussian model, wherein the probability value is positively correlated with the beautification degree of the corresponding pixel point, and then beautify the first image according to the probability value to obtain a beautified second image. In this way, when the existing technology is not accurate enough in recognizing the skin area, the beautification of the skin area and the non-skin area in the video image can be smoother, and a more realistic portrait can be obtained, thereby improving the quality of the video.

[0040] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0042] Figure 1is a schematic diagram of main steps of a video image beautification method according to an embodiment of the present invention;

[0043] Figure 2 It is a grayscale weight map generated according to the probability value;

[0044] Figure 3 It is a first grayscale weight map generated according to the weight value;

[0045] Figure 4 is a beautified second image obtained by the prior art;

[0046] Figure 5 is a beautified second image obtained by this scheme;

[0047] Figure 6 is a schematic diagram of main steps of another method for beautifying a video image according to an embodiment of the present invention;

[0048] Figure 7 is a schematic diagram of main modules of a video image beautification device according to an embodiment of the present invention;

[0049] Figure 8 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0050] Fig. 9 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0052] It should be pointed out that the embodiments of the present invention and the technical features therein may be combined with each other without conflict.

[0053] In the prior art, the return value of the commonly used skin color detection algorithm is 0 or 1. If the return value is 1, it is determined that the current pixel is located in the skin area, and if the return value is 0, it is determined that the current pixel is located in the non-skin area. This method will cause the skin area and the non-skin area of ​​the portrait in the video to have obvious segmentation, affecting the visual effect.

[0054] Based on this, this scheme uses the Gaussian skin color similarity model based on the YCbCr space to solve the probability value of each pixel point in each frame of the video image being the skin area, and then can effectively distinguish the skin area from the non-skin area, and then combine the generated grayscale weight map to beautify the video image in real time, thereby effectively improving the beauty effect of the portrait.

[0055] Figure 1 It is a schematic diagram of main steps of a video image beautification method according to an embodiment of the present invention.

[0056] like Figure 1 As shown, a video image beautification method according to an embodiment of the present invention performs the following steps respectively for multiple frames of first images in a video:

[0057] Step S101: Determine the probability value of each pixel point in the first image being a skin area according to the Gaussian model, wherein the probability value is positively correlated with the beautification degree of the corresponding pixel point.

[0058] In an embodiment of the present invention, the method further includes: determining whether the pixel values ​​of the first image are in the first color space, and if not, converting the pixel values ​​of the first image into the first color space.

[0059] In an embodiment of the present invention, the first color space can be an RGB color space, a YCbCr color space, an HSV color space, or other color spaces. Among them, since the light intensity component Y in the YCbCr color space is independent, the problem of the light intensity change affecting the skin color of the face can be well solved, and in the YCbCr color space, the skin color of the face is more compact, and the overlap between the skin area and the non-skin area caused by the light is not obvious, which is more convenient for detecting and segmenting the skin area and the non-skin area. Therefore, in a preferred embodiment of the present invention, the first color space is the YCrCb space, and the chromaticity information is the value of the blue chromaticity component Cb and the red chromaticity component Cr.

[0060] In the embodiment of the present invention, when the pixel value of the first image is not in the YCrCb space, the pixel value of the first image can be converted into the YCrCb space. For example, the formula for converting the RGB color space into the YCrCb space is as follows:

[0061] Y=0.299*R+0.587*G+0.114*B

[0062] Cb=(RY)*0.713+128

[0063] Cr=(BY)*0.564+128

[0064] Among them, Y refers to the brightness component, Cb refers to the blue chrominance component, and Cr refers to the red chrominance component.

[0065] Since people's skin colors vary greatly in brightness but are relatively close in the chromaticity space, the skin area is relatively concentrated in the two-dimensional chromaticity plane. Therefore, in an embodiment of the present invention, Gaussian distribution can be used to describe the skin area and non-skin area. Specifically, after the color space is converted to the YCbCr color space, the probability value of each pixel in the first image is calculated based on the chromaticity information of the pixel value of the first image in the first color space using the Gaussian model. The probability value indicates the similarity between the corresponding pixel and the skin area.

[0066] In the embodiment of the present invention, the mean and variance of the chromaticity information may be calculated, the mean and variance may be used as inputs of a Gaussian model, and the output of the Gaussian model may be used as a probability value; wherein the probability value is distributed in the range of 0 to 1.

[0067] In the embodiment of the present invention, the formula for calculating the probability value of the Gaussian model is as follows:

[0068] P(CbCr)=exp(-0.5(xm) T C -1 (xm))

[0069] Where x = (CbCr) T ; m is the mean of the overall skin color CbCr channel, m = E(x); C is the covariance matrix, C = E(xm)(xm T ).

[0070] In the embodiment of the present invention, the mean m and the variance C can also be obtained by statistically analyzing a large number of images. In a preferred embodiment of the present invention,

[0071] m=[117.4316,148.5599

[0072]

[0073] In an embodiment of the present invention, after determining the probability value that each pixel point in the first image is a skin area, the weight value of the pixel point can also be determined based on the probability value corresponding to each pixel point, the weight value is positively correlated with the probability value, and based on the weight value corresponding to each pixel point in the first image, a first grayscale weight map corresponding to the first image is generated.

[0074] In a preferred embodiment of the present invention, a cubic function y=x can be used. 3Generate pixel weight values ​​to further increase the weights of pixels with higher probability values ​​and reduce the weights of pixels with lower probability values, so that the weights of pixels closer to the skin area are larger and the weights of pixels farther away from the skin area are smaller. For example, the grayscale weight map generated according to the probability value is as follows: Figure 2 As shown, the cubic function y = x 3 After converting the probability value into the weight value, the first grayscale weight map generated is as follows Figure 3 As shown, obviously, Figure 3 Compared to Figure 2 It is easier to distinguish skin areas from non-skin areas.

[0075] Step S102: Beautify the first image according to the probability value to obtain a beautified second image.

[0076] In the prior art, when continuous first images are formed into a video, the influence of light may cause different brightness of the continuous multiple frames of the first image, thereby causing flickering in the video. Therefore, in an embodiment of the present invention, for each frame of the first image, the following can be further performed: based on the first grayscale weight map corresponding to the first image and the first grayscale weight maps corresponding to other images before the first image in the video, a second grayscale weight map corresponding to the first image is generated, so that the brightness difference between the generated continuous multiple frames of the second image is smaller, the occurrence of flickering in the video is reduced, and the accuracy of identifying the skin area can also be improved.

[0077] In a preferred embodiment of the present invention, the first grayscale weight map of four consecutive frames can be fused together in a weighted fusion manner to generate a second grayscale weight map, which can reduce the flickering phenomenon. Specifically, the first grayscale weight map corresponding to the first image to be beautified and the first grayscale weight maps corresponding to three other images in the video that are adjacent to the first image and located before the first image can be saved in a four-dimensional array in sequence, and the first grayscale weight map corresponding to the first image to be beautified is saved in the first value of the array, that is, I 1 In the example, the first grayscale weight map corresponding to the other images is stored in the other values ​​​​I of the array in sequence according to the distance between the other images and the first image in the video. 2 , I 3 and I 4 Then, according to the following formula, the second grayscale weight map corresponding to the first image is generated:

[0078] I skin =I 1 *0.4+I 2 *0.3+I 3 *0.2+I 4 *0.1

[0079] Among them, I skin This is the second grayscale weight map generated.

[0080] In the embodiment of the present invention, the obtained second grayscale weight map can be used as a weight function when beautifying the first image, so that the closer the area is to the skin, the greater the weight is, and the higher the beautification degree is.

[0081] In an embodiment of the present invention, a beautified second image can be generated according to the second grayscale weight map, the preprocessed image of the first image, and the first image, wherein the preprocessed image of the first image can be a full-screen beautified image obtained by any image beautification method in the prior art.

[0082] In a preferred embodiment of the present invention, the beautified second image can be generated according to the following formula:

[0083] I out =(1.0-I skin )*I ori +I skin *I blur

[0084] Among them, I ori is the first image, I skin is the second grayscale weight map generated, I blur is the preprocessed image of the first image, I out The second image is generated.

[0085] In the embodiment of the present invention, the next frame image of the first image in the video may be beautified according to the second grayscale weight map corresponding to the first image. Specifically, the next frame image of the first image in the video may be beautified according to the second grayscale weight map corresponding to the first image, the next frame image of the first image in the video, and the preprocessed image of the next frame image.

[0086] In the embodiment of the present invention, the second image after beautification is obtained by using the prior art. Figure 4 As shown in the figure, due to inaccurate skin color detection, Figure 4 There are some skin areas in the image that have not been beautified by skin resurfacing; and the second image after beautification based on this scheme is as follows Figure 5 As shown, it is obvious that based on the second grayscale weight map Figure 5 The entire skin area can be smoothed and beautified without being affected by light, making the skin area more realistic visually.

[0087] In the embodiment of the present invention, the video image beautification method proposed in the present solution can also be applied to scenes such as real-time video live broadcast, specifically, Figure 6 As shown, Figure 61 is a schematic diagram of the main steps of another method for beautifying a video image according to an embodiment of the present invention. The method mainly includes the following steps:

[0088] Step S601: Acquire a first image through a camera;

[0089] Step S602: obtaining a probability value of each pixel in the first image being a skin area through a skin color detection algorithm, wherein the probability value is positively correlated with the beautification degree of the corresponding pixel;

[0090] Step S603: adjusting the probability value to obtain a weight value, and generating a first grayscale weight map corresponding to the first image according to the weight value;

[0091] Step S604: Mixing the first grayscale weight map corresponding to the first image and the first grayscale weight maps corresponding to other images before the first image to obtain a second grayscale weight map corresponding to the first image;

[0092] Step S605: performing skin smoothing and beautification on the first image according to the second grayscale weight map, the preprocessed image of the first image, and the first image to obtain a second image.

[0093] It can be seen from a video image beautification method according to an embodiment of the present invention that, for multiple frames of first images in a video, the probability value of each pixel in each first image being a skin area can be determined according to a Gaussian model, wherein the probability value is positively correlated with the beautification degree of the corresponding pixel point, and then the first image is beautified according to the probability value to obtain a beautified second image. In this way, when the existing technology is not accurate enough in recognizing the skin area, the beautification of the skin area and the non-skin area in the video image can be smoother, and a more realistic portrait can be obtained, thereby improving the quality of the video.

[0094] Figure 7 4 is a schematic diagram of main modules of a video image beautification device according to an embodiment of the present invention.

[0095] like Figure 7 As shown, a video image beautification device 700 according to an embodiment of the present invention includes a probability determination module 701 and a beautification module 702; wherein:

[0096] The probability determination module 701 is used to respectively perform the following steps for the first image frames in the video: determining the probability value of each pixel point in the first image being a skin area according to the Gaussian model, wherein the probability value is positively correlated with the beautification degree of the corresponding pixel point;

[0097] The beautification module 702 is used to beautify the first image according to the probability value to obtain a beautified second image.

[0098] In the embodiment of the present invention, the probability determination module 701 is further used to: determine whether the pixel values ​​of the first image are in the first color space, and if not, convert the pixel values ​​of the first image into the first color space.

[0099] In the embodiment of the present invention, the probability determination module 701 is further used to: calculate the probability value of each pixel in the first image using a Gaussian model according to the chromaticity information of the pixel value of the first image in the first color space.

[0100] In the embodiment of the present invention, the probability determination module 701 is further used to: calculate the mean and variance of the chromaticity information, use the mean and variance as the input of the Gaussian model, and use the output of the Gaussian model as the probability value; wherein the probability value is distributed in the range of 0 to 1.

[0101] In the embodiment of the present invention, the first color space is a YCrCb space, and the chromaticity information is the values ​​of the blue chromaticity component Cb and the red chromaticity component Cr.

[0102] In an embodiment of the present invention, after determining the probability value that each pixel point in the first image is a skin area, the probability determination module 701 is further used to: determine the weight value of the pixel point based on the probability value corresponding to each pixel point, and the weight value is positively correlated with the probability value; and generate a first grayscale weight map corresponding to the first image based on the weight value corresponding to each pixel point in the first image.

[0103] In an embodiment of the present invention, the beautification module 702 is further used to: for each frame of the first image, execute: based on the first grayscale weight map corresponding to the first image and the first grayscale weight maps corresponding to other images in the video that are located before the first image, generate a second grayscale weight map corresponding to the first image.

[0104] In the embodiment of the present invention, the beautification module 702 is further configured to generate a beautified second image according to the second grayscale weight map, the preprocessed image of the first image, and the first image.

[0105] It can be seen that a video image beautification device according to an embodiment of the present invention can determine, for multiple frames of first images in a video, the probability value of each pixel in each first image being a skin area according to a Gaussian model, wherein the probability value is positively correlated with the beautification degree of the corresponding pixel point, and then the first image is beautified according to the probability value to obtain a beautified second image. In this way, when the existing technology is not accurate enough in recognizing the skin area, the beautification of the skin area and the non-skin area in the video image can be smoother, and a more realistic portrait can be obtained, thereby improving the quality of the video.

[0106] Figure 8An exemplary system architecture 800 is shown to which a video image beautification method or a video image beautification device according to an embodiment of the present invention can be applied.

[0107] like Figure 8 As shown, system architecture 800 may include terminal devices 801, 802, 803, a network 804, and an electronic device 805. Network 804 is used to provide a medium for communication links between terminal devices 801, 802, 803 and electronic device 805. Network 804 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0108] The user can use the terminal devices 801, 802, 803 to interact with the electronic device 805 through the network 804 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 801, 802, 803, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0109] The terminal devices 801 , 802 , and 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0110] The electronic device 805 may be a server that provides various services, such as a background management server that provides support for shopping websites browsed by users using the terminal devices 801, 802, and 803. The background management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information and product information) to the terminal device.

[0111] It should be noted that the video image beautification method provided in the embodiment of the present invention is generally executed by the electronic device 805 , and accordingly, the video image beautification device is generally disposed in the electronic device 805 .

[0112] It should be understood that Figure 8 The number of terminal devices, networks and electronic devices in the embodiment is only for illustration. Any number of terminal devices, networks and electronic devices may be provided according to implementation requirements.

[0113] Reference below Fig. 9 , which shows a schematic diagram of the structure of a computer system 900 of a terminal device suitable for implementing an embodiment of the present invention. Fig. 9 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0114] like Fig. 9As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0115] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.

[0116] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above-mentioned functions defined in the system of the present invention are executed.

[0117] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0118] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0119] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a probability determination module and a beautification module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the beautification module may also be described as "a module for beautifying a first image according to a probability value to obtain a beautified second image".

[0120] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: for multiple frames of first images in the video, respectively executing: according to the Gaussian model, determining the probability value of each pixel point in the first image being a skin area, wherein the probability value is positively correlated with the beautification degree of the corresponding pixel point; and according to the probability value, beautifying the first image to obtain a beautified second image.

[0121] According to the technical solution of the embodiment of the present invention, the probability value of each pixel in each first image being a skin area can be determined according to the Gaussian model for multiple frames of first images in the video, wherein the probability value is positively correlated with the beautification degree of the corresponding pixel point. Then, according to the probability value, the first image is beautified to obtain a beautified second image. In this way, when the existing technology is not accurate enough in recognizing the skin area, the beautification of the skin area and the non-skin area in the video image can be smoother, and a more realistic portrait can be obtained, thereby improving the quality of the video.

[0122] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A video image beautification method, characterized in that: include: For the first images of multiple frames in the video, execute respectively: Determine, according to the Gaussian model, a probability value that each pixel point in the first image is a skin area, wherein the probability value is positively correlated with the beautification degree of the corresponding pixel point; Determine a weight value of the pixel point according to the probability value corresponding to each pixel point, wherein the weight value is positively correlated with the probability value; generate a first grayscale weight map corresponding to the first image according to the weight value corresponding to each pixel point in the first image; generate a second grayscale weight map corresponding to the first image according to the first grayscale weight map corresponding to the first image and the first grayscale weight maps corresponding to other images in the video that are located before the first image; Beautify the first image according to the probability value to obtain a beautified second image; specifically including: generating the beautified second image according to the second grayscale weight map, a preprocessed image of the first image and the first image.

2. The method according to claim 1, characterized in that Also includes: Determine whether the pixel values ​​of the first image are in a first color space, and if not, convert the pixel values ​​of the first image into the first color space.

3. The method according to claim 2, characterized in that Determining, according to the Gaussian model, a probability value of each pixel point in the first image being a skin area includes: The probability value of each pixel point in the first image is calculated according to the chromaticity information of the pixel value of the first image in the first color space using the Gaussian model.

4. The method according to claim 3, characterized in that The mean and variance of the chromaticity information are calculated, the mean and variance are used as inputs of the Gaussian model, and the output of the Gaussian model is used as the probability value; wherein the probability value is distributed in the range of 0 to 1.

5. The method according to claim 3 or 4, characterized in that: The first color space is a YCrCb space, and the chromaticity information is the values ​​of a blue chromaticity component Cb and a red chromaticity component Cr.

6. A video image beautification device, characterized in that: It includes a probability determination module and a beautification module; wherein: The probability determination module is used to respectively perform the following operations for the multiple frames of the first image in the video: determining the probability value of each pixel in the first image being a skin area according to the Gaussian model, wherein the probability value is positively correlated with the beautification degree of the corresponding pixel; determining the weight value of the pixel according to the probability value corresponding to each pixel, wherein the weight value is positively correlated with the probability value; and generating a first grayscale weight map corresponding to the first image according to the weight value corresponding to each pixel in the first image; The beautification module is used to beautify the first image according to the probability value to obtain a beautified second image; it is also used to generate a second grayscale weight map corresponding to the first image according to the first grayscale weight map corresponding to the first image and the first grayscale weight maps corresponding to other images in the video that are located before the first image; and generate a beautified second image according to the second grayscale weight map, a preprocessed image of the first image and the first image.

7. An electronic device for beautifying video images, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

8. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Image processing method, device and equipment and storage medium

    CN109447031A

  • Multi-style portrait beautifying and buffing method and device

    CN110223246A