Color overflow suppression method and device of green screen image, live broadcast system, equipment and medium
By converting the green screen image to the YUV color space and performing chromaticity offset processing, the problem of poor overflow suppression effect of green screen pictures in the prior art is solved, and efficient overflow suppression effect and low calculation complexity are achieved.
Patent Information
- Application Number
- CN202411503947.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-02-25
AI Technical Summary
The existing green screen overflow suppression algorithm is difficult to ensure the overflow suppression effect of the picture on the basis of real-time, resulting in the problem of green overflow seriously affecting the visual perception.
By converting the green screen image in RGB format to the YUV color space, the chromaticity offset process is performed according to the color boundary and key color values of the green screen image to obtain the image after overflow suppression.
The overflow suppression effect is optimized, the calculation complexity is reduced, the processing performance is improved, and excellent suppression effect can be obtained in difficult scenarios.
Smart Images

Figure CN119520754A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method, device, live broadcast system, electronic device and computer-readable storage medium for suppressing overflow of green screen images. Background Art
[0002] With the development of image processing technology, green screen keying and image synthesis technology has been widely used in many fields such as image editing, live video, film and television creation, etc.; the target object photographed in front of the green screen will inevitably have green overflow due to the reflection of the screen, translucency (such as glasses, gauze), motion blur, etc. This phenomenon can easily present a series of image problems in the final synthesized image, such as green light reflection on the face and body, green tinting of transparent clothing, green edges of fast-moving (micro-dynamic) limbs, etc., which seriously affect the viewing experience.
[0003] In general, the overflow suppression algorithm is applied to suppress or remove the overflowed green component in the green screen image, so as to avoid the green overflow problem of the image; the currently commonly used green screen image overflow suppression algorithms mainly include the weighted average processing method of the grayscale image and the original image, and the RGB channel replacement or offset processing method. The above suppression methods can restore the foreground color to a certain extent, but it is easy to cause the loss of the entire image color or serious distortion of some colors (such as yellow), and the performance is poor in some difficult scenes (such as limb motion blur, red translucent clothing), and the overall effect is insufficient. In addition, there are also methods based on optimization solution methods and green color concentration suppression superposition RGB white balance adjustment methods; the foreground color can be effectively (or better) restored based on the optimization solution method, but the solution based on pixel-by-pixel optimization solution has a very high computational complexity and is difficult to support real-time tasks, especially on mid- and low-end devices; and the effect of the green color concentration suppression superposition RGB white balance adjustment method is generally general, and the white balance strategy is easy to fail.
[0004] It can be seen from this that the commonly used green screen image spill suppression algorithm is difficult to guarantee the image spill suppression effect on a real-time basis, which affects the use of green screen keying and image synthesis technology in scenarios such as image editing, video live broadcast, and film and television creation. Summary of the invention
[0005] Based on this, it is necessary to provide a method, device, live broadcast system, electronic device and computer-readable storage medium for suppressing overflow of green screen images to address at least one of the above-mentioned technical defects, which can optimize the overflow suppression effect and improve processing performance.
[0006] A method for suppressing overflow of a green screen image, comprising:
[0007] Get the green screen image in RGB format and the key color for keying;
[0008] Performing color space conversion on the green screen image and the key color respectively to obtain a first foreground image and a key color value in a YUV color space;
[0009] Determine a color boundary of the green screen image, and perform chromaticity shift processing on the first foreground image according to the key color value and the color boundary to obtain a second foreground image;
[0010] Performing color space inverse conversion on the second foreground image to obtain a first overflow suppression image in RGB format.
[0011] In one embodiment, performing chromaticity shift processing on the first foreground image according to the key color value and the color boundary to obtain the second foreground image includes:
[0012] Calculate the key color angle of the key color on the UV plane according to the key color value;
[0013] Estimate the corresponding UV position offset according to the value of the UV channel of each pixel point of the first foreground image, the key color value and the color boundary; wherein the color boundary includes a red-green boundary and a blue-green boundary;
[0014] Under a given Y value, UV channel shift is performed on each pixel of the first foreground image according to the UV position shift amount and the key color angle to obtain a second foreground image with green suppressed.
[0015] In one embodiment, performing UV channel shift on each pixel of the first foreground image according to the UV position shift and the key color angle includes:
[0016] When the color of the pixel point is located in the middle area between the red-green boundary and the key color angle, the color between the red-green boundary and the key color angle is shifted to the color on the red-green boundary line according to the UV position offset;
[0017] When the color of the pixel point is located in the middle area between the cyan boundary and the key color angle, the color between the cyan boundary and the key color angle is shifted to the color on the cyan boundary line according to the UV position offset.
[0018] In one embodiment, performing UV channel shift on each pixel of the first foreground image according to the UV position shift and the key color angle includes:
[0019]
[0020] Among them, U' represents the value of the pixel after the U channel is offset, V' represents the value of the pixel after the V channel is offset, U represents the value of the pixel U channel, and V represents the value of the pixel V channel. represents the pre-derived upper and lower bounds of the U channel, represents the upper and lower bounds of the pre-derived V channel, β represents the position offset, and k u Indicates the setting coefficient, θ K Indicates the key color angle.
[0021] In one embodiment, performing UV channel shift on each pixel of the first foreground image according to the UV position shift and the key color angle includes:
[0022] According to the UV position offset, a chromaticity offset of the UV channel of the corresponding pixel point is searched in a preset lookup table, and a color value of the UV channel of the corresponding pixel point is offset according to the chromaticity offset;
[0023] The lookup table is used to record the color value of the UV channel of the chromaticity offset of the pixel point under a given YUV value.
[0024] In one embodiment, the method for suppressing overflow of a green screen image further includes:
[0025] Calculate the color base of the first spill suppression image;
[0026] Color correction is performed on each RGB channel of the first overflow suppression image according to the color base to obtain a second overflow suppression image for picture synthesis.
[0027] A device for suppressing overflow of a green screen image, comprising:
[0028] An acquisition module is used to acquire a green screen image in RGB format and key colors for keying;
[0029] A conversion module, used for performing color space conversion on the green screen image and the key color to obtain a first foreground image and a key color value in a YUV color space;
[0030] An offset module, used for determining a color boundary of the green screen image, and performing chromaticity offset processing on the first foreground image according to the key color value and the color boundary to obtain a second foreground image;
[0031] The inverse conversion module is used to perform color space inverse conversion on the second foreground image to obtain a first overflow suppression image in RGB format.
[0032] A live broadcast system, comprising: an anchor terminal, an audience terminal and a live broadcast server; wherein the anchor terminal and the audience terminal are respectively connected to the live broadcast server via a network;
[0033] The live broadcast server is used to receive the green screen image uploaded by the anchor end, process the anchor's green screen image using the overflow color suppression method of the green screen image to obtain an overflow color suppression image, use the overflow color suppression image to perform green screen matting and image synthesis to obtain the anchor's live video image and forward it to the audience end;
[0034] The anchor terminal is used to access the anchor in the live broadcast room, collect the anchor's green screen image and upload it to the live broadcast server;
[0035] The audience terminal is used for users to access the live broadcast room and play the live video images.
[0036] An electronic device, comprising:
[0037] one or more processors;
[0038] Memory;
[0039] One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the steps of the above-mentioned method for suppressing overflow of green screen images.
[0040] A computer-readable storage medium stores at least one instruction, at least one program, a code set or an instruction set, wherein the at least one instruction, the at least one program, the code set or the instruction set is loaded by the processor and executes the steps of the above-mentioned green screen image overflow suppression method.
[0041] The technical solution of the present application converts the color space of the green screen image and key color in RGB format into YUV color space, performs chromaticity shift processing according to the color boundary and key color value of the green screen image, and then inversely converts the color space into an overflow suppression image in RGB format; this technical solution optimizes the overflow suppression effect, has the advantages of low computational complexity and fast processing speed, improves software coverage of devices, and brings better user experience; it can be widely used in various applications such as film and television creation, short videos, live video, image editing and creation, etc.
[0042] Furthermore, a specific chromaticity range is completely suppressed in the YUV color space, and the validity of the offset color is guaranteed by deriving the upper and lower limits of the UV channel at a given Y value.
[0043] Furthermore, based on the chromaticity shift and RGB channel correction scheme, it is possible to effectively suppress green spill while avoiding damage to colors close to green (such as yellow), thereby achieving excellent suppression effects in more difficult scenes (such as limb motion blur and red translucent clothing).
[0044] Furthermore, based on the lookup table method, chroma offset processing in the YUV color space is implemented, and a high-performance video green (blue) screen keying system is realized by exchanging space for time, which improves the computing performance in the broadcast tool products, reduces computing overhead, improves software coverage of devices, and brings a better user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is a schematic diagram of an example of spill suppression application for a green screen image;
[0046] Figure 2 is a flow chart of a method for suppressing overflow of a green screen image according to an embodiment;
[0047] Figure 3 is a schematic diagram of an example chromaticity shift;
[0048] Figure 4 This is an example of a green screen keying technology application diagram;
[0049] Figure 5 is a schematic structural diagram of a device for suppressing overflow of a green screen image according to an embodiment;
[0050] Figure 6 This is a schematic diagram of the live broadcast system structure;
[0051] Figure 7 is a block diagram of an example electronic device. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] In the embodiments of the present application, the words "first", "second", etc. are used to distinguish between identical or similar items with substantially the same effects and functions. "at least one" means one or more, and "multiple" means two or more. For example, multiple objects refer to two or more objects. "Include" or "comprises" and similar words mean that the information appearing before "include" or "comprises" covers the information listed after "include" or "comprises" and its equivalents, and does not exclude other information. "And / or" mentioned in the embodiments of the present application indicates that three types of relationships may exist. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0054] refer to Figure 1 As shown, Figure 1 The following is an example of an application diagram of overflow suppression of a green screen image. The input green screen image is processed by the overflow suppression algorithm of the green screen image, and the other path is the matte image obtained by green screen matte. The green screen image after the suppression processing is combined with the green screen matte image and the background image to finally obtain the desired composite image. For example, the picture data I of the input RGB format video image is RGB ∈R H×W×3 , after overflow suppression, output the video image in RGB format I″ RGB ∈R H×W×3 For subsequent processing, W and H represent the width and height of the output video image, respectively; for subsequent processing, the semi-transparent channel α∈R can be calculated from the input image by applying the matting algorithm H×W and any background image B RGB ∈R H×E×3 Synthesize to output the final video image synthesis screen C = α·I″ RGB +(1-α)·B RGB , C∈R H×W×3 .
[0055] Since the commonly used green screen image spill color suppression algorithm is difficult to ensure the image spill color suppression effect on a real-time basis, the present application provides a green screen image spill color suppression method, which converts the green screen image in RGB format into YUV (YCbCr) color space, and completely suppresses a specific chromaticity range in the YUV color space to ensure the effectiveness of the offset color, so as to improve the use of green screen keying and image synthesis technology in image editing, video live broadcast, film and television creation and other scenarios.
[0056] like Figure 2 As shown, Figure 2 The flowchart of a method for suppressing overflow of a green screen image according to an embodiment includes the following steps:
[0057] Step S10, obtaining a green screen image in RGB format and a key color for keying.
[0058] In this step, the input green screen image in RGB format and its key color for keying are obtained from the video image; for example, the green screen image I is obtained. RGB (i.e. the foreground image) and the key color k used for keying RGB ∈R 3×1 ; At the same time, the red and green boundary θ of the foreground image can also be obtained R and the blue-green boundary θ B .
[0059] Step S20, performing color space conversion on the green screen image and the key color respectively to obtain a first foreground image and a key color value in a YUV color space.
[0060] Specifically, the input green screen image I RGB and key color k RGB The color space is converted into a normalized YUV color space (or YCbCr color space), thereby obtaining a first foreground image I YUV ∈R H×W×3 and the key color value k YUV ; For example, the value range of the Y channel is [0,1], and the value range of the normalized UV channel is [-1,1].
[0061] Step S30, determining the color boundary of the green screen image, and performing chromaticity shift processing on the first foreground image according to the key color value and the color boundary to obtain a second foreground image.
[0062] In this step, based on the color boundary and key color value k of the green screen image in the YUV color space, YUV , for the first foreground image I YUV ∈R H×W×Y Perform chromaticity shift processing to obtain the second foreground image I YU′V′ ∈R H×W×3 .
[0063] In one embodiment, the method of performing chromaticity shift processing on the first foreground image according to the key color value and the color boundary to obtain the second foreground image in step S30 includes the following steps:
[0064] S301, calculating the key color angle of the key color on the UV plane according to the key color value.
[0065] For example, according to the key color value k YU3 The key color angle θ of the key color on the UV plane can be converted K .
[0066] S302, estimating a corresponding UV position offset according to a value of a UV channel of each pixel point of the first foreground image, a key color value, and a color boundary; wherein the color boundary includes a red-green boundary and a cyan boundary.
[0067] Exemplarily, according to the first foreground image I YUV , the key color value k YUV , at the red-green boundary θ R and the blue-green boundary θ B Under this condition, estimate the corresponding UV position offset β∈R H×W .
[0068] In one embodiment, performing UV channel shift on each pixel of the first foreground image according to the UV position shift and the key color angle may include the following:
[0069] (1) When the color of the pixel point is located in the middle area between the red-green boundary and the key color angle, the color between the red-green boundary and the key color angle is shifted to the color on the red-green boundary line according to the UV position offset.
[0070] (2) When the color of the pixel point is located in the middle area between the cyan boundary and the key color angle, the color between the cyan boundary and the key color angle is shifted to the color on the cyan boundary line according to the UV position offset.
[0071] For example, Figure 3 As shown, Figure 3 is an example of chromaticity shift schematic diagram, for the first foreground image I YUV Any pixel p = (x, y), according to the value of its UV channel I UV (x,y), key color k YUV , and the screen color boundary θ R ,θ B The corresponding UV position offset β(x,y) can be estimated; when I UV (x,y) is located at θ R and θ K Or θ B and θ K When the color is in the middle area of , the color needs to be offset, so β(x,y)>0. Taking point P(x,y) as an example, the corresponding β(x,y) value is Figure 3 The distance from the midline segment ①, that is, the distance from point P(x,y) to θ R The distance from the connecting line of the line segment ② to which it belongs, which is parallel to θ K The corresponding line segment ③; otherwise, its color is not within the corrected range, and the offset β(x,y)=0.
[0072] S303 , at a given Y value, performing UV channel shift on each pixel of the first foreground image according to the UV position shift amount and the key color angle to obtain a second foreground image with green suppressed.
[0073] In this step, the first foreground image I YUV By performing UV channel offset, we can finally obtain the second foreground image I with green suppressed. YU′V′ .
[0074] For example, since the UV channel has different upper and lower bounds at different Y values in different color spaces, it is necessary to derive the upper and lower bounds of U respectively. and the upper and lower bounds of V Then Figure 3 Medium θ R and θ K The color of the angle is shifted to θ R The color on the line, B and θ K The color of the angle is shifted to θ B The color on the line, thus achieving θ R and θ B Inside (θ K The green color on the side where the image is located is completely suppressed.
[0075] In one embodiment, the UV channel after the above offset can be mathematically expressed as:
[0076]
[0077] Among them, U' represents the value of the pixel after the U channel is offset, V' represents the value of the pixel after the V channel is offset, U represents the value of the pixel U channel, and V represents the value of the pixel V channel. represents the pre-derived upper and lower bounds of the U channel, represents the upper and lower bounds of the pre-derived V channel, β represents the position offset, and k u Indicates the setting coefficient.
[0078] Step S40: performing color space inverse conversion on the second foreground image to obtain a first overflow suppression image in RGB format.
[0079] In this step, the chromaticity shift of the second foreground image I is completed. YU′V′ ∈R H×W×3 Reverse conversion back to RGB color space to obtain the first overflow suppression image I′ after overflow suppression processing RGB .
[0080] As in the technical solutions of the above-mentioned embodiments, in the overflow suppression of green screen images, the overflow suppression effect is optimized, with the advantages of low computational complexity and fast processing speed, which improves software coverage of devices and brings a better user experience; a specific chromaticity range is completely suppressed in the YUV color space, and the upper and lower limits of the UV channel at a given Y value are derived to ensure the validity of the offset color, which can be widely used in various applications such as film and television creation, short videos, live video broadcasts, image editing and creation, etc.
[0081] In order to make the technical solution of the present application more clear, more embodiments are described below.
[0082] In one embodiment, considering the key color k RGB Generally, in practical applications, the color shift result is fixed for any given YUV value, given the specific overflow suppression parameters.
[0083] Based on this, the overflow suppression method of the green screen image of the present application first enumerates all possible YUV combinations, and then constructs a lookup table. When pixel processing is required, the offset β∈R is directly determined by the lookup table method. H×W Estimation can be performed to save the complex intermediate calculation process and greatly optimize the calculation performance. Specifically, when performing UV channel offset on each pixel of the first foreground image according to the UV position offset and the key color angle, the chromaticity offset of the UV channel of the corresponding pixel point can be searched in a preset lookup table according to the UV position offset, and the color value of the UV channel of the corresponding pixel point can be offset according to the chromaticity offset; wherein the lookup table is used to record the color value of the UV channel of the chromaticity offset of the pixel point under a given YUV value.
[0084] For example, the sensitivity of the human eye to brightness (ie, the Y channel) is about 1%, and there are 256 possible values of UV; therefore, this embodiment only needs to consume additional O(100×256×256) storage to achieve a computational complexity of O(1).
[0085] The technical solution of the above-mentioned embodiment realizes chromaticity offset processing in the YUV color space based on the lookup table method, and realizes a high-performance video green (blue) screen matting system by exchanging space for time, thereby improving the computing performance in the broadcast tool product, reducing computing overhead, improving software coverage of devices, and bringing a better user experience.
[0086] In one embodiment, in order to effectively handle overflow and avoid serious discoloration of colors close to green (such as yellow), the overflow suppression method of the green screen image of the present application may also include:
[0087] (1) Calculating the color base of the first overflow suppression image;
[0088] Exemplarily, calculating the color base of the first spill suppression image includes the following formula:
[0089]
[0090] τ=R*W r -2·B
[0091] τ2=min(max(-τ,0),1)
[0092] β2=(1-W r )·τ2+α1·(1-τ2)
[0093] Among them, λ represents the color base, R, B represent the values of the red and blue channels of the pixel respectively, and W r and a1 are the preset or input red weight and red mixing ratio.
[0094] (2) performing color correction on each RGB channel of the first overflow suppression image according to the color base to obtain a second overflow suppression image for image synthesis.
[0095] Exemplarily, after obtaining the color base λ, the channel correction method of RGB can be mathematically expressed as:
[0096] d=G-λ
[0097] R′=G-γ r d; G′=G-γ g d; B′=G-γ b d
[0098] Where G represents the pixel green channel value of the second overflow suppression image, γ r ,γ g ,γ b Respectively represent the correction amplitude of the three channels of RGB. Generally speaking, γ g =1,γ r =0,γ b =0.
[0099] The technical solution of the above embodiment improves the situation that the overflow suppression algorithm based on RGB channel correction cannot effectively suppress green overflow while ensuring that colors close to green (such as yellow) do not change color significantly. It adopts a chromaticity shift superimposed RGB channel correction scheme to achieve effective green overflow suppression while avoiding damage to colors close to green (such as yellow), thereby achieving excellent suppression effects in more difficult scenes (such as limb motion blur, red translucent clothing).
[0100] Based on the technical solutions of the above embodiments, Figure 4 As shown, Figure 4 This is an example of a green screen keying technology application diagram. One path of the input green screen image passes through the green screen image overflow suppression processing flow, and executes the chroma offset overflow suppression algorithm. The algorithm includes color space conversion, chroma offset and color space conversion, and then enters the RGB color channel correction to obtain the overflow suppression image. The other path passes through the green screen keying to obtain the keyed image. The overflow suppression image, the keyed image and the background image are combined for synthesis processing to obtain the final composite image.
[0101] The technical solution of the present application suppresses a specific chromaticity range in the YUV color space, and ensures the validity of the offset color by deriving the limit of the UV channel at a given Y value; the overflow suppression processing solution based on RGB channel correction can effectively suppress green overflow while avoiding damage to colors close to green (such as yellow); the chromaticity shift algorithm based on the YUV color space implemented based on the lookup table method is efficiently implemented by using space-for-time approach.
[0102] An embodiment of a device for suppressing overflow of a green screen image is described below.
[0103] refer to Figure 5 As shown, Figure 5 The structure diagram of a device for suppressing overflow of a green screen image according to an embodiment includes:
[0104] An acquisition module 10 is used to acquire a green screen image in RGB format and a key color for keying;
[0105] A conversion module 20, used for performing color space conversion on the green screen image and the key color to obtain a first foreground image and a key color value in a YUV color space;
[0106] An offset module 30 is used to determine the color boundary of the green screen image, and perform chromaticity offset processing on the first foreground image according to the key color value and the color boundary to obtain a second foreground image;
[0107] The inverse conversion module 40 is configured to perform color space inverse conversion on the second foreground image to obtain a first overflow suppression image in RGB format.
[0108] The green screen image overflow suppression device of this embodiment can execute a green screen image overflow suppression method provided in the embodiment of the present application, and its implementation principle is similar. The actions performed by each module in the green screen image overflow suppression device in each embodiment of the present application correspond to the steps in the green screen image overflow suppression method in each embodiment of the present application. For the detailed functional description of each module of the green screen image overflow suppression device, please refer to the description of the corresponding green screen image overflow suppression method shown in the previous text, which will not be repeated here.
[0109] An embodiment of the live broadcast system is described below.
[0110] The live broadcast system of this embodiment refers to Figure 6 As shown, Figure 6 This is an example of a live broadcast system structure diagram, the system framework may include an anchor terminal, a live broadcast server and an audience terminal, wherein the anchor terminal and multiple audience terminals respectively establish communication connections with the live broadcast server through a wired network or a wireless network. The anchor user broadcasts live through the anchor terminal, such as performing a real talent show, and the audience user chooses to enter a virtual live broadcast room through the audience terminal to watch the anchor user broadcast live. The audience terminal and the anchor terminal can enter the live broadcast platform through a client installed on an electronic device. For example, the anchor terminal and the audience terminal can be computer devices, such as PDAs, smart phones, tablet computers, desktop computers or laptops, etc., which are not limited to this. It can also be a software module of an application. The live broadcast server includes a background server for providing background services for electronic devices, which can be implemented with an independent server or a server cluster composed of multiple servers.
[0111] In this embodiment, the live broadcast server is used to receive the green screen image uploaded by the anchor end, use the overflow color suppression method of the green screen image of any of the aforementioned embodiments to process the anchor's green screen image to obtain a overflow color suppression image, use the overflow color suppression image to perform green screen matting and image synthesis to obtain the anchor's live video image and forward it to the audience end; the anchor end is used to access the anchor in the live broadcast room, collect the anchor's green screen image through the camera and upload it to the live broadcast server; the audience end is used to access users in the live broadcast room and play live video images.
[0112] The live broadcast system of the above-mentioned embodiment can help optimize the computing performance of the video green (blue) screen cutout broadcast tool product, reduce computing overhead, improve software coverage equipment, and bring a better user experience; based on the provided green screen image overflow suppression algorithm, it has the advantages of low computational complexity and high speed; it can be widely used in film and television creation, short videos, video live broadcast, image editing and creation and other applications; especially in the live broadcast business, it can be used in the anchor broadcast tool, virtual human production tool, and director tool, and is suitable for mainstream PC and mobile devices.
[0113] Embodiments of electronic devices and computer-readable storage media are described below.
[0114] The present application provides a technical solution for an electronic device, which is used to implement functions related to a method for suppressing overflow of a green screen image.
[0115] In one embodiment, the present application provides an electronic device, the electronic device comprising:
[0116] one or more processors;
[0117] Memory;
[0118] One or more application programs, wherein the one or more application programs are stored in a memory and configured to be executed by one or more processors, and the one or more program configurations are used in the method for suppressing spill of a green screen image in any embodiment.
[0119] like Figure 7 As shown, Figure 7 1 is a block diagram of an example electronic device. The electronic device may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc. The electronic device 100 may include one or more of the following components: a processing component 102, a memory 104, a power component 106, a multimedia component 108, an audio component 109, an input / output (I / O) interface 112, a sensor component 114, and a communication component 116.
[0120] The processing component 102 generally controls the overall operation of the electronic device 100, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations.
[0121] The memory 104 is configured to store various types of data to support operations in the electronic device 100, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0122] The power supply component 106 provides power to various components of the electronic device 100 .
[0123] The multimedia component 109 includes a screen that provides an output interface between the electronic device 100 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). In some embodiments, the multimedia component 108 includes a front camera and / or a rear camera.
[0124] The audio component 109 is configured to output and / or input audio signals.
[0125] I / O interface 112 provides an interface between processing component 102 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0126] The sensor component 114 includes one or more sensors for providing various aspects of status assessment for the electronic device 100. The sensor component 114 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact.
[0127] The communication component 116 is configured to facilitate wired or wireless communication between the electronic device 100 and other devices. The electronic device 100 can access a wireless network based on a communication standard, such as WiFi, an operator network (such as 2G, 3G, 4G or 5G), or a combination thereof.
[0128] The present application provides a technical solution of a computer-readable storage medium, which is used to implement functions related to the method for suppressing the overflow of green screen images. The computer-readable storage medium stores at least one instruction, at least one program, code set or instruction set, which is loaded by a processor and executes the method for suppressing the overflow of green screen images of any embodiment.
[0129] In an exemplary embodiment, the computer-readable storage medium may be a non-temporary computer-readable storage medium including instructions, such as a memory including instructions. For example, the non-temporary computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0130] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for suppressing overflow of a green screen image, characterized in that: include: Get the green screen image in RGB format and the key color for keying; Performing color space conversion on the green screen image and the key color respectively to obtain a first foreground image and a key color value in a YUV color space; Determine a color boundary of the green screen image, and perform chromaticity shift processing on the first foreground image according to the key color value and the color boundary to obtain a second foreground image; Performing color space inverse conversion on the second foreground image to obtain a first overflow suppression image in RGB format.
2. The method for suppressing overflow of a green screen image according to claim 1, characterized in that: Performing chromaticity shift processing on the first foreground image according to the key color value and the color boundary to obtain a second foreground image includes: Calculate the key color angle of the key color on the UV plane according to the key color value; Estimate the corresponding UV position offset according to the value of the UV channel of each pixel point of the first foreground image, the key color value and the color boundary; wherein the color boundary includes a red-green boundary and a blue-green boundary; Under a given Y value, UV channel shift is performed on each pixel of the first foreground image according to the UV position shift amount and the key color angle to obtain a second foreground image with green suppressed.
3. The method for suppressing overflow of a green screen image according to claim 2, characterized in that: Performing UV channel shift on each pixel of the first foreground image according to the UV position shift and the key color angle includes: When the color of the pixel point is located in the middle area between the red-green boundary and the key color angle, the color between the red-green boundary and the key color angle is shifted to the color on the red-green boundary line according to the UV position offset; When the color of the pixel point is located in the middle area between the cyan boundary and the key color angle, the color between the cyan boundary and the key color angle is shifted to the color on the cyan boundary line according to the UV position offset.
4. The method for suppressing overflow of a green screen image according to claim 3, characterized in that: Performing UV channel shift on each pixel of the first foreground image according to the UV position shift and the key color angle includes: Among them, U' represents the value of the pixel after the U channel is offset, V' represents the value of the pixel after the V channel is offset, U represents the value of the pixel U channel, and V represents the value of the pixel V channel. represents the pre-derived upper and lower bounds of the U channel, represents the upper and lower bounds of the pre-derived V channel, β represents the position offset, and k u Indicates the setting coefficient, θ K Indicates the key color angle.
5. The method for suppressing overflow of a green screen image according to claim 2, characterized in that: The step of performing UV channel shifting on each pixel of the first foreground image according to the UV position shift and the key color angle includes: According to the UV position offset, a chromaticity offset of the UV channel of the corresponding pixel point is searched in a preset lookup table, and a color value of the UV channel of the corresponding pixel point is offset according to the chromaticity offset; The lookup table is used to record the color value of the UV channel of the chromaticity offset of the pixel point under a given YUV value.
6. The method for suppressing overflow of a green screen image according to any one of claims 1 to 5, characterized in that: Also includes: Calculate the color base of the first spill suppression image; Color correction is performed on each RGB channel of the first overflow suppression image according to the color base to obtain a second overflow suppression image for picture synthesis.
7. A device for suppressing overflow of green screen images, characterized in that: include: An acquisition module is used to acquire a green screen image in RGB format and key colors for keying; A conversion module, used for performing color space conversion on the green screen image and the key color to obtain a first foreground image and a key color value in a YUV color space; An offset module, used for determining a color boundary of the green screen image, and performing chromaticity offset processing on the first foreground image according to the key color value and the color boundary to obtain a second foreground image; The inverse conversion module is used to perform color space inverse conversion on the second foreground image to obtain a first overflow suppression image in RGB format.
8. A live broadcast system, characterized in that: include: An anchor terminal, an audience terminal and a live broadcast server; wherein the anchor terminal and the audience terminal are respectively connected to the live broadcast server via a network; The live broadcast server is used to receive the green screen image uploaded by the anchor, process the anchor's green screen image using the overflow suppression method of the green screen image according to any one of claims 1 to 6 to obtain an overflow suppression image, use the overflow suppression image to perform green screen matting and image synthesis to obtain the anchor's live video image and forward it to the audience end; The anchor terminal is used to access the anchor in the live broadcast room, collect the anchor's green screen image and upload it to the live broadcast server; The audience terminal is used for users to access the live broadcast room and play the live video images.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the steps of the method for suppressing overflow of a green screen image as described in any one of claims 1-6.
10. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded by the processor and executes the steps of the method for suppressing overflow of a green screen image as described in any one of claims 1-6.