CN114862897A - Image background processing method and device and electronic equipment - Google Patents

Image background processing method and device and electronic equipment Download PDF

Info

Publication number
CN114862897A
CN114862897A CN202210453835.7A CN202210453835A CN114862897A CN 114862897 A CN114862897 A CN 114862897A CN 202210453835 A CN202210453835 A CN 202210453835A CN 114862897 A CN114862897 A CN 114862897A
Authority
CN
China
Prior art keywords
image
pixel
value
image data
mask
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202210453835.7A
Other languages
Chinese (zh)
Inventor
王海君
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210453835.7A priority Critical patent/CN114862897A/en
Publication of CN114862897A publication Critical patent/CN114862897A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

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

Abstract

The disclosure provides an image background processing method and device and electronic equipment, relates to the field of artificial intelligence, and particularly relates to the field of computer vision. The specific scheme is as follows: acquiring a gray scale image of an original image, wherein the image comprises a main body and a background; generating a gray histogram of the gray map, and calculating a segmentation threshold value based on the gray histogram; generating a binary mask image of the gray level image based on a segmentation threshold, wherein a region with a pixel value as a first value in the binary mask image comprises a main body, and a pixel with a pixel value as a second value in the binary mask image is a background pixel; correcting the binarized mask image to obtain a corrected mask image, wherein the correction is used for matting background pixels in an area with a pixel value as a first value; and scratching the background of the original image based on the corrected mask image to obtain a target image. The background matting accuracy can be improved.

Description

Image background processing method and device and electronic equipment
Technical Field
The present disclosure relates to the field of artificial intelligence technologies such as computer vision, and in particular, to an image background processing method and apparatus, and an electronic device.
Background
The virtual show of main part receives more and more attention, needs to carry out the image shooting to the main part, and the image of shooing not only includes the main part image, still includes the background, needs to scratch the background of the image of shooing.
At present, the common mode is to manually scratch off the background through image software.
Disclosure of Invention
The disclosure provides a method and a device for image background processing, an electronic device and a storage medium.
According to an aspect of the present disclosure, there is provided an image background processing method of an embodiment, including:
acquiring a gray scale image of an original image, wherein the image comprises a main body and a background;
generating a gray level histogram of the gray level image, and calculating a segmentation threshold value based on the gray level histogram;
generating a binarized mask image of the gray scale image based on the segmentation threshold, wherein a region with a pixel value of a first value in the binarized mask image comprises the main body, and a pixel with a pixel value of a second value in the binarized mask image is a background pixel;
correcting the binarized mask image to obtain a corrected mask image, wherein the correction is used for matting background pixels in an area with pixel values as the first values;
and scratching the background of the original image based on the corrected mask image to obtain a target image.
According to a second aspect of the present disclosure, there is provided an image background processing method of an embodiment, including:
acquiring a binary mask (mask) image, wherein a region with a pixel value as a first value in the binary mask image comprises a main body, and a pixel with a pixel value as a second value in the binary mask image is a background pixel;
carrying out corrosion treatment on the binarized mask image to obtain first image data;
performing expansion processing on the first image data to obtain second image data;
acquiring differential image data of the second image data and the first image data;
and based on the differential image data, matting background pixels in an area with the pixel value as the first value in the binarized mask image to obtain a target mask image.
According to a third aspect of the present disclosure, there is provided an image background processing apparatus of an embodiment, including:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring a gray scale image of an original image, and the image comprises a main body and a background;
the calculation module is used for generating a gray histogram of the gray map and calculating a segmentation threshold value based on the gray histogram;
a generating module, configured to generate a binarized mask map of the grayscale map based on the segmentation threshold, where a region in the binarized mask map where a pixel value is a first value includes the main body, and a pixel in the binarized mask map where a pixel value is a second value is a background pixel;
the correction module is used for correcting the binarized mask image to obtain a corrected mask image, and the correction is used for matting background pixels in an area with pixel values as the first values;
and the matting module is used for matting the background of the original image based on the corrected mask image to obtain a target image.
According to a fourth aspect of the present disclosure, there is provided an image background processing apparatus of an embodiment, including:
the device comprises a first obtaining module, a second obtaining module and a third obtaining module, wherein the first obtaining module is used for obtaining a binary mask image, an area of which the pixel value is a first value in the binary mask image comprises a main body, and a pixel of which the pixel value is a second value in the binary mask image is a background pixel;
the corrosion module is used for carrying out corrosion treatment on the binaryzation mask graph to obtain first image data;
the expansion module is used for performing expansion processing on the first image data to obtain second image data;
a second obtaining module, configured to obtain difference image data between the second image data and the first image data;
and the matting module is used for matting background pixels in the area of which the pixel values in the binarized mask image are the first values based on the differential image data to obtain a target mask image.
In a fifth aspect, an embodiment of the present disclosure further provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the image background processing method as provided by the first aspect or the image background processing method as provided by the second aspect of the present disclosure.
In a sixth aspect, an embodiment of the present disclosure further provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the image background processing method provided by the first aspect of the present disclosure or the image background processing method provided by the second aspect of the present disclosure.
In a seventh aspect, an embodiment of the present disclosure provides a computer program product, which includes a computer program that, when executed by a processor, implements the image background processing method provided by the first aspect or the image background processing method provided by the second aspect of the present disclosure.
In the method of this embodiment, because the binarized mask map of the grayscale map is generated based on the segmentation threshold calculated by the grayscale histogram, and the binarized mask map is corrected, it is possible to scrape out background pixels in the region where the pixel value in the binarized mask map is the first value, so that the corrected mask map is used to scrape out the background of the original image to obtain the target image, thereby improving the accuracy of the obtained target image.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is one of the flow diagrams of an image background processing method according to an embodiment provided in the present disclosure;
fig. 2 is a second schematic flowchart of an image background processing method according to an embodiment of the present disclosure;
fig. 3 is a third schematic flowchart of an image background processing method according to an embodiment of the present disclosure;
FIG. 4 is a grayscale diagram of one embodiment provided by the present disclosure;
FIG. 5 is a binarized mask diagram of a grayscale map of one embodiment provided by the present disclosure;
FIG. 6 is a modified mask diagram of a grayscale diagram of one embodiment provided by the present disclosure;
FIG. 7 is one of the mask graphs after initial optimization of the grayscale map of one embodiment provided by the present disclosure;
FIG. 8 is a second mask diagram after initial optimization of the grayscale map of one embodiment provided by the present disclosure;
FIG. 9 is an enlarged view of a sub-region within a rectangular box in the mask map after initial optimization of the grayscale map of one embodiment provided by the present disclosure;
FIG. 10 is an enlarged view of a sub-region within a rectangular box in an optimized mask diagram of a grayscale map of one embodiment provided by the present disclosure;
FIG. 11 is an original image of one embodiment provided by the present disclosure;
FIG. 12 is a target image of one embodiment provided by the present disclosure;
fig. 13 is one of schematic structural diagrams of an image background processing apparatus according to an embodiment provided in the present disclosure;
fig. 14 is a second schematic structural diagram of an image background processing apparatus according to an embodiment of the present disclosure;
fig. 15 is a third schematic structural diagram of an image background processing apparatus according to an embodiment of the present disclosure;
FIG. 16 is a fourth schematic structural diagram of an image background processing apparatus according to an embodiment of the disclosure;
fig. 17 is a block diagram of an electronic device for implementing an image background processing method according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
As shown in fig. 1, according to an embodiment of the present disclosure, the present disclosure provides an image background processing method applicable to an electronic device, the method including:
step S101: a gray scale image of an original image is acquired, the image including a subject and a background.
The original image may be a captured image and the grayscale image is a single channel image. In one example, the original image may be a color image, the color image may include component images of three color channels, the original image may be directly converted into a gray scale map, or the original image of a first color model may be converted into an image of a second color model, and a component image of one color channel is obtained from the image of the second color model as a gray scale map.
For example, the original image may be an RGB (red, green and blue) image, that is, an image of an RGB color model, including an image of a red color channel, an image of a green color channel, and an image of a blue color channel, and in one example, the RGB image may be directly converted into a gray scale image, for example, a weighted summation process may be performed on component images of three color channels of the RGB image to obtain the gray scale image. If the weighting coefficients are 1/3, it means that the component images of the three color channels of the RGB image are averaged to obtain a gray scale map. In another example, the RGB image may be first converted into an image of another color model, for example, the RGB image may be converted into an HSV image, that is, an image of an HSV color model, which includes a component image of an H channel, a component image of an S channel, and a component image of a V channel, where H (hue) represents hue, S (saturation) represents saturation, and V represents brightness (Value), and the component image of the V channel may be used as a gray scale image.
Step S102: a gradation histogram of the gradation map is generated, and a division threshold value is calculated based on the gradation histogram.
The gray histogram is a statistic of gray level distribution in a gray image, and the gray histogram is a statistic of the occurrence frequency of all pixel points in the gray image according to the size of pixel values (gray values). The segmentation threshold can be calculated by using a gray histogram, that is, the gray value threshold is obtained, and it is understood that the segmentation threshold used for performing binarization processing on the gray image is determined by the statistical result of the gray value of the pixel of the gray image itself.
Step S103: and generating a binary mask (mask) image of the gray level image based on the segmentation threshold, wherein the area of the first pixel value in the binary mask image comprises a main body, and the background pixel is the pixel of the second pixel value in the binary mask image.
After the segmentation threshold value is obtained by utilizing the gray level histogram calculation, the binary processing can be carried out on the gray level image by utilizing the segmentation threshold value to obtain a binary mask image, and the pixel value of the pixel point in the binary mask image is a first value or a second value. For example, the pixel value of a first target pixel point in the gray-scale image is adjusted to be a first value, the pixel value of the first target pixel point in the gray-scale image is larger than the segmentation threshold, the pixel value of a second target pixel point in the gray-scale image is adjusted to be a second value, and the pixel value of the second target pixel point in the gray-scale image is smaller than or equal to the segmentation threshold, so that a binary mask image can be obtained, and thus, a main body pixel and a background pixel can be distinguished. The segmentation threshold value adopted for the binarization processing of the gray-scale image is determined by calculating the statistical result of the gray-scale value of the pixel of the gray-scale image, so that the accuracy of the binarization processing of the gray-scale image can be improved, and the accuracy of the obtained binarized mask image can be improved.
Step S104: and correcting the binarized mask image to obtain a corrected mask image, wherein the correction is used for matting background pixels in the area with the pixel value as the first value.
After the binarization processing, the pixel points in the background may be used as the main body, which causes poor accuracy of the binarized mask image.
Step S105: and scratching the background of the original image based on the corrected mask image to obtain a target image.
And utilizing the corrected mask image to carry out background matting on the original image, so as to realize background matting and obtain the target image. For example, in one example, the modified mask image may be merged with the original image to achieve background matting of the original image, so as to obtain the target image.
In the method of this embodiment, because the binarized mask map of the grayscale map is generated based on the segmentation threshold calculated by the grayscale histogram, and the binarized mask map is corrected, it is possible to scrape out background pixels in the region where the pixel value in the binarized mask map is the first value, so that the corrected mask map is used to scrape out the background of the original image to obtain the target image, thereby improving the accuracy of the obtained target image.
In addition, the method of the embodiment of the disclosure obtains the binarized mask image, corrects the binarized mask image to obtain the corrected mask image, and utilizes the corrected mask image to scratch the background of the original image, so as to realize background scratching without manual scratching through image software, thereby improving the efficiency of background scratching.
As shown in fig. 2, in an embodiment, the step S104 of performing a correction process on the binarized mask map to obtain a corrected mask map includes:
step S1041: carrying out corrosion treatment on the binarized mask image to obtain first image data;
step S1042: performing expansion processing on the first image data to obtain second image data;
step S1043: acquiring differential image data of the second image data and the first image data;
step S1044: and based on the differential image data, matting background pixels in an area with a pixel value as a first value in the binarized mask image to obtain a corrected mask image.
After the binary mask image is subjected to corrosion processing, the area of the region with the pixel value as the first value is reduced, and some interference noise at the edge can be filtered out. The differential image data can represent the difference between the second image data and the first image data, and background pixels in the area with the pixel value as the first value in the binary mask image are scratched by utilizing the differential image data so as to improve the accuracy of scratching the background pixels and improve the accuracy of the obtained corrected mask image.
In one embodiment, the first value is 1, the second value is 0, and based on the difference image data, matting background pixels in an area where a pixel value in the binarized mask image is the first value to obtain a modified mask image, including:
performing AND operation on the difference image data and the binary mask image by taking pixels as units to obtain expanded image data;
and performing OR operation on the expansion image data and the first image data by taking the pixel as a unit to obtain a corrected mask image.
The and operation rule is that the result is 1 if the pixel values of the two pixels are both 1, otherwise the result is 0, or the operation rule is that the result is 1 if the pixel value of at least one of the two pixels is 1, that is, if only one of the two pixels involved in the operation has a pixel value of 1, the result is 1, otherwise the result is 0.
The difference image data and the binarized mask map have the same size, for example, M rows and N columns, that is, M × N, and M and N are positive integers, and the obtained dilated image data and corrected mask map have the same size, that is, M rows and N columns. In the process of correcting the binarized mask image, the difference image data and the binarized mask image are subjected to and operation, and in the and operation process, the and operation is performed by taking a pixel as a unit, namely, the pixel value of a first pixel in the difference image data and the pixel value of a corresponding second pixel in the binarized mask image are subjected to and operation, the first pixel is any pixel in the difference image data, the position of the first pixel in the difference image data is the same as the position of the second pixel in the binarized mask image, and the pixel value of each pixel in the difference image data is subjected to corresponding and operation respectively to obtain the expanded image data. For example, the pixel value of the jth pixel in the ith row and the jth pixel in the ith row in the differential image data is subjected to AND operation with the pixel value of the jth pixel in the ith row in the binarized mask image, i is more than or equal to 1 and less than or equal to M, j is more than or equal to 1 and less than or equal to N, and the pixel values of M × N pixels in the differential image data are subjected to AND operation, so that the expanded image data can be obtained.
In addition, the dilated image data and the first image data are subjected to or operation, in the process of or operation, the pixel value of a third pixel in the dilated image data and the pixel value of a corresponding fourth pixel in the first image data are subjected to or operation in pixel units, namely, the third pixel is any one pixel in the dilated image data, the position of the third pixel in the dilated image data is the same as the position of the fourth pixel in the first image data, and the pixel value of each pixel in the dilated image data is subjected to corresponding or operation respectively to obtain a mask image. For example, the pixel value of the ith row and jth column pixel in the expanded image data is and-computed with the pixel value of the ith row and jth column pixel in the first image data, and the pixel values of the M × N pixels in the expanded image data are and-computed, so that the corrected mask image can be obtained.
In this embodiment, in the process of correcting the binarized mask map, since the difference image data and the binarized mask map can be subjected to and operation on a pixel basis to obtain the dilated image data, a reasonable dilated area can be obtained, and the accuracy of the dilated image data can be improved, and then the dilated image data and the first image data can be subjected to or operation on a pixel basis, the correction of the mask map can be realized, the corrected mask map can be obtained, and the accuracy of the corrected mask map can be improved.
In one embodiment, computing the segmentation threshold based on the gray histogram includes:
determining a target gray level interval with the largest number of pixels in a gray level histogram, wherein the gray level histogram has a plurality of gray level intervals, each gray level interval corresponds to a gray level range, and for any gray level interval, the gray level value of the pixels in the gray level interval belongs to the gray level range value corresponding to the gray level interval;
and determining a segmentation threshold value based on the gray value range corresponding to the target gray value interval.
For example, there are k gray scale intervals in the gray scale histogram, where k is an integer greater than 1, and the k gray scale intervals are the gray scale interval h1, the gray scale intervals h2, … …, the gray scale interval hk-1, and the gray scale interval hk, respectively, where the number of pixels whose gray scale values are in the gray scale interval h2 is the largest in the gray scale map, and the target gray scale interval is the gray scale interval h 2. After the target gray scale interval is determined, the segmentation threshold value can be determined by utilizing the gray scale value range corresponding to the target gray scale interval. For example, in a main shooting scene, a background is generally a studio with a single color, a gray value interval with more pixel points can be used as a gray value approximation of the background to determine a segmentation threshold, a gray value range corresponding to a target gray value interval with the largest number of pixels can greatly represent the gray value of the background in an image, the segmentation threshold is determined according to the gray value range corresponding to the target gray value interval with the largest number of pixels, the accuracy of the segmentation threshold can be improved, a binary mask image is obtained by performing binarization processing on the segmentation threshold, the accuracy of the binarization processing can be improved, and the accuracy of the obtained binary mask image can be improved.
For example, in one example, an upper limit or a lower limit of the gray value range corresponding to the target gray scale interval may be used as the division threshold, or a gray value with the largest number of pixels may be selected as the division threshold in the gray value range corresponding to the target gray scale interval, or an average value of the upper limit and the lower limit of the gray value range corresponding to the target gray scale interval may be used as the division threshold.
In one embodiment, matting and removing the background of the original image based on the modified mask image to obtain the target image comprises:
performing optimization processing on the corrected mask graph to obtain an optimized mask graph;
matting and removing the background of the original image based on the optimized mask image to obtain a target image;
wherein the optimization process comprises at least one of:
removing edge sawteeth;
and deleting a target connected pixel set, wherein the target connected pixel point comprises a pixel which is except the main body and has a pixel value of a first value.
For example, edge aliasing may be performed on the modified mask map and reduced, in one example, edge aliasing may be performed using gaussian filtering. In addition, since the original image may include other objects (the pixel value is also the first value in the binarized mask image) in addition to the main body, the target connected pixel set in the corrected mask image may be obtained in advance, and the target connected pixel set may also be scratched out of the corrected mask image, so as to scratch out the pixels of which the pixel values except for the main body are the first value, thereby realizing the scratching out of other objects in the image. It should be noted that the connected pixel set can be understood as a connected region.
In this embodiment, after obtaining the correction mask image, can further carry out optimization to it, can scratch out the edge sawtooth and/or scratch out the target connected pixel set, can obtain the higher optimization mask image of accuracy like this, follow-up according to optimizing the mask image and scratch out the background of original image, realize the background and scratch out, obtain the target image, can further improve the accuracy that the background was scratched out.
In one embodiment, matting out object connected pixel points comprises:
determining a plurality of connected pixel sets in the modified mask image and parameter information of each connected pixel set, wherein the parameter information comprises: at least one of a central point coordinate and a region area, wherein each connected pixel set comprises a plurality of pixel points connected in position, and no pixel point connected in position exists between any two connected pixel sets;
and taking the connected pixel set of which the parameter information meets the preset condition as a target connected pixel point, and scratching out the target connected pixel set.
It should be noted that, a connected pixel set may be understood as a connected region, where the positions are connected to each other, and a row difference or a column difference between two pixels connected at any position is 1, for example, a pixel in the ith row and the jth column in a modified mask diagram is connected to a pixel in the ith row and the jth +1 column in a position, a pixel in the ith row and the jth column in an i +1 row and a jth column in a position, a pixel in the ith row and the jth column in an i-1 row and a pixel in the jth column in an i-1 column in a position, and a plurality of pixels connected at positions in the connected pixel set may be understood as that any one of the plurality of pixels has at least one pixel connected at a corresponding position among the plurality of pixels.
In addition to the background, the original image may include a plurality of objects, and the plurality of objects may include a subject and other objects, so that a plurality of connected pixel sets in the modified mask image may be determined. For example, three objects, subject, object A1, and object A2, are included in the original image, so that three connected sets of pixels in the modified mask map can be determined.
In addition, parameter information of each connected pixel set is determined, a target connected pixel point set is determined from the plurality of connected pixel sets by using the parameter information, and a subject is generally located in the central area of an image in the process of shooting the image of the subject. In addition, the area of the main body is generally larger than the areas of other interfering objects, so in this embodiment, at least one of a center point coordinate and an area of the connected pixel set may be determined, and a target connected pixel point set is determined from the plurality of connected pixel sets by at least one of the center point coordinate and the area, that is, the connected pixel point sets of other interfering objects are determined, and the target connected pixel point set is deducted, thereby reducing the influence of other interfering objects and improving the accuracy of the obtained optimized mask map.
In one embodiment, the parameter information satisfying the preset condition includes at least one of:
the center point coordinate is positioned at the image edge of the correction mask image;
the region area is not the maximum region area, and the maximum region area is the region area of a connected pixel set in which the region area of the plurality of connected pixel sets is the largest.
Because the main part generally can be located the central zone of image, other objects generally can deviate from the central zone, thus, through scratching out the communicating region that the central point coordinate is located the image edge, get rid of the central point coordinate and be located the interference of the communicating region corresponding object at image edge, because the area of main part generally can be greater than the area of other interference objects, thus, the accessible is scratched out the communicating region that the regional area is not the biggest regional area, get rid of the area and not the interference of the biggest communicating region corresponding object, improve the accuracy of the optimization mask picture that obtains.
In one embodiment, the body comprises at least one of:
merchandise, human faces.
Under the trend that internet e-commerce is developing continuously, commodity virtual display is more and more emphasized, firstly, commodity shooting can be carried out in a photostudio, an original commodity image can be obtained, however, the shot original commodity image comprises a background, and the attention of a user is easily dispersed in the display process.
In addition, in some scenes, such as scenes of face recognition and the like, a face image is needed, the face can be shot to obtain an original face image, and in the process of shooting the face, the shot face image also comprises a background besides the face, which may influence the accuracy of face recognition, so that the method disclosed by the embodiment of the disclosure can be used for processing the image background, so as to realize the removal of the background and obtain a target image comprising the face.
As shown in fig. 3, an embodiment of the present disclosure further provides an image background processing method, including:
step S301: acquiring a binarized mask image, wherein a region with a pixel value as a first value in the binarized mask image comprises a main body, and a pixel with a pixel value as a second value in the binarized mask image is a background pixel;
step S302: carrying out corrosion treatment on the binarized mask image to obtain first image data;
step S303: performing expansion processing on the first image data to obtain second image data;
step S304: acquiring differential image data of the second image data and the first image data;
step S305: and based on the differential image data, matting background pixels in an area with a pixel value as a first value in the binarized mask image to obtain a target mask image.
It should be noted that the target mask diagram can be understood as a modified mask diagram, which can be used for matting the background of an image, for example, matting the background of an image, or detecting an object, etc. For example, the background of the original image can be scratched by using a target mask to obtain the target image, i.e., the target mask is used to scratch the background of the original image to obtain the target image.
In this embodiment, the difference image data is used to cut out the background pixels in the area where the pixel value in the binarized mask image is the first value to obtain the target mask image, so that the accuracy of background cutting out of the target mask image is improved.
In one embodiment, the first value is 1, the second value is 0, and based on the difference image data, matting background pixels in an area where a pixel value in the binarized mask image is the first value to obtain a target mask image, including:
performing AND operation on the difference image data and the binary mask image by taking pixels as units to obtain expanded image data;
and performing OR operation on the expansion image data and the first image data by taking pixels as units to obtain a target mask image.
The process of the above method is described in detail below with an embodiment.
First, an RGB image is acquired and a corresponding grayscale map is generated. For example, an RGB image may be converted from an RGB color space to an HSV color space, resulting in an HSV image, with the component images of the lightness channels in the HSV image being used as a grayscale map. As shown in fig. 4, it is a grayscale diagram of the RGB image X.
Then, a segmentation threshold calculation is performed. The gray level histogram of the gray level image can be generated firstly, and the background is generally a photostudio with a single color in the shooting scene, so that the target gray level interval with the largest number of pixels can be used as the gray level approximation of the background. The division threshold is calculated using the gray histogram, and for example, the upper limit of the gray scale value range corresponding to the target gray scale section may be set as the division threshold.
Next, region division is performed. The grayscale map is binary-divided according to the division threshold, for example, pixels higher than the division threshold are used as main pixels, the pixel value is adjusted to 1, otherwise, the pixel value is adjusted to 0, and the binarization of the image is realized to obtain a binarized mask map, which is the binarized mask map of the image X as shown in fig. 5.
And correcting the binarized mask image to obtain a corrected mask image.
Because the binary mask image is obtained by taking the segmentation threshold as the segmentation standard, some pixels in the background region are easily taken as the main body, and some pixels in the main body are taken as the background and are removed. This situation may be improved by using a conventional erosion dilation algorithm, but may result in details of the object being removed, and thus, embodiments of the present disclosure provide a new erosion dilation algorithm that overcomes the above-mentioned problems and drawbacks. The process is as follows:
carrying out corrosion treatment on the binarized mask image to obtain first image data;
performing expansion processing on the first image data to obtain second image data;
subtracting the first image data from the second image data to obtain differential image data;
carrying out AND operation on the difference image data and the binary mask image by taking pixels as units to obtain expanded image data;
and performing OR operation on the collision image data and the first image data by taking pixels as units to obtain a corrected mask image.
As shown in fig. 6, the modified mask map is obtained by processing the binarized mask map of the image X by the erosion-dilation algorithm described above in the present disclosure.
Further, optimization processing can be carried out on the corrected mask graph, and the optimization processing process is as follows:
calculating an individual connected region of the corrected mask graph to obtain a plurality of connected pixel sets, and acquiring a central point coordinate and a region area of each connected pixel set;
the pixel connected sets with the coordinates of the center point located at the edge of the image of the modified mask image and the pixel connected sets with the areas of the scratched areas not being the maximum area can be scratched to obtain the initially optimized mask image, as shown in fig. 7. In addition, edge aliasing may be further removed, for example, using gaussian filtering on the initially optimized mask map, edge aliasing may be removed to obtain an optimized mask map. And (5) enlarging and displaying the sub-regions in the rectangular boxes in the mask diagram after the initial optimization in the figure 8, as shown in figure 9. After the edge sawtooth is removed from the initially optimized mask graph, the optimized mask graph is obtained, and the sub-regions in the corresponding rectangular frames in the optimized mask graph are displayed in an enlarged mode, as shown in fig. 10, the edge sawtooth phenomenon can be relieved.
And after the optimized mask image is obtained, the optimized mask image and the RGB image can be subjected to sum synthesis to obtain a target image.
In addition, as shown in fig. 11, the original image Y is a commercial doll, and after being processed by the image background processing method according to the embodiment of the disclosure, a corresponding target image is obtained, as shown in fig. 12. By the image background processing method, the purpose of removing the background while the loss of the details of the main body is small can be achieved, and the accuracy of the obtained target image is improved.
As shown in fig. 13, according to an embodiment of the present disclosure, the present disclosure provides an image background processing apparatus applicable to an electronic device, the apparatus including:
an obtaining module 1301, configured to obtain a grayscale image of an original image, where the image includes a subject and a background;
a calculating module 1302, configured to generate a grayscale histogram of the grayscale map, and calculate a segmentation threshold based on the grayscale histogram;
a generating module 1303, configured to generate a binarized mask map of the grayscale map based on the segmentation threshold, where a region in the binarized mask map where a pixel value is a first value includes a main body, and a pixel in the binarized mask map where a pixel value is a second value is a background pixel;
a correction module 1304, configured to perform correction processing on the binarized mask image to obtain a corrected mask image, where the correction processing is used to scratch out background pixels in an area where a pixel value is a first value;
a matting module 1305, configured to scrub the background of the original image based on the modified mask image to obtain the target image.
As shown in fig. 14, in one embodiment, the modification module 1304 includes:
an etching unit 13041, configured to perform etching processing on the binarized mask map to obtain first image data;
an expansion unit 13042, configured to perform expansion processing on the first image data to obtain second image data;
a difference unit 13043 for acquiring difference image data of the second image data and the first image data;
a matting unit 13044 is configured to scrub background pixels in an area where a pixel value in the binarized mask image is a first value based on the difference image data, so as to obtain a corrected mask image.
In one embodiment, the first value is 1, the second value is 0, and the matting unit is configured to perform an and operation on the difference image data and the binarized mask image in units of pixels to obtain expanded image data; and performing OR operation on the expanded image data and the first image data by taking the pixel as a unit to obtain a corrected mask image.
In one embodiment, the calculation module 1302 is configured to generate a gray histogram of a gray map, and determine a target gray interval with the largest number of pixels in the gray histogram, where there are multiple gray intervals in the gray histogram, each gray interval corresponds to a gray value range, and for any gray interval, the gray values of the pixels in the gray interval belong to the gray range values corresponding to the gray interval; and determining a segmentation threshold value based on the gray value range corresponding to the target gray value interval.
As shown in fig. 15, in one embodiment, the matting module 1305 includes:
an optimizing unit 13051, configured to perform optimization processing on the corrected mask map to obtain an optimized mask map;
a matting unit 13052, configured to matte the background of the original image based on the optimized mask image to obtain a target image;
wherein the optimization process comprises at least one of:
removing edge sawteeth;
and deleting a target connected pixel set, wherein the target connected pixel point comprises a pixel which is except the main body and has a pixel value of a first value.
In one embodiment, matting out object connected pixel points comprises:
determining a plurality of connected pixel sets in the modified mask image and parameter information of each connected pixel set, wherein the parameter information comprises: at least one of a central point coordinate and a region area, wherein each connected pixel set comprises a plurality of pixel points connected in position, and no pixel point connected in position exists between any two connected pixel sets;
and taking the connected pixel set of which the parameter information meets the preset condition as a target connected pixel point, and scratching out the target connected pixel set.
In one embodiment, the parameter information satisfying the preset condition includes at least one of:
the center point coordinate is positioned at the image edge of the correction mask image;
the region area is not the maximum region area, and the maximum region area is the region area of a connected pixel set in which the region area of the plurality of connected pixel sets is the largest.
In one embodiment, the body comprises at least one of:
merchandise, human faces.
The image background processing apparatus in each embodiment is an apparatus for implementing the image background processing method in each embodiment, and the technical features correspond to the technical effects, and are not described herein again.
As shown in fig. 16, the present disclosure also provides an image background processing apparatus of an embodiment, including:
a first obtaining module 1601, configured to obtain a binarized mask image, where an area in the binarized mask image where a pixel value is a first value includes a main body, and a pixel in the binarized mask image where a pixel value is a second value is a background pixel;
an etching module 1602, configured to perform etching processing on the binarized mask map to obtain first image data;
an expansion module 1603, configured to perform expansion processing on the first image data to obtain second image data;
a second obtaining module 1604, configured to obtain difference image data between the second image data and the first image data;
a matting module 1605, configured to matte background pixels in an area where a pixel value in the binarized mask image is a first value based on the difference image data, to obtain a target mask image.
In one embodiment, the first value is 1, the second value is 0, and the matting module 1605 is configured to perform an and operation on the difference image data and the binarized mask image by taking a pixel as a unit to obtain expanded image data; and performing OR operation on the expanded image data and the first image data by taking pixels as units to obtain a target mask image.
The image background processing apparatus in each embodiment is an apparatus for implementing the image background processing method in each embodiment, and the technical features correspond to the technical effects, and are not described herein again.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
Fig. 17 illustrates a schematic block diagram of an example electronic device 1700 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 17, the apparatus 1700 includes a computing unit 1701 that may perform various appropriate actions and processes in accordance with a computer program stored in a Read Only Memory (ROM)1702 or a computer program loaded from a storage unit 1708 into a Random Access Memory (RAM) 1703. In the RAM 1703, various programs and data required for the operation of the device 1700 can also be stored. The computing unit 1701, the ROM 1702, and the RAM 1703 are connected to each other through a bus 1704. An input/output (I/O) interface 1705 is also connected to bus 1704.
Various components in the device 1700 are connected to the I/O interface 1705, including: an input unit 1706 such as a keyboard, a mouse, and the like; an output unit 1707 such as various types of displays, speakers, and the like; a storage unit 1708 such as a magnetic disk, optical disk, or the like; and a communication unit 1709 such as a network card, modem, wireless communication transceiver, etc. The communication unit 1709 allows the device 1700 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 1701 may be a variety of general purpose and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 1701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and the like. The calculation unit 1701 executes the respective methods and processes described above, such as the image background processing method. For example, in some embodiments, the image background processing method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 1708. In some embodiments, part or all of a computer program may be loaded onto and/or installed onto device 1700 via ROM 1702 and/or communications unit 1709. When the computer program is loaded into the RAM 1703 and executed by the computing unit 1701, one or more steps of the image background processing method described above may be performed. Alternatively, in other embodiments, the computing unit 1701 may be configured in any other suitable manner (e.g., by means of firmware) to perform the image background processing method.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel or sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (22)

1. An image background processing method, comprising:
acquiring a gray scale image of an original image, wherein the image comprises a main body and a background;
generating a gray level histogram of the gray level image, and calculating a segmentation threshold value based on the gray level histogram;
generating a binarized mask image of the gray scale image based on the segmentation threshold, wherein a region with a pixel value of a first value in the binarized mask image comprises the main body, and a pixel with a pixel value of a second value in the binarized mask image is a background pixel;
correcting the binarized mask image to obtain a corrected mask image, wherein the correction is used for matting background pixels in an area with pixel values as the first values;
and scratching the background of the original image based on the corrected mask image to obtain a target image.
2. The method according to claim 1, wherein said performing a correction process on said binarized mask map to obtain a corrected mask map comprises:
carrying out corrosion treatment on the binarized mask image to obtain first image data;
performing expansion processing on the first image data to obtain second image data;
acquiring differential image data of the second image data and the first image data;
based on the difference image data, background pixels in the area of which the pixel value is the first value in the binarized mask image are scratched to obtain the corrected mask image.
3. The method as claimed in claim 2, wherein the first value is 1, the second value is 0, and the matting background pixels in the area of the binarized mask map with the pixel value being the first value based on the difference image data to obtain the modified mask map comprises:
performing AND operation on the difference image data and the binarized mask image by taking pixels as units to obtain expanded image data;
and performing OR operation on the expanded image data and the first image data by taking a pixel as a unit to obtain the corrected mask image.
4. The method of any of claims 1 to 3, wherein said computing a segmentation threshold based on the grayscale histogram comprises:
determining a target gray level interval with the maximum number of pixels in the gray level histogram, wherein the gray level histogram has a plurality of gray level intervals, and each gray level interval corresponds to a gray level range; for any gray scale interval, the gray scale value of the pixel in the gray scale interval belongs to the gray scale range value corresponding to the gray scale interval;
and determining the segmentation threshold value based on the gray value range corresponding to the target gray level interval.
5. The method of any one of claims 1 to 3, wherein said matting the background of the original image based on the modified mask image to obtain a target image comprises:
performing optimization processing on the corrected mask graph to obtain an optimized mask graph;
based on the optimized mask image, matting and removing the background of the original image to obtain a target image;
wherein the optimization process comprises at least one of:
removing edge sawteeth;
and matting out a target connected pixel set, wherein the target connected pixel point comprises a pixel which is except the main body and has a pixel value of the first value.
6. The method of claim 5, wherein the matting an object connected pixel point comprises:
determining a plurality of connected pixel sets in the modified mask graph and parameter information of each connected pixel set, wherein the parameter information comprises: at least one of a central point coordinate and a region area, wherein each connected pixel set comprises a plurality of pixel points connected in position, and no pixel point connected in position exists between any two connected pixel sets;
and taking the connected pixel set of which the parameter information meets the preset condition as the target connected pixel point, and removing the target connected pixel set.
7. The method of claim 6, wherein the parameter information satisfying a preset condition comprises at least one of:
the center point coordinate is positioned at the image edge of the correction mask image;
the region area is not a maximum region area, and the maximum region area is a region area of a connected pixel set in which the region area of the plurality of connected pixel sets is the largest.
8. The method of any of claims 1-3, wherein the subject comprises at least one of:
merchandise, human faces.
9. An image background processing method, comprising:
acquiring a binarized mask image, wherein a region with a pixel value as a first value in the binarized mask image comprises a main body, and a pixel with a pixel value as a second value in the binarized mask image is a background pixel;
carrying out corrosion treatment on the binarized mask image to obtain first image data;
performing expansion processing on the first image data to obtain second image data;
acquiring differential image data of the second image data and the first image data;
and based on the differential image data, matting background pixels in an area with the pixel value as the first value in the binarized mask image to obtain a target mask image.
10. The method as claimed in claim 9, wherein the first value is 1, the second value is 0, and the matting out background pixels in the area of the binarized mask map with pixel value being the first value based on the difference image data to obtain a target mask map, comprises:
performing AND operation on the difference image data and the binarized mask image by taking pixels as units to obtain expanded image data;
and performing OR operation on the expanded image data and the first image data by taking pixels as units to obtain the target mask image.
11. An image background processing apparatus comprising:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring a gray scale image of an original image, and the image comprises a main body and a background;
the calculation module is used for generating a gray histogram of the gray map and calculating a segmentation threshold value based on the gray histogram;
a generating module, configured to generate a binarized mask map of the grayscale map based on the segmentation threshold, where a region in the binarized mask map where a pixel value is a first value includes the main body, and a pixel in the binarized mask map where a pixel value is a second value is a background pixel;
the correction module is used for correcting the binarized mask image to obtain a corrected mask image, and the correction is used for matting background pixels in an area with pixel values as the first values;
and the matting module is used for matting the background of the original image based on the corrected mask image to obtain a target image.
12. The apparatus of claim 11, wherein the correction module comprises:
the etching unit is used for etching the binarized mask image to obtain first image data;
the expansion unit is used for performing expansion processing on the first image data to obtain second image data;
a difference unit configured to acquire difference image data of the second image data and the first image data;
and the matting unit is used for matting background pixels in the area of which the pixel values are the first values in the binarized mask image based on the differential image data to obtain the corrected mask image.
13. The apparatus according to claim 12, wherein the first value is 1, the second value is 0, and the matting unit is configured to and the difference image data with the binarized mask map in units of pixels to obtain expanded image data; and performing OR operation on the expanded image data and the first image data by taking pixels as units to obtain the corrected mask image.
14. The apparatus according to any one of claims 11 to 13, wherein the computing module is configured to generate a gray histogram of the gray map, in which a target gray bin with the largest number of pixels is determined, where there are multiple gray bins in the gray histogram, and each gray bin corresponds to a gray value range; for any gray scale interval, the gray scale value of the pixel in the gray scale interval belongs to the gray scale range value corresponding to the gray scale interval; and determining the segmentation threshold value based on the gray value range corresponding to the target gray value interval.
15. The device of any one of claims 11 to 13, wherein the matting module comprises:
the optimization unit is used for executing optimization processing on the corrected mask graph to obtain an optimized mask graph;
the matting unit is used for matting and removing the background of the original image based on the optimized mask image to obtain a target image;
wherein the optimization process comprises at least one of:
removing edge sawteeth;
and matting out a target connected pixel set, wherein the target connected pixel point comprises a pixel which is except the main body and has a pixel value of the first value.
16. The apparatus of claim 15, wherein the matting of object connected pixels comprises:
determining a plurality of connected pixel sets in the modified mask graph and parameter information of each connected pixel set, wherein the parameter information comprises: at least one of a central point coordinate and a region area, wherein each connected pixel set comprises a plurality of pixel points connected in position, and no pixel point connected in position exists between any two connected pixel sets;
and taking the connected pixel set of which the parameter information meets the preset condition as the target connected pixel point, and removing the target connected pixel set.
17. The apparatus of claim 16, wherein the parameter information satisfying a preset condition comprises at least one of:
the center point coordinate is positioned at the image edge of the correction mask image;
the region area is not a maximum region area, and the maximum region area is a region area of a connected pixel set in which the region area of the plurality of connected pixel sets is the largest.
18. The apparatus of any one of claims 11 to 13, wherein the body comprises at least one of:
merchandise, human faces.
19. An image background processing apparatus comprising:
the device comprises a first obtaining module, a second obtaining module and a third obtaining module, wherein the first obtaining module is used for obtaining a binary mask image, an area of which the pixel value is a first value in the binary mask image comprises a main body, and a pixel of which the pixel value is a second value in the binary mask image is a background pixel;
the corrosion module is used for carrying out corrosion treatment on the binarized mask image to obtain first image data;
the expansion module is used for performing expansion processing on the first image data to obtain second image data;
a second obtaining module, configured to obtain difference image data between the second image data and the first image data;
and the matting module is used for matting background pixels in the area of which the pixel values in the binarized mask image are the first values based on the differential image data to obtain a target mask image.
20. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8 or to enable the at least one processor to perform the method of any one of claims 9-10.
21. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-8 or the computer instructions for causing the computer to perform the method of any one of claims 9-10.
22. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-8, and which, when executed by a processor, implements the method according to any one of claims 9-10.
CN202210453835.7A 2022-04-24 2022-04-24 Image background processing method and device and electronic equipment Pending CN114862897A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210453835.7A CN114862897A (en) 2022-04-24 2022-04-24 Image background processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210453835.7A CN114862897A (en) 2022-04-24 2022-04-24 Image background processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN114862897A true CN114862897A (en) 2022-08-05

Family

ID=82633777

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210453835.7A Pending CN114862897A (en) 2022-04-24 2022-04-24 Image background processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN114862897A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117132499A (en) * 2023-09-07 2023-11-28 石家庄开发区天远科技有限公司 Background removing method and device for image recognition
CN117221504A (en) * 2023-11-07 2023-12-12 北京医百科技有限公司 Video matting method and device
CN117132499B (en) * 2023-09-07 2024-05-14 石家庄开发区天远科技有限公司 Background removing method and device for image recognition

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050254699A1 (en) * 2004-05-13 2005-11-17 Dainippon Screen Mfg, Co., Ltd. Apparatus and method for detecting defect and apparatus and method for extracting wire area
US20090010546A1 (en) * 2005-12-30 2009-01-08 Telecom Italia S P.A. Edge-Guided Morphological Closing in Segmentation of Video Sequences
JP2012156839A (en) * 2011-01-27 2012-08-16 Nec Engineering Ltd Image area separation method, program for executing the same, and image area separation device
CN107169973A (en) * 2017-05-18 2017-09-15 深圳市优微视技术有限公司 The background removal and synthetic method and device of a kind of image
CN108073931A (en) * 2016-11-08 2018-05-25 广州城市职业学院 A kind of complex background image goes down unless the method for character and graphic
CN108830780A (en) * 2018-05-09 2018-11-16 北京京东金融科技控股有限公司 Image processing method and device, electronic equipment, storage medium
CN110400290A (en) * 2019-07-02 2019-11-01 广州大学 A kind of detection method, device and the storage medium of solar battery sheet color difference
CN110717919A (en) * 2019-10-15 2020-01-21 阿里巴巴(中国)有限公司 Image processing method, device, medium and computing equipment
CN110807747A (en) * 2019-10-31 2020-02-18 北京华宇信息技术有限公司 Document image noise reduction method based on foreground mask
WO2021042823A1 (en) * 2019-09-02 2021-03-11 苏宁云计算有限公司 Picture test method and device
CN112529773A (en) * 2020-12-17 2021-03-19 豪威科技(武汉)有限公司 QPD image post-processing method and QPD camera
CN112884785A (en) * 2021-03-16 2021-06-01 常熟理工学院 Method, device and medium for automatically removing background of multi-oblique-position mammary X-ray image
CN113222850A (en) * 2021-05-24 2021-08-06 努比亚技术有限公司 Image processing method, device and computer readable storage medium
CN113870154A (en) * 2020-06-30 2021-12-31 广州慧睿思通人工智能技术有限公司 Image data processing method, image data processing device, computer equipment and storage medium
CN114240989A (en) * 2021-11-30 2022-03-25 中国工商银行股份有限公司 Image segmentation method and device, electronic equipment and computer storage medium

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050254699A1 (en) * 2004-05-13 2005-11-17 Dainippon Screen Mfg, Co., Ltd. Apparatus and method for detecting defect and apparatus and method for extracting wire area
US20090010546A1 (en) * 2005-12-30 2009-01-08 Telecom Italia S P.A. Edge-Guided Morphological Closing in Segmentation of Video Sequences
JP2012156839A (en) * 2011-01-27 2012-08-16 Nec Engineering Ltd Image area separation method, program for executing the same, and image area separation device
CN108073931A (en) * 2016-11-08 2018-05-25 广州城市职业学院 A kind of complex background image goes down unless the method for character and graphic
CN107169973A (en) * 2017-05-18 2017-09-15 深圳市优微视技术有限公司 The background removal and synthetic method and device of a kind of image
CN108830780A (en) * 2018-05-09 2018-11-16 北京京东金融科技控股有限公司 Image processing method and device, electronic equipment, storage medium
CN110400290A (en) * 2019-07-02 2019-11-01 广州大学 A kind of detection method, device and the storage medium of solar battery sheet color difference
WO2021042823A1 (en) * 2019-09-02 2021-03-11 苏宁云计算有限公司 Picture test method and device
CN110717919A (en) * 2019-10-15 2020-01-21 阿里巴巴(中国)有限公司 Image processing method, device, medium and computing equipment
CN110807747A (en) * 2019-10-31 2020-02-18 北京华宇信息技术有限公司 Document image noise reduction method based on foreground mask
CN113870154A (en) * 2020-06-30 2021-12-31 广州慧睿思通人工智能技术有限公司 Image data processing method, image data processing device, computer equipment and storage medium
CN112529773A (en) * 2020-12-17 2021-03-19 豪威科技(武汉)有限公司 QPD image post-processing method and QPD camera
CN112884785A (en) * 2021-03-16 2021-06-01 常熟理工学院 Method, device and medium for automatically removing background of multi-oblique-position mammary X-ray image
CN113222850A (en) * 2021-05-24 2021-08-06 努比亚技术有限公司 Image processing method, device and computer readable storage medium
CN114240989A (en) * 2021-11-30 2022-03-25 中国工商银行股份有限公司 Image segmentation method and device, electronic equipment and computer storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
李正明;王森;孙俊;: "图像分割在成熟茄子目标识别中的应用", 农业机械学报, no. 1, 30 September 2009 (2009-09-30), pages 111 - 114 *
毛志伟;赵滨;周少玲;: "线结构光视觉传感焊缝跟踪图像处理", 热加工工艺, no. 15, 29 July 2016 (2016-07-29), pages 241 - 243 *
王海南;郝重阳;: "基于数学形态学的PET图像背景噪声处理算法", 计算机应用研究, no. 09, 15 September 2007 (2007-09-15), pages 318 - 320 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117132499A (en) * 2023-09-07 2023-11-28 石家庄开发区天远科技有限公司 Background removing method and device for image recognition
CN117132499B (en) * 2023-09-07 2024-05-14 石家庄开发区天远科技有限公司 Background removing method and device for image recognition
CN117221504A (en) * 2023-11-07 2023-12-12 北京医百科技有限公司 Video matting method and device
CN117221504B (en) * 2023-11-07 2024-01-23 北京医百科技有限公司 Video matting method and device

Similar Documents

Publication Publication Date Title
US11113795B2 (en) Image edge processing method, electronic device, and computer readable storage medium
CN112967315B (en) Target tracking method and device and electronic equipment
CN113344801A (en) Image enhancement method, system, terminal and storage medium applied to gas metering facility environment
CN112802037A (en) Portrait extraction method, device, electronic equipment and storage medium
CN112785492A (en) Image processing method, image processing device, electronic equipment and storage medium
CN111383178A (en) Image enhancement method and device and terminal equipment
CN114298985B (en) Defect detection method, device, equipment and storage medium
CN113487473B (en) Method and device for adding image watermark, electronic equipment and storage medium
CN114862897A (en) Image background processing method and device and electronic equipment
CN113569708A (en) Living body recognition method, living body recognition device, electronic apparatus, and storage medium
CN115660991A (en) Model training method, image exposure correction method, device, equipment and medium
CN115222939A (en) Image recognition method, device, equipment and storage medium
CN115018730A (en) Method, device, equipment and medium for removing image stripe noise
CN115205163A (en) Method, device and equipment for processing identification image and storage medium
CN114037630A (en) Model training and image defogging method, device, equipment and storage medium
CN114494686A (en) Text image correction method, text image correction device, electronic equipment and storage medium
CN114418848A (en) Video processing method and device, storage medium and electronic equipment
CN114219744B (en) Image generation method, device, equipment and storage medium
CN112053300B (en) Correction method, device and equipment for illumination non-uniform image
CN113379631B (en) Image defogging method and device
CN116957983A (en) Image enhancement method, device, equipment and storage medium
CN114612492B (en) Image frame detection method and device and electronic equipment
CN113221926B (en) Line segment extraction method based on angular point optimization
CN115829872A (en) Method, device and equipment for enhancing image contrast and storage medium
CN113657482A (en) Model training method, target detection method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination