WO2016011745A1 - 图像分割方法、装置及设备 - Google Patents

图像分割方法、装置及设备 Download PDF

Info

Publication number
WO2016011745A1
WO2016011745A1 PCT/CN2014/091643 CN2014091643W WO2016011745A1 WO 2016011745 A1 WO2016011745 A1 WO 2016011745A1 CN 2014091643 W CN2014091643 W CN 2014091643W WO 2016011745 A1 WO2016011745 A1 WO 2016011745A1
Authority
WO
WIPO (PCT)
Prior art keywords
head
probability
foreground
image
shoulder
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.)
Ceased
Application number
PCT/CN2014/091643
Other languages
English (en)
French (fr)
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.)
Xiaomi Inc
Original Assignee
Xiaomi Inc
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 Xiaomi Inc filed Critical Xiaomi Inc
Priority to RU2015106324/08A priority Critical patent/RU2577188C1/ru
Priority to KR1020157001161A priority patent/KR101694643B1/ko
Priority to MX2015002246A priority patent/MX352237B/es
Priority to BR112015003800A priority patent/BR112015003800A2/pt
Priority to JP2016535336A priority patent/JP6134446B2/ja
Priority to US14/669,888 priority patent/US9665945B2/en
Publication of WO2016011745A1 publication Critical patent/WO2016011745A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/143Segmentation; Edge detection involving probabilistic approaches, e.g. Markov random field [MRF] modelling
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/272Means for inserting a foreground image in a background image, i.e. inlay, outlay
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/14Systems for two-way working
    • H04N7/15Conference systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • G06F18/24155Bayesian classification
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • G06V40/162Detection; Localisation; Normalisation using pixel segmentation or colour matching

Definitions

  • the present disclosure relates to the field of image processing technologies, and in particular, to an image segmentation method, apparatus, and device.
  • the head-shoulder segmentation technology has been promoted as a special image segmentation technology. It has been widely used in background replacements such as video conferencing, in front-end camera shooting, and rear camera shooting on mobile devices.
  • the user when performing head-shoulder segmentation of an image, the user is first instructed to select a first sample pixel point of the head-shoulder foreground and a second sample pixel point of the background; thereafter, the first sample pixel point and the second sample are respectively calculated a color feature vector of the pixel, obtaining a first color feature vector of the head and shoulder foreground and a second color feature vector of the background; and color modeling the head and shoulder foreground and the background according to the first color feature vector and the second color feature vector, respectively The first color model and the second color model are obtained. Finally, the image is subjected to head and shoulder segmentation using the first color model and the second color model to obtain a head and shoulder segmentation result.
  • the user In the image segmentation process, the user is required to participate in the selection of the sample pixel points, so the user experience is poor; in addition, since the image segmentation is performed based only on the color feature vector of the sample pixel point, the segmentation accuracy is poor.
  • the present disclosure provides an image segmentation method, apparatus, and device.
  • an image segmentation method comprising: calculating a position of each pixel in a preset size image according to a positioning result of a contour point of a face outside a face
  • the head and shoulder segmentation is performed on the image to be segmented according to the first posterior probability and the second posterior probability.
  • the calculating according to the positioning result of the outer contour point of the face, calculating the position of each pixel in the preset size image A priori probability of head and shoulders prospects, including:
  • a head and shoulder calibration image of each female frontal face image is generated
  • the alignment and size normalization processing of each head and shoulder calibration image is performed to obtain a plurality of preset size images
  • a prior probability of the head and shoulder foreground appearing at the pixel point position is calculated.
  • the calculating according to the positioning result of the outer contour point of the face, calculating a prior probability of the head and shoulder foreground of each pixel position in the preset size image, including:
  • a head and shoulder calibration image of each male frontal face image is generated
  • the image of each of the head and shoulder calibration images is aligned and normalized to obtain a plurality of preset size images
  • a prior probability of the head and shoulder foreground appearing at the pixel point position is calculated.
  • the selecting the head and shoulder foreground sample pixel point and the background sample pixel point in the image to be segmented according to the prior probability, the preset head and shoulder foreground probability threshold, and the background probability threshold including:
  • applying a formula to calculate a first color likelihood probability of the head and shoulder foreground and The second color likelihood probability of the background includes:
  • N F refers to the number of cluster centers of the head and shoulder foreground sample pixels
  • N B refers to the number of cluster centers of the background sample pixels
  • w j refers to the ratio of the number of sample pixels in the j-th cluster center to the total number of sample pixels
  • refers to the average Euclidean distance between the color feature vectors of different cluster centers.
  • the calculating, according to the prior probability, the first color likelihood probability and the second color likelihood probability, a posterior probability of the head and shoulders foreground, the background Posterior probability including:
  • an image segmentation apparatus comprising:
  • the prior probability calculation module is configured to calculate a prior probability of the head and shoulder foreground of each pixel position in the preset size image according to the positioning result of the outer contour point of the face;
  • a sample pixel point selection module configured to select a head and shoulder foreground sample pixel point and a background sample pixel point in the image to be segmented according to the prior probability, the preset head and shoulder foreground probability threshold, and the background probability threshold;
  • a color likelihood probability calculation module configured to calculate a first color likelihood probability of the head and shoulder foreground and the color according to a color feature vector of the head and shoulder foreground sample pixel point and a color feature vector of the background sample pixel point Second color likelihood probability of the background;
  • a posterior probability calculation module configured to calculate a first posterior probability of the head and shoulders foreground and the background according to the prior probability, the first color likelihood probability, and the second color likelihood probability Second posterior probability;
  • an image segmentation module configured to perform head and shoulder segmentation on the image to be segmented according to the first posterior probability and the second posterior probability.
  • the prior probability calculation module is configured to select a preset number of female frontal face images; and generate each female frontal person according to the user's calibration result of the head and shoulder foreground of each female frontal facial image.
  • the head and shoulder calibration images of the face image; the facial contour points of each face are imaged for each female frontal face image, and the positioning result is obtained; according to the positioning result of the outer contour feature points of the face, each head and shoulder calibration image is performed. Aligning and sizing normalization to obtain a plurality of preset size images; for pixels of the same position in the plurality of preset size images, calculating a head and shoulder foreground of the pixel position according to the head and shoulder foreground calibration result Priori probability.
  • the prior probability calculation module is configured to select a preset number of male frontal face images; and generate each male positive person according to the user's calibration result of the head and shoulder foreground of each male positive facial image.
  • the image is aligned and resized to obtain a plurality of preset size images; for pixels of the same position in the plurality of preset size images, the head and shoulder of the pixel position are calculated according to the head and shoulder foreground calibration result The prior probability of the foreground.
  • the prior probability calculation module applies a formula to calculate a prior probability that a head and shoulder foreground occurs in the pixel position:
  • the sample pixel point selection module is configured to perform gender recognition on the face in the image to be segmented to obtain a gender recognition result; and determine, according to the gender recognition result, a priori corresponding to the image to be segmented Probability; for each pixel in the image to be segmented, determining whether the prior probability of the pixel is greater than the head and shoulder foreground probability threshold; if the prior probability of the pixel is greater than the head and shoulder foreground probability a threshold, the pixel point is determined as a foreground sample pixel point; for each pixel point in the image to be segmented, determining whether the prior probability of the pixel point is less than the background probability threshold; if the pixel point The prior probability is less than the background probability threshold, and the pixel is determined as a background sample pixel.
  • the color likelihood probability calculation module applies a formula to calculate a first color likelihood probability of the head and shoulders foreground and a second color likelihood probability of the background:
  • N F refers to the number of cluster centers of the head and shoulder foreground sample pixels
  • N B refers to the number of cluster centers of the background sample pixels
  • w j refers to the ratio of the number of sample pixels in the j-th cluster center to the total number of sample pixels
  • refers to the average Euclidean distance between the color feature vectors of different cluster centers.
  • the posterior probability calculation module applies a formula to calculate a posterior probability of the head and shoulders foreground and a posterior probability of the background, including:
  • an image segmentation device comprising:
  • a memory for storing processor executable instructions
  • the processor is configured to: calculate a prior probability of a head-shoulder foreground for each pixel position in the preset size image according to the positioning result of the outer contour point of the face; according to the prior probability, preset a head and shoulder foreground probability threshold and a background probability threshold, selecting a head and shoulder foreground sample pixel point and a background sample pixel point in the image to be segmented; according to the color feature vector of the head and shoulder foreground sample pixel point and the color of the background sample pixel point a feature vector, calculating a first color likelihood probability of the head and shoulders foreground and a second color likelihood probability of the background; according to the prior probability, the first color likelihood probability, and the second color a probability, a first posterior probability of the head and shoulders foreground and a second posterior probability of the background are calculated; and the image to be segmented is performed according to the first posterior probability and the second posterior probability Head and shoulders are divided.
  • the prior probability of the head and shoulder foreground appears at each pixel position in the preset size image, and the head and shoulder foreground sample pixel points and the background are automatically selected based on the prior probability of the head and shoulder foreground.
  • the sample pixel points achieve the purpose of no user participation in the selection process of the sample pixel points, and the user experience is good.
  • the segmentation criterion is based on the prior probability and the color likelihood probability, and the segmentation standard is more detailed and segmented. High precision.
  • FIG. 1 is a flowchart of an image segmentation method according to an exemplary embodiment.
  • FIG. 2 is a flowchart of an image segmentation method according to an exemplary embodiment.
  • FIG. 3 is a block diagram of an image segmentation apparatus according to an exemplary embodiment.
  • FIG. 4 is a block diagram of an image segmentation apparatus, according to an exemplary embodiment.
  • FIG. 5 is a block diagram of an image segmentation apparatus, according to an exemplary embodiment.
  • FIG. 1 is a flowchart of an image segmentation method according to an exemplary embodiment. As shown in FIG. 1 , the image segmentation method is used in an image segmentation apparatus, and includes the following steps.
  • step 101 according to the positioning result of the outer contour point of the face, each of the preset size images is calculated.
  • a priori probability of a head and shoulders foreground occurs at a pixel location.
  • step 102 the head and shoulder foreground sample pixel points and the background sample pixel points are selected in the image to be segmented according to the prior probability, the preset head and shoulder foreground probability threshold, and the background probability threshold.
  • step 103 the first color likelihood probability of the head and shoulders foreground and the second color likelihood probability of the background are calculated according to the color feature vector of the head and shoulder foreground sample pixel points and the color feature vector of the background sample pixel point.
  • a first posterior probability of the head and shoulders foreground and a second posterior probability of the background are calculated based on the prior probability, the first color likelihood probability, and the second color likelihood probability.
  • step 105 the segmentation of the image to be segmented is performed according to the first posterior probability and the second posterior probability.
  • the method provided by the embodiment of the present disclosure calculates the prior probability of the head-shoulder foreground for each pixel position in the preset size image according to the positioning result of the outer contour point of the face, and automatically selects the prior probability based on the head-shoulder foreground.
  • the head and shoulder foreground sample pixel and the background sample pixel achieve the purpose of no user participation in the selection process of the sample pixel, and the user experience is good; in addition, based on the prior probability and the color likelihood probability when performing image segmentation Segmentation, the segmentation standard is more detailed, and the segmentation precision is higher.
  • calculating a prior probability of the head and shoulder foreground of each pixel position in the preset size image including:
  • a head and shoulder calibration image of each female frontal face image is generated
  • the alignment and size normalization processing of each head and shoulder calibration image is performed to obtain a plurality of preset size images
  • the prior probability of the head and shoulder foreground appears at the pixel position according to the head and shoulder foreground calibration result.
  • calculating a prior probability of the head and shoulder foreground of each pixel position in the preset size image including:
  • a head and shoulder calibration image of each male frontal face image is generated
  • the alignment and size normalization processing of each head and shoulder calibration image is performed to obtain a plurality of preset size images
  • the prior probability of the head and shoulder foreground appears at the pixel position according to the head and shoulder foreground calibration result.
  • the following formula is applied to calculate the prior probability of the head and shoulder foreground of the pixel position:
  • the head and shoulder foreground sample pixel points and the background sample pixel points are selected in the image to be segmented according to the prior probability, the preset head and shoulder foreground probability threshold, and the background probability threshold, including:
  • Gender recognition is performed on the face in the segmented image to obtain a gender recognition result
  • the pixel For each pixel in the image to be segmented, it is determined whether the prior probability of the pixel point is greater than the head and shoulder foreground probability threshold; if the prior probability of the pixel is greater than the head and shoulder foreground probability threshold, the pixel is determined as the foreground sample pixel ;
  • the pixel point For each pixel in the image to be segmented, it is determined whether the prior probability of the pixel point is less than the background probability threshold; if the prior probability of the pixel point is less than the background probability threshold, the pixel point is determined as the background sample pixel point.
  • the following formula is applied to calculate the first color likelihood probability of the head and shoulders foreground and the second color likelihood probability of the background ,include:
  • N F refers to the number of cluster centers of the head and shoulder foreground sample pixels
  • N B refers to the number of cluster centers of the background sample pixels
  • w j refers to the ratio of the number of sample pixels in the j-th cluster center to the total number of sample pixels
  • refers to the average Euclidean distance between the color feature vectors of different cluster centers.
  • the first color likelihood probability, and the second color likelihood probability applying the following formula, calculating a posterior probability of the head and shoulders foreground, and a posterior probability of the background, including:
  • FIG. 2 is a flowchart of an image segmentation method according to an exemplary embodiment. As shown in FIG. 2, the image segmentation method is used in an image segmentation apparatus, and includes the following steps.
  • step 201 according to the positioning result of the outer contour point of the face, the prior probability of the head and shoulder foreground appears at each pixel position in the preset size image.
  • the calculation process of the prior probability of the head and shoulders foreground that is, the process of establishing the head and shoulder position prior model. Because of the differences in facial features between men and women, it is necessary to establish a prior model of the head and shoulder position and a prior model of the head and shoulder position of the male when establishing the a priori model of the head and shoulder position. Among them, the establishment process of the head and shoulder position prior model is as follows:
  • the establishment process of the female head and shoulder position prior model is divided into the following five steps.
  • the first step is to select a preset number of female positive face images.
  • the size of the preset number may be 500 or 1000, etc., and the embodiment of the present disclosure does not specifically limit this.
  • the preset number of female frontal face images is stored in the image training library as training data for the subsequent a priori model of the female head and shoulders position.
  • each female is generated.
  • the head and shoulders of the face image are calibrated.
  • the head and shoulder foreground calibration of a preset number of female frontal face images needs to be manually completed. That is, the user is required to manually calibrate the head and shoulder areas in each female frontal face image.
  • a binary image is generated, and the binary image is used as a head and shoulder calibration image.
  • the area where the pixel point gray value is 255 in the binary image is the head and shoulder foreground, that is, the white area in the binary image is the head and shoulder area; the area where the pixel point gray value is 0 in the binary image is the background. That is, the black area in the binary image is the background area.
  • the identification value can be set to 1, if it is the background, the identification value can be Set to 0.
  • the identification value can be set to 1 if it is the background.
  • the third step is to locate the external contour feature points of each female positive face image to obtain the positioning result.
  • the positioning algorithm of the existing external contour feature points of the face may be implemented when the facial contour feature points of each of the female frontal face images are located, and details are not described herein. After the face contour feature points of the female face image are positioned, the position coordinate data of the outer contour feature points of each face can be obtained.
  • each of the head and shoulder calibration images are aligned and normalized to obtain a plurality of preset size images.
  • the preset size may be 400*400, 200*200, etc., and the embodiment of the present disclosure does not specifically limit this.
  • the embodiment of the present disclosure is exemplified by taking a preset size of 400*400 as an example.
  • each head and shoulder calibration image after obtaining the positioning result of the external contour feature point of the face, first adjusting the head and shoulder calibration image according to the positioning result of the external contour feature point of the face to a uniform size; after that, the head and shoulder calibration image is aligned with the external contour feature point according to the position coordinate data of the external contour feature point of the face, and the head and shoulder calibration image is normalized into a 400*400 template. . Since each head and shoulder calibration image corresponds to a 400*400 template, multiple preset size images are available.
  • the prior probability of the head and shoulder foreground appears at the pixel position.
  • the pixel point position has a prior probability of the head, shoulder, and shoulder foreground, that is, each female front person in the image training library.
  • the pixel in the face image is calibrated to the frequency of the head and shoulders foreground. For example, suppose there are 1000 female positive face images, and a pixel is marked as a head and shoulder foreground in 500 female frontal face images, then the prior probability of the head and shoulders foreground appears at the pixel position. Is 0.5. Therefore, by counting the frequency at which each pixel is calibrated to the foreground of the head and shoulder in the training data, the probability of a head-and-shoulder foreground at each pixel position can be obtained.
  • the first step is to select a preset number of male frontal faces.
  • the size of the preset number may be 500 or 1000, etc., and the embodiment of the present disclosure does not specifically limit this.
  • the preset number of male frontal face images is stored in the image training library as training data for the subsequent male head and shoulder position prior model.
  • a head and shoulder calibration image of each male frontal face image is generated according to the user's calibration result of the head and shoulder foreground of each male positive face image.
  • step 201a The same as the second step in step 201a, and details are not described herein again.
  • the third step is to locate the external contour feature points of each male positive face image to obtain the positioning result.
  • step 201a The same as the third step in step 201a, and details are not described herein again.
  • each of the head and shoulder calibration images are aligned and normalized to obtain a plurality of preset size images.
  • the fourth step in the step 201a is the same as the above, and will not be described again here.
  • the prior probability of the head and shoulder foreground appears at the pixel position.
  • step 201a The same as the fifth step in step 201a, and details are not described herein again.
  • the prior probability of the head-shoulder foreground at each pixel position can be obtained by the following formula (1). According to the head-shoulder foreground calibration result, the following formula is applied. Calculate the prior probability of the head and shoulders foreground at the pixel position:
  • the female head and shoulder position prior model is obtained; for the male frontal face image, each one is calculated. After the prior probability of the head and shoulders foreground appears at the pixel position, the male head and shoulder position prior model is obtained.
  • step 202 the face in the image to be segmented is subjected to gender recognition to obtain a gender recognition result; and according to the gender recognition result, the prior probability corresponding to the image to be segmented is determined.
  • the features of the male face image and the female face image are different, corresponding to different head and shoulder position prior models, it is necessary to treat the face in the segmented image before performing image segmentation. Gender identification.
  • the existing face recognition algorithm may be adopted, and no further description is made here. Since the female head and shoulder position prior model and the male head and shoulder position prior model have been obtained in the above step 201, after determining the face gender in the image to be segmented, the head and shoulder position a priori corresponding to the image to be segmented can be directly determined.
  • the model that is, the prior probability corresponding to the image to be segmented.
  • step 203 for each pixel in the image to be segmented, it is determined whether the prior probability of the pixel point is greater than a head-shoulder foreground probability threshold; if the prior probability of the pixel point is greater than the head-shoulder foreground probability threshold, the pixel point is determined For the foreground The pixel point; determining whether the prior probability of the pixel point is less than the background probability threshold; if the prior probability of the pixel point is less than the background probability threshold, determining the pixel point as the background sample pixel point.
  • the head and shoulder foreground probability threshold may be specifically 0.7 or 0.8, etc., and the embodiment of the present disclosure does not specifically limit this.
  • the background probability threshold may be specifically 0.2 or 0.3, etc., and the embodiment of the present disclosure also does not specifically limit this.
  • the segmented image may be firstly subjected to local contour feature point positioning, and the image to be segmented is resized according to the positioning result to be compared with the size of the 400*400 template. the same.
  • each pixel in the image to be segmented corresponds to a pixel at the same position in the 400*400 template. Therefore, the prior probability of the head-and-shoulder foreground appears at the position of the pixel at the corresponding position in the 400*400 template, which is the prior probability corresponding to the pixel at the same position in the image to be segmented.
  • the head-shoulder foreground probability threshold of 0.8 0.8
  • the background probability threshold of 0.2 0.2
  • the pixel is determined as the foreground sample pixel; if the pixel If the prior probability of the point is less than 0.2, the pixel is determined as the background sample pixel. For pixels with a prior probability of 0.2 to 0.8, no processing is done.
  • a first color likelihood probability of the head and shoulders foreground and a second color likelihood probability of the background are calculated based on the color feature vector of the head and shoulder foreground sample pixel points and the color feature vector of the background sample pixel point.
  • the color feature vector of the head and shoulder foreground sample pixel points and the color feature vector of the background sample pixel point may be obtained by using an existing color vector calculation manner, and details are not described herein.
  • the embodiment of the present disclosure Before calculating the first color likelihood probability and the second color likelihood probability, that is, before obtaining the color likelihood model, the embodiment of the present disclosure further needs to compare the head and shoulder foreground sample pixel points and the background sample pixel points according to the correlation between the colors. Perform clustering.
  • the size of the N F and the N B may be other values in addition to the above values, which are not specifically limited in the embodiment of the present disclosure.
  • Equation (2) the first color likelihood probability of the head and shoulder foreground and the second color likelihood probability of the background are calculated, Equation (2) and formula (3) are implemented.
  • N F refers to the number of cluster centers of the head and shoulder foreground sample pixels
  • N B refers to the number of cluster centers of the background sample pixels
  • w j refers to the ratio of the number of sample pixels in the j-th cluster center to the total number of sample pixels
  • refers to the average Euclidean distance between the color feature vectors of different cluster centers.
  • a first posterior probability of the head and shoulders foreground and a second posterior probability of the background are calculated based on the prior probability, the first color likelihood probability, and the second color likelihood probability.
  • the color extrapolation vector of the head and shoulder foreground sample pixel and the background sample pixel is known.
  • the posterior probability of the jackpot foreground and the posterior probability of the background it can be obtained by the following formula (6) and formula (7).
  • step 206 the segmentation of the image to be segmented is performed according to the first posterior probability and the second posterior probability.
  • the final head-shoulder segmentation model is obtained.
  • the head-shoulder segmentation model is loaded into the data item in the Graph cut optimization framework, and combined with the contrast information of the image pixels, the min-cut-max-flow optimization method is used to segment the segmented image to obtain the final head-shoulder segmentation result.
  • the method provided by the embodiment of the present disclosure calculates the prior probability of the head-shoulder foreground for each pixel position in the preset size image according to the positioning result of the outer contour point of the face, and automatically selects the prior probability based on the head-shoulder foreground.
  • the head and shoulder foreground sample pixel and the background sample pixel achieve the purpose of no user participation in the selection process of the sample pixel, and the user experience is good; in addition, based on the prior probability and the color likelihood probability when performing image segmentation Segmentation, the segmentation standard is more detailed, and the segmentation precision is higher.
  • FIG. 3 is a block diagram of an image segmentation apparatus according to an exemplary embodiment.
  • the apparatus includes a prior probability calculation module 301, a sample pixel point selection module 302, a color likelihood probability calculation module 303, a posterior probability calculation module 304, and an image segmentation module 305.
  • the prior probability calculation module 301 is configured to calculate a prior probability of the head and shoulder foreground of each pixel position in the preset size image according to the positioning result of the outer contour point of the face; the sample pixel point selection module 302 and the prior Probability calculation The module 301 is connected to select a head and shoulder foreground sample pixel point and a background sample pixel point in the image to be segmented according to the prior probability, the preset head and shoulder foreground probability threshold and the background probability threshold; the color likelihood probability calculation module 303 and The sample pixel point selection module 302 is connected to calculate a first color likelihood probability of the head and shoulders foreground and a second color likelihood of the background according to the color feature vector of the head and shoulder foreground sample pixel points and the color feature vector of the background sample pixel point.
  • the probability; the posterior probability calculation module 304 is coupled to the color likelihood probability calculation module 303 for calculating the first posterior probability of the head and shoulders foreground based on the prior probability, the first color likelihood probability, and the second color likelihood probability.
  • the second posterior probability of the background; the image segmentation module 305 is coupled to the posterior probability calculation module 304 for performing head and shoulder segmentation on the segmentation image according to the first posterior probability and the second posterior probability.
  • the prior probability calculation module is configured to select a preset number of female frontal face images; and each female frontal face image is generated according to the user's calibration result of the head and shoulder foreground of each female frontal face image.
  • the head and shoulder calibration images; the facial contour points of each face are imaged for each female facial image to obtain the positioning result; according to the positioning result of the outer contour feature points of the face, the alignment images of each head and shoulder are aligned and
  • the size is normalized to obtain a plurality of preset size images; for a pixel point of the same position in a plurality of preset size images, according to the head and shoulder foreground calibration result, the prior probability of the head and shoulder foreground appears at the pixel position.
  • the prior probability calculation module is configured to select a preset number of male frontal face images; and generate each male frontal face image according to the user's calibration result of the head and shoulder foreground of each male positive facial image.
  • the head and shoulders are calibrated; the facial contour points of each face are positioned for each male facial image to obtain a positioning result; and the alignment images of each head and shoulder are aligned according to the positioning result of the outer contour feature points of the face and
  • the size is normalized to obtain a plurality of preset size images; for a pixel point of the same position in a plurality of preset size images, according to the head and shoulder foreground calibration result, the prior probability of the head and shoulder foreground appears at the pixel position.
  • the prior probability calculation module applies the following formula to calculate the prior probability of the head and shoulder foreground of the pixel position:
  • the sample pixel point selection module is configured to perform gender recognition on the face in the segmentation image to obtain a gender recognition result; and determine, according to the gender recognition result, a prior probability corresponding to the image to be segmented; a pixel point, determining whether the prior probability of the pixel point is greater than the head and shoulder foreground probability threshold; if the prior probability of the pixel point is greater than the head and shoulder foreground probability threshold, determining the pixel point as the foreground sample pixel point; for the image to be segmented For each pixel, determine whether the prior probability of the pixel is less than the background probability threshold; if the prior probability of the pixel is less than the background probability threshold, The pixel is then determined as the background sample pixel.
  • the color likelihood probability calculation module applies the following formula to calculate a first color likelihood probability of the head and shoulders foreground and a second color likelihood probability of the background:
  • N F refers to the number of cluster centers of the head and shoulder foreground sample pixels
  • N B refers to the number of cluster centers of the background sample pixels
  • w j refers to the ratio of the number of sample pixels in the j-th cluster center to the total number of sample pixels
  • refers to the average Euclidean distance between the color feature vectors of different cluster centers.
  • the posterior probability calculation module applies the following formula to calculate the posterior probability of the head and shoulders foreground and the posterior probability of the background, including:
  • the device provided by the embodiment of the present disclosure automatically calculates the prior probability of the head and shoulders foreground for each pixel position in the preset size image according to the positioning result of the outer contour point of the face, and automatically selects the prior probability based on the head and shoulder foreground.
  • the head and shoulder foreground sample pixel and the background sample pixel achieve the purpose of no user participation in the selection process of the sample pixel, and the user experience is good; in addition, based on the prior probability and the color likelihood probability when performing image segmentation Segmentation More detailed, high segmentation accuracy.
  • FIG. 4 is a block diagram of an apparatus 400 for segmenting a table image, according to an exemplary embodiment.
  • device 400 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a gaming console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
  • device 400 can include one or more of the following components: processing component 402, memory 404, power component 406, multimedia component 408, audio component 410, I/O (Input/Output) interface 412, sensor Component 414, and communication component 416.
  • processing component 402 memory 404
  • power component 406 multimedia component 408, audio component 410
  • I/O (Input/Output) interface 412 sensor Component 414
  • communication component 416 communication component 416.
  • Processing component 402 typically controls the overall operation of device 400, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations.
  • Processing component 402 can include one or more processors 420 to execute instructions to perform all or part of the steps of the methods described above.
  • processing component 402 can include one or more modules to facilitate interaction between component 402 and other components.
  • processing component 402 can include a multimedia module to facilitate interaction between multimedia component 408 and processing component 402.
  • Memory 404 is configured to store various types of data to support operation at device 400. Examples of such data include instructions for any application or method operating on device 400, contact data, phone book data, messages, pictures, videos, and the like.
  • the memory 404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as SRAM (Static Random Access Memory), EEPROM (Electrically-Erasable Programmable Read-Only Memory) Erasable Programmable Read Only Memory (EPROM), PROM (Programmable Read-Only Memory), ROM (Read-Only Memory, Read only memory), magnetic memory, flash memory, disk or optical disk.
  • SRAM Static Random Access Memory
  • EEPROM Electrically-Erasable Programmable Read-Only Memory
  • EPROM Erasable Programmable Read Only Memory
  • PROM Programmable Read-Only Memory
  • ROM Read-Only Memory, Read only memory
  • magnetic memory flash memory, disk or optical disk.
  • Power component 406 provides power to various components of device 400.
  • Power component 406 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for device 400.
  • the multimedia component 408 includes a screen between the device 400 and the user that provides an output interface.
  • the screen may include an LCD (Liquid Crystal Display) and a TP (Touch Panel). If the screen includes a TP, the screen can be implemented as a touch screen to receive input signals from the user.
  • the TP includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor can not only sense the boundaries of the touch or swipe action, but can also detect the duration and pressure associated with the touch or slide operation.
  • the multimedia component 408 includes a front camera and/or a rear camera. When the device 400 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front and rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
  • the audio component 410 is configured to output and/or input an audio signal.
  • the audio component 410 includes a MIC (Microphone), when the device 400 is in an operation mode such as a call mode, a recording mode, and a voice recognition mode,
  • the microphone is configured to receive an external audio signal.
  • the received audio signal may be further stored in memory 404 or transmitted via communication component 416.
  • audio component 410 also includes a speaker for outputting an audio signal.
  • the I/O interface 412 provides an interface between the processing component 402 and the peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to, a home button, a volume button, a start button, and a lock button.
  • Sensor assembly 414 includes one or more sensors for providing device 400 with a status assessment of various aspects.
  • sensor component 414 can detect an open/closed state of device 400, a relative positioning of components, such as a display and keypad of device 400, and sensor component 414 can also detect a change in position of one component of device 400 or device 400, user The presence or absence of contact with device 400, device 400 orientation or acceleration/deceleration and temperature variation of device 400.
  • Sensor assembly 414 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact.
  • Sensor assembly 414 may also include a light sensor, such as a CMOS (Complementary Metal Oxide Semiconductor) or CCD (Charge-coupled Device) image sensor for use in imaging applications.
  • the sensor assembly 414 can also include an acceleration sensor, a gyro sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communication component 416 is configured to facilitate wired or wireless communication between device 400 and other devices.
  • Device 400 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof.
  • communication component 416 receives broadcast signals or broadcast associated information from an external broadcast management system via a broadcast channel.
  • communication component 416 also includes an NFC (Near Field Communication) module to facilitate short range communication.
  • the NFC module can be based on RFID (Radio Frequency Identification) technology, IrDA (Infra-red Data Association) technology, UWB (Ultra Wideband) technology, BT (Bluetooth) technology and Other technologies to achieve.
  • RFID Radio Frequency Identification
  • IrDA Infra-red Data Association
  • UWB Ultra Wideband
  • BT Bluetooth
  • the device 400 may be configured by one or more ASICs (Application Specific Integrated Circuits), DSP (Digital Signal Processor), DSPD (Digital Signal Processor Device) Device), PLD (Programmable Logic Device), FPGA (Field Programmable Gate Array), controller, microcontroller, microprocessor or other electronic component implementation for performing the above method.
  • ASICs Application Specific Integrated Circuits
  • DSP Digital Signal Processor
  • DSPD Digital Signal Processor Device
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • controller microcontroller, microprocessor or other electronic component implementation for performing the above method.
  • non-transitory computer readable storage medium comprising instructions, such as a memory 404 comprising instructions executable by processor 420 of device 400 to perform the above method.
  • the non-transitory computer readable storage medium may be a ROM, a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, and an optical data storage device. Wait.
  • a non-transitory computer readable storage medium when executed by a processor of a mobile terminal, enables a mobile terminal to perform an image segmentation method, the method comprising:
  • the head and shoulder segmentation is performed on the segmentation image according to the first posterior probability and the second posterior probability.
  • calculating a prior probability of the head and shoulder foreground of each pixel position in the preset size image including:
  • a head and shoulder calibration image of each female frontal face image is generated
  • the alignment and size normalization processing of each head and shoulder calibration image is performed to obtain a plurality of preset size images
  • the prior probability of the head and shoulder foreground appears at the pixel position according to the head and shoulder foreground calibration result.
  • calculating a prior probability of the head and shoulder foreground of each pixel position in the preset size image including:
  • a head and shoulder calibration image of each male frontal face image is generated
  • the alignment and size normalization processing of each head and shoulder calibration image is performed to obtain a plurality of preset size images
  • the prior probability of the head and shoulder foreground appears at the pixel position according to the head and shoulder foreground calibration result.
  • the following formula is applied to calculate the prior probability of the head and shoulder foreground of the pixel position:
  • the head and shoulder foreground sample pixel points and the background sample pixel points are selected in the image to be segmented according to the prior probability, the preset head and shoulder foreground probability threshold, and the background probability threshold, including:
  • Gender recognition is performed on the face in the segmented image to obtain a gender recognition result
  • the pixel For each pixel in the image to be segmented, it is determined whether the prior probability of the pixel point is greater than the head and shoulder foreground probability threshold; if the prior probability of the pixel is greater than the head and shoulder foreground probability threshold, the pixel is determined as the foreground sample pixel ;
  • the pixel point For each pixel in the image to be segmented, it is determined whether the prior probability of the pixel point is less than the background probability threshold; if the prior probability of the pixel point is less than the background probability threshold, the pixel point is determined as the background sample pixel point.
  • the following formula is applied to calculate the first color likelihood probability of the head and shoulders foreground and the second color likelihood probability of the background ,include:
  • N F refers to the number of cluster centers of the head and shoulder foreground sample pixels
  • N B refers to the number of cluster centers of the background sample pixels
  • w j refers to the ratio of the number of sample pixels in the j-th cluster center to the total number of sample pixels
  • refers to the average Euclidean distance between the color feature vectors of different cluster centers.
  • the first color likelihood probability, and the second color likelihood probability applying the following formula, calculating a posterior probability of the head and shoulders foreground, and a posterior probability of the background, including:
  • the non-transitory computer readable storage medium calculates a prior probability of head and shoulder foreground for each pixel position in the preset size image according to the positioning result of the outer contour point of the face, and is based on the head and shoulders.
  • the prior probability of the foreground automatically selects the head and shoulder foreground sample pixels and the background sample pixels, which achieves the purpose of no user participation in the selection process of the sample pixel points, and the user experience is good; in addition, based on the priori in image segmentation Probability and color likelihood probability are segmented, the segmentation criteria are more detailed, and the segmentation precision is higher.
  • FIG. 5 is a block diagram of an apparatus 500 for image segmentation, according to an exemplary embodiment.
  • device 500 can be provided as a server.
  • apparatus 500 includes a processing component 522 that further includes one or more processors, and memory resources represented by memory 532 for storing instructions executable by processing component 522, such as an application.
  • An application stored in memory 532 can include one or more modules each corresponding to a set of instructions.
  • processing component 522 is configured to execute instructions to perform the methods described above...
  • Device 500 may also include a power component 526 configured to perform power management of device 500, a wired or wireless network interface 550 configured to connect device 500 to the network, and an input/output (I/O) interface 558.
  • Device 500 can operate based on an operating system stored in memory 532, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Signal Processing (AREA)
  • Probability & Statistics with Applications (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

一种图像分割方法、装置及设备,属于图像处理技术领域。方法包括:根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率;根据先验概率、预先设置的头肩前景概率阈值和背景概率阈值,在待分割图像中选取头肩前景样本像素点和背景样本像素点;根据头肩前景样本像素点和背景样本像素点的颜色特征向量,计算头肩前景的第一颜色似然概率和背景的第二颜色似然概率;根据先验概率、第一颜色似然概率和第二颜色似然概率,计算头肩前景的第一后验概率和背景的第二后验概率;根据第一后验概率和第二后验概率,对待分割图像进行头肩分割。由于基于先验概率和颜色似然概率进行图像分割,分割精度较高。

Description

图像分割方法、装置及设备
本申请基于申请号为201410353140.7、申请日为2014年7月23日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本公开涉及图像处理技术领域,特别涉及一种图像分割方法、装置及设备。
背景技术
随着网络多媒体信息量的快速增长,头肩分割技术,作为一种特殊的图像分割技术得到了推动性的发展。其现已广泛应用于诸如视频会议的背景替换,移动设备上前置摄像头拍人、后置摄像头拍景等场景中。
相关技术中,在进行图像的头肩分割时,首先指示用户选取头肩前景的第一样本像素点和背景的第二样本像素点;之后,分别计算第一样本像素点和第二样本像素点的颜色特征向量,得到头肩前景的第一颜色特征向量和背景的第二颜色特征向量;根据第一颜色特征向量和第二颜色特征向量,分别对头肩前景和背景进行颜色建模,得到第一颜色模型和第二颜色模型;最后,采用第一颜色模型和第二颜色模型对图像进行头肩分割,得到头肩分割结果。
在实现本公开的过程中,发明人发现相关技术至少存在以下问题:
在图像分割过程中需要用户参与样本像素点的选取,所以用户体验较差;此外,由于仅基于样本像素点的颜色特征向量进行图像分割,所以分割精度较差。
发明内容
为克服相关技术中存在的问题,本公开提供一种图像分割方法、装置及设备。
根据本公开实施例的第一方面,提供一种图像分割方法,所述方法包括:根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置
出现头肩前景的先验概率;
根据所述先验概率、预先设置的头肩前景概率阈值和背景概率阈值,在待分割图像中选取头肩前景样本像素点和背景样本像素点;
根据所述头肩前景样本像素点的颜色特征向量和所述背景样本像素点的颜色特征向量,计算所述头肩前景的第一颜色似然概率和所述背景的第二颜色似然概率;
根据所述先验概率、所述第一颜色似然概率和所述第二颜色似然概率,计算所述头肩前景的第一后验概率和所述背景的第二后验概率;
根据所述第一后验概率和所述第二后验概率,对所述待分割图像进行头肩分割。
可选地,所述根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置 出现头肩前景的先验概率,包括:
选取预设数目幅女性正面人脸图像;
根据用户对每一幅女性正面人脸图像的头肩前景标定结果,生成每一幅女性正面人脸图像的头肩标定图像;
对每一幅女性正面人脸图像进行人脸外部轮廓特征点定位,得到定位结果;
根据人脸外部轮廓特征点的定位结果,对每一幅头肩标定图像进行对齐及尺寸归一化处理,得到多幅预设大小图像;
对于多幅预设大小图像中同一位置的像素点,根据所述头肩前景标定结果,计算所述像素点位置出现头肩前景的先验概率。
可选地,所述根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率,包括:
选取预设数目幅男性正面人脸图像;
根据用户对每一幅男性正面人脸图像的头肩前景标定结果,生成每一幅男性正面人脸图像的头肩标定图像;
对每一幅男性正面人脸图像进行人脸外部轮廓特征点定位,得到定位结果;
根据人脸外部轮廓特征点的定位结果,对所述每一幅头肩标定图像进行对齐及尺寸归一化处理,得到多幅预设大小图像;
对于多幅预设大小图像中同一位置的像素点,根据所述头肩前景标定结果,计算所述像素点位置出现头肩前景的先验概率。
可选地,所述根据所述头肩前景标定结果,应用如下公式,计算所述像素点位置出现头肩前景的先验概率:
Figure PCTCN2014091643-appb-000001
其中,
Figure PCTCN2014091643-appb-000002
指代像素点(xi,yi)处出现头肩前景的先验概率,
Figure PCTCN2014091643-appb-000003
指代第j幅图像中像素点(xi,yi)处的标定结果,
Figure PCTCN2014091643-appb-000004
表示第j幅图像中像素点(xi,yi)处被标定成头肩前景,
Figure PCTCN2014091643-appb-000005
表示第j幅图像中像素点(xi,yi)处被标定成背景,N指代正面人脸图像的数目。
可选地,所述根据所述先验概率、预先设置的头肩前景概率阈值和背景概率阈值,在待分割图像中选取头肩前景样本像素点和背景样本像素点,包括:
对所述待分割图像中的人脸进行性别识别,得到性别识别结果;
根据所述性别识别结果,确定所述待分割图像对应的先验概率;
对于所述待分割图像中的每一个像素点,判断所述像素点的先验概率是否大于所述头肩 前景概率阈值;如果所述像素点的先验概率大于所述头肩前景概率阈值,则将所述像素点确定为前景样本像素点;
对于所述待分割图像中的每一个像素点,判断所述像素点的先验概率是否小于所述背景概率阈值;如果所述像素点的先验概率小于所述背景概率阈值,则将所述像素点确定为背景样本像素点。
可选地,所述根据所述头肩前景样本像素点的颜色特征向量和所述背景样本像素点的颜色特征向量,应用下述公式,计算所述头肩前景的第一颜色似然概率和所述背景的第二颜色似然概率,包括:
Figure PCTCN2014091643-appb-000006
Figure PCTCN2014091643-appb-000007
其中,
Figure PCTCN2014091643-appb-000008
指代第j个聚类中心的颜色特征向量,
Figure PCTCN2014091643-appb-000009
指代第一颜色似然概率,
Figure PCTCN2014091643-appb-000010
指代第二颜色似然概率,NF指代头肩前景样本像素点的聚类中心个数,NB指代背景样本像素点的聚类中心个数;
Figure PCTCN2014091643-appb-000011
指代颜色特征向量
Figure PCTCN2014091643-appb-000012
到聚类中心
Figure PCTCN2014091643-appb-000013
的欧式距离,wj指代第j个聚类中心的样本像素点个数占总样本像素点个数的比率,β指代不同聚类中心的颜色特征向量之间的平均欧式距离值,其定义如下:
Figure PCTCN2014091643-appb-000014
Figure PCTCN2014091643-appb-000015
可选地,所述根据所述先验概率、所述第一颜色似然概率和所述第二颜色似然概率,应用如下公式,计算所述头肩前景的后验概率、所述背景的后验概率,包括:
Figure PCTCN2014091643-appb-000016
Figure PCTCN2014091643-appb-000017
其中,
Figure PCTCN2014091643-appb-000018
指代所述头肩前景的后验概率;
Figure PCTCN2014091643-appb-000019
指代所述背景的后验概率。
根据本公开实施例的第二方面,提供一种图像分割装置,所述装置包括:
先验概率计算模块,用于根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率;
样本像素点选取模块,用于根据所述先验概率、预先设置的头肩前景概率阈值和背景概率阈值,在待分割图像中选取头肩前景样本像素点和背景样本像素点;
颜色似然概率计算模块,用于根据所述头肩前景样本像素点的颜色特征向量和所述背景样本像素点的颜色特征向量,计算所述头肩前景的第一颜色似然概率和所述背景的第二颜色似然概率;
后验概率计算模块,用于根据所述先验概率、所述第一颜色似然概率和所述第二颜色似然概率,计算所述头肩前景的第一后验概率和所述背景的第二后验概率;
图像分割模块,用于根据所述第一后验概率和所述第二后验概率,对所述待分割图像进行头肩分割。
可选地,所述先验概率计算模块,用于选取预设数目幅女性正面人脸图像;根据用户对每一幅女性正面人脸图像的头肩前景标定结果,生成每一幅女性正面人脸图像的头肩标定图像;对每一幅女性正面人脸图像进行人脸外部轮廓特征点定位,得到定位结果;根据人脸外部轮廓特征点的定位结果,对每一幅头肩标定图像进行对齐及尺寸归一化处理,得到多幅预设大小图像;对于多幅预设大小图像中同一位置的像素点,根据所述头肩前景标定结果,计算所述像素点位置出现头肩前景的先验概率。
可选地,所述先验概率计算模块,用于选取预设数目幅男性正面人脸图像;根据用户对每一幅男性正面人脸图像的头肩前景标定结果,生成每一幅男性正面人脸图像的头肩标定图像;对每一幅男性正面人脸图像进行人脸外部轮廓特征点定位,得到定位结果;根据人脸外部轮廓特征点的定位结果,对所述每一幅头肩标定图像进行对齐及尺寸归一化处理,得到多幅预设大小图像;对于多幅预设大小图像中同一位置的像素点,根据所述头肩前景标定结果,计算所述像素点位置出现头肩前景的先验概率。
可选地,所述先验概率计算模块,应用如下公式,计算所述像素点位置出现头肩前景的先验概率:
Figure PCTCN2014091643-appb-000020
其中,
Figure PCTCN2014091643-appb-000021
指代像素点(xi,yi)处出现头肩前景的先验概率,
Figure PCTCN2014091643-appb-000022
指代第j幅 图像中像素点(xi,yi)处的标定结果,
Figure PCTCN2014091643-appb-000023
表示第j幅图像中像素点(xi,yi)处被标定成头肩前景,
Figure PCTCN2014091643-appb-000024
表示第j幅图像中像素点(xi,yi)处被标定成背景,N指代正面人脸图像的数目。
可选地,所述样本像素点选取模块,用于对所述待分割图像中的人脸进行性别识别,得到性别识别结果;根据所述性别识别结果,确定所述待分割图像对应的先验概率;对于所述待分割图像中的每一个像素点,判断所述像素点的先验概率是否大于所述头肩前景概率阈值;如果所述像素点的先验概率大于所述头肩前景概率阈值,则将所述像素点确定为前景样本像素点;对于所述待分割图像中的每一个像素点,判断所述像素点的先验概率是否小于所述背景概率阈值;如果所述像素点的先验概率小于所述背景概率阈值,则将所述像素点确定为背景样本像素点。
可选地,所述颜色似然概率计算模块,应用下述公式,计算所述头肩前景的第一颜色似然概率和所述背景的第二颜色似然概率:
Figure PCTCN2014091643-appb-000025
Figure PCTCN2014091643-appb-000026
其中,
Figure PCTCN2014091643-appb-000027
指代第j个聚类中心的颜色特征向量,
Figure PCTCN2014091643-appb-000028
指代第一颜色似然概率,
Figure PCTCN2014091643-appb-000029
指代第二颜色似然概率,NF指代头肩前景样本像素点的聚类中心个数,NB指代背景样本像素点的聚类中心个数;
Figure PCTCN2014091643-appb-000030
指代颜色特征向量
Figure PCTCN2014091643-appb-000031
到聚类中心
Figure PCTCN2014091643-appb-000032
的欧式距离,wj指代第j个聚类中心的样本像素点个数占总样本像素点个数的比率,β指代不同聚类中心的颜色特征向量之间的平均欧式距离值,其定义如下:
Figure PCTCN2014091643-appb-000033
Figure PCTCN2014091643-appb-000034
可选地,所述后验概率计算模块,应用如下公式,计算所述头肩前景的后验概率、所述背景的后验概率,包括:
Figure PCTCN2014091643-appb-000035
Figure PCTCN2014091643-appb-000036
其中,
Figure PCTCN2014091643-appb-000037
指代所述头肩前景的后验概率;
Figure PCTCN2014091643-appb-000038
指代所述背景的后验概率。
根据本公开实施例的第三方面,提供一种图像分割设备,所述设备包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器被配置为:根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率;根据所述先验概率、预先设置的头肩前景概率阈值和背景概率阈值,在待分割图像中选取头肩前景样本像素点和背景样本像素点;根据所述头肩前景样本像素点的颜色特征向量和所述背景样本像素点的颜色特征向量,计算所述头肩前景的第一颜色似然概率和所述背景的第二颜色似然概率;根据所述先验概率、所述第一颜色似然概率和所述第二颜色似然概率,计算所述头肩前景的第一后验概率和所述背景的第二后验概率;根据所述第一后验概率和所述第二后验概率,对所述待分割图像进行头肩分割。
本公开的实施例提供的技术方案可以包括以下有益效果:
由于根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率,并基于头肩前景的先验概率自动选取头肩前景样本像素点和背景样本像素点,达到了在样本像素点的选择过程中无需用户参与的目的,用户体验度良好;此外,在进行图像分割时基于先验概率和颜色似然概率进行分割,分割标准较为细致,分割精度较高。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
图1是根据一示例性实施例示出的一种图像分割方法的流程图。
图2是根据一示例性实施例示出的一种图像分割方法的流程图。
图3是根据一示例性实施例示出的一种图像分割装置的框图。
图4是根据一示例性实施例示出的一种图像分割设备的框图。
图5是根据一示例性实施例示出的一种图像分割设备的框图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。
图1是根据一示例性实施例示出的一种图像分割方法的流程图,如图1所示,该图像分割方法用于图像分割设备中,包括以下步骤。
在步骤101中,根据人脸外部轮廓点的定位结果,计算预设大小图像中每
一个像素点位置出现头肩前景的先验概率。
在步骤102中,根据先验概率、预先设置的头肩前景概率阈值和背景概率阈值,在待分割图像中选取头肩前景样本像素点和背景样本像素点。
在步骤103中,根据头肩前景样本像素点的颜色特征向量和背景样本像素点的颜色特征向量,计算头肩前景的第一颜色似然概率和背景的第二颜色似然概率。
在步骤104中,根据先验概率、第一颜色似然概率和第二颜色似然概率,计算头肩前景的第一后验概率和背景的第二后验概率。
在步骤105中,根据第一后验概率和第二后验概率,对待分割图像进行头肩分割。
本公开实施例提供的方法,由于根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率,并基于头肩前景的先验概率自动选取头肩前景样本像素点和背景样本像素点,达到了在样本像素点的选择过程中无需用户参与的目的,用户体验度良好;此外,在进行图像分割时基于先验概率和颜色似然概率进行分割,分割标准较为细致,分割精度较高。
可选地,根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率,包括:
选取预设数目幅女性正面人脸图像;
根据用户对每一幅女性正面人脸图像的头肩前景标定结果,生成每一幅女性正面人脸图像的头肩标定图像;
对每一幅女性正面人脸图像进行人脸外部轮廓特征点定位,得到定位结果;
根据人脸外部轮廓特征点的定位结果,对每一幅头肩标定图像进行对齐及尺寸归一化处理,得到多幅预设大小图像;
对于多幅预设大小图像中同一位置的像素点,根据头肩前景标定结果,计算像素点位置出现头肩前景的先验概率。
可选地,根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率,包括:
选取预设数目幅男性正面人脸图像;
根据用户对每一幅男性正面人脸图像的头肩前景标定结果,生成每一幅男性正面人脸图像的头肩标定图像;
对每一幅男性正面人脸图像进行人脸外部轮廓特征点定位,得到定位结果;
根据人脸外部轮廓特征点的定位结果,对每一幅头肩标定图像进行对齐及尺寸归一化处理,得到多幅预设大小图像;
对于多幅预设大小图像中同一位置的像素点,根据头肩前景标定结果,计算像素点位置出现头肩前景的先验概率。
可选地,根据头肩前景标定结果,应用如下公式,计算像素点位置出现头肩前景的先验概率:
Figure PCTCN2014091643-appb-000039
其中,
Figure PCTCN2014091643-appb-000040
指代像素点(xi,yi)处出现头肩前景的先验概率,
Figure PCTCN2014091643-appb-000041
指代第j幅图像中像素点(xi,yi)处的标定结果,
Figure PCTCN2014091643-appb-000042
表示第j幅图像中像素点(xi,yi)处被标定成头肩前景,
Figure PCTCN2014091643-appb-000043
表示第j幅图像中像素点(xi,yi)处被标定成背景,N指代正面人脸图像的数目。
可选地,根据先验概率、预先设置的头肩前景概率阈值和背景概率阈值,在待分割图像中选取头肩前景样本像素点和背景样本像素点,包括:
对待分割图像中的人脸进行性别识别,得到性别识别结果;
根据性别识别结果,确定待分割图像对应的先验概率;
对于待分割图像中的每一个像素点,判断像素点的先验概率是否大于头肩前景概率阈值;如果像素点的先验概率大于头肩前景概率阈值,则将像素点确定为前景样本像素点;
对于待分割图像中的每一个像素点,判断像素点的先验概率是否小于背景概率阈值;如果像素点的先验概率小于背景概率阈值,则将像素点确定为背景样本像素点。
可选地,根据头肩前景样本像素点的颜色特征向量和背景样本像素点的颜色特征向量,应用下述公式,计算头肩前景的第一颜色似然概率和背景的第二颜色似然概率,包括:
Figure PCTCN2014091643-appb-000044
Figure PCTCN2014091643-appb-000045
其中,
Figure PCTCN2014091643-appb-000046
指代第j个聚类中心的颜色特征向量,
Figure PCTCN2014091643-appb-000047
指代第一颜色似然概率,
Figure PCTCN2014091643-appb-000048
指代第二颜色似然概率,NF指代头肩前景样本像素点 的聚类中心个数,NB指代背景样本像素点的聚类中心个数;
Figure PCTCN2014091643-appb-000049
指代颜色特征向量
Figure PCTCN2014091643-appb-000050
到聚类中心
Figure PCTCN2014091643-appb-000051
的欧式距离,wj指代第j个聚类中心的样本像素点个数占总样本像素点个数的比率,β指代不同聚类中心的颜色特征向量之间的平均欧式距离值,其定义如下:
Figure PCTCN2014091643-appb-000052
Figure PCTCN2014091643-appb-000053
可选地,根据先验概率、第一颜色似然概率和第二颜色似然概率,应用如下公式,计算头肩前景的后验概率、背景的后验概率,包括:
Figure PCTCN2014091643-appb-000054
Figure PCTCN2014091643-appb-000055
其中,
Figure PCTCN2014091643-appb-000056
指代头肩前景的后验概率;
Figure PCTCN2014091643-appb-000057
指代背景的后验概率。
上述所有可选技术方案,可以采用任意结合形成本公开的可选实施例,在此不再一一赘述。
图2是根据一示例性实施例示出的一种图像分割方法的流程图,如图2所示,该图像分割方法用于图像分割设备中,包括以下步骤。
在步骤201中,根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率。
在本公开实施例中,头肩前景的先验概率的计算过程,也即建立头肩位置先验模型的过程。由于男性和女性的脸部特征有所差异,所以在建立头肩位置先验模型时,还需分别建立女性头肩位置先验模型和男性头肩位置先验模型。其中,头肩位置先验模型的建立过程如下:
201a、女性头肩位置先验模型的建立过程分为下述五个步骤。
第一步、选取预设数目幅女性正面人脸图像。
其中,预设数目的大小可为500或1000等等,本公开实施例对此不作具体限定。预设数目幅女性正面人脸图像作为后续得到女性头肩位置先验模型的训练数据存放在图像训练库中。
第二步、根据用户对每一幅女性正面人脸图像的头肩前景标定结果,生成每一幅女性正 面人脸图像的头肩标定图像。
在离线训练的过程中,预设数目幅女性正面人脸图像的头肩前景标定,需要人工完成。也即,需要用户手动标定每一幅女性正面人脸图像中的头肩区域。在得到每一幅女性正面人脸图像的标定结果后,生成一幅二值图像,并将该二值图像作为头肩标定图像。其中,二值图像中像素点灰度值为255的区域为头肩前景,也即二值图像中的白色区域为头肩区域;二值图像中像素点灰度值为0的区域为背景,也即二值图像中的黑色区域为背景区域。
此外,在对女性正面人脸图像进行头肩前景标定时,对于一个像素点来说,若其为头肩前景,则可将其标识值置1,若其为背景,则可将其标识值置0。以像素点(xi,yi)为例,则
Figure PCTCN2014091643-appb-000058
表示像素点(xi,yi)被标定成头肩前景,
Figure PCTCN2014091643-appb-000059
表示像素点(xi,yi)被标定成背景。
第三步、对每一幅女性正面人脸图像进行人脸外部轮廓特征点定位,得到定位结果。
在本公开实施例中,在对每一幅女性正面人脸图像进行人脸外部轮廓特征点定位时,可采取现有的人脸外部轮廓特征点的定位算法实现,在此不再进行赘述。在对女性正面人脸图像进行人脸外部轮廓特征点的定位后,可得到每一个人脸外部轮廓特征点的位置坐标数据。
第四步、根据人脸外部轮廓特征点的定位结果,对每一幅头肩标定图像进行对齐及尺寸归一化处理,得到多幅预设大小图像。
其中,预设大小可为400*400,200*200等,本公开实施例对此不作具体限定。本公开实施例仅以预设大小为400*400为例进行举例说明。
在本公开实施例中,对于每一幅头肩标定图像来说,在得到人脸外部轮廓特征点的定位结果后,首先根据人脸外部轮廓特征点的定位结果将该头肩标定图像调整到一个统一的尺寸;之后,根据人脸外部轮廓特征点的位置坐标数据将头肩标定图像与人脸外部轮廓特征点进行对齐,并将头肩标定图像归一化到一个400*400的模板内。由于每一个头肩标定图像均对应一个400*400的模板,因此可得到多幅预设大小图像。
第五步、对于多幅预设大小图像中同一位置的像素点,根据头肩前景标定结果,计算像素点位置出现头肩前景的先验概率。
在本公开实施例中,对于多幅预设大小图像中同一位置的像素点来说,该像素点位置出现头肩头肩前景的先验概率,也即在图像训练库中每一幅女性正面人脸图像中该像素点被标定成头肩前景的频率。举个例子来说,假设有1000幅女性正面人脸图像,某一像素点在500张女性正面人脸图像中被标定成头肩前景,则该像素点位置出现头肩前景的先验概率便为0.5。因此,统计每一个像素点在训练数据中被标定成头肩前景的频率,便可得到每一个像素点位置出现头肩前景的概率。
201b、男性头肩位置先验模型的建立过程分为下述五个步骤。
第一步、选取预设数目幅男性正面人脸图像。
其中,预设数目的大小可为500或1000等等,本公开实施例对此不作具体限定。预设数目幅男性正面人脸图像作为后续得到男性头肩位置先验模型的训练数据存放在图像训练库中。
第二步、根据用户对每一幅男性正面人脸图像的头肩前景标定结果,生成每一幅男性正面人脸图像的头肩标定图像。
同步骤201a中第二步同理,此处不再赘述。
第三步、对每一幅男性正面人脸图像进行人脸外部轮廓特征点定位,得到定位结果。
同步骤201a中第三步同理,此处不再赘述。
第四步、根据人脸外部轮廓特征点的定位结果,对每一幅头肩标定图像进行对齐及尺寸归一化处理,得到多幅预设大小图像。
同步骤201a中第四步同理,此处不再赘述。
第五步、对于多幅预设大小图像中同一位置的像素点,根据头肩前景标定结果,计算像素点位置出现头肩前景的先验概率。
同步骤201a中第五步同理,此处不再赘述。
需要说明的是,无论针对步骤201a还是步骤201b来说,每一个像素点位置出现头肩前景的先验概率均可通过下述公式(1)得到,根据头肩前景标定结果,应用如下公式,计算像素点位置出现头肩前景的先验概率:
Figure PCTCN2014091643-appb-000060
其中,
Figure PCTCN2014091643-appb-000061
指代像素点(xi,yi)处出现头肩前景的先验概率,
Figure PCTCN2014091643-appb-000062
指代第j幅图像中像素点(xi,yi)处的标定结果,
Figure PCTCN2014091643-appb-000063
表示第j幅图像中像素点(xi,yi)处被标定成头肩前景,
Figure PCTCN2014091643-appb-000064
表示第j幅图像中像素点(xi,yi)处被标定成背景,N指代正面人脸图像的数目。对于女性正面人脸图像而言,在计算每一个像素点位置出现头肩前景的先验概率之后,便得到了女性头肩位置先验模型;对于男性正面人脸图像而言,在计算每一个像素点位置出现头肩前景的先验概率之后,便得到了男性头肩位置先验模型。
在步骤202中,对待分割图像中的人脸进行性别识别,得到性别识别结果;根据性别识别结果,确定待分割图像对应的先验概率。
在本公开实施例中,由于男性人脸图像和女性人脸图像的特征有所差异,对应不同的头肩位置先验模型,所以在进行图像分割之前,还需对待分割图像中的人脸进行性别识别。在对待分割图像中的人脸进行性别识别时,可采取现有的人脸识别算法实现,在此不再进行赘述。由于上述步骤201中已经得到女性头肩位置先验模型和男性头肩位置先验模型,因此在确定待分割图像中的人脸性别后,便可直接确定待分割图像对应的头肩位置先验模型,也即得到待分割图像对应的先验概率。
在步骤203中,对于待分割图像中的每一个像素点,判断像素点的先验概率是否大于头肩前景概率阈值;如果像素点的先验概率大于头肩前景概率阈值,则将像素点确定为前景样 本像素点;判断像素点的先验概率是否小于背景概率阈值;如果像素点的先验概率小于背景概率阈值,则将像素点确定为背景样本像素点。
其中,头肩前景概率阈值具体可为0.7或0.8等等,本公开实施例对此不作具体限定。背景概率阈值具体可为0.2或0.3等等,本公开实施例对此同样不作具体限定。
在本公开实施例中,在选取样本像素点之前,可先对待分割图像进行人脸外部轮廓特征点定位,并根据定位结果将待分割图像进行尺寸调整,使之与400*400模板的尺寸大小相同。这样,待分割图像中的每一个像素点均与400*400模板中同位置的像素点相对应。所以400*400模板中对应位置上像素点位置出现头肩前景的先验概率,便为待分割图像中同一位置像素点对应的先验概率。
以头肩前景概率阈值为0.8,背景概率阈值为0.2为例,则对于一个像素点来说,若像素点的先验概率大于0.8,则将该像素点确定为前景样本像素点;若该像素点的先验概率小于0.2,则将像素点确定为背景样本像素点。对于先验概率处于0.2至0.8之前的像素点则不作任何处理。
在步骤204中,根据头肩前景样本像素点的颜色特征向量和背景样本像素点的颜色特征向量,计算头肩前景的第一颜色似然概率和背景的第二颜色似然概率。
在本公开实施例中,头肩前景样本像素点的颜色特征向量和背景样本像素点的颜色特征向量,可采取现有的颜色向量计算方式得到,在此不再进行赘述。在计算第一颜色似然概率和第二颜色似然概率,也即在得到颜色似然模型之前,本公开实施例还需根据颜色间的相关性,对头肩前景样本像素点和背景样本像素点进行聚类。在进行聚类时,本公开实施例将头肩前景样本像素点聚类成NF=5个聚类中心;考虑到背景的复杂性,本公开实施例将头肩前景样本像素点聚类成NB=15个聚类中心。当然,NF和NB的大小除上述数值外,还可为其他数值,本公开实施例对此不作具体限定。
其中,在根据头肩前景样本像素点的颜色特征向量和背景样本像素点的颜色特征向量,计算头肩前景的第一颜色似然概率和背景的第二颜色似然概率时,可通过下述公式(2)和公式(3)实现。
Figure PCTCN2014091643-appb-000065
Figure PCTCN2014091643-appb-000066
其中,
Figure PCTCN2014091643-appb-000067
指代第j个聚类中心的颜色特征向量,
Figure PCTCN2014091643-appb-000068
指代第一颜色似然概率,
Figure PCTCN2014091643-appb-000069
指代第二颜色似然概率,NF指代头肩前景样本像素点的聚类中心个数,NB指代背景样本像素点的聚类中心个数;
Figure PCTCN2014091643-appb-000070
指代颜色特征向量
Figure PCTCN2014091643-appb-000071
到聚类中心
Figure PCTCN2014091643-appb-000072
的欧式距离,wj指代第j个聚类中心的样本像素点 个数占总样本像素点个数的比率,β指代不同聚类中心的颜色特征向量之间的平均欧式距离值,其定义如下:
Figure PCTCN2014091643-appb-000073
Figure PCTCN2014091643-appb-000074
在步骤205中,根据先验概率、第一颜色似然概率和第二颜色似然概率,计算头肩前景的第一后验概率和背景的第二后验概率。
在本公开实施例中,在得到头肩位置先验模型和颜色似然模型之后,根据贝叶斯后验概率理论,在已知头肩前景样本像素点和背景样本像素点的颜色特增向量的情况下,头奖前景的后验概率和背景的后验概率,可通过下述公式公式(6)和公式(7)得到。
Figure PCTCN2014091643-appb-000075
Figure PCTCN2014091643-appb-000076
其中,
Figure PCTCN2014091643-appb-000077
指代头肩前景的后验概率;
Figure PCTCN2014091643-appb-000078
指代背景的后验概率。
在步骤206中,根据第一后验概率和第二后验概率,对待分割图像进行头肩分割。
在本公开实施例中,在得到第一后验概率和第二后验概率后,便得到了最终的头肩分割模型。将头肩分割模型装入Graph cut优化框架中的数据项,并结合图像像素的对比度信息,采用min-cut-max-flow优化方法对待分割图像进行分割,便可得到最终的头肩分割结果。
本公开实施例提供的方法,由于根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率,并基于头肩前景的先验概率自动选取头肩前景样本像素点和背景样本像素点,达到了在样本像素点的选择过程中无需用户参与的目的,用户体验度良好;此外,在进行图像分割时基于先验概率和颜色似然概率进行分割,分割标准较为细致,分割精度较高。
图3是根据一示例性实施例示出的一种图像分割装置的框图。参照图3,该装置包括先验概率计算模块301、样本像素点选取模块302、颜色似然概率计算模块303、后验概率计算模块304、图像分割模块305。
其中,先验概率计算模块301,用于根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率;样本像素点选取模块302与先验概率计算 模块301连接,用于根据先验概率、预先设置的头肩前景概率阈值和背景概率阈值,在待分割图像中选取头肩前景样本像素点和背景样本像素点;颜色似然概率计算模块303与样本像素点选取模块302连接,用于根据头肩前景样本像素点的颜色特征向量和背景样本像素点的颜色特征向量,计算头肩前景的第一颜色似然概率和背景的第二颜色似然概率;后验概率计算模块304与颜色似然概率计算模块303连接,用于根据先验概率、第一颜色似然概率和第二颜色似然概率,计算头肩前景的第一后验概率和背景的第二后验概率;图像分割模块305与后验概率计算模块304连接,用于根据第一后验概率和第二后验概率,对待分割图像进行头肩分割。
可选地,先验概率计算模块,用于选取预设数目幅女性正面人脸图像;根据用户对每一幅女性正面人脸图像的头肩前景标定结果,生成每一幅女性正面人脸图像的头肩标定图像;对每一幅女性正面人脸图像进行人脸外部轮廓特征点定位,得到定位结果;根据人脸外部轮廓特征点的定位结果,对每一幅头肩标定图像进行对齐及尺寸归一化处理,得到多幅预设大小图像;对于多幅预设大小图像中同一位置的像素点,根据头肩前景标定结果,计算像素点位置出现头肩前景的先验概率。
可选地,先验概率计算模块,用于选取预设数目幅男性正面人脸图像;根据用户对每一幅男性正面人脸图像的头肩前景标定结果,生成每一幅男性正面人脸图像的头肩标定图像;对每一幅男性正面人脸图像进行人脸外部轮廓特征点定位,得到定位结果;根据人脸外部轮廓特征点的定位结果,对每一幅头肩标定图像进行对齐及尺寸归一化处理,得到多幅预设大小图像;对于多幅预设大小图像中同一位置的像素点,根据头肩前景标定结果,计算像素点位置出现头肩前景的先验概率。
可选地,先验概率计算模块,应用如下公式,计算像素点位置出现头肩前景的先验概率:
Figure PCTCN2014091643-appb-000079
其中,
Figure PCTCN2014091643-appb-000080
指代像素点(xi,yi)处出现头肩前景的先验概率,
Figure PCTCN2014091643-appb-000081
指代第j幅图像中像素点(xi,yi)处的标定结果,
Figure PCTCN2014091643-appb-000082
表示第j幅图像中像素点(xi,yi)处被标定成头肩前景,
Figure PCTCN2014091643-appb-000083
表示第j幅图像中像素点(xi,yi)处被标定成背景,N指代正面人脸图像的数目。
可选地,样本像素点选取模块,用于对待分割图像中的人脸进行性别识别,得到性别识别结果;根据性别识别结果,确定待分割图像对应的先验概率;对于待分割图像中的每一个像素点,判断像素点的先验概率是否大于头肩前景概率阈值;如果像素点的先验概率大于头肩前景概率阈值,则将像素点确定为前景样本像素点;对于待分割图像中的每一个像素点,判断像素点的先验概率是否小于背景概率阈值;如果像素点的先验概率小于背景概率阈值, 则将像素点确定为背景样本像素点。
可选地,颜色似然概率计算模块,应用下述公式,计算头肩前景的第一颜色似然概率和背景的第二颜色似然概率:
Figure PCTCN2014091643-appb-000084
Figure PCTCN2014091643-appb-000085
其中,
Figure PCTCN2014091643-appb-000086
指代第j个聚类中心的颜色特征向量,
Figure PCTCN2014091643-appb-000087
指代第一颜色似然概率,
Figure PCTCN2014091643-appb-000088
指代第二颜色似然概率,NF指代头肩前景样本像素点的聚类中心个数,NB指代背景样本像素点的聚类中心个数;
Figure PCTCN2014091643-appb-000089
指代颜色特征向量
Figure PCTCN2014091643-appb-000090
到聚类中心
Figure PCTCN2014091643-appb-000091
的欧式距离,wj指代第j个聚类中心的样本像素点个数占总样本像素点个数的比率,β指代不同聚类中心的颜色特征向量之间的平均欧式距离值,其定义如下:
Figure PCTCN2014091643-appb-000092
Figure PCTCN2014091643-appb-000093
可选地,后验概率计算模块,应用如下公式,计算头肩前景的后验概率、背景的后验概率,包括:
Figure PCTCN2014091643-appb-000094
Figure PCTCN2014091643-appb-000095
其中,
Figure PCTCN2014091643-appb-000096
指代头肩前景的后验概率;
Figure PCTCN2014091643-appb-000097
指代背景的后验概率。
本公开实施例提供的装置,由于根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率,并基于头肩前景的先验概率自动选取头肩前景样本像素点和背景样本像素点,达到了在样本像素点的选择过程中无需用户参与的目的,用户体验度良好;此外,在进行图像分割时基于先验概率和颜色似然概率进行分割,分割标准 较为细致,分割精度较高。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
图4是根据一示例性实施例示出的一种用于对桌图像进行分割的设备400的框图。例如,设备400可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。
参照图4,设备400可以包括以下一个或多个组件:处理组件402,存储器404,电源组件406,多媒体组件408,音频组件410,I/O(Input/Output,输入/输出)接口412,传感器组件414,以及通信组件416。
处理组件402通常控制设备400的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件402可以包括一个或多个处理器420来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件402可以包括一个或多个模块,便于处理组件402和其它组件之间的交互。例如,处理组件402可以包括多媒体模块,以方便多媒体组件408和处理组件402之间的交互。
存储器404被配置为存储各种类型的数据以支持在设备400的操作。这些数据的示例包括用于在设备400上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器404可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如SRAM(Static Random Access Memory,静态随机存取存储器),EEPROM(Electrically-Erasable Programmable Read-Only Memory,电可擦除可编程只读存储器),EPROM(Erasable Programmable Read Only Memory,可擦除可编程只读存储器),PROM(Programmable Read-Only Memory,可编程只读存储器),ROM(Read-Only Memory,只读存储器),磁存储器,快闪存储器,磁盘或光盘。
电源组件406为设备400的各种组件提供电力。电源组件406可以包括电源管理系统,一个或多个电源,及其它与为设备400生成、管理和分配电力相关联的组件。
多媒体组件408包括在设备400和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括LCD(Liquid Crystal Display,液晶显示器)和TP(Touch Panel,触摸面板)。如果屏幕包括TP,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。TP包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。触摸传感器不仅可以感测触摸或滑动动作的边界,而且还可以检测与触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件408包括一个前置摄像头和/或后置摄像头。当设备400处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件410被配置为输出和/或输入音频信号。例如,音频组件410包括一个MIC(Microphone,麦克风),当设备400处于操作模式,如呼叫模式、记录模式和语音识别模式时, 麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器404或经由通信组件416发送。在一些实施例中,音频组件410还包括一个扬声器,用于输出音频信号。
I/O接口412为处理组件402和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件414包括一个或多个传感器,用于为设备400提供各个方面的状态评估。例如,传感器组件414可以检测到设备400的打开/关闭状态,组件的相对定位,例如组件为设备400的显示器和小键盘,传感器组件414还可以检测设备400或设备400一个组件的位置改变,用户与设备400接触的存在或不存在,设备400方位或加速/减速和设备400的温度变化。传感器组件414可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件414还可以包括光传感器,如CMOS(Complementary Metal Oxide Semiconductor,互补金属氧化物)或CCD(Charge-coupled Device,电荷耦合元件)图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件414还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件416被配置为便于设备400和其他设备之间有线或无线方式的通信。设备400可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件416经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,通信组件416还包括NFC(Near Field Communication,近场通信)模块,以促进短程通信。例如,在NFC模块可基于RFID(Radio Frequency Identification,射频识别)技术,IrDA(Infra-red Data Association,红外数据协会)技术,UWB(Ultra Wideband,超宽带)技术,BT(Bluetooth,蓝牙)技术和其他技术来实现。
在示例性实施例中,设备400可以被一个或多个ASIC(Application Specific Integrated Circuit,应用专用集成电路)、DSP(Digital signal Processor,数字信号处理器)、DSPD(Digital signal Processor Device,数字信号处理设备)、PLD(Programmable Logic Device,可编程逻辑器件)、FPGA)(Field Programmable Gate Array,现场可编程门阵列)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器404,上述指令可由设备400的处理器420执行以完成上述方法。例如,非临时性计算机可读存储介质可以是ROM、RAM(Random Access Memory,随机存取存储器)、CD-ROM(Compact Disc Read-Only Memory,光盘只读存储器)、磁带、软盘和光数据存储设备等。
一种非临时性计算机可读存储介质,当存储介质中的指令由移动终端的处理器执行时,使得移动终端能够执行一种图像分割方法,方法包括:
根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置
出现头肩前景的先验概率;
根据先验概率、预先设置的头肩前景概率阈值和背景概率阈值,在待分割图像中选取头肩前景样本像素点和背景样本像素点;
根据头肩前景样本像素点的颜色特征向量和背景样本像素点的颜色特征向量,计算头肩前景的第一颜色似然概率和背景的第二颜色似然概率;
根据先验概率、第一颜色似然概率和第二颜色似然概率,计算头肩前景的第一后验概率和背景的第二后验概率;
根据第一后验概率和第二后验概率,对待分割图像进行头肩分割。
可选地,根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率,包括:
选取预设数目幅女性正面人脸图像;
根据用户对每一幅女性正面人脸图像的头肩前景标定结果,生成每一幅女性正面人脸图像的头肩标定图像;
对每一幅女性正面人脸图像进行人脸外部轮廓特征点定位,得到定位结果;
根据人脸外部轮廓特征点的定位结果,对每一幅头肩标定图像进行对齐及尺寸归一化处理,得到多幅预设大小图像;
对于多幅预设大小图像中同一位置的像素点,根据头肩前景标定结果,计算像素点位置出现头肩前景的先验概率。
可选地,根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率,包括:
选取预设数目幅男性正面人脸图像;
根据用户对每一幅男性正面人脸图像的头肩前景标定结果,生成每一幅男性正面人脸图像的头肩标定图像;
对每一幅男性正面人脸图像进行人脸外部轮廓特征点定位,得到定位结果;
根据人脸外部轮廓特征点的定位结果,对每一幅头肩标定图像进行对齐及尺寸归一化处理,得到多幅预设大小图像;
对于多幅预设大小图像中同一位置的像素点,根据头肩前景标定结果,计算像素点位置出现头肩前景的先验概率。
可选地,根据头肩前景标定结果,应用如下公式,计算像素点位置出现头肩前景的先验概率:
Figure PCTCN2014091643-appb-000098
其中,
Figure PCTCN2014091643-appb-000099
指代像素点(xi,yi)处出现头肩前景的先验概率,
Figure PCTCN2014091643-appb-000100
指代第j幅图像中像素点(xi,yi)处的标定结果,
Figure PCTCN2014091643-appb-000101
表示第j幅图像中像素点(xi,yi)处被标定成头肩前景,
Figure PCTCN2014091643-appb-000102
表示第j幅图像中像素点(xi,yi)处被标定成背景,N指代正面人脸图像的数目。
可选地,根据先验概率、预先设置的头肩前景概率阈值和背景概率阈值,在待分割图像中选取头肩前景样本像素点和背景样本像素点,包括:
对待分割图像中的人脸进行性别识别,得到性别识别结果;
根据性别识别结果,确定待分割图像对应的先验概率;
对于待分割图像中的每一个像素点,判断像素点的先验概率是否大于头肩前景概率阈值;如果像素点的先验概率大于头肩前景概率阈值,则将像素点确定为前景样本像素点;
对于待分割图像中的每一个像素点,判断像素点的先验概率是否小于背景概率阈值;如果像素点的先验概率小于背景概率阈值,则将像素点确定为背景样本像素点。
可选地,根据头肩前景样本像素点的颜色特征向量和背景样本像素点的颜色特征向量,应用下述公式,计算头肩前景的第一颜色似然概率和背景的第二颜色似然概率,包括:
Figure PCTCN2014091643-appb-000103
Figure PCTCN2014091643-appb-000104
其中,
Figure PCTCN2014091643-appb-000105
指代第j个聚类中心的颜色特征向量,
Figure PCTCN2014091643-appb-000106
指代第一颜色似然概率,
Figure PCTCN2014091643-appb-000107
指代第二颜色似然概率,NF指代头肩前景样本像素点的聚类中心个数,NB指代背景样本像素点的聚类中心个数;
Figure PCTCN2014091643-appb-000108
指代颜色特征向量
Figure PCTCN2014091643-appb-000109
到聚类中心
Figure PCTCN2014091643-appb-000110
的欧式距离,wj指代第j个聚类中心的样本像素点个数占总样本像素点个数的比率,β指代不同聚类中心的颜色特征向量之间的平均欧式距离值,其定义如下:
Figure PCTCN2014091643-appb-000111
Figure PCTCN2014091643-appb-000112
可选地,根据先验概率、第一颜色似然概率和第二颜色似然概率,应用如下公式,计算头肩前景的后验概率、背景的后验概率,包括:
Figure PCTCN2014091643-appb-000113
Figure PCTCN2014091643-appb-000114
其中,
Figure PCTCN2014091643-appb-000115
指代头肩前景的后验概率;
Figure PCTCN2014091643-appb-000116
指代背景的后验概率。
本公开实施例提供的非临时性计算机可读存储介质,由于根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率,并基于头肩前景的先验概率自动选取头肩前景样本像素点和背景样本像素点,达到了在样本像素点的选择过程中无需用户参与的目的,用户体验度良好;此外,在进行图像分割时基于先验概率和颜色似然概率进行分割,分割标准较为细致,分割精度较高。
图5是根据一示例性实施例示出的一种用于图像分割的设备500的框图。例如,设备500可以被提供为一服务器。参照图5,设备500包括处理组件522,其进一步包括一个或多个处理器,以及由存储器532所代表的存储器资源,用于存储可由处理组件522的执行的指令,例如应用程序。存储器532中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件522被配置为执行指令,以执行上述方法……
设备500还可以包括一个电源组件526被配置为执行设备500的电源管理,一个有线或无线网络接口550被配置为将设备500连接到网络,和一个输入输出(I/O)接口558。设备500可以操作基于存储在存储器532的操作系统,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM或类似。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。

Claims (15)

  1. 一种图像分割方法,其特征在于,所述方法包括:
    根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率;
    根据所述先验概率、预先设置的头肩前景概率阈值和背景概率阈值,在待分割图像中选取头肩前景样本像素点和背景样本像素点;
    根据所述头肩前景样本像素点的颜色特征向量和所述背景样本像素点的颜色特征向量,计算所述头肩前景的第一颜色似然概率和所述背景的第二颜色似然概率;
    根据所述先验概率、所述第一颜色似然概率和所述第二颜色似然概率,计算所述头肩前景的第一后验概率和所述背景的第二后验概率;
    根据所述第一后验概率和所述第二后验概率,对所述待分割图像进行头肩分割。
  2. 根据权利要求1所述的方法,其特征在于,所述根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率,包括:
    选取预设数目幅女性正面人脸图像;
    根据用户对每一幅女性正面人脸图像的头肩前景标定结果,生成每一幅女性正面人脸图像的头肩标定图像;
    对每一幅女性正面人脸图像进行人脸外部轮廓特征点定位,得到定位结果;
    根据人脸外部轮廓特征点的定位结果,对每一幅头肩标定图像进行对齐及尺寸归一化处理,得到多幅预设大小图像;
    对于多幅预设大小图像中同一位置的像素点,根据所述头肩前景标定结果,计算所述像素点位置出现头肩前景的先验概率。
  3. 根据权利要求1所述的方法,其特征在于,所述根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率,包括:
    选取预设数目幅男性正面人脸图像;
    根据用户对每一幅男性正面人脸图像的头肩前景标定结果,生成每一幅男性正面人脸图像的头肩标定图像;
    对每一幅男性正面人脸图像进行人脸外部轮廓特征点定位,得到定位结果;
    根据人脸外部轮廓特征点的定位结果,对所述每一幅头肩标定图像进行对齐及尺寸归一化处理,得到多幅预设大小图像;
    对于多幅预设大小图像中同一位置的像素点,根据所述头肩前景标定结果,计算所述像素点位置出现头肩前景的先验概率。
  4. 根据权利要求2或3所述的方法,其特征在于,所述根据所述头肩前景标定结果,应 用如下公式,计算所述像素点位置出现头肩前景的先验概率:
    Figure PCTCN2014091643-appb-100001
    其中,
    Figure PCTCN2014091643-appb-100002
    指代像素点(xi,yi)处出现头肩前景的先验概率,
    Figure PCTCN2014091643-appb-100003
    指代第j幅图像中像素点(xi,yi)处的标定结果,
    Figure PCTCN2014091643-appb-100004
    表示第j幅图像中像素点(xi,yi)处被标定成头肩前景,
    Figure PCTCN2014091643-appb-100005
    表示第j幅图像中像素点(xi,yi)处被标定成背景,N指代正面人脸图像的数目。
  5. 根据权利要求1所述的方法,其特征在于,所述根据所述先验概率、预先设置的头肩前景概率阈值和背景概率阈值,在待分割图像中选取头肩前景样本像素点和背景样本像素点,包括:
    对所述待分割图像中的人脸进行性别识别,得到性别识别结果;
    根据所述性别识别结果,确定所述待分割图像对应的先验概率;
    对于所述待分割图像中的每一个像素点,判断所述像素点的先验概率是否大于所述头肩前景概率阈值;如果所述像素点的先验概率大于所述头肩前景概率阈值,则将所述像素点确定为前景样本像素点;
    对于所述待分割图像中的每一个像素点,判断所述像素点的先验概率是否小于所述背景概率阈值;如果所述像素点的先验概率小于所述背景概率阈值,则将所述像素点确定为背景样本像素点。
  6. 根据权利要求1所述的方法,其特征在于,所述根据所述头肩前景样本像素点的颜色特征向量和所述背景样本像素点的颜色特征向量,应用下述公式,计算所述头肩前景的第一颜色似然概率和所述背景的第二颜色似然概率,包括:
    Figure PCTCN2014091643-appb-100006
    Figure PCTCN2014091643-appb-100007
    其中,
    Figure PCTCN2014091643-appb-100008
    指代第j个聚类中心的颜色特征向量,
    Figure PCTCN2014091643-appb-100009
    指代第一颜色似然概率,
    Figure PCTCN2014091643-appb-100010
    指代第二颜色似然概率,NF指代头肩前景样本像素点 的聚类中心个数,NB指代背景样本像素点的聚类中心个数;
    Figure PCTCN2014091643-appb-100011
    指代颜色特征向量
    Figure PCTCN2014091643-appb-100012
    到聚类中心
    Figure PCTCN2014091643-appb-100013
    的欧式距离,wj指代第j个聚类中心的样本像素点个数占总样本像素点个数的比率,β指代不同聚类中心的颜色特征向量之间的平均欧式距离值,其定义如下:
    Figure PCTCN2014091643-appb-100014
    Figure PCTCN2014091643-appb-100015
  7. 根据权利要求1至6中任一权利要求所述的方法,其特征在于,所述根据所述先验概率、所述第一颜色似然概率和所述第二颜色似然概率,应用如下公式,计算所述头肩前景的后验概率、所述背景的后验概率,包括:
    Figure PCTCN2014091643-appb-100016
    Figure PCTCN2014091643-appb-100017
    其中,
    Figure PCTCN2014091643-appb-100018
    指代所述头肩前景的后验概率;
    Figure PCTCN2014091643-appb-100019
    指代所述背景的后验概率。
  8. 一种图像分割装置,其特征在于,所述装置包括:
    先验概率计算模块,用于根据人脸外部轮廓点的定位结果,计算预设大小图像中每一个像素点位置出现头肩前景的先验概率;
    样本像素点选取模块,用于根据所述先验概率、预先设置的头肩前景概率阈值和背景概率阈值,在待分割图像中选取头肩前景样本像素点和背景样本像素点;
    颜色似然概率计算模块,用于根据所述头肩前景样本像素点的颜色特征向量和所述背景样本像素点的颜色特征向量,计算所述头肩前景的第一颜色似然概率和所述背景的第二颜色似然概率;
    后验概率计算模块,用于根据所述先验概率、所述第一颜色似然概率和所述第二颜色似然概率,计算所述头肩前景的第一后验概率和所述背景的第二后验概率;
    图像分割模块,用于根据所述第一后验概率和所述第二后验概率,对所述待分割图像进行头肩分割。
  9. 根据权利要求8所述的装置,其特征在于,所述先验概率计算模块,用于选取预设数目幅女性正面人脸图像;根据用户对每一幅女性正面人脸图像的头肩前景标定结果,生成每一幅女性正面人脸图像的头肩标定图像;对每一幅女性正面人脸图像进行人脸外部轮廓特征点定位,得到定位结果;根据人脸外部轮廓特征点的定位结果,对每一幅头肩标定图像进行对齐及尺寸归一化处理,得到多幅预设大小图像;对于多幅预设大小图像中同一位置的像素点,根据所述头肩前景标定结果,计算所述像素点位置出现头肩前景的先验概率。
  10. 根据权利要求8所述的装置,其特征在于,所述先验概率计算模块,用于选取预设数目幅男性正面人脸图像;根据用户对每一幅男性正面人脸图像的头肩前景标定结果,生成每一幅男性正面人脸图像的头肩标定图像;对每一幅男性正面人脸图像进行人脸外部轮廓特征点定位,得到定位结果;根据人脸外部轮廓特征点的定位结果,对所述每一幅头肩标定图像进行对齐及尺寸归一化处理,得到多幅预设大小图像;对于多幅预设大小图像中同一位置的像素点,根据所述头肩前景标定结果,计算所述像素点位置出现头肩前景的先验概率。
  11. 根据权利要求9或10所述的装置,其特征在于,所述先验概率计算模块,应用如下公式,计算所述像素点位置出现头肩前景的先验概率:
    Figure PCTCN2014091643-appb-100020
    其中,
    Figure PCTCN2014091643-appb-100021
    指代像素点(xi,yi)处出现头肩前景的先验概率,
    Figure PCTCN2014091643-appb-100022
    指代第j幅图像中像素点(xi,yi)处的标定结果,
    Figure PCTCN2014091643-appb-100023
    表示第j幅图像中像素点(xi,yi)处被标定成头肩前景,
    Figure PCTCN2014091643-appb-100024
    表示第j幅图像中像素点(xi,yi)处被标定成背景,N指代正面人脸图像的数目。
  12. 根据权利要求8所述的装置,其特征在于,所述样本像素点选取模块,用于对所述待分割图像中的人脸进行性别识别,得到性别识别结果;根据所述性别识别结果,确定所述待分割图像对应的先验概率;对于所述待分割图像中的每一个像素点,判断所述像素点的先验概率是否大于所述头肩前景概率阈值;如果所述像素点的先验概率大于所述头肩前景概率阈值,则将所述像素点确定为前景样本像素点;对于所述待分割图像中的每一个像素点,判断所述像素点的先验概率是否小于所述背景概率阈值;如果所述像素点的先验概率小于所述背景概率阈值,则将所述像素点确定为背景样本像素点。
  13. 根据权利要求8所述的装置,其特征在于,所述颜色似然概率计算模块,应用下述 公式,计算所述头肩前景的第一颜色似然概率和所述背景的第二颜色似然概率:
    Figure PCTCN2014091643-appb-100025
    Figure PCTCN2014091643-appb-100026
    其中,
    Figure PCTCN2014091643-appb-100027
    指代第j个聚类中心的颜色特征向量,
    Figure PCTCN2014091643-appb-100028
    指代第一颜色似然概率,
    Figure PCTCN2014091643-appb-100029
    指代第二颜色似然概率,NF指代头肩前景样本像素点的聚类中心个数,NB指代背景样本像素点的聚类中心个数;
    Figure PCTCN2014091643-appb-100030
    指代颜色特征向量
    Figure PCTCN2014091643-appb-100031
    到聚类中心
    Figure PCTCN2014091643-appb-100032
    的欧式距离,wj指代第j个聚类中心的样本像素点个数占总样本像素点个数的比率,β指代不同聚类中心的颜色特征向量之间的平均欧式距离值,其定义如下:
    Figure PCTCN2014091643-appb-100033
    Figure PCTCN2014091643-appb-100034
  14. 根据权利要求8至13中任一权利要求所述的装置,其特征在于,所述后验概率计算模块,应用如下公式,计算所述头肩前景的后验概率、所述背景的后验概率,包括:
    Figure PCTCN2014091643-appb-100035
    Figure PCTCN2014091643-appb-100036
    其中,
    Figure PCTCN2014091643-appb-100037
    指代所述头肩前景的后验概率;
    Figure PCTCN2014091643-appb-100038
    指代所述背景的后验概率。
  15. 一种图像分割设备,其特征在于,所述设备包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器被配置为:根据人脸外部轮廓点的定位结果,计算预设大小图像中每 一个像素点位置出现头肩前景的先验概率;根据所述先验概率、预先设置的头肩前景概率阈值和背景概率阈值,在待分割图像中选取头肩前景样本像素点和背景样本像素点;根据所述头肩前景样本像素点的颜色特征向量和所述背景样本像素点的颜色特征向量,计算所述头肩前景的第一颜色似然概率和所述背景的第二颜色似然概率;根据所述先验概率、所述第一颜色似然概率和所述第二颜色似然概率,计算所述头肩前景的第一后验概率和所述背景的第二后验概率;根据所述第一后验概率和所述第二后验概率,对所述待分割图像进行头肩分割。
PCT/CN2014/091643 2014-07-23 2014-11-19 图像分割方法、装置及设备 Ceased WO2016011745A1 (zh)

Priority Applications (6)

Application Number Priority Date Filing Date Title
RU2015106324/08A RU2577188C1 (ru) 2014-07-23 2014-11-19 Способ, аппарат и устройство для сегментации изображения
KR1020157001161A KR101694643B1 (ko) 2014-07-23 2014-11-19 이미지 분할 방법, 장치, 기기, 프로그램 및 기록매체
MX2015002246A MX352237B (es) 2014-07-23 2014-11-19 Metodo, aparato y dispositivo para segmentar imagen.
BR112015003800A BR112015003800A2 (pt) 2014-07-23 2014-11-19 método, aparelho e dispositivo para a segmentação de imagem
JP2016535336A JP6134446B2 (ja) 2014-07-23 2014-11-19 画像分割方法、画像分割装置、画像分割デバイス、プログラム及び記録媒体
US14/669,888 US9665945B2 (en) 2014-07-23 2015-03-26 Techniques for image segmentation

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410353140.7 2014-07-23
CN201410353140.7A CN104156947B (zh) 2014-07-23 2014-07-23 图像分割方法、装置及设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/669,888 Continuation-In-Part US9665945B2 (en) 2014-07-23 2015-03-26 Techniques for image segmentation

Publications (1)

Publication Number Publication Date
WO2016011745A1 true WO2016011745A1 (zh) 2016-01-28

Family

ID=51882437

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/091643 Ceased WO2016011745A1 (zh) 2014-07-23 2014-11-19 图像分割方法、装置及设备

Country Status (9)

Country Link
US (1) US9665945B2 (zh)
EP (1) EP2977956B1 (zh)
JP (1) JP6134446B2 (zh)
KR (1) KR101694643B1 (zh)
CN (1) CN104156947B (zh)
BR (1) BR112015003800A2 (zh)
MX (1) MX352237B (zh)
RU (1) RU2577188C1 (zh)
WO (1) WO2016011745A1 (zh)

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105258680B (zh) * 2015-09-30 2017-12-01 西安电子科技大学 一种目标位姿测量方法和装置
CN105719294B (zh) * 2016-01-21 2018-09-25 中南大学 一种乳腺癌病理学图像有丝分裂核自动分割方法
JP6688990B2 (ja) * 2016-04-28 2020-04-28 パナソニックIpマネジメント株式会社 識別装置、識別方法、識別プログラムおよび記録媒体
US9681096B1 (en) 2016-07-18 2017-06-13 Apple Inc. Light field capture
US10999602B2 (en) 2016-12-23 2021-05-04 Apple Inc. Sphere projected motion estimation/compensation and mode decision
EP3579963A4 (en) 2017-02-07 2020-12-16 Valorbec Societe en Commandite ADDITIVE MANUFACTURING PROCESSES AND SYSTEMS
US11259046B2 (en) 2017-02-15 2022-02-22 Apple Inc. Processing of equirectangular object data to compensate for distortion by spherical projections
US10924747B2 (en) 2017-02-27 2021-02-16 Apple Inc. Video coding techniques for multi-view video
US9992450B1 (en) * 2017-03-24 2018-06-05 Apple Inc. Systems and methods for background concealment in video conferencing session
US11093752B2 (en) 2017-06-02 2021-08-17 Apple Inc. Object tracking in multi-view video
US10754242B2 (en) 2017-06-30 2020-08-25 Apple Inc. Adaptive resolution and projection format in multi-direction video
US11070729B2 (en) * 2018-07-27 2021-07-20 Canon Kabushiki Kaisha Image processing apparatus capable of detecting moving objects, control method thereof, and image capture apparatus
CN109816663B (zh) 2018-10-15 2021-04-20 华为技术有限公司 一种图像处理方法、装置与设备
CN109614983B (zh) * 2018-10-26 2023-06-16 创新先进技术有限公司 训练数据的生成方法、装置及系统
CN109409377B (zh) * 2018-12-03 2020-06-02 龙马智芯(珠海横琴)科技有限公司 图像中文字的检测方法及装置
US10635940B1 (en) * 2018-12-11 2020-04-28 Capital One Services, Llc Systems and methods for updating image recognition models
CN109509195B (zh) * 2018-12-12 2020-04-17 北京达佳互联信息技术有限公司 前景处理方法、装置、电子设备及存储介质
US11348366B2 (en) 2019-04-23 2022-05-31 The Procter And Gamble Company Apparatus and method for determining cosmetic skin attributes
CN113767439A (zh) 2019-04-23 2021-12-07 宝洁公司 用于将美容皮肤属性可视化的设备和方法
CN110266611B (zh) * 2019-07-08 2023-06-23 腾讯科技(上海)有限公司 缓冲数据的处理方法、装置和系统
CN110827371B (zh) * 2019-11-05 2023-04-28 厦门美图之家科技有限公司 证件照生成方法、装置、电子设备及存储介质
CN114022934B (zh) * 2021-11-04 2023-06-27 清华大学 一种基于多数原则的实时人像聚档方法、系统和介质
CN115345895B (zh) * 2022-10-19 2023-01-06 深圳市壹倍科技有限公司 用于视觉检测的图像分割方法、装置、计算机设备及介质
CN119273703B (zh) * 2024-12-09 2025-04-01 深圳惟德精准医疗科技有限公司 图像分割方法及相关产品

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012003719A (ja) * 2010-06-21 2012-01-05 Nippon Telegr & Teleph Corp <Ntt> 状態推定装置、状態推定方法、およびプログラム
CN102436636A (zh) * 2010-09-29 2012-05-02 中国科学院计算技术研究所 自动分割头发的方法及其系统
CN102567998A (zh) * 2012-01-06 2012-07-11 西安理工大学 基于双模板匹配和边缘细化的头肩序列图像分割方法
CN103871050A (zh) * 2014-02-19 2014-06-18 小米科技有限责任公司 图标分割方法、装置和终端

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW505513B (en) 2000-11-30 2002-10-11 Sanyo Electric Co Massager and electronic machine with controller
KR100427181B1 (ko) * 2001-12-19 2004-04-28 한국전자통신연구원 에지/컬러정보를 이용한 얼굴 피부색 영역 추출시스템 및그 방법
US6879709B2 (en) * 2002-01-17 2005-04-12 International Business Machines Corporation System and method for automatically detecting neutral expressionless faces in digital images
US20030156759A1 (en) 2002-02-19 2003-08-21 Koninklijke Philips Electronics N.V. Background-foreground segmentation using probability models that can provide pixel dependency and incremental training
KR100474848B1 (ko) * 2002-07-19 2005-03-10 삼성전자주식회사 영상시각 정보를 결합하여 실시간으로 복수의 얼굴을검출하고 추적하는 얼굴 검출 및 추적 시스템 및 방법
GB2395264A (en) * 2002-11-29 2004-05-19 Sony Uk Ltd Face detection in images
GB2395779A (en) * 2002-11-29 2004-06-02 Sony Uk Ltd Face detection
JP2010282276A (ja) * 2009-06-02 2010-12-16 Nippon Telegr & Teleph Corp <Ntt> 映像認識理解装置、映像認識理解方法、及びプログラム
CN102436637B (zh) 2010-09-29 2013-08-21 中国科学院计算技术研究所 从头部图像中自动分割头发的方法及其系统
RU2440608C1 (ru) * 2010-12-02 2012-01-20 Государственное образовательное учреждение высшего профессионального образования Московский военный институт радиоэлектроники Космических войск Способ распознавания объектов на основе фрактально-вейвлетного анализа
US20150339828A1 (en) 2012-05-31 2015-11-26 Thomson Licensing Segmentation of a foreground object in a 3d scene
EP2669865A1 (en) 2012-05-31 2013-12-04 Thomson Licensing Segmentation of a foreground object in a 3D scene
RU2522044C1 (ru) * 2013-01-09 2014-07-10 Федеральное государственное бюджетное образовательное учреждение высшего профессионального образования "Южно-Российский государственный университет экономики и сервиса" (ФГБОУ ВПО "ЮРГУЭС") Устройство выделения контуров объектов на текстурированном фоне при обработке цифровых изображений
CN103871060B (zh) 2014-03-13 2016-08-17 西安电子科技大学 基于平稳方向波域概率图模型的图像分割方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012003719A (ja) * 2010-06-21 2012-01-05 Nippon Telegr & Teleph Corp <Ntt> 状態推定装置、状態推定方法、およびプログラム
CN102436636A (zh) * 2010-09-29 2012-05-02 中国科学院计算技术研究所 自动分割头发的方法及其系统
CN102567998A (zh) * 2012-01-06 2012-07-11 西安理工大学 基于双模板匹配和边缘细化的头肩序列图像分割方法
CN103871050A (zh) * 2014-02-19 2014-06-18 小米科技有限责任公司 图标分割方法、装置和终端

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SUN, BO ET AL.: "The Research of Image Segmentation Based on Bayesian Estimation", VALUE ENGINEERING, 30 June 2012 (2012-06-30) *
ZHANG, QINGLI ET AL.: "Fast Segmentation for Head-shoulder Video Sequence", COMPUTER ENGINEERING, vol. 20, no. 31, 31 October 2005 (2005-10-31) *

Also Published As

Publication number Publication date
US20160027187A1 (en) 2016-01-28
EP2977956B1 (en) 2017-01-11
RU2577188C1 (ru) 2016-03-10
KR20160021737A (ko) 2016-02-26
CN104156947A (zh) 2014-11-19
BR112015003800A2 (pt) 2017-07-04
KR101694643B1 (ko) 2017-01-09
JP6134446B2 (ja) 2017-05-24
MX2015002246A (es) 2016-04-01
MX352237B (es) 2017-11-15
CN104156947B (zh) 2018-03-16
US9665945B2 (en) 2017-05-30
EP2977956A1 (en) 2016-01-27
JP2016531361A (ja) 2016-10-06

Similar Documents

Publication Publication Date Title
WO2016011745A1 (zh) 图像分割方法、装置及设备
CN111310616A (zh) 图像处理方法及装置、电子设备和存储介质
US9892314B2 (en) Method and device for determining associated user
WO2016011747A1 (zh) 肤色调整方法和装置
CN113409342B (zh) 图像风格迁移模型的训练方法、装置及电子设备
WO2021031609A1 (zh) 活体检测方法及装置、电子设备和存储介质
CN107944367B (zh) 人脸关键点检测方法及装置
WO2017031901A1 (zh) 人脸识别方法、装置及终端
CN108154466B (zh) 图像处理方法及装置
CN106295499B (zh) 年龄估计方法及装置
CN105631803B (zh) 滤镜处理的方法和装置
CN107527053A (zh) 目标检测方法及装置
CN107967459B (zh) 卷积处理方法、装置及存储介质
CN106778531A (zh) 人脸定位方法及装置
CN112200040A (zh) 遮挡图像检测方法、装置及介质
CN109034150B (zh) 图像处理方法及装置
CN105528765A (zh) 处理图像的方法及装置
CN106339695A (zh) 人脸相似检测方法、装置及终端
CN107958223A (zh) 人脸识别方法及装置、移动设备、计算机可读存储介质
CN107480785A (zh) 卷积神经网络的训练方法及装置
US9665925B2 (en) Method and terminal device for retargeting images
CN106469446B (zh) 深度图像的分割方法和分割装置
CN107730443B (zh) 图像处理方法、装置及用户设备
CN107239758B (zh) 人脸关键点定位的方法及装置
CN107992894B (zh) 图像识别方法、装置及计算机可读存储介质

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 20157001161

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2016535336

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: MX/A/2015/002246

Country of ref document: MX

ENP Entry into the national phase

Ref document number: 2015106324

Country of ref document: RU

Kind code of ref document: A

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: 112015003800

Country of ref document: BR

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

Ref document number: 14898096

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 112015003800

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20150223

122 Ep: pct application non-entry in european phase

Ref document number: 14898096

Country of ref document: EP

Kind code of ref document: A1