Method, device and equipment for detecting semitransparent area of ultra-high-definition image and medium
By acquiring semi-transparent candidate regions in green screen images and performing transparency coefficient inversion and color mixing model judgment, the problem of inaccurate semi-transparent region recognition in ultra-high-definition images is solved, achieving accurate semi-transparent region detection and adapting to changes in different lighting and shooting environments.
Patent Information
- Application Number
- CN202511394490.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-28
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-09-28
AI Technical Summary
Existing technologies struggle to accurately identify semi-transparent areas when processing green screen images, leading to problems such as green edges and incorrect color mixing, which is particularly noticeable in ultra-high-definition images.
By acquiring preprocessed images of the input and background images, semi-transparent candidate regions are obtained using Euclidean distance. Semi-transparent target regions are then determined through transparency coefficient inversion and color mixing models. Further filtering is performed by combining edge detection and connectivity analysis.
It achieves accurate identification of semi-transparent areas in ultra-high-definition images, avoiding green edges and color mixing errors. The output results are natural and continuous, adapting to changes in different lighting and shooting environments.
Smart Images

Figure CN120894352A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of green screen matting, and in particular to a semi-transparent region detection method and device for ultra-high-definition images, equipment and a medium. BACKGROUND
[0002] Green screen matting technology is a core means for separating foreground and background in the fields of virtual live broadcast, XR shooting, film production, etc.
[0003] Traditional matting algorithms, such as methods based on color keying (such as threshold judgment in RGB, YUV color space) or simple statistical models (such as Gaussian mixture model), have been relatively mature in dealing with objects with clear and opaque boundaries.
[0004] However, when the current scene object contains rich semi-transparent details, the inherent limitations of these methods are exposed. They usually simply classify pixels as completely foreground or completely background, and semi-transparent objects such as glass, water, and film between completely foreground and completely background cannot be accurately processed, often resulting in green edges and color mixing errors. SUMMARY
[0005] The purpose of the present application is to provide a semi-transparent region detection method and device for ultra-high-definition images, which can effectively identify semi-transparent regions in green screen composite images.
[0006] To achieve the above purpose, the present application provides the following solutions: In a first aspect, the present application provides a semi-transparent region detection method for ultra-high-definition images, comprising: obtaining an input image and a background image; pre-processing the input image to obtain a first pre-processed image and pre-processing the background image to obtain a second pre-processed image; obtaining a semi-transparent candidate region according to the Euclidean distance between the first pre-processed image and the second pre-processed image; judging whether the semi-transparent candidate region is a semi-transparent target region by performing transparency coefficient inversion on the semi-transparent candidate region.
[0007] Optionally, judging whether the semi-transparent candidate region is a semi-transparent target region by performing transparency coefficient inversion on the semi-transparent candidate region comprises: performing edge detection on the first pre-processed image to obtain an edge image; obtaining a transparency coefficient and a foreground color value by performing inversion on the semi-transparent candidate region according to the first pre-processed image and the second pre-processed image through a color mixing model; judging whether conditions one and two are simultaneously satisfied; wherein condition one comprises that the transparency coefficient is within a preset range; and condition two comprises that the semi-transparent candidate region has a response on the edge image. The semi-transparent candidate region satisfying both the first condition and the second condition is selected as the semi-transparent target region.
[0008] Optionally, the color mixing model is: ; wherein, is a pixel value of the first pre-processed image at position (x, y), is a pixel value of the second pre-processed image at position (x, y), is a transparency coefficient of the first pre-processed image at position (x, y), and the value range is 0-1, the first pre-processed image is a foreground color value at position (x, y).
[0009] Optionally, the semi-transparent candidate region is obtained according to the Euclidean distance between the first pre-processed image and the second pre-processed image, and the method comprises: for each pixel point, obtaining the Euclidean distance between the current pixel value of the first pre-processed image and the pixel value in the second pre-processed image; constructing a color difference histogram of the whole image according to the Euclidean distance; obtaining a background threshold and a foreground threshold according to the color difference histogram; performing connectivity analysis on the part with the Euclidean distance less than the foreground threshold and greater than the background threshold to obtain the semi-transparent candidate region.
[0010] Optionally, the background threshold and the foreground threshold are obtained by performing bimodal fitting on the color difference histogram, and the method comprises: performing bimodal fitting on the color difference histogram by using a bimodal Gaussian mixture model, and the bimodal Gaussian mixture model is: ; wherein, w1 and w2 are the weights of the two Gaussian distributions, respectively, and are the means of the two Gaussian distributions, respectively, and are the standard deviations of the two Gaussian distributions, respectively; is a Gaussian distribution probability density function with a mean of and a standard deviation of ; according to iterative calculation by using the expectation maximization algorithm to obtain the probability P(x) fitted with the histogram data, is the background threshold, is the foreground threshold, .
[0011] The background threshold and the foreground threshold are obtained according to the color difference histogram, and the method comprises: obtaining a mean value and a standard deviation of the color difference histogram; The background threshold and the foreground threshold are obtained according to the following formula: T_bg = μ d - k1 x σ d T_fg = μ d + k2 x σ d wherein, μ d is the mean value of the color difference histogram, σ d is the standard deviation of the color difference histogram, T_bg is the background threshold, T_fg is the foreground threshold, k1 and k2 are empirical coefficients, and the value range of k1 and k2 is 1.0-2.0.
[0012] Optionally, the input image is preprocessed to obtain a first preprocessed image, including: The input image is converted into a YCbCr color space to obtain a first image; The luminance value of the first image is normalized to obtain a second image; The second image is denoised to obtain the first preprocessed image.
[0013] Optionally, if the semi-transparent candidate region is determined to be a semi-transparent target region, the method further includes: The semi-transparent target region is edge-smoothed to output an edge-smoothed semi-transparent target region.
[0014] In a second aspect, the present application provides a semi-transparent region detection device for ultra-high definition images, including: A preprocessing module is configured to obtain an input image and a background image, and to preprocess the input image to obtain a first preprocessed image and to preprocess the background image to obtain a second preprocessed image; A preliminary screening module is configured to obtain a semi-transparent candidate region according to the Euclidean distance between the first preprocessed image and the second preprocessed image; A determination module is configured to determine whether the semi-transparent candidate region is a semi-transparent target region by performing transparency coefficient inversion on the semi-transparent candidate region.
[0015] In a third aspect, the present application provides a computer device, including a memory, a processor, a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the steps of the semi-transparent region detection method for ultra-high definition images according to any one of the above.
[0016] In a fourth aspect, the present application provides a computer readable storage medium having a computer program stored thereon, and the computer program is executable by a processor to implement the steps of the semi-transparent region detection method for ultra-high definition images according to any one of the above.
[0017] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method for detecting semi-transparent regions of ultra-high-definition images as described above.
[0018] According to the specific embodiments provided in this application, the following technical effects are disclosed: This application provides a method, apparatus, device, and medium for detecting semi-transparent regions in ultra-high-definition images. It can obtain semi-transparent candidate regions by the Euclidean distance between a second preprocessed image and a first preprocessed image, and determine the semi-transparent target region by performing transparency coefficient inversion on the semi-transparent candidate regions, thus solving the problem of difficult accurate identification of semi-transparent regions in the prior art. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating a method for detecting semi-transparent regions in an ultra-high-definition image according to an embodiment of this application. Figure 2 This is a schematic diagram of the preprocessing process for an input image in one embodiment of this application; Figure 3 for Figure 1 A flowchart illustrating step 103; Figure 4 for Figure 1 A flowchart illustrating step 104 in the middle section; Figure 5 A schematic diagram of the functional modules of a translucent region detection device for ultra-high-definition images provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] It should be noted that the terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented, for example, in orders other than those illustrated or described herein.
[0023] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0024] This application addresses the problem in existing technologies where semi-transparent areas cannot be accurately extracted when performing image cutout on green screen images. Especially in ultra-high-definition (4K) images, every pore, every strand of hair, and every texture of fabric is incredibly clear. The aforementioned minute imperfections will also be magnified and presented with equal clarity. If semi-transparent areas cannot be accurately detected, issues such as jagged edges and aliasing will be more visually apparent, severely impacting the final image quality.
[0025] In one exemplary embodiment, such as Figure 1 As shown, a method for detecting semi-transparent regions in ultra-high-definition images is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method includes steps 101 to 104. Wherein: Step 101: Obtain the input image and background image; Specifically, the input image is the green screen image to be cut out, and the background image is the pure background image of the green screen.
[0026] Step 102: Preprocess the input image to obtain a first preprocessed image; preprocess the background image to obtain a second preprocessed image; Specifically, preprocessing includes color conversion, noise reduction, and other processes to enhance image information.
[0027] Step 103: Obtain the semi-transparent candidate region based on the Euclidean distance between the first preprocessed image and the second preprocessed image; Specifically, this step involves comparing the second preprocessed image with the first preprocessed image to obtain semi-transparent candidate regions.
[0028] Step 104: Perform transparency coefficient inversion on the semi-transparent candidate region to determine whether the semi-transparent candidate region is a semi-transparent target region.
[0029] Specifically, the semi-transparent candidate regions are further screened based on the transparency coefficient inversion.
[0030] Furthermore, edge smoothing processing is performed on the semi-transparent target area to output a semi-transparent target area with smooth edges.
[0031] Furthermore, edge-preserving filtering methods can be used for edge smoothing.
[0032] By implementing steps 101 to 104 above, a semi-transparent candidate region can be obtained by the Euclidean distance between the second preprocessed image and the first preprocessed image. The semi-transparent target region can be determined by performing transparency coefficient inversion on the semi-transparent candidate region, thus solving the problem of the target region being difficult to accurately identify in the prior art.
[0033] In another exemplary embodiment of this application, in order to accurately identify semi-transparent candidate regions in the input image, both the input image and the background image are preprocessed. Preprocessing includes color conversion, noise reduction, and other processes to enhance image information. The preprocessing steps for the input image and the background image are the same; therefore, the preprocessing steps for the input image will be described in detail here, while the preprocessing steps for the background image will not be repeated. Figure 2 As shown, the steps for preprocessing the input image are replaced by steps 201 to 203: Step 201: Convert the input image to the YCbCr color space to obtain the first image; The main purpose of the YCbCr color space is to separate color information (chromaticity) and luminance information (luminance).
[0034] Y represents the luminance component. It represents the brightness or grayscale information of an image, containing the details that our eyes are most sensitive to.
[0035] Cb represents the blue differential chromaticity component. It indicates the difference between the blue component and the luminance value.
[0036] Cr represents the red differential chromaticity component. It indicates the difference between the red component and the luminance value.
[0037] Step 202: Normalize the brightness values of the first image to obtain the second image; Specifically, the Y component is normalized.
[0038] Step 203: Perform noise reduction processing on the second image to obtain the first preprocessed image.
[0039] Alternatively, median filtering or bilateral filtering can be selected for noise reduction.
[0040] In another exemplary embodiment of this application, in order to adapt to changes in different lighting conditions, shooting environment, and image content, and to accurately identify semi-transparent candidate regions in the input image, a histogram can be generated based on the corresponding Euclidean distance. A foreground threshold and a background threshold are determined based on the histogram, and the semi-transparent candidate regions are determined by threshold judgment. Figure 3 As shown, step 103 above is replaced by steps 301 to 303: Step 301: For each pixel, obtain the Euclidean distance between the current pixel value in the first preprocessed image and the pixel values in the second preprocessed image; Specifically, we calculate the Euclidean distance between the first and second preprocessed images to obtain a color difference histogram. The formula for calculating Euclidean distance is as follows: ; in, Let C be the Euclidean distance. in For the first preprocessed image, C bg This is the second preprocessed image; Step 302: Obtain the background threshold and foreground threshold based on the color difference histogram; Specifically, the core idea of bimodal fitting is that we assume the observed histogram data is generated by a mixture of two different populations (or processes). Each population follows its own distribution (most commonly Gaussian / normal). Our goal is to find the optimal parameters for these two distributions so that we can distinguish between them.
[0041] Specifically, the color difference histogram data can be divided into two groups based on a segmentation threshold T, and a bimodal fitting is performed using a bigroup Gaussian mixture model. The model is as follows: ; Here, w1 and w2 are the weights of two Gaussian distributions (w1+w2=1).
[0042] and These are the means of two Gaussian distributions, which are the locations of the low and high peaks we want to find.
[0043] and These are the standard deviations of two Gaussian distributions (which determine the width of the distribution).
[0044] The mean is The standard deviation is The Gaussian probability density function.
[0045] Specifically, we need to solve for a set of parameters (w1, , w2 , This ensures that the probability P(x) calculated by our model is most similar to the observed histogram data.
[0046] Furthermore, the Expectation-Maximization (EM) algorithm can be used for iterative calculations to obtain the above parameters.
[0047] Specifically, the low-difference peak (the first peak) As a background threshold, the high difference peak (the second peak) and As a foreground threshold .
[0048] As another implementation, step 302 above can also be obtained by the following method: Specifically, obtain the mean and standard deviation of the color difference histogram, and calculate the background and foreground thresholds using the following formulas: T_bg=μ_d-k1×σ_d; T_fg=μ_d+k2×σ_d; Where μ_d is the mean of the color difference histogram, σ_d is the standard deviation of the color difference histogram, T_bg is the background threshold, T_fg is the foreground threshold, and k1 and k2 are empirical coefficients, generally ranging from 1.0 to 2.0. This correction method can dynamically adjust the threshold size according to the actual image differences.
[0049] Step 303: Perform connectivity analysis on the regions whose Euclidean distance is less than the foreground threshold and greater than the background threshold to obtain semi-transparent candidate regions.
[0050] Specifically, the portion larger than the foreground threshold is identified as the foreground region, the portion smaller than the background threshold is identified as the background region, and the portion between the two thresholds is identified as the semi-transparent candidate region.
[0051] Specifically, we only extract the semi-transparent candidate regions here for further judgment in the next step.
[0052] In another exemplary embodiment of this application, in order to further filter the semi-transparent candidate regions to obtain the semi-transparent target regions, such as... Figure 4 As shown, step 104 above may further include steps 401 to 403. Wherein: Step 401: Perform edge detection on the first preprocessed image to obtain an edge image; Specifically, edge images are obtained based on existing edge detection algorithms.
[0053] Step 402: Based on the first preprocessed image and the second preprocessed image, the transparency coefficient and foreground color value are obtained by inverting the semi-transparent candidate region using a color mixing model; Specifically, the color mixing model is as follows: in, Let be the pixel value of the first preprocessed image at position (x, y). Let be the pixel value of the second preprocessed image at position (x, y). The transparency coefficient of the first preprocessed image at position (x, y) ranges from 0 to 1. The first preprocessed image is the foreground color value at position (x, y).
[0054] Specifically, and It should be the color vector of the image in the YCbCr color space model.
[0055] Specifically, the unknown variables in the model are solved. and Here we only need to obtain the transparency coefficient for the judgment of condition one.
[0056] The transparency can be determined by solving the model using the following formula: The foreground color can be determined using the following formula: Step 403: Determine whether both condition 1 and condition 2 are satisfied simultaneously; condition 1 includes: the transparency coefficient is within a preset range; condition 2 includes: the semi-transparent candidate region has a response in the edge image.
[0057] Furthermore, the preset range can be set to 0.1~0.9.
[0058] Furthermore, determining whether a semi-transparent candidate region has a response on the edge map E(x,y) is generally done through the following steps: Step 4031: Obtain the number of pixels in the semi-transparent candidate region that belong to the edge region on the edge map E(x,y) as the first quantity; Step 4032: Obtain the ratio of the first quantity to the total number of pixels in the semi-transparent candidate region as the first ratio. Step 4033: If the first ratio exceeds the preset threshold, determine whether the semi-transparent candidate region has a response on the edge map E(x,y).
[0059] Specifically, the preset threshold is set to 10%.
[0060] Step 404: Select the semi-transparent candidate region that satisfies both condition one and condition two as the semi-transparent target region; This application provides a method for detecting semi-transparent regions in ultra-high-definition images, which has the following technical advantages: To adapt to changes in lighting conditions, shooting environment, and image content, and to accurately identify semi-transparent candidate regions in input images, an adaptive thresholding method is provided. This method obtains background and foreground thresholds by performing bimodal fitting based on a color difference histogram, and then identifies semi-transparent candidate regions based on these thresholds. To further refine these candidate regions and obtain semi-transparent target regions, a color mixing model is used to invert the semi-transparent candidate regions, obtaining transparency coefficients and foreground color values. These transparency coefficients and foreground color values are then used to determine the semi-transparent target regions. This application can more accurately identify semi-transparent regions and avoids problems such as green edges and color mixing errors.
[0061] This application also utilizes edge map processing, connectivity analysis, and edge optimization for semi-transparent target regions to produce a natural and continuous output map.
[0062] The method provided in this application has a small memory footprint and is more accurate in recognizing semi-transparent areas in green screen images. It can accurately detect semi-transparent areas in ultra-high-definition images of 4K and above. Similarly, it can also perform batch real-time operations on images in real-time video streams of 4K and above ultra-high-definition.
[0063] This application also provides an application scenario in which the above-described method for detecting semi-transparent regions in ultra-high-definition images is applied. Specifically, the method for detecting semi-transparent regions in ultra-high-definition images provided in this embodiment can be applied in scenarios such as virtual live streaming, XR shooting, and film production. Combined with existing image matting methods, it can solve the problem of inaccurate segmentation of semi-transparent regions.
[0064] Based on the same inventive concept, this application also provides an apparatus for detecting the semi-transparent region of an ultra-high-definition image, used to implement the aforementioned method for detecting the semi-transparent region of an ultra-high-definition image. The solution provided by this apparatus is similar to the implementation described in the above method. Therefore, the specific limitations in one or more embodiments of the apparatus for detecting the semi-transparent region of an ultra-high-definition image provided below can be found in the limitations of the method for detecting the semi-transparent region of an ultra-high-definition image described above, and will not be repeated here.
[0065] In one exemplary embodiment, such as Figure 5 As shown, a device for detecting semi-transparent areas in ultra-high-definition images is provided, comprising: The preprocessing module is used to acquire the input image and the background image; to preprocess the input image to obtain the first preprocessed image, and to preprocess the background image to obtain the second preprocessed image; The initial screening module is used to obtain semi-transparent candidate regions based on the Euclidean distance between the first preprocessed image and the second preprocessed image; The determination module is used to perform transparency coefficient inversion on the semi-transparent candidate region to determine whether the semi-transparent candidate region is a semi-transparent target region.
[0066] As an optional implementation, the determining module is used for: Edge detection is performed on the first preprocessed image to obtain an edge image; Based on the first and second preprocessed images, the transparency coefficient and foreground color value of the semi-transparent candidate region are obtained by inverting the color mixing model; Determine whether both condition one and condition two are satisfied simultaneously; where condition one includes: the transparency coefficient is within a preset range; condition two includes: the semi-transparent candidate region has a response in the edge image; Select the semi-transparent candidate region that satisfies both condition one and condition two as the semi-transparent target region.
[0067] As an optional implementation, the color mixing model is as follows: in, Let be the pixel value of the first preprocessed image at position (x, y). Let be the pixel value of the second preprocessed image at position (x, y). The transparency coefficient of the first preprocessed image at position (x, y) ranges from 0 to 1. The first preprocessed image is the foreground color value at position (x, y).
[0068] As an optional implementation, the initial screening module is also used for: For each pixel, obtain the Euclidean distance between the current pixel value in the first preprocessed image and the pixel values in the second preprocessed image; Construct a color difference histogram for the entire image based on Euclidean distance; Obtain background and foreground thresholds based on the color difference histogram; For regions whose Euclidean distance is less than the foreground threshold but greater than the background threshold, connectivity analysis is performed to obtain semi-transparent candidate regions.
[0069] As an optional implementation, the initial screening module is further used for: The color difference histogram was fitted with a bimodal Gaussian mixture model, which is as follows: Where w1 and w2 are the weights of two Gaussian distributions, respectively. and These are the means of two Gaussian distributions, respectively. and These are the standard deviations of two Gaussian distributions; The mean is The standard deviation is The Gaussian probability density function; The algorithm employs an iterative calculation using the expectation-maximization algorithm to obtain the probability P(x) calculated by the two-group Gaussian mixture model that is most similar to the observed histogram data. and ,in Background threshold Foreground threshold, where .
[0070] As an optional implementation, the initial screening module is also used for: Obtain the mean and standard deviation of the color difference histogram; The background threshold and foreground threshold are obtained using the following formulas: T_bg=μ_d-k1×σ_d; T_fg=μ_d+k2×σ_d; Where μ_d is the mean of the color difference histogram, σ_d is the standard deviation of the color difference histogram, T_bg is the background threshold, T_fg is the foreground threshold, and k1 and k2 are empirical coefficients, with values ranging from 1.0 to 2.0.
[0071] As an optional implementation, the preprocessing module is also used for: Convert the input image to the YCbCr color space to obtain the first image; The brightness values of the first image are normalized to obtain the second image; The second image is denoised to obtain the first preprocessed image.
[0072] As an optional implementation, the determining module is further used for: The edges of the semi-transparent target area are smoothed to output a semi-transparent target area with smooth edges.
[0073] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 6As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network. When executed by the processor, the computer program implements a method for detecting semi-transparent areas in ultra-high-definition images.
[0074] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0075] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0076] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0077] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0078] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0079] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0080] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0081] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0082] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. In summary, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for detecting semi-transparent regions in ultra-high-definition images, characterized in that, The method for detecting semi-transparent regions in ultra-high-definition images includes: Obtain an input image and a background image; preprocess the input image to obtain a first preprocessed image, and preprocess the background image to obtain a second preprocessed image; The semi-transparent candidate region is obtained based on the Euclidean distance between the first preprocessed image and the second preprocessed image; The transparency coefficient of the semi-transparent candidate region is inverted to determine whether the semi-transparent candidate region is a semi-transparent target region.
2. The method for detecting semi-transparent regions in ultra-high-definition images according to claim 1, characterized in that, The step of performing transparency coefficient inversion on the semi-transparent candidate region to determine whether the semi-transparent candidate region is a semi-transparent target region includes: Edge detection is performed on the first preprocessed image to obtain an edge image; Based on the first preprocessed image and the second preprocessed image, the transparency coefficient of the semi-transparent candidate region is obtained by inverting the color mixing model. Determine whether both condition one and condition two are satisfied simultaneously; wherein, condition one includes: the transparency coefficient is within a preset range; condition two includes: the semi-transparent candidate region has a response on the edge image; Select the semi-transparent candidate region that simultaneously satisfies conditions one and two as the semi-transparent target region.
3. The method for detecting semi-transparent regions in ultra-high-definition images according to claim 2, characterized in that, The color mixing model is as follows: ; in, Let be the pixel value of the first preprocessed image at position (x, y). Let be the pixel value of the second preprocessed image at position (x, y). The transparency coefficient of the first preprocessed image at position (x, y) ranges from 0 to 1. The first preprocessed image is the foreground color value at position (x, y).
4. The method for detecting semi-transparent regions in ultra-high-definition images according to claim 1, characterized in that, The step of obtaining semi-transparent candidate regions based on the Euclidean distance between the first preprocessed image and the second preprocessed image includes: For each pixel, obtain the Euclidean distance between the current pixel value in the first preprocessed image and the pixel value in the second preprocessed image; Construct a color difference histogram of the entire image based on the Euclidean distance; The background threshold and foreground threshold are obtained based on the color difference histogram; The semi-transparent candidate regions are obtained by performing connectivity analysis on the regions whose Euclidean distance is less than the foreground threshold and greater than the background threshold.
5. The method for detecting semi-transparent regions in ultra-high-definition images according to claim 4, characterized in that, The step of obtaining the background threshold and foreground threshold based on the color difference histogram includes: The color difference histogram was fitted with a bimodal Gaussian mixture model, which is as follows: ; Where w1 and w2 are the weights of two Gaussian distributions, respectively. and These are the means of two Gaussian distributions, respectively. and These are the standard deviations of two Gaussian distributions; The mean is The standard deviation is The Gaussian probability density function; The probability P(x) of fitting the histogram data is obtained by iterative calculation using the expectation-maximization algorithm. Background threshold Foreground threshold, .
6. The method for detecting semi-transparent regions in ultra-high-definition images according to claim 4, characterized in that, The step of obtaining the background threshold and foreground threshold based on the color difference histogram includes: Obtain the mean and standard deviation of the color difference histogram; The background threshold and foreground threshold are obtained according to the following formulas: T_bg=μ_d-k1×σ_d; T_fg=μ_d+k2×σ_d; Wherein, μ_d is the mean of the color difference histogram, σ_d is the standard deviation of the color difference histogram, T_bg is the background threshold, T_fg is the foreground threshold, and k1 and k2 are empirical coefficients, with values ranging from 1.0 to 2.
0.
7. The method for detecting semi-transparent regions in ultra-high-definition images according to claim 1, characterized in that, The step of preprocessing the input image to obtain a first preprocessed image includes: The input image is converted to the YCbCr color space to obtain the first image; The brightness values of the first image are normalized to obtain the second image; The second image is subjected to noise reduction processing to obtain the first preprocessed image.
8. A device for detecting semi-transparent areas in ultra-high-definition images, characterized in that, The translucent region detection device for the ultra-high-definition image includes: A preprocessing module is used to acquire an input image and a background image; to preprocess the input image to obtain a first preprocessed image, and to preprocess the background image to obtain a second preprocessed image; The initial screening module is used to obtain semi-transparent candidate regions based on the Euclidean distance between the first preprocessed image and the second preprocessed image; The determination module is used to perform transparency coefficient inversion on the semi-transparent candidate region to determine whether the semi-transparent candidate region is a semi-transparent target region.
9. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the steps of the method for detecting translucent regions of an ultra-high-definition image according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the method for detecting translucent regions of ultra-high-definition images according to any one of claims 1-7.
Citation Information
Patent Citations
Method and system for processing split online video on the basis of depth sensor
CN102999901A
Automatic background replacement method, system and server for certificate photo
CN109344724A
Method and apparatus for detecting semi-transparencies in video
US20100166257A1
Image processing apparatus, image processing method, and storage medium
US20200027197A1