WO2018141232A1 - 图像处理方法、计算机存储介质及计算机设备 - Google Patents

图像处理方法、计算机存储介质及计算机设备 Download PDF

Info

Publication number
WO2018141232A1
WO2018141232A1 PCT/CN2018/074458 CN2018074458W WO2018141232A1 WO 2018141232 A1 WO2018141232 A1 WO 2018141232A1 CN 2018074458 W CN2018074458 W CN 2018074458W WO 2018141232 A1 WO2018141232 A1 WO 2018141232A1
Authority
WO
WIPO (PCT)
Prior art keywords
pixel
image
background
foreground
pixel point
Prior art date
Application number
PCT/CN2018/074458
Other languages
English (en)
French (fr)
Inventor
程培
傅斌
钱梦仁
沈珂轶
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2018141232A1 publication Critical patent/WO2018141232A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation

Definitions

  • the present application relates to image processing techniques, and more particularly to an image processing method, a computer readable storage medium, and a computer device.
  • the user provides some foreground pixels and background pixels by clicking, etc., which is called a foreground seed pixel and Background seed pixels, then use these seed pixels to establish a mixed Gaussian (GMM) probability model, design an energy function (loss function) that can evaluate the segmentation result, and then solve the energy function through a mathematical tool, so as to foreground, background of the image to be replaced Segmentation.
  • GMM mixed Gaussian
  • the pixel points of the image are simply divided into the foreground pixel and the background pixel, so that the background color band is easily left at the foreground edge, so that the image edge of the new background obtained by the final fusion is obtained.
  • the outline is unnatural, affecting the quality of the image that replaces the background of the image.
  • the purpose of the embodiment is to provide an image processing method, an image processing device, a computer device, and a computer readable storage medium, wherein the segmentation result is stable, and the resulting image is replaced by the background image. high quality.
  • the present embodiment adopts the following technical solutions:
  • An image processing method comprising the steps of:
  • the terminal acquires a to-be-processed image, a new background image, and a screen image;
  • a pixel point type of each of the pixel points according to a foreground pixel probability and a background pixel probability of each of the pixel points, where the pixel point type includes a foreground pixel point, a background pixel point, and a mixed pixel point;
  • the terminal determines, according to each of the mixed pixel points, the foreground pixel probability of each of the mixed pixel points, and the screen image, a fusion weight of each of the mixed pixel points, and according to the fusion right of each of the mixed pixel points a value determining a foreground component value of each of the mixed pixel points;
  • the terminal uses the pixel value of the foreground pixel as the pixel value of the pixel at the position corresponding to the foreground pixel in the background image after the background replacement;
  • the terminal uses the pixel value of the pixel at the position corresponding to the background pixel in the new background image as the pixel value of the pixel at the position corresponding to the background pixel in the image after the replacement background;
  • a computer device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor executing the computer program to implement the following steps:
  • the terminal acquires a to-be-processed image, a new background image, and a screen image;
  • a pixel point type of each of the pixel points according to a foreground pixel probability and a background pixel probability of each of the pixel points, where the pixel point type includes a foreground pixel point, a background pixel point, and a mixed pixel point;
  • the terminal determines, according to each of the mixed pixel points, the foreground pixel probability of each of the mixed pixel points, and the screen image, a fusion weight of each of the mixed pixel points, and according to the fusion right of each of the mixed pixel points a value determining a foreground component value of each of the mixed pixel points;
  • the terminal uses the pixel value of the foreground pixel as the pixel value of the pixel at the position corresponding to the foreground pixel in the background image after the background replacement;
  • the terminal uses the pixel value of the pixel at the position corresponding to the background pixel in the new background image as the pixel value of the pixel at the position corresponding to the background pixel in the image after the replacement background;
  • a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the following steps:
  • the terminal acquires a to-be-processed image, a new background image, and a screen image;
  • a pixel point type of each of the pixel points according to a foreground pixel probability and a background pixel probability of each of the pixel points, where the pixel point type includes a foreground pixel point, a background pixel point, and a mixed pixel point;
  • the terminal determines, according to each of the mixed pixel points, the foreground pixel probability of each of the mixed pixel points, and the screen image, a fusion weight of each of the mixed pixel points, and according to the fusion right of each of the mixed pixel points a value determining a foreground component value of each of the mixed pixel points;
  • the terminal uses the pixel value of the foreground pixel as the pixel value of the pixel at the position corresponding to the foreground pixel in the background image after the background replacement;
  • the terminal uses the pixel value of the pixel at the position corresponding to the background pixel in the new background image as the pixel value of the pixel at the position corresponding to the background pixel in the image after the replacement background;
  • the fusion weight value and the foreground component value of the mixed pixel points are determined, so that when the image background is replaced on this basis, the mixed pixel points can be based on the mixing
  • the fusion weight and the foreground component value of the pixel merge the mixed pixel with the new background image, thereby effectively distinguishing the mixed pixels of the foreground and the background fusion, and obtaining a stable extraction result of the foreground image, so that the replacement is performed.
  • the image obtained by replacing the background when the background of the image is obtained does not have an unnatural contour edge, and the obtained image quality is high.
  • FIG. 1 is a schematic diagram of an application environment of a solution of the present application in an embodiment
  • FIG. 2 is a schematic diagram of an application scenario of the solution of this embodiment in a specific application example
  • FIG. 3 is a schematic structural diagram of a terminal in an embodiment
  • FIG. 4 is a schematic flow chart of an image processing method in an embodiment
  • FIG. 5 is a flow chart showing an overall process of image processing in a specific example
  • FIG. 6 is a schematic diagram showing the principle of an image processing method in a specific example
  • FIG. 7 is a schematic structural diagram of an apparatus for extracting a foreground image in an embodiment
  • FIG. 8 is a schematic structural diagram of a pixel point probability model establishing module in a specific example
  • Figure 9 is a block diagram showing the structure of an apparatus for replacing an image in an embodiment.
  • FIG. 1 shows a schematic diagram of a working environment in an embodiment of the present application.
  • the working environment relates to the terminal 101.
  • the server 102 may also be involved.
  • the terminal 101 can extract its foreground image (2-2 as shown in FIG. 2) for its own stored or externally acquired image (2-1 as shown in FIG. 2), and can extract the foreground image based on it.
  • the image background is replaced to obtain an image after replacing the background (2-3 as shown in Fig. 2).
  • the foreground image extracted by the terminal 101 or the image after replacing the background may be stored and viewed locally in the terminal 101, or may be transmitted to other network terminals via the network, or transmitted to the server 102 through the network, and then transmitted to the server 102 via the server 102.
  • Other network terminals may be used to receive network terminal 101.
  • the terminal 101 may be a terminal carrying a camera, or may be a terminal externally connected to the imaging device 1010, so that the terminal 101 can extract a foreground image of a frame image captured by the camera, and perform an image on the basis of the image.
  • the replacement of the background enables the replacement of various image backgrounds in various applications such as live video and video chat, thereby realizing live video or video chat under various backgrounds.
  • the present embodiment relates to a scheme in which the terminal 101 extracts its foreground image from an image and performs image background replacement accordingly.
  • the terminal 101 includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus.
  • the processor of the terminal 101 is used to provide calculation and control capabilities.
  • the memory of the terminal 101 includes a nonvolatile storage medium, an internal memory.
  • the non-volatile storage medium stores an operating system and a computer program.
  • the network interface of the terminal 101 is used to connect and communicate with other terminals or servers 102 of the network terminal.
  • the internal memory provides an environment for operation of an operating system and computer programs in a non-volatile storage medium.
  • the computer program implements an image processing method when executed by a processor.
  • the terminal 101 can be any device capable of implementing intelligent input and output, such as a mobile terminal, such as a mobile phone, a tablet computer, a personal computer, etc.; or other devices having the above structure.
  • the display screen of the terminal 101 may be a liquid crystal display or an electronic ink display screen.
  • the input device of the terminal 101 may be a touch layer covered on the display screen, or may be a button, a trackball or a touchpad provided on the terminal housing, or It is an external keyboard, trackpad or mouse.
  • FIG. 4 A schematic flow chart of an image processing method in one embodiment is shown in FIG. In this embodiment, an application is applied to the terminal 101 as an example for description. As shown in FIG. 4, the image processing method in this embodiment includes:
  • Step S401 The terminal acquires an image to be processed, a new background image, and a screen image;
  • Step S402 The terminal determines, according to the to-be-processed image and the screen image, a foreground pixel probability that each pixel point in the image to be processed belongs to a foreground pixel point, and a background pixel probability that belongs to a background pixel point;
  • Step S403 The terminal determines, according to the foreground pixel probability and the background pixel probability of each of the pixel points, a pixel point type of each of the pixel points, where the pixel point type includes a foreground pixel point, a background pixel point, and a mixed pixel point;
  • Step S404 The terminal determines, according to each of the mixed pixel points, the foreground pixel probability of each of the mixed pixel points, and the screen image, a fusion weight value of each of the mixed pixel points, and according to each of the mixed pixel points a fusion weight value determining a foreground component value of each of the mixed pixel points;
  • Step S405 The terminal uses the pixel value of the foreground pixel as the pixel value of the pixel at the position corresponding to the foreground pixel in the background image after the background replacement;
  • Step S406 The terminal uses the pixel value of the pixel at the position corresponding to the background pixel in the new background image as the pixel value of the pixel at the position corresponding to the background pixel in the image after the replacement background. ;
  • Step S407 The terminal determines, according to the fusion weight value and the foreground component value of the mixed pixel point, the pixel value of the new background pixel, a fused pixel value of the mixed pixel point, and uses the fused pixel value as the The pixel value of the pixel at the position corresponding to the mixed pixel point in the background image is replaced.
  • the fusion weight value and the foreground component value of the mixed pixel points are determined, so that when the image background is replaced on this basis, the mixed pixel points can be based on the mixing
  • the fusion weight and the foreground component value of the pixel merge the mixed pixel with the new background image, thereby effectively distinguishing the mixed pixels of the foreground and the background fusion, and obtaining a stable extraction result of the foreground image, so that the replacement is performed.
  • the image obtained by replacing the background when the background of the image is obtained does not have an unnatural contour edge, and the obtained image quality is high.
  • step S405, step S406, and step S407 can be performed simultaneously without prioritization.
  • the mixed pixels of the foreground and the background fusion are effectively distinguished, and the segmentation result of the foreground image can be stably obtained, so that the background image obtained by replacing the background of the image is finally obtained. There is no unnatural contour edge and the resulting image quality is high.
  • the pixel point probability model may be combined, that is, the terminal may determine, according to the image to be processed, the screen image, and the pixel point probability model, each pixel in the image to be processed belongs to the foreground pixel.
  • the pixel point probability model can be determined in the following manner:
  • the terminal acquires a sample image and the screen image, wherein the sample image herein includes an image of a video frame in the video stream in which the image to be processed is located before the image to be processed, and it may be understood that, in some cases, here
  • the sample image may also be the image to be processed described above;
  • the terminal performs threshold filtering on the sample image according to the pixel value of the sample image and the pixel value of the screen image, and extracts a seed foreground pixel point and a seed background pixel point from the sample image; in an application example After calculating a distance between each pixel point of the sample image and a pixel point at a corresponding position of the screen image, when the distance is greater than the first distance threshold, determining the corresponding pixel point as a seed foreground a pixel point, when the distance is less than a second distance threshold, determining the corresponding pixel point as a seed background pixel point, where the first distance threshold is greater than a second distance threshold;
  • the terminal establishes the pixel point probability model according to the extracted seed foreground pixel point and the seed background pixel point.
  • the terminal may further extract a video frame image from the video stream after spacing the sample image by a predetermined frame distance, and use the video frame image as a new sample image. And performing threshold filtering on the new sample image according to the pixel value of the new sample image and the pixel value of the screen image, and extracting a seed foreground pixel point and a seed background pixel point from the new sample image.
  • the pixel point probability model is then updated based on the seed foreground pixel points and the seed background pixel points extracted from the new sample image. Thereby to improve the accuracy of the established pixel point probability model.
  • the terminal may perform the method in any possible manner, for example:
  • the terminal converts the pixel value of the sample image into a YCrCb color space, and obtains a Cr component and a Cb component of each pixel of the sample image;
  • the terminal converts the pixel value of the screen image into a YCrCb color space, and obtains a Cr component and a Cb component of each pixel point of the screen image;
  • the terminal calculates a corresponding position of each pixel point of the sample image and the screen image according to a Cr component and a Cb component of each pixel of the sample image, and a Cr component and a Cb component of each pixel of the screen image. The distance of the pixel points.
  • the manner in an application example may include:
  • the terminal clusters the extracted seed foreground pixel and the seed background pixel to obtain each foreground component sample and each background component sample; when clustering specifically, the terminal may perform clustering by using any possible clustering manner;
  • the terminal calculates the mean and covariance of each foreground component sample, and the mean and covariance of each background component sample;
  • the terminal determines a probability density function of each foreground component and a probability density function of each background component according to the mean and covariance of each foreground component sample, and the mean and covariance of each background component sample;
  • the terminal generates the pixel point probability model according to a probability density function of each foreground component and a probability density function of each background component.
  • the terminal may determine that the pixel point is a foreground pixel point when the foreground pixel probability of the pixel is greater than the foreground probability threshold; and when the background pixel probability of the pixel is greater than the background probability threshold, It is determined that the pixel is a background pixel; and the pixel in other cases is determined to be a mixed pixel.
  • FIG. 5 shows a schematic flowchart of the overall process of image processing in a specific example
  • FIG. 6 correspondingly shows a schematic diagram of a method of image processing in a specific example.
  • the background image is replaced with a video frame image in the video stream.
  • the terminal when the background image is replaced with the video frame image in the video stream, the terminal first acquires the first frame image of the video stream as a sample image, and acquires the screen image.
  • the first frame image herein may be the first frame image of the entire video stream, or may be when the image background of the replacement video stream needs to be replaced (for example, an instruction to replace the background of the image is received during the video stream playing).
  • the first frame image that is, the first frame image as the sample image here is a relative concept, and does not refer to the first frame image in the video frame sequence of the video stream.
  • the screen image here may be an environment image of the environment in which the video stream is located, and the like. Taking video live broadcast as an example, the screen image here may be an image of the environment in which the live broadcast is broadcast during the live broadcast of the video, and the image of the environment here may be an image formed by a solid color screen.
  • the terminal performs threshold filtering on the sample image according to the proximity of the sample image to the color of the screen image, and extracts the seed foreground pixel point and the curtain pixel point from the sample image.
  • the pixel value of the obtained sample image and the pixel value of the screen image may be combined to perform threshold filtering on the sample image, and the seed foreground pixel point and the seed background pixel point are extracted from the sample image.
  • the degree of proximity can be measured in conjunction with the Cr and Cb components of the YCrCb color space. It converts the pixel value of the sample image into the YCrCb color space, obtains the Cr component and the Cb component of each pixel of the sample image, and converts the pixel value of the screen image into the YCrCb color space to obtain the Cr component of each pixel of the screen image. And the Cb component; then, according to the Cr component and the Cb component of each pixel of the sample image, the Cr component and the Cb component of each pixel of the screen image, the pixels at the corresponding positions of the pixel image and the screen image are calculated. The distance of the point.
  • r denote the pixel point in the sample image
  • g denote the pixel point in the screen image
  • d(r, g) denote the distance between the pixel point r and the pixel point g in the coordinate system of Cr and Cb as the axis
  • the distance can be For Euclidean distance
  • Yr is used to indicate the pixel point category to which the pixel r belongs
  • Yr is used to indicate the pixel point category to which the pixel r belongs
  • t 1 is the first distance threshold
  • t 2 is the second distance threshold
  • t 1 is greater than t 2 .
  • the seed foreground pixel and the seed background pixel are thus extracted from the sample image based on the above manner.
  • the terminal clusters the extracted seed foreground pixel points and the seed background pixel points to obtain each foreground component sample and each background component sample.
  • clustering can be performed by any possible clustering method, for example, k-means unsupervised clustering algorithm and EM algorithm for clustering;
  • the mean and covariance of each foreground component sample, the mean and covariance of each background component sample are then calculated.
  • the manner in which the mean and the covariance are specifically calculated may be performed in any possible manner, for example, using the maximum likelihood estimation algorithm to estimate the mean and covariance of the sample models of each sample.
  • the terminal determines a probability density function of each foreground component and a probability density function of each background component according to the mean and covariance of each foreground component sample, and the mean and covariance of each background component sample.
  • the probability density function can be as follows:
  • is the mean of the samples, respectively, and ⁇ is the sample covariance matrix.
  • the terminal generates the pixel point probability model according to a probability density function of each foreground component and a probability density function of each background component.
  • the pixel point probability model determined based on the above probability density function is as follows:
  • x r represents the pixel value of the pixel r
  • y r represents the category of the pixel r.
  • the terminal may further extract a video frame image, such as a g-th frame image, from the video stream after the predetermined frame distance of the sample image is spaced, and use the video frame image as a new sample image, and repeat the foregoing process, and the pixel probability
  • the model is updated to improve the accuracy of the established pixel point probability model.
  • the pixel point probability model in this example can be referred to as a GMM model.
  • the foreground image of the image to be processed can be extracted based on the pixel point probability model, and the background image can be replaced accordingly.
  • the terminal After acquiring the image to be processed, the terminal determines, according to the image to be processed, the image of the screen, and the pixel point probability model, a foreground pixel probability that each pixel in the image to be processed belongs to the foreground pixel, and a background pixel belonging to the background pixel. Probability.
  • the terminal can determine the pixel type of each pixel according to the foreground pixel probability and the background pixel probability of each pixel of the image to be processed, that is, whether each pixel is a foreground pixel, a background pixel, or a mixed pixel.
  • the type of pixel can be determined in conjunction with the principle of the following formula.
  • p(y r 0
  • x r ) represents the probability that the pixel r belongs to the foreground pixel
  • p(y r 1
  • x r ) represents the probability that the pixel r belongs to the background pixel.
  • the terminal may determine a fusion weight value of each mixed pixel point according to each mixed pixel point, a foreground pixel probability of each mixed pixel point, and the screen image, and determine, according to a fusion weight value of each mixed pixel point, each mixed pixel point.
  • the foreground component value may be determined by the terminal.
  • the fusion weight and foreground component values of the mixed pixel points can be determined in conjunction with the principle of the following formula.
  • ⁇ r represents the fusion weight value
  • c r represents the foreground component value
  • m represents the pixel value of the corresponding pixel point of the screen image
  • k is based on the foreground component probability value of the pixel r obtained in the above-mentioned pixel point probability model, Indicates the average pixel value of each mixed pixel.
  • the process of updating the pixel point probability model and the process of extracting the foreground image to be processed may be performed simultaneously, so that the updated pixel point probability model may be applied to subsequent The foreground image of the video frame image of the video stream and the process of replacing the background image.
  • the terminal uses the pixel value of the foreground pixel as the pixel value of the pixel at the position corresponding to the foreground pixel in the background image after replacing the background pixel; and the pixel value of the pixel at the position corresponding to the background pixel in the new background image. As the pixel value of the pixel at the position corresponding to the background pixel in the image after replacing the background.
  • the terminal determines the fused pixel value of the mixed pixel point according to the fusion weight value and the foreground component value of the mixed pixel point and the pixel value of the new background pixel, and uses the fused pixel value as the location corresponding to the mixed pixel point in the image after replacing the background.
  • the pixel value of the pixel is the fused pixel value of the pixel.
  • the fused pixel value determined in one specific example can be as follows:
  • BG r represents the pixel value of the new background image and result r represents the fused pixel value.
  • the fusion weight model and the foreground component extraction are performed on the mixed pixels, so that the finally obtained background replacement image is more real and natural, the technical effect is greatly improved, and the edge processing is not solved. Clean problems and reduced computational complexity to meet real-time requirements.
  • the seed foreground pixel point and the seed background pixel point are extracted based on the screen pixel, which reduces the number of user interactions and improves the efficiency.
  • the user replaces the background image of the live video image during the live broadcast process.
  • the terminal 101 is a mobile phone with a camera as an example for acquiring an image to be processed.
  • the user arranges the curtain as a screen image in the live broadcast room, and broadcasts the video in front of the screen, and then uses the software installed on the mobile phone to map the live screen and replace the background image to create a special effect video.
  • the software interface may include a button for selecting a background image, a video recording start button, a button for extracting a foreground image, and a button for replacing the background image.
  • the user can select a background scene that he wants by clicking the button of the background image on the software interface as the background of the replaced image.
  • a control command is given to the camera hair to control the camera to start working, and the video image is started to be taken; the captured video image is the image to be processed, as shown in FIG. 2-1, which is an embodiment.
  • the pending image obtained in .
  • the effect of the user's live video is that the user records the live broadcast in front of the background image selected by the user, thereby realizing that the live video with the image desired by the user can be generated indoors.
  • the probability that each pixel in the image to be processed belongs to the foreground pixel and the probability of belonging to the background pixel is determined based on the screen image when extracting the foreground image, and the pixel point is divided into the foreground pixel according to the The background pixel and the mixed pixel point, and the fusion weight value and the foreground component value of the mixed pixel point are determined, so that when the image background is replaced on the basis of the image, the blending pixel point may be based on the blending weight value and the foreground component of the mixed pixel point.
  • the value is used to fuse the mixed pixel with the new background image, so that the mixed pixels of the foreground and the background fusion are effectively distinguished, and the segmentation result of the foreground image can be stably extracted, so that the background obtained by replacing the background of the image is replaced.
  • the image does not have an unnatural edge, so the resulting image is of high quality and the background is realistic.
  • Fig. 7 is a block diagram showing the structure of an apparatus for extracting a foreground image in an embodiment.
  • the device in this embodiment represents a partial functional module of the terminal 101.
  • the apparatus 70 for extracting a foreground image in this embodiment includes:
  • the probability calculation module 701 is configured to determine, according to the predetermined screen image, a foreground pixel probability that each pixel point in the image to be processed belongs to the foreground pixel point, and a background pixel probability belonging to the background pixel point;
  • a pixel point type determining module 702 configured to determine, according to a foreground pixel probability and a background pixel probability of each of the pixel points, a pixel point type of each of the pixel points, where the pixel point type includes a foreground pixel point, a background pixel point, and a mixture pixel;
  • the hybrid pixel fusion information determining module 703 is configured to determine, according to each of the mixed pixel points, the foreground pixel probability of each of the mixed pixel points, and the screen image, a fusion weight of each of the mixed pixel points, and according to The blending weights of the respective blended pixels determine the foreground component values for each of the blended pixel points.
  • the fusion weight value and the foreground component value of the mixed pixel points are determined, so that when the image background is replaced on this basis, the mixed pixel points can be based on the mixing
  • the fusion weight and the foreground component value of the pixel merge the mixed pixel with the new background image, thereby effectively distinguishing the mixed pixels of the foreground and the background fusion, and obtaining a stable extraction result of the foreground image, so that the replacement is performed.
  • the image obtained by replacing the background when the background of the image is obtained does not have an unnatural contour edge, and the obtained image quality is high.
  • the apparatus for extracting a foreground image of the embodiment may further include a pixel point probability model establishing module 700, and the pixel point probability model establishing module 700 is configured to establish a pixel point probability model.
  • the probability calculation module 701 is configured to determine, according to the to-be-processed image, the screen image, and the pixel point probability model, a foreground pixel probability that each pixel in the image to be processed belongs to a foreground pixel, and belongs to a background pixel. The background pixel probability of the point.
  • FIG. 8 is a schematic structural diagram of a pixel point probability model establishing module 700 in a specific example. As shown in FIG. 8, the pixel point probability model establishing module 700 includes:
  • a first image obtaining module 7001 configured to acquire a sample image and the screen image, where the sample image includes an image of a video frame in front of the image to be processed in a video stream in which the image to be processed is located;
  • the seed pixel extraction module 7002 is configured to perform threshold filtering on the sample image according to a pixel value of the sample image and a pixel value of the screen image, and extract a seed foreground pixel and a seed background pixel from the sample image. point;
  • the model establishing module 7003 is configured to establish the pixel point probability model according to the extracted seed foreground pixel point and the seed background pixel point.
  • the seed pixel extraction module 7002 may include:
  • the distance calculation module 70021 is configured to calculate a distance between each pixel point of the sample image and a pixel point at a corresponding position of the screen image;
  • the threshold comparison determining module 70022 is configured to determine, when the distance is greater than the first distance threshold, the corresponding pixel point as a seed foreground pixel point, and when the distance is less than the second distance threshold, the corresponding pixel is The point is determined to be a seed background pixel, the first distance threshold being greater than the second distance threshold.
  • the distance calculation module 70021 may perform the calculation of the distance between each pixel point of the sample image and the pixel point at the corresponding coordinate of the screen image, for example, in combination with the YCrCb color space. Taking the distance calculated by combining the YCrCb color space as an example, the distance calculation module 70021 may include:
  • a first color space conversion module configured to convert pixel values of the sample image into a YCrCb color space, to obtain a Cr component and a Cb component of each pixel of the sample image;
  • a second color space conversion module configured to convert pixel values of the screen image into a YCrCb color space, to obtain a Cr component and a Cb component of each pixel of the screen image;
  • a calculation module configured to calculate, according to a Cr component and a Cb component of each pixel of the sample image, a Cr component and a Cb component of each pixel of the screen image, each pixel point of the sample image and the screen image The distance of the pixel at the corresponding position.
  • model building module 7003 may include:
  • the clustering module is configured to cluster the extracted seed foreground pixel points and the seed background pixel points to obtain each foreground component sample and each background component sample; when clustering, the clustering may be performed by any possible clustering method;
  • Mean covariance calculation module which is used for calculating the mean and covariance of each foreground component sample, and the mean and covariance of each background component sample;
  • a probability density determining module configured to determine a probability density function of each foreground component and a probability density function of each background component according to mean and covariance of each foreground component sample, mean and covariance of each background component sample;
  • a model generating module configured to generate the pixel point probability model according to a probability density function of each foreground component and a probability density function of each background component.
  • the pixel point probability model establishing module 700 may further include:
  • a model update module 7004 configured to extract a video frame image from the video stream after spacing the sample image by a predetermined frame distance, and use the video frame image as a new sample image; according to the pixel value of the new sample image a pixel value of the screen image, performing threshold filtering on the new sample image, extracting a seed foreground pixel point and a seed background pixel point from the new sample image; and extracting a seed foreground according to the new sample image
  • the pixel point, seed background pixel points update the pixel point probability model.
  • the pixel point type determining module 702 is configured to determine that the pixel point is a foreground pixel point when the foreground pixel probability of the pixel point is greater than the foreground probability threshold; and when the background pixel probability of the pixel point is greater than the background probability threshold Determining that the pixel is a background pixel; otherwise, determining that the pixel is a mixed pixel.
  • FIG. 9 is a schematic structural diagram of an apparatus for replacing an image background in an embodiment. As shown in FIG. 9, the apparatus for replacing an image background in the embodiment includes:
  • a second image acquisition module 901 configured to acquire a to-be-processed image and a new background image
  • the foreground pixel fusion module 902 is configured to: the pixel value of the foreground pixel determined by the device for extracting the foreground image as the pixel value of the pixel at the position corresponding to the foreground pixel in the background image after the background is replaced;
  • a background pixel fusion module 903 configured to: in the new background image, a pixel value of a pixel point corresponding to a background pixel point determined by the device for extracting the foreground image, in the image after the replacement background The pixel value of the pixel at the corresponding position of the background pixel;
  • a hybrid pixel fusion module 904 configured to determine a fused pixel value of the mixed pixel point according to a fusion weight value and a foreground component value of the mixed pixel point determined by the device for extracting the foreground image, and a pixel value of the new background pixel, And using the fused pixel value as a pixel value of a pixel at a position corresponding to the mixed pixel point in the image after the replacement background.
  • the mixed pixels of the foreground and the background fusion are effectively distinguished, and the segmentation result of the foreground image can be stably obtained, so that the background image obtained by replacing the background of the image is finally obtained. There is no unnatural contour edge and the resulting image quality is high.
  • a computer apparatus comprising a memory, a processor, and a computer program stored on the memory and operative on the processor, the processor performing the following steps when executing the computer program:
  • the terminal acquires a to-be-processed image, a new background image, and a screen image;
  • a pixel point type of each of the pixel points according to a foreground pixel probability and a background pixel probability of each of the pixel points, where the pixel point type includes a foreground pixel point, a background pixel point, and a mixed pixel point;
  • the terminal determines, according to each of the mixed pixel points, the foreground pixel probability of each of the mixed pixel points, and the screen image, a fusion weight of each of the mixed pixel points, and according to the fusion right of each of the mixed pixel points a value determining a foreground component value of each of the mixed pixel points;
  • the terminal uses the pixel value of the foreground pixel as the pixel value of the pixel at the position corresponding to the foreground pixel in the background image after the background replacement;
  • the terminal uses the pixel value of the pixel at the position corresponding to the background pixel in the new background image as the pixel value of the pixel at the position corresponding to the background pixel in the image after the replacement background;
  • the processor further implements the following steps when executing the computer program:
  • the method for determining the pixel point probability model includes:
  • the terminal acquires a sample image and the screen image, where the sample image includes an image of a video frame in front of the image to be processed in the video stream in which the image to be processed is located;
  • the terminal performs threshold filtering on the sample image according to the pixel value of the sample image and the pixel value of the screen image, and extracts a seed foreground pixel point and a seed background pixel point from the sample image;
  • the terminal establishes the pixel point probability model according to the extracted seed foreground pixel point and the seed background pixel point.
  • the processor further implements the following steps when executing the computer program:
  • the terminal performs threshold filtering on the sample image according to the pixel value of the sample image and the pixel value of the screen image, and extracting the seed foreground pixel point and the seed background pixel point from the sample image includes:
  • the terminal calculates a distance between each pixel point of the sample image and a pixel point at a corresponding position of the screen image
  • the terminal determines the corresponding pixel point as a seed foreground pixel point, and when the distance is less than the second distance threshold, the terminal determines the corresponding pixel point as a seed background pixel. Point, the first distance threshold is greater than the second distance threshold.
  • the processor further implements the following steps when executing the computer program:
  • the manner in which the terminal calculates the distance between each pixel point of the sample image and the pixel point at the corresponding coordinate of the screen image includes:
  • the terminal converts the pixel value of the sample image into a YCrCb color space, and obtains a Cr component and a Cb component of each pixel of the sample image;
  • the terminal converts the pixel value of the screen image into a YCrCb color space, and obtains a Cr component and a Cb component of each pixel point of the screen image;
  • the terminal calculates a corresponding position of each pixel point of the sample image and the screen image according to a Cr component and a Cb component of each pixel of the sample image, and a Cr component and a Cb component of each pixel of the screen image. The distance of the pixel points.
  • the processor further implements the following steps when executing the computer program:
  • the terminal After spacing the sample image by a predetermined frame distance, the terminal extracts a video frame image from the video stream, and uses the video frame image as a new sample image;
  • the terminal performs threshold filtering on the new sample image according to the pixel value of the new sample image and the pixel value of the screen image, and extracts a seed foreground pixel point and a seed background pixel point from the new sample image;
  • the terminal updates the pixel point probability model according to the seed foreground pixel point and the seed background pixel point extracted from the new sample image.
  • the processor further implements the following steps when executing the computer program:
  • the terminal determines that the pixel is the foreground pixel
  • the terminal determines that the pixel is a background pixel
  • the terminal determines that the pixel is a mixed pixel point.
  • a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the following steps:
  • the terminal acquires a to-be-processed image, a new background image, and a screen image;
  • a pixel point type of each of the pixel points according to a foreground pixel probability and a background pixel probability of each of the pixel points, where the pixel point type includes a foreground pixel point, a background pixel point, and a mixed pixel point;
  • the terminal determines, according to each of the mixed pixel points, the foreground pixel probability of each of the mixed pixel points, and the screen image, a fusion weight of each of the mixed pixel points, and according to the fusion right of each of the mixed pixel points a value determining a foreground component value of each of the mixed pixel points;
  • the terminal uses the pixel value of the foreground pixel as the pixel value of the pixel at the position corresponding to the foreground pixel in the background image after the background replacement;
  • the terminal uses the pixel value of the pixel at the position corresponding to the background pixel in the new background image as the pixel value of the pixel at the position corresponding to the background pixel in the image after the replacement background;
  • the computer program is executed by the processor to also implement the following steps:
  • the method for determining the pixel point probability model includes:
  • the terminal acquires a sample image and the screen image, where the sample image includes an image of a video frame in front of the image to be processed in the video stream in which the image to be processed is located;
  • the terminal performs threshold filtering on the sample image according to the pixel value of the sample image and the pixel value of the screen image, and extracts a seed foreground pixel point and a seed background pixel point from the sample image;
  • the terminal establishes the pixel point probability model according to the extracted seed foreground pixel point and the seed background pixel point.
  • the computer program is executed by the processor to also implement the following steps:
  • the terminal performs threshold filtering on the sample image according to the pixel value of the sample image and the pixel value of the screen image, and extracting the seed foreground pixel point and the seed background pixel point from the sample image includes:
  • the terminal calculates a distance between each pixel point of the sample image and a pixel point at a corresponding position of the screen image
  • the terminal determines the corresponding pixel point as a seed foreground pixel point, and when the distance is less than the second distance threshold, the terminal determines the corresponding pixel point as a seed background pixel. Point, the first distance threshold is greater than the second distance threshold.
  • the computer program is executed by the processor to also implement the following steps:
  • the manner in which the terminal calculates the distance between each pixel point of the sample image and the pixel point at the corresponding coordinate of the screen image includes:
  • the terminal converts the pixel value of the sample image into a YCrCb color space, and obtains a Cr component and a Cb component of each pixel of the sample image;
  • the terminal converts the pixel value of the screen image into a YCrCb color space, and obtains a Cr component and a Cb component of each pixel point of the screen image;
  • the terminal calculates a corresponding position of each pixel point of the sample image and the screen image according to a Cr component and a Cb component of each pixel of the sample image, and a Cr component and a Cb component of each pixel of the screen image. The distance of the pixel points.
  • the computer program is executed by the processor to also implement the following steps:
  • the terminal After spacing the sample image by a predetermined frame distance, the terminal extracts a video frame image from the video stream, and uses the video frame image as a new sample image;
  • the terminal performs threshold filtering on the new sample image according to the pixel value of the new sample image and the pixel value of the screen image, and extracts a seed foreground pixel point and a seed background pixel point from the new sample image;
  • the terminal updates the pixel point probability model according to the seed foreground pixel point and the seed background pixel point extracted from the new sample image.
  • the computer program is executed by the processor to also implement the following steps:
  • the terminal determines that the pixel point is a foreground pixel point
  • the terminal determines that the pixel is a background pixel
  • the terminal determines that the pixel is a mixed pixel point.
  • Non-volatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in a variety of formats, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization chain.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • Synchlink DRAM SLDRAM
  • Memory Bus Radbus
  • RDRAM Direct RAM
  • DRAM Direct Memory Bus Dynamic RAM
  • RDRAM Memory Bus Dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

一种图像处理方法、计算机设备及存储介质,一个实施例的图像处理方法包括:终端获取待处理图像、新背景图像以及幕布图像;终端根据所述待处理图像和所述幕布图像,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率;终端根据各所述像素点的前景像素概率、背景像素概率,确定各所述像素点的像素点类型,所述像素点类型包括前景像素点、背景像素点以及混合像素点;终端根据各所述混合像素点、各所述混合像素点的所述前景像素概率、所述幕布图像,确定各所述混合像素点的融合权值,并根据各混合像素点的融合权值确定各混合像素点的前景分量值。终端将所述前景像素点的像素值,作为替换背景后图像中、与所述前景像素点对应位置处像素点的像素值;将所述新背景图像中、与所述背景像素点对应位置处像素点的像素值,作为所述替换背景后图像中、与所述背景像素点对应位置处像素点的像素值;根据所述混合像素点的融合权值和前景分量值、所述新背景像素的像素值,确定所述混合像素点的融合像素值,并将所述融合像素值,作为所述替换背景后图像中、与所述混合像素点对应位置处像素点的像素值。本实施例可以得到稳定的提取前景图像的分割结果,使得替换图像背景时最终得到的替换了背景的图像质量高。

Description

图像处理方法、计算机存储介质及计算机设备
本申请要求于2017年02月06日提交中国专利局,申请号为201710065799.6,发明名称为“提取前景图像、替换图像背景的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像处理技术,特别是涉及一种图像处理方法、计算机可读存储介质和计算机设备。
背景技术
随着视频图像处理技术的发展,人们对替换图像背景的技术的需求也日益广泛,例如P图、直播、视频拍摄的抠图以制作出特效视频等,通常的替换图像背景的方式,是将一段在纯色幕布前拍摄的视频在移动端进行实时处理,将视频中的前景目标提取并融合到新的背景中,从而可以做到足不出户,仅准备一块纯色幕布,就可以生成各种高质量的多样逼真背景下的视频内容。
目前的替换图像背景的技术,通常需要结合背景建模、键值分割、图像融合技术进行。具体替换图像背景时,前景图像的提取是进行图像背景替换过程中的一个重要步骤。目前在提取前景图像时,通常是对于待替换背景的图片(通常也称为待抠取图片),通过交互界面,由用户通过点击等方式提供一些前景像素及背景像素,称为前景种子像素及背景种子像素,然后用这些种子像素建立混高斯(GMM)概率模型,设计出能评估分割结果的能量函数(损失函数),然后通过数学工具求解能量函数,从而对待替换背景的图片进行前景、背景的分割。
在目前的这种前景图像的提取方式中,是将图像的像素点简单的区分为前景像素和背景像素,从而容易在前景边缘处留下背景颜色带,使得最终融合得到的新背景的图片边缘轮廓不自然,影响替换了图像背景的图像的质量。
发明内容
基于此,本实施例的目的在于提供一种图像处理方法、一种图像处理的装置、一种计算机设备以及一种计算机可读存储介质,其分割结果稳定,最终得到的替换了背景的图像的质量高。
为达到上述目的,本实施例采用以下技术方案:
一种图像处理方法,包括步骤:
终端获取待处理图像、新背景图像以及幕布图像;
终端根据所述待处理图像和所述幕布图像,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率;
终端根据各所述像素点的前景像素概率、背景像素概率,确定各所述像素点的像素点类型,所述像素点类型包括前景像素点、背景像素点以及混合像素点;
终端根据各所述混合像素点、各所述混合像素点的所述前景像素概率、所述幕布图像,确定各所述混合像素点的融合权值,并根据各所述混合像素点的融合权值确定各所述混合像素点的前景分量值;
终端将所述前景像素点的像素值,作为替换背景后图像中、与所述前景像素点对应位置处像素点的像素值;
终端将所述新背景图像中、与所述背景像素点对应位置处像素点的像素值,作为所述替换背景后图像中、与所述背景像素点对应位置处像素点的像素值;
终端根据所述混合像素点的融合权值和前景分量值、所述新背景像素的像素值,确定所述混合像素点的融合像素值,并将所述融合像素值,作为所述替换背景后图像中、与所述混合像素点对应位置处像素点的像素值。
一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:
终端获取待处理图像、新背景图像以及幕布图像;
终端根据所述待处理图像和所述幕布图像,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率;
终端根据各所述像素点的前景像素概率、背景像素概率,确定各所述像素点的像素点类型,所述像素点类型包括前景像素点、背景像素点以及混合像素点;
终端根据各所述混合像素点、各所述混合像素点的所述前景像素概率、所述幕布图像,确定各所述混合像素点的融合权值,并根据各所述混合像素点的融合权值确定各所述混合像素点的前景分量值;
终端将所述前景像素点的像素值,作为替换背景后图像中、与所述前景像素点对应位置处像素点的像素值;
终端将所述新背景图像中、与所述背景像素点对应位置处像素点的像素值,作为所述替换背景后图像中、与所述背景像素点对应位置处像素点的像素值;
终端根据所述混合像素点的融合权值和前景分量值、所述新背景像素的像素值,确定所述混合像素点的融合像素值,并将所述融合像素值,作为所述替换背景后图像中、与所述混合像素点对应位置处像素点的像素值。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:
终端获取待处理图像、新背景图像以及幕布图像;
终端根据所述待处理图像和所述幕布图像,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率;
终端根据各所述像素点的前景像素概率、背景像素概率,确定各所述像素点的像素点类型,所述像素点类型包括前景像素点、背景像素点以及混合像素点;
终端根据各所述混合像素点、各所述混合像素点的所述前景像素概率、所述幕布图像,确定各所述混合像素点的融合权值,并根据各所述混合像素点的融合权值确定各所述混合像素点的前景分量值;
终端将所述前景像素点的像素值,作为替换背景后图像中、与所述前景像素点对应位置处像素点的像素值;
终端将所述新背景图像中、与所述背景像素点对应位置处像素点的像素值,作为所述替换背景后图像中、与所述背景像素点对应位置处像素点的像素值;
终端根据所述混合像素点的融合权值和前景分量值、所述新背景像素的像素值,确定所述混合像素点的融合像素值,并将所述融合像素值,作为所述替换背景后图像中、与所述混合像素点对应位置处像素点的像素值。
基于如上所述的实施例中的方案,其是提取前景图像时,是基于幕布图像,确定出待处理图像中的各像素点属于前景像素点的概率、属于背景像素点的概率,并据此将像素点区分为前景像素点、背景像素点和混合像素点,并确定出混合像素点的融合权值和前景分量值,从而在此基础上替换图像背景时,针对混合像素点,可以基于混合像素点的融合权值和前景分量值,将混合像素点与新背景图像进行融合,从而将前景与背景融合处的混合像素进行了有效区分,可以得到稳定的提取前景图像的分割结果,使得替换图像背景时最终得到的替换了背景的图像不会存在轮廓边缘不自然的情况,获得的图像质量高。
附图说明
图1是一个实施例中的本申请方案的应用环境的示意图;
图2是一个具体应用示例中的本实施例方案的应用场景的示意图;
图3是一个实施例中的终端的组成结构示意图;
图4是一个实施例中的图像处理方法的流程示意图;
图5是一个具体示例中图像处理的整体过程的流程示意图;
图6是一个具体示例中的图像处理方法的原理示意图;
图7是一个实施例中的提取前景图像的装置的结构示意图;
图8是一个具体示例中的像素点概率模型建立模块的结构示意图;
图9是一个实施例中的替换图像背景的装置的结构示意图。
具体实施方式
为使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步的详细说明。应当理解,此处所描述的具体实施方式仅仅用以解释本申请,并不限定本申请的保护范围。
图1示出了本申请一个实施例中的工作环境示意图,如图1所示,其工作环境涉及终端101,在某些情况下,还可能涉及服务器102。终端101可以对其自身存储的或者从外部获取的图像(如图2所示的2-1)提取其前景图像(如图2所示的2-2),并可以在提取前景图像的基础上进行图像背景的替换,从而得到替换背景后的图像(如图2所示的2-3)。终端101提取的前景图像或者替换背景后的图像,可以存储在终端101本地进行查看和播放,也可以经由网络传输至其他的网络终端,或者通过网络传输至服务器102后,经由服务器102再传输至其他的网络终端。
在一个应用示例中,该终端101可以是携带摄像头的终端,也可以是外接有摄像设备1010的终端,从而终端101可以提取通过摄像头拍摄得到的帧图像的前景图像,并在此基础上进行图像背景的替换,从而在视频直播、视频聊天等各种应用中,实现各类图像背景的替换,进而实现各类背景下的视频直播或者视频聊天。本实施例涉及的是终端101对图像提取其前景图像并据此进行图像背景替换的方案。
终端101在一个实施例中的结构示意图如图3所示。该终端101包括通过***总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,终端101的处理器用于提供计算和控制能力。终端101的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作***和计算机程序。终端101的网络接口用于与网络终端其他终端或者服务器102连接和通信。该内存储器为非易失性存储介质中的操作***和计算机程序的运行提供环境。该计算机程序被处理器执行时实现一种图像处理方法。终端101可以是任何一种能 够实现智能输入输出的设备,例如移动终端,比如手机、平板电脑、个人计算机等;也可以是其它具有上述结构的设备。终端101的显示屏可以是液晶显示屏或者电子墨水显示屏,终端101的输入装置可以是显示屏上覆盖的触摸层,也可以是终端外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。
图4中示出了一个实施例中的图像处理方法的流程示意图。该实施例中是以应用在终端101为例进行说明。如图4所示,该实施例中的图像处理方法包括:
步骤S401:终端获取待处理图像、新背景图像以及幕布图像;
步骤S402:终端根据所述待处理图像和所述幕布图像,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率;
步骤S403:终端根据各所述像素点的前景像素概率、背景像素概率,确定各所述像素点的像素点类型,所述像素点类型包括前景像素点、背景像素点以及混合像素点;
步骤S404:终端根据各所述混合像素点、各所述混合像素点的所述前景像素概率、所述幕布图像,确定各所述混合像素点的融合权值,并根据各所述混合像素点的融合权值确定各所述混合像素点的前景分量值;
步骤S405:终端将所述前景像素点的像素值,作为替换背景后图像中、与所述前景像素点对应位置处像素点的像素值;
步骤S406:终端将所述新背景图像中、与所述背景像素点对应位置处像素点的像素值,作为所述替换背景后图像中、与所述背景像素点对应位置处像素点的像素值;
步骤S407:终端根据所述混合像素点的融合权值和前景分量值、所述新背景像素的像素值,确定所述混合像素点的融合像素值,并将所述融合像素值,作为所述替换背景后图像中、与所述混合像素点对应位置处像素点的像素值。
基于如上所述的实施例中的方案,其是提取前景图像时,是基于幕布图像,确定出待处理图像中的各像素点属于前景像素点的概率、属于背景像素点的概率,并据此将像素点区分为前景像素点、背景像素点和混合像素点,并确定出混合像素点的融合权值和前景分量值,从而在此基础上替换图像背景时,针对混合像素点,可以基于混合像素点的融合权值和前景分量值,将混合像素点与新背景图像进行融合,从而将前景与背景融合处的混合像素进行了有效区分,可以得到稳定的提取前景图像的分割结果,使得替换图像背景时最终得到的替换了背景的图像不会存在轮廓边缘不自然的情况,获得的图像质量高。
可以理解的,步骤S405、步骤S406、步骤S407中的处理过程可以不分先后顺序同时进行。
据此,基于本实施例中的方案,其将前景与背景融合处的混合像素进行了有效区分,可以得到稳定的提取前景图像的分割结果,使得替换图像背景时最终得到的替换了背景的图像不会存在轮廓边缘不自然的情况,获得的图像质量高。
其中,在上述步骤S402中,可以结合像素点概率模型进行,即终端可以根据所述待处理图像、所述幕布图像以及像素点概率模型,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率。
在一个具体示例中,可以采用下述方式确定该像素点概率模型:
终端获取样本图像和所述幕布图像,其中,这里的样本图像包括所述待处理图像所在视频流中、在所述待处理图像之前的视频帧的图像,可以理解,在某些情况下,这里的样本图像也可以是上述待处理图像;
终端根据所述样本图像的像素值与所述幕布图像的像素值,对所述样本图像进行阈值过滤,从所述样本图像中提取出种子前景像素点和种子背景像素点;在一个应用示例中,可以是计算所述样本图像的各像素点与所述幕布 图像的对应位置处的像素点的距离后,在所述距离大于第一距离阈值时,将对应的所述像素点确定为种子前景像素点,在所述距离小于第二距离阈值时,将对应的所述像素点确定为种子背景像素点,所述第一距离阈值大于第二距离阈值;
终端根据提取的种子前景像素点、种子背景像素点,建立所述像素点概率模型。
在一个应用示例中,终端还可以在间隔所述样本图像预定帧距后,从所述视频流中提取视频帧图像,并将该视频帧图像作为新样本图像。并根据所述新样本图像的像素值与所述幕布图像的像素值,对所述新样本图像进行阈值过滤,从所述新样本图像中提取出种子前景像素点和种子背景像素点。然后根据从所述新样本图像中提取的种子前景像素点、种子背景像素点对所述像素点概率模型进行更新。从而以提高建立的像素点概率模型的准确性。
上述计算所述样本图像的各像素点与所述幕布图像的对应坐标处的像素点的距离时,终端可以采用任何可能的方式进行,例如:
终端将所述样本图像的像素值转换到YCrCb颜色空间,获得所述样本图像的各像素点的Cr分量、Cb分量;
终端将所述幕布图像的像素值转换到YCrCb颜色空间,获得所述幕布图像的各像素点的Cr分量、Cb分量;
终端根据所述样本图像的各像素点的Cr分量、Cb分量,所述幕布图像的各像素点的Cr分量、Cb分量,计算所述样本图像的各像素点与所述幕布图像的对应位置处的像素点的距离。
在终端根据提取的种子前景像素点、种子背景像素点,建立所述像素点概率模型时,一个应用示例中的方式可以包括:
终端对提取的种子前景像素点、种子背景像素点进行聚类,获得各前景分量样本、各背景分量样本;具体聚类时,终端可以采用任何可能的聚类方式进行聚类;
终端计算各前景分量样本的均值与协方差、各背景分量样本的均值与协 方差;
终端根据各前景分量样本的均值与协方差、各背景分量样本的均值与协方差,确定各前景分量的概率密度函数、各背景分量的概率密度函数;
终端根据各前景分量的概率密度函数、各背景分量的概率密度函数生成所述像素点概率模型。
在一个示例中,在上述步骤S403中,终端可以是在像素点的前景像素概率大于前景概率阈值时,判定该像素点为前景像素点;并在像素点的背景像素概率大于背景概率阈值时,判定该像素点为背景像素点;而将其他情况下的像素点则判定为是混合像素点。
基于上述各实施例的方案,图5示出了一个具体示例中的图像处理的整体过程的流程示意图,图6相应示出了是一个具体示例中的图像处理的方法的原理示意图。在图5、图6所示的示例中,是以对视频流中的视频帧图像替换背景图像为例进行说明。
如图5、图6所示,在对视频流中的视频帧图像替换背景图像时,首先终端获取视频流的第1帧图像作为样本图像,并获取幕布图像。可以理解,这里的第1帧图像可以是整个视频流的第1帧图像,也可以是在需要进行替换视频流的图像背景时(例如在视频流播放过程中接收到了替换图像背景的指令)的第1帧图像,即这里作为样本图像的第1帧图像是一个相对的概念,并不是指视频流的视频帧顺序中的第1帧图像。此外,可以理解的是,这里的幕布图像可以是视频流所在环境的环境图像等。以视频直播为例,这里的幕布图像可以为视频直播过程中的直播主播所在环境的图像,这里的环境的图像可以是纯色幕布形成的图像等。
然后,终端根据样本图像与幕布图像的颜色的接近程度,对样本图像进行阈值过滤,从样本图像中提取种子前景像素点和幕布像素点。具体进行过滤时,可以结合获取的样本图像的像素值和上述幕布图像的像素值,对样本图像进行阈值过滤,从样本图像中提取出种子前景像素点和种子背景像素点。
在该具体示例中,在进行阈值过滤时,可以结合YCrCb颜色空间的Cr、Cb分量来衡量这种接近程度。其将样本图像的像素值转换到YCrCb颜色空间,获得样本图像的各像素点的Cr分量、Cb分量,并将幕布图像的像素值转换到YCrCb颜色空间,获得幕布图像的各像素点的Cr分量、Cb分量;然后根据样本图像的各像素点的Cr分量、Cb分量,幕布图像的各像素点的Cr分量、Cb分量,计算样本图像的各像素点与所述幕布图像的对应位置处的像素点的距离。
假设r表示样本图像中的像素点,g表示幕布图像中的像素点,用d(r,g)表示像素点r与像素点g在Cr、Cb为轴的坐标系下的距离,该距离可以为欧氏距离,用Yr表示像素r所属的像素点类别,并用Yr=0表示像素点r属于前景像素点,用Yr=1表示像素点r属于背景像素点,用Yr=2表示像素点r属于混合像素点。从而有:
Figure PCTCN2018074458-appb-000001
其中,t 1为上述第一距离阈值,t 2为上述第二距离阈值,且t 1大于t 2
从而基于上述方式从样本图像中提取出种子前景像素点和种子背景像素点。
然后,终端对提取的种子前景像素点、种子背景像素点进行聚类,获得各前景分量样本、各背景分量样本。具体聚类时,可以采用任何可能的聚类方式进行聚类,例如用k-means无监督聚类算法、EM算法进行聚类;
基于上述聚类后,然后计算各前景分量样本的均值与协方差、各背景分量样本的均值与协方差。具体计算均值与协方差的方式,可以采用任何可能的方式进行,例如采用最大似然估计算法估计各样本的样本模型的均值与协方差。
然后,终端根据各前景分量样本的均值与协方差、各背景分量样本的均值与协方差,确定各前景分量的概率密度函数、各背景分量的概率密度函数。 一个具体示例中,该概率密度函数可以是如下所述:
Figure PCTCN2018074458-appb-000002
其中,μ分别为样本的均值,Σ分别为样本协方差矩阵。
随后,终端根据各前景分量的概率密度函数、各背景分量的概率密度函数生成所述像素点概率模型。基于上述概率密度函数确定的像素点概率模型如下所述:
Figure PCTCN2018074458-appb-000003
其中i=0,1表示标签前景或者背景。x r表示像素r的像素值,y r表示像素r的类别。
此外,终端还可以在间隔样本图像预定帧距后,从视频流中提取视频帧图像,例如第g帧图像,并将该视频帧图像作为新样本图像,重复上述过程后,对上述像素点概率模型进行更新,从而以提高建立的像素点概率模型的准确性。本示例中的像素点概率模型可以称之为GMM模型。
在建立上述像素点概率模型之后,即可基于该像素点概率模型提取待处理图像的前景图像,并据此进行背景图像的替换。
在获取待处理图像后,终端根据待处理图像、所述幕布图像以及所述像素点概率模型,确定待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率。
随后,终端即可根据待处理图像的各像素点的前景像素概率、背景像素概率,确定各像素点的像素点类型,即确定各像素点是前景像素点、背景像素点还是混合像素点。
一个具体示例中,可以结合下式的原理确定像素点的类型。
Figure PCTCN2018074458-appb-000004
其中,p(y r=0|x r)表示像素r属于前景像素的概率,p(y r=1|x r)表示像素 r属于背景像素的概率。
随后,终端可以根据各混合像素点、各混合像素点的前景像素概率、所述幕布图像,确定各混合像素点的融合权值,并根据各混合像素点的融合权值确定各混合像素点的前景分量值。
一个具体示例中,可以结合下式的原理确定混合像素点的融合权值和前景分量值。
Figure PCTCN2018074458-appb-000005
c r=x rrm
式中,α r表示融合权值,c r表示前景分量值,m表示幕布图像的对应像素点的像素值,k基于上述像素点概率模型中得到的像素r的前景分量概率值,
Figure PCTCN2018074458-appb-000006
表示各混合像素的平均像素值。通过前景分量的提取,可使最终融合结果中去除边缘的幕布颜色,使结果更真实自然。可以理解的是,还可以采用其他的方式来确定融合权值和前景分量,例如坐标轴转换、目标角度投影等。
可以理解的是,在一个示例中,上述对像素点概率模型更新的过程,和对待处理图像提取前景图像的过程,可以是同时进行,从而更新后的像素点概率模型,可以应用到对后续的视频流的视频帧图像的前景图像和替换背景图像的过程。
然后,终端将前景像素点的像素值,作为替换背景后图像中、与前景像素点对应位置处像素点的像素值;并将新背景图像中、与背景像素点对应位置处像素点的像素值,作为替换背景后图像中、与背景像素点对应位置处像素点的像素值。
终端根据混合像素点的融合权值和前景分量值、新背景像素的像素值,确定混合像素点的融合像素值,并将融合像素值,作为替换背景后图像中、与混合像素点对应位置处像素点的像素值。
一个具体示例中确定的融合像素值可以是如下式所示:
result r=c rrBG r
其中,BG r表示新背景图像的像素值,result r表示融合像素值。
基于如上所述的实施例的方案,通过对混合像素进行融合权值建模和前景分量提取,从而使得最终得到的背景替换后的图像更真实自然,大大提高了技术效果,解决了边缘处理不干净的问题,而且降低了计算复杂度,可以满足实时性需求。此外,在建立像素点概率模型时,是基于幕布像素提取出种子前景像素点和种子背景像素点,减少了用户交互次数,提高了效率。
以用户在直播过程中,对直播的视频画面图像进行替换背景为例。在本实施例中,以终端101是带有摄像头的手机为例,用于获取待处理图像。用户在直播间布置好幕布作为幕布图像,并在该幕布前进行视频的直播,然后通过装在手机上的软件对直播画面进行抠图并替换背景图像以制作出特效视频。
首先,用户打开软件,软件界面可以包括选择背景图像的按钮、视频录制开始按钮、提取前景图像的按钮以及替换背景图像的按钮。用户可以通过在软件界面上点击选择背景图像的按钮,用户选择一个自己想要的背景场景,作为替换后图像的背景。然后,通过点击软件上的开始按钮,向摄像头发出一个控制命令,控制摄像头开始工作,开始录取视频图像;录取到的视频图像即为待处理图像,如图2-1所示即为一个实施例中获取的待处理图像。同时点击界面上的提取前景的按钮,软件对摄像头录取到的视频图像进行提取前景图像操作,得到如图2-2所示的前景图像;点击替换背景图像的按钮,手机将对视频图像进行背景图像的替换,将视频图像中的背景实时替换成为用户之前选定的背景图像,得到如图2-3所示的替换后的视频图像。
如此,用户的直播视频的效果表现为用户是在自己选择的背景图像前录制直播的,实现了在室内即可生成以自己想要的图像为背景的直播视频。此外,由于在提取前景图像时,是基于幕布图像,确定出待处理图像中的各像素点属于前景像素点的概率、属于背景像素点的概率,并据此将像素点区分 为前景像素点、背景像素点和混合像素点,并确定出混合像素点的融合权值和前景分量值,从而在此基础上替换图像背景时,针对混合像素点,可以基于混合像素点的融合权值和前景分量值,将混合像素点与新背景图像进行融合,从而将前景与背景融合处的混合像素进行了有效区分,可以得到稳定的提取前景图像的分割结果,使得替换图像背景时最终得到的替换了背景的图像不会存在轮廓边缘不自然的情况,因此,获得的图像质量高、背景逼真。
对终端101中实现上述图像处理方法的功能模块进行模块划分,可以划分为提取前景图像的装置和替换图像背景的装置。图7示出了一个实施例中的提取前景图像的装置的结构示意图。该实施例中的装置表示终端101的部分功能模块。如图7所示,该实施例中的提取前景图像的装置70包括:
概率计算模块701,用于根据预定幕布图像,确定待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率;
像素点类型确定模块702,用于根据各所述像素点的前景像素概率、背景像素概率,确定各所述像素点的像素点类型,所述像素点类型包括前景像素点、背景像素点以及混合像素点;
混合像素融合信息确定模块703,用于根据各所述混合像素点、各所述混合像素点的所述前景像素概率、所述幕布图像,确定各所述混合像素点的融合权值,并根据各混合像素点的融合权值确定各所述混合像素点的前景分量值。
基于如上所述的实施例中的方案,其是提取前景图像时,是基于幕布图像,确定出待处理图像中的各像素点属于前景像素点的概率、属于背景像素点的概率,并据此将像素点区分为前景像素点、背景像素点和混合像素点,并确定出混合像素点的融合权值和前景分量值,从而在此基础上替换图像背景时,针对混合像素点,可以基于混合像素点的融合权值和前景分量值,将混合像素点与新背景图像进行融合,从而将前景与背景融合处的混合像素进行了有效区分,可以得到稳定的提取前景图像的分割结果,使得替换图像背 景时最终得到的替换了背景的图像不会存在轮廓边缘不自然的情况,获得的图像质量高。
在一个具体示例中,如图7所示,本实施例的提取前景图像的装置还可以包括像素点概率模型建立模块700,该像素点概率模型建立模块700用以建立像素点概率模型。此时,上述概率计算模块701,是根据所述待处理图像、所述幕布图像以及像素点概率模型,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率。
图8示出了一个具体示例中的像素点概率模型建立模块700的结构示意图,如图8所示,该像素点概率模型建立模块700包括:
第一图像获取模块7001,用于获取样本图像和所述幕布图像,所述样本图像包括所述待处理图像所在视频流中、在所述待处理图像之前的视频帧的图像;
种子像素提取模块7002,用于根据所述样本图像的像素值与所述幕布图像的像素值,对所述样本图像进行阈值过滤,从所述样本图像中提取出种子前景像素点和种子背景像素点;
模型建立模块7003,用于根据提取的种子前景像素点、种子背景像素点,建立所述像素点概率模型。
如图8所示,在一个具体应用示例中,上述种子像素提取模块7002可以包括:
距离计算模块70021,用于计算所述样本图像的各像素点与所述幕布图像的对应位置处的像素点的距离;
阈值比较确定模块70022,用于在所述距离大于第一距离阈值时,将对应的所述像素点确定为种子前景像素点,在所述距离小于第二距离阈值时,将对应的所述像素点确定为种子背景像素点,所述第一距离阈值大于第二距离阈值。
距离计算模块70021在计算所述样本图像的各像素点与所述幕布图像的对应坐标处的像素点的距离时,可以采用任何可能的方式进行,例如结合 YCrCb颜色空间进行。以结合YCrCb颜色空间计算距离为例,上述距离计算模块70021可以包括:
第一颜色空间转换模块,用于将所述样本图像的像素值转换到YCrCb颜色空间,获得所述样本图像的各像素点的Cr分量、Cb分量;
第二颜色空间转换模块,用于将所述幕布图像的像素值转换到YCrCb颜色空间,获得所述幕布图像的各像素点的Cr分量、Cb分量;
计算模块,用于根据所述样本图像的各像素点的Cr分量、Cb分量,所述幕布图像的各像素点的Cr分量、Cb分量,计算所述样本图像的各像素点与所述幕布图像的对应位置处的像素点的距离。
在一个具体示例中,上述模型建立模块7003可以包括:
聚类模块,用于对提取的种子前景像素点、种子背景像素点进行聚类,获得各前景分量样本、各背景分量样本;具体聚类时,可以采用任何可能的聚类方式进行聚类;
均值协方差计算模块,用于计算各前景分量样本的均值与协方差、各背景分量样本的均值与协方差;
概率密度确定模块,用于根据各前景分量样本的均值与协方差、各背景分量样本的均值与协方差,确定各前景分量的概率密度函数、各背景分量的概率密度函数;
模型生成模块,用于根据各前景分量的概率密度函数、各背景分量的概率密度函数生成所述像素点概率模型。
如图8所示,在一个具体示例中,上述像素点概率模型建立模块700还可以包括:
模型更新模块7004,用于在间隔所述样本图像预定帧距后,从所述视频流中提取视频帧图像,并将该视频帧图像作为新样本图像;根据所述新样本图像的像素值与所述幕布图像的像素值,对所述新样本图像进行阈值过滤,从所述新样本图像中提取出种子前景像素点和种子背景像素点;并根据从所述新样本图像中提取的种子前景像素点、种子背景像素点对所述像素点概率 模型进行更新。
在一个具体示例中,上述像素点类型确定模块702,用于在像素点的前景像素概率大于前景概率阈值时,判定该像素点为前景像素点;在像素点的背景像素概率大于背景概率阈值时,判定该像素点为背景像素点;否则,判定该像素点为混合像素点。
图9示出了一个实施例中的替换图像背景的装置的结构示意图,如图9所示,该实施例中的替换图像背景的装置包括:
第二图像获取模块901,用于获取待处理图像、新背景图像;
上述提取前景图像的装置70;
前景像素融合模块902,用于将提取前景图像的装置确定的前景像素点的像素值,作为替换背景后图像中、与所述前景像素点对应位置处像素点的像素值;
背景像素融合模块903,用于将所述新背景图像中、与所述提取前景图像的装置确定的背景像素点对应位置处像素点的像素值,作为所述替换背景后图像中、与所述背景像素点对应位置处像素点的像素值;
混合像素融合模块904,用于根据所述提取前景图像的装置确定的混合像素点的融合权值和前景分量值、所述新背景像素的像素值,确定所述混合像素点的融合像素值,并将所述融合像素值,作为所述替换背景后图像中、与所述混合像素点对应位置处像素点的像素值。
据此,基于本实施例中的方案,其将前景与背景融合处的混合像素进行了有效区分,可以得到稳定的提取前景图像的分割结果,使得替换图像背景时最终得到的替换了背景的图像不会存在轮廓边缘不自然的情况,获得的图像质量高。
可以理解,本实施例的装置中的相关模块,可采用与上述实施例的方法中的相同的方式实现。
在本申请的一个实施例中,提供了一种计算机设备,包括存储器、处理 器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现以下步骤:
终端获取待处理图像、新背景图像以及幕布图像;
终端根据所述待处理图像和所述幕布图像,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率;
终端根据各所述像素点的前景像素概率、背景像素概率,确定各所述像素点的像素点类型,所述像素点类型包括前景像素点、背景像素点以及混合像素点;
终端根据各所述混合像素点、各所述混合像素点的所述前景像素概率、所述幕布图像,确定各所述混合像素点的融合权值,并根据各所述混合像素点的融合权值确定各所述混合像素点的前景分量值;
终端将所述前景像素点的像素值,作为替换背景后图像中、与所述前景像素点对应位置处像素点的像素值;
终端将所述新背景图像中、与所述背景像素点对应位置处像素点的像素值,作为所述替换背景后图像中、与所述背景像素点对应位置处像素点的像素值;
终端根据所述混合像素点的融合权值和前景分量值、所述新背景像素的像素值,确定所述混合像素点的融合像素值,并将所述融合像素值,作为所述替换背景后图像中、与所述混合像素点对应位置处像素点的像素值。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
终端根据所述待处理图像、所述幕布图像以及像素点概率模型,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率;
所述像素点概率模型的确定方式包括:
终端获取样本图像和所述幕布图像,所述样本图像包括所述待处理图像所在视频流中、在所述待处理图像之前的视频帧的图像;
终端根据所述样本图像的像素值与所述幕布图像的像素值,对所述样本 图像进行阈值过滤,从所述样本图像中提取出种子前景像素点和种子背景像素点;
终端根据提取的种子前景像素点、种子背景像素点,建立所述像素点概率模型。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
终端根据所述样本图像的像素值与所述幕布图像的像素值,对所述样本图像进行阈值过滤,从所述样本图像中提取出种子前景像素点和种子背景像素点的方式包括:
终端计算所述样本图像的各像素点与所述幕布图像的对应位置处的像素点的距离;
在所述距离大于第一距离阈值时,终端将对应的所述像素点确定为种子前景像素点,在所述距离小于第二距离阈值时,终端将对应的所述像素点确定为种子背景像素点,所述第一距离阈值大于第二距离阈值。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
终端计算所述样本图像的各像素点与所述幕布图像的对应坐标处的像素点的距离的方式包括:
终端将所述样本图像的像素值转换到YCrCb颜色空间,获得所述样本图像的各像素点的Cr分量、Cb分量;
终端将所述幕布图像的像素值转换到YCrCb颜色空间,获得所述幕布图像的各像素点的Cr分量、Cb分量;
终端根据所述样本图像的各像素点的Cr分量、Cb分量,所述幕布图像的各像素点的Cr分量、Cb分量,计算所述样本图像的各像素点与所述幕布图像的对应位置处的像素点的距离。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
在间隔所述样本图像预定帧距后,终端从所述视频流中提取视频帧图像,并将该视频帧图像作为新样本图像;
终端根据所述新样本图像的像素值与所述幕布图像的像素值,对所述新 样本图像进行阈值过滤,从所述新样本图像中提取出种子前景像素点和种子背景像素点;
终端根据从所述新样本图像中提取的种子前景像素点、种子背景像素点对所述像素点概率模型进行更新。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
在像素点的前景像素概率大于前景概率阈值时,终端判定该像素点为前景像素点;
在像素点的背景像素概率大于背景概率阈值时,终端判定该像素点为背景像素点;
否则,终端判定该像素点为混合像素点。
在本申请的一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:
终端获取待处理图像、新背景图像以及幕布图像;
终端根据所述待处理图像和所述幕布图像,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率;
终端根据各所述像素点的前景像素概率、背景像素概率,确定各所述像素点的像素点类型,所述像素点类型包括前景像素点、背景像素点以及混合像素点;
终端根据各所述混合像素点、各所述混合像素点的所述前景像素概率、所述幕布图像,确定各所述混合像素点的融合权值,并根据各所述混合像素点的融合权值确定各所述混合像素点的前景分量值;
终端将所述前景像素点的像素值,作为替换背景后图像中、与所述前景像素点对应位置处像素点的像素值;
终端将所述新背景图像中、与所述背景像素点对应位置处像素点的像素值,作为所述替换背景后图像中、与所述背景像素点对应位置处像素点的像素值;
终端根据所述混合像素点的融合权值和前景分量值、所述新背景像素的像素值,确定所述混合像素点的融合像素值,并将所述融合像素值,作为所述替换背景后图像中、与所述混合像素点对应位置处像素点的像素值。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
终端根据所述待处理图像、所述幕布图像以及像素点概率模型,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率;
所述像素点概率模型的确定方式包括:
终端获取样本图像和所述幕布图像,所述样本图像包括所述待处理图像所在视频流中、在所述待处理图像之前的视频帧的图像;
终端根据所述样本图像的像素值与所述幕布图像的像素值,对所述样本图像进行阈值过滤,从所述样本图像中提取出种子前景像素点和种子背景像素点;
终端根据提取的种子前景像素点、种子背景像素点,建立所述像素点概率模型。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
终端根据所述样本图像的像素值与所述幕布图像的像素值,对所述样本图像进行阈值过滤,从所述样本图像中提取出种子前景像素点和种子背景像素点的方式包括:
终端计算所述样本图像的各像素点与所述幕布图像的对应位置处的像素点的距离;
在所述距离大于第一距离阈值时,终端将对应的所述像素点确定为种子前景像素点,在所述距离小于第二距离阈值时,终端将对应的所述像素点确定为种子背景像素点,所述第一距离阈值大于第二距离阈值。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
终端计算所述样本图像的各像素点与所述幕布图像的对应坐标处的像素点的距离的方式包括:
终端将所述样本图像的像素值转换到YCrCb颜色空间,获得所述样本图像的各像素点的Cr分量、Cb分量;
终端将所述幕布图像的像素值转换到YCrCb颜色空间,获得所述幕布图像的各像素点的Cr分量、Cb分量;
终端根据所述样本图像的各像素点的Cr分量、Cb分量,所述幕布图像的各像素点的Cr分量、Cb分量,计算所述样本图像的各像素点与所述幕布图像的对应位置处的像素点的距离。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
在间隔所述样本图像预定帧距后,终端从所述视频流中提取视频帧图像,并将该视频帧图像作为新样本图像;
终端根据所述新样本图像的像素值与所述幕布图像的像素值,对所述新样本图像进行阈值过滤,从所述新样本图像中提取出种子前景像素点和种子背景像素点;
终端根据从所述新样本图像中提取的种子前景像素点、种子背景像素点对所述像素点概率模型进行更新。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
在在像素点的前景像素概率大于前景概率阈值时,终端判定该像素点为前景像素点;
在像素点的背景像素概率大于背景概率阈值时,终端判定该像素点为背景像素点;
否则,终端判定该像素点为混合像素点。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或 易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (18)

  1. 一种图像处理方法,其特征在于,包括步骤:
    终端获取待处理图像、新背景图像以及幕布图像;
    终端根据所述待处理图像和所述幕布图像,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率;
    终端根据各所述像素点的前景像素概率、背景像素概率,确定各所述像素点的像素点类型,所述像素点类型包括前景像素点、背景像素点以及混合像素点;
    终端根据各所述混合像素点、各所述混合像素点的所述前景像素概率、所述幕布图像,确定各所述混合像素点的融合权值,并根据各所述混合像素点的融合权值确定各所述混合像素点的前景分量值;
    终端将所述前景像素点的像素值,作为替换背景后图像中、与所述前景像素点对应位置处像素点的像素值;
    终端将所述新背景图像中、与所述背景像素点对应位置处像素点的像素值,作为所述替换背景后图像中、与所述背景像素点对应位置处像素点的像素值;
    终端根据所述混合像素点的融合权值和前景分量值、所述新背景像素的像素值,确定所述混合像素点的融合像素值,并将所述融合像素值,作为所述替换背景后图像中、与所述混合像素点对应位置处像素点的像素值。
  2. 根据权利要求1所述的图像处理方法,其特征在于,终端根据所述待处理图像、所述幕布图像以及像素点概率模型,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率;
    所述像素点概率模型的确定方式包括:
    终端获取样本图像和所述幕布图像,所述样本图像包括所述待处理图像所在视频流中、在所述待处理图像之前的视频帧的图像;
    终端根据所述样本图像的像素值与所述幕布图像的像素值,对所述样本图像进行阈值过滤,从所述样本图像中提取出种子前景像素点和种子背景像 素点;
    终端根据提取的种子前景像素点、种子背景像素点,建立所述像素点概率模型。
  3. 根据权利要求2所述的图像处理方法,其特征在于,终端根据所述样本图像的像素值与所述幕布图像的像素值,对所述样本图像进行阈值过滤,从所述样本图像中提取出种子前景像素点和种子背景像素点的方式包括:
    终端计算所述样本图像的各像素点与所述幕布图像的对应位置处的像素点的距离;
    在所述距离大于第一距离阈值时,终端将对应的所述像素点确定为种子前景像素点,在所述距离小于第二距离阈值时,终端将对应的所述像素点确定为种子背景像素点,所述第一距离阈值大于第二距离阈值。
  4. 根据权利要求3所述的图像处理方法,其特征在于,终端计算所述样本图像的各像素点与所述幕布图像的对应坐标处的像素点的距离的方式包括:
    终端将所述样本图像的像素值转换到YCrCb颜色空间,获得所述样本图像的各像素点的Cr分量、Cb分量;
    终端将所述幕布图像的像素值转换到YCrCb颜色空间,获得所述幕布图像的各像素点的Cr分量、Cb分量;
    终端根据所述样本图像的各像素点的Cr分量、Cb分量,所述幕布图像的各像素点的Cr分量、Cb分量,计算所述样本图像的各像素点与所述幕布图像的对应位置处的像素点的距离。
  5. 根据权利要求2所述的图像处理方法,其特征在于,还包括:
    在间隔所述样本图像预定帧距后,终端从所述视频流中提取视频帧图像,并将该视频帧图像作为新样本图像;
    终端根据所述新样本图像的像素值与所述幕布图像的像素值,对所述新样本图像进行阈值过滤,从所述新样本图像中提取出种子前景像素点和种子背景像素点;
    终端根据从所述新样本图像中提取的种子前景像素点、种子背景像素点对所述像素点概率模型进行更新。
  6. 根据权利要求1至5任意一项所述的图像处理方法,其特征在于:
    在像素点的前景像素概率大于前景概率阈值时,终端判定该像素点为前景像素点;
    在像素点的背景像素概率大于背景概率阈值时,终端判定该像素点为背景像素点;
    否则,终端判定该像素点为混合像素点。
  7. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现以下步骤:
    终端获取待处理图像、新背景图像以及幕布图像;
    终端根据所述待处理图像和所述幕布图像,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率;
    终端根据各所述像素点的前景像素概率、背景像素概率,确定各所述像素点的像素点类型,所述像素点类型包括前景像素点、背景像素点以及混合像素点;
    终端根据各所述混合像素点、各所述混合像素点的所述前景像素概率、所述幕布图像,确定各所述混合像素点的融合权值,并根据各所述混合像素点的融合权值确定各所述混合像素点的前景分量值;
    终端将所述前景像素点的像素值,作为替换背景后图像中、与所述前景像素点对应位置处像素点的像素值;
    终端将所述新背景图像中、与所述背景像素点对应位置处像素点的像素值,作为所述替换背景后图像中、与所述背景像素点对应位置处像素点的像素值;
    终端根据所述混合像素点的融合权值和前景分量值、所述新背景像素的 像素值,确定所述混合像素点的融合像素值,并将所述融合像素值,作为所述替换背景后图像中、与所述混合像素点对应位置处像素点的像素值。
  8. 根据权利要求7所述的计算机设备,其特征在于,所述处理器执行所述计算机程序时还实现以下步骤:
    终端根据所述待处理图像、所述幕布图像以及像素点概率模型,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率;
    所述像素点概率模型的确定方式包括:
    终端获取样本图像和所述幕布图像,所述样本图像包括所述待处理图像所在视频流中、在所述待处理图像之前的视频帧的图像;
    终端根据所述样本图像的像素值与所述幕布图像的像素值,对所述样本图像进行阈值过滤,从所述样本图像中提取出种子前景像素点和种子背景像素点;
    终端根据提取的种子前景像素点、种子背景像素点,建立所述像素点概率模型。
  9. 根据权利要求8所述的计算机设备,其特征在于,所述处理器执行所述计算机程序时还实现以下步骤:
    终端根据所述样本图像的像素值与所述幕布图像的像素值,对所述样本图像进行阈值过滤,从所述样本图像中提取出种子前景像素点和种子背景像素点的方式包括:
    终端计算所述样本图像的各像素点与所述幕布图像的对应位置处的像素点的距离;
    在所述距离大于第一距离阈值时,终端将对应的所述像素点确定为种子前景像素点,在所述距离小于第二距离阈值时,终端将对应的所述像素点确定为种子背景像素点,所述第一距离阈值大于第二距离阈值。
  10. 根据权利要求9所述的计算机设备,其特征在于,所述处理器执行所述计算机程序时还实现以下步骤:
    终端计算所述样本图像的各像素点与所述幕布图像的对应坐标处的像素点的距离的方式包括:
    终端将所述样本图像的像素值转换到YCrCb颜色空间,获得所述样本图像的各像素点的Cr分量、Cb分量;
    终端将所述幕布图像的像素值转换到YCrCb颜色空间,获得所述幕布图像的各像素点的Cr分量、Cb分量;
    终端根据所述样本图像的各像素点的Cr分量、Cb分量,所述幕布图像的各像素点的Cr分量、Cb分量,计算所述样本图像的各像素点与所述幕布图像的对应位置处的像素点的距离。
  11. 根据权利要求8所述的计算机设备,其特征在于,所述处理器执行所述计算机程序时还实现以下步骤:
    在间隔所述样本图像预定帧距后,终端从所述视频流中提取视频帧图像,并将该视频帧图像作为新样本图像;
    终端根据所述新样本图像的像素值与所述幕布图像的像素值,对所述新样本图像进行阈值过滤,从所述新样本图像中提取出种子前景像素点和种子背景像素点;
    终端根据从所述新样本图像中提取的种子前景像素点、种子背景像素点对所述像素点概率模型进行更新。
  12. 根据权利要求7-11任意一项所述的计算机设备,其特征在于,所述处理器执行所述计算机程序时还实现以下步骤:
    在像素点的前景像素概率大于前景概率阈值时,终端判定该像素点为前景像素点;
    在像素点的背景像素概率大于背景概率阈值时,终端判定该像素点为背景像素点;
    否则,终端判定该像素点为混合像素点。
  13. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于, 所述计算机程序被处理器执行时实现以下步骤:
    终端获取待处理图像、新背景图像以及幕布图像;
    终端根据所述待处理图像和所述幕布图像,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率;
    终端根据各所述像素点的前景像素概率、背景像素概率,确定各所述像素点的像素点类型,所述像素点类型包括前景像素点、背景像素点以及混合像素点;
    终端根据各所述混合像素点、各所述混合像素点的所述前景像素概率、所述幕布图像,确定各所述混合像素点的融合权值,并根据各所述混合像素点的融合权值确定各所述混合像素点的前景分量值;
    终端将所述前景像素点的像素值,作为替换背景后图像中、与所述前景像素点对应位置处像素点的像素值;
    终端将所述新背景图像中、与所述背景像素点对应位置处像素点的像素值,作为所述替换背景后图像中、与所述背景像素点对应位置处像素点的像素值;
    终端根据所述混合像素点的融合权值和前景分量值、所述新背景像素的像素值,确定所述混合像素点的融合像素值,并将所述融合像素值,作为所述替换背景后图像中、与所述混合像素点对应位置处像素点的像素值。
  14. 根据权利要求13所述的计算机可读存储介质,其特征在于,所述计算机程序被处理器执行时还实现以下步骤:
    终端根据所述待处理图像、所述幕布图像以及像素点概率模型,确定所述待处理图像中的各像素点属于前景像素点的前景像素概率、属于背景像素点的背景像素概率;
    所述像素点概率模型的确定方式包括:
    终端获取样本图像和所述幕布图像,所述样本图像包括所述待处理图像所在视频流中、在所述待处理图像之前的视频帧的图像;
    终端根据所述样本图像的像素值与所述幕布图像的像素值,对所述样本 图像进行阈值过滤,从所述样本图像中提取出种子前景像素点和种子背景像素点;
    终端根据提取的种子前景像素点、种子背景像素点,建立所述像素点概率模型。
  15. 根据权利要求14所述的计算机可读存储介质,其特征在于,所述计算机程序被处理器执行时还实现以下步骤:
    终端根据所述样本图像的像素值与所述幕布图像的像素值,对所述样本图像进行阈值过滤,从所述样本图像中提取出种子前景像素点和种子背景像素点的方式包括:
    终端计算所述样本图像的各像素点与所述幕布图像的对应位置处的像素点的距离;
    在所述距离大于第一距离阈值时,终端将对应的所述像素点确定为种子前景像素点,在所述距离小于第二距离阈值时,终端将对应的所述像素点确定为种子背景像素点,所述第一距离阈值大于第二距离阈值。
  16. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述计算机程序被处理器执行时还实现以下步骤:
    终端计算所述样本图像的各像素点与所述幕布图像的对应坐标处的像素点的距离的方式包括:
    终端将所述样本图像的像素值转换到YCrCb颜色空间,获得所述样本图像的各像素点的Cr分量、Cb分量;
    终端将所述幕布图像的像素值转换到YCrCb颜色空间,获得所述幕布图像的各像素点的Cr分量、Cb分量;
    终端根据所述样本图像的各像素点的Cr分量、Cb分量,所述幕布图像的各像素点的Cr分量、Cb分量,计算所述样本图像的各像素点与所述幕布图像的对应位置处的像素点的距离。
  17. 根据权利要求14所述的计算机可读存储介质,其特征在于,所述计算机程序被处理器执行时还实现以下步骤:
    在间隔所述样本图像预定帧距后,终端从所述视频流中提取视频帧图像,并将该视频帧图像作为新样本图像;
    终端根据所述新样本图像的像素值与所述幕布图像的像素值,对所述新样本图像进行阈值过滤,从所述新样本图像中提取出种子前景像素点和种子背景像素点;
    终端根据从所述新样本图像中提取的种子前景像素点、种子背景像素点对所述像素点概率模型进行更新。
  18. 根据权利要求13-17任意一项所述的计算机可读存储介质,其特征在于,所述计算机程序被处理器执行时还实现以下步骤:
    在像素点的前景像素概率大于前景概率阈值时,终端判定该像素点为前景像素点;
    在像素点的背景像素概率大于背景概率阈值时,终端判定该像素点为背景像素点;
    否则,终端判定该像素点为混合像素点。
PCT/CN2018/074458 2017-02-06 2018-01-29 图像处理方法、计算机存储介质及计算机设备 WO2018141232A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710065799.6A CN106846336B (zh) 2017-02-06 2017-02-06 提取前景图像、替换图像背景的方法及装置
CN201710065799.6 2017-02-06

Publications (1)

Publication Number Publication Date
WO2018141232A1 true WO2018141232A1 (zh) 2018-08-09

Family

ID=59122081

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/074458 WO2018141232A1 (zh) 2017-02-06 2018-01-29 图像处理方法、计算机存储介质及计算机设备

Country Status (2)

Country Link
CN (1) CN106846336B (zh)
WO (1) WO2018141232A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109766828A (zh) * 2019-01-08 2019-05-17 重庆同济同枥信息技术有限公司 一种车辆目标分割方法、装置及通信设备
CN112446936A (zh) * 2019-08-29 2021-03-05 北京京东尚科信息技术有限公司 图像处理方法和装置
CN112601029A (zh) * 2020-11-25 2021-04-02 上海卫莎网络科技有限公司 一种已知背景先验信息的视频分割方法、终端和存储介质
CN112651938A (zh) * 2020-12-24 2021-04-13 平安科技(深圳)有限公司 视盘图像分类模型的训练方法、装置、设备及存储介质
CN113793395A (zh) * 2021-09-15 2021-12-14 湖南快乐阳光互动娱乐传媒有限公司 一种关键色提取方法及装置
CN113808154A (zh) * 2021-08-02 2021-12-17 惠州Tcl移动通信有限公司 一种视频图像处理方法、装置、终端设备及存储介质

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106846336B (zh) * 2017-02-06 2022-07-15 腾讯科技(上海)有限公司 提取前景图像、替换图像背景的方法及装置
CN107358593B (zh) * 2017-06-16 2020-06-26 Oppo广东移动通信有限公司 成像方法和装置
CN107547803B (zh) * 2017-09-25 2020-02-04 北京奇虎科技有限公司 视频分割结果边缘优化处理方法、装置及计算设备
CN108010039B (zh) * 2017-12-19 2021-04-06 北京奇虎科技有限公司 基于自适应阈值分割的视频人物装扮方法及装置
CN108124194B (zh) * 2017-12-28 2021-03-12 北京奇艺世纪科技有限公司 一种视频直播方法、装置及电子设备
CN108765537A (zh) * 2018-06-04 2018-11-06 北京旷视科技有限公司 一种图像的处理方法、装置、电子设备和计算机可读介质
CN109389611A (zh) 2018-08-29 2019-02-26 稿定(厦门)科技有限公司 交互式抠图方法、介质及计算机设备
CN110059643B (zh) * 2019-04-23 2021-06-15 王雪燕 一种多图像特征比对及择优融合的方法、移动终端与可读存储介质
CN110660066B (zh) * 2019-09-29 2023-08-04 Oppo广东移动通信有限公司 网络的训练方法、图像处理方法、网络、终端设备及介质
CN111768425B (zh) * 2020-07-23 2021-08-10 腾讯科技(深圳)有限公司 图像处理方法、装置及设备
CN112634247B (zh) * 2020-12-29 2022-04-12 浙江德源智能科技股份有限公司 基于图像分离的搬运对象识别方法及装置
CN114567794B (zh) * 2022-03-11 2023-06-30 浙江理工大学 一种直播视频背景替换方法

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1471692A (zh) * 2001-06-27 2004-01-28 ���ṫ˾ 图像处理设备和方法以及图像捕获设备
CN101582168A (zh) * 2009-06-16 2009-11-18 武汉大学 基于模糊连接度的抠图样本集构造方法
CN101777180A (zh) * 2009-12-23 2010-07-14 中国科学院自动化研究所 基于背景建模和能量最小化的复杂背景实时替换方法
CN102222339A (zh) * 2011-06-17 2011-10-19 中国科学院自动化研究所 一种基于纹理和强度特征融合的多尺度背景建模方法
CN103119625A (zh) * 2011-09-16 2013-05-22 华为技术有限公司 一种视频人物分割的方法及装置
US8594423B1 (en) * 2012-01-12 2013-11-26 Google Inc. Automatic background identification in video images
CN106846336A (zh) * 2017-02-06 2017-06-13 腾讯科技(上海)有限公司 提取前景图像、替换图像背景的方法及装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102340620B (zh) * 2011-10-25 2013-06-19 重庆大学 基于马氏距离的视频图像背景检测方法
US9058605B2 (en) * 2012-04-20 2015-06-16 Taaz, Inc. Systems and methods for simulating accessory display on a subject
CN103177446B (zh) * 2013-03-13 2016-03-30 北京航空航天大学 基于邻域和非邻域平滑先验的图像前景精准提取方法
CN104156959A (zh) * 2014-08-08 2014-11-19 中科创达软件股份有限公司 一种视频抠图方法及装置
CN104820990A (zh) * 2015-05-15 2015-08-05 北京理工大学 一种交互式图像抠图***
CN106251286B (zh) * 2015-12-30 2019-11-22 深圳超多维科技有限公司 图像处理方法、装置及设备

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1471692A (zh) * 2001-06-27 2004-01-28 ���ṫ˾ 图像处理设备和方法以及图像捕获设备
CN101582168A (zh) * 2009-06-16 2009-11-18 武汉大学 基于模糊连接度的抠图样本集构造方法
CN101777180A (zh) * 2009-12-23 2010-07-14 中国科学院自动化研究所 基于背景建模和能量最小化的复杂背景实时替换方法
CN102222339A (zh) * 2011-06-17 2011-10-19 中国科学院自动化研究所 一种基于纹理和强度特征融合的多尺度背景建模方法
CN103119625A (zh) * 2011-09-16 2013-05-22 华为技术有限公司 一种视频人物分割的方法及装置
US8594423B1 (en) * 2012-01-12 2013-11-26 Google Inc. Automatic background identification in video images
CN106846336A (zh) * 2017-02-06 2017-06-13 腾讯科技(上海)有限公司 提取前景图像、替换图像背景的方法及装置

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109766828A (zh) * 2019-01-08 2019-05-17 重庆同济同枥信息技术有限公司 一种车辆目标分割方法、装置及通信设备
CN112446936A (zh) * 2019-08-29 2021-03-05 北京京东尚科信息技术有限公司 图像处理方法和装置
CN112601029A (zh) * 2020-11-25 2021-04-02 上海卫莎网络科技有限公司 一种已知背景先验信息的视频分割方法、终端和存储介质
CN112651938A (zh) * 2020-12-24 2021-04-13 平安科技(深圳)有限公司 视盘图像分类模型的训练方法、装置、设备及存储介质
CN112651938B (zh) * 2020-12-24 2023-12-19 平安科技(深圳)有限公司 视盘图像分类模型的训练方法、装置、设备及存储介质
CN113808154A (zh) * 2021-08-02 2021-12-17 惠州Tcl移动通信有限公司 一种视频图像处理方法、装置、终端设备及存储介质
CN113793395A (zh) * 2021-09-15 2021-12-14 湖南快乐阳光互动娱乐传媒有限公司 一种关键色提取方法及装置
CN113793395B (zh) * 2021-09-15 2024-05-03 湖南快乐阳光互动娱乐传媒有限公司 一种关键色提取方法及装置

Also Published As

Publication number Publication date
CN106846336A (zh) 2017-06-13
CN106846336B (zh) 2022-07-15

Similar Documents

Publication Publication Date Title
WO2018141232A1 (zh) 图像处理方法、计算机存储介质及计算机设备
CN109376684B (zh) 一种人脸关键点检测方法、装置、计算机设备和存储介质
CN109344742B (zh) 特征点定位方法、装置、存储介质和计算机设备
EP3852009A1 (en) Image segmentation method and apparatus, computer device, and storage medium
CN107516319B (zh) 一种高精度简易交互式抠图方法、存储设备及终端
WO2022142450A1 (zh) 用于图像分割模型训练和图像分割的方法及装置
WO2020253127A1 (zh) 脸部特征提取模型训练方法、脸部特征提取方法、装置、设备及存储介质
WO2016110239A1 (zh) 图像处理方法和装置
CN111383232B (zh) 抠图方法、装置、终端设备及计算机可读存储介质
US20180322367A1 (en) Image processing method, non-transitory computer readable storage medium and image processing system
WO2021114612A1 (zh) 目标重识别方法、装置、计算机设备和存储介质
WO2019041660A1 (zh) 人脸去模糊方法及装置
CN109788359B (zh) 一种视频数据处理方法和相关装置
CN113505799B (zh) 显著性检测方法及其模型的训练方法和装置、设备、介质
WO2022148248A1 (zh) 图像处理模型的训练方法、图像处理方法、装置、电子设备及计算机程序产品
WO2023005194A1 (zh) 视频生成方法及电子设备
Wang et al. Perf: Panoramic neural radiance field from a single panorama
CN113886510A (zh) 一种终端交互方法、装置、设备及存储介质
CN112614149A (zh) 基于实例分割的语义合成方法
WO2023115838A1 (zh) 视频文字跟踪方法及电子设备
Halperin et al. Clear Skies Ahead: Towards Real‐Time Automatic Sky Replacement in Video
CN112601029B (zh) 一种已知背景先验信息的视频分割方法、终端和存储介质
WO2021164329A1 (zh) 图像处理方法、装置、通信设备及可读存储介质
CN114841851A (zh) 图像生成方法、装置、电子设备及存储介质
CN112700481B (zh) 基于深度学习的纹理图自动生成方法、装置、计算机设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18747496

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18747496

Country of ref document: EP

Kind code of ref document: A1