CN102592268B - Method for segmenting foreground image - Google Patents

Method for segmenting foreground image Download PDF

Info

Publication number
CN102592268B
CN102592268B CN201210004333.2A CN201210004333A CN102592268B CN 102592268 B CN102592268 B CN 102592268B CN 201210004333 A CN201210004333 A CN 201210004333A CN 102592268 B CN102592268 B CN 102592268B
Authority
CN
China
Prior art keywords
image
rectangle
prime
pixel
algorithm
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.)
Active
Application number
CN201210004333.2A
Other languages
Chinese (zh)
Other versions
CN102592268A (en
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.)
Shenzhen Graduate School Tsinghua University
Original Assignee
Shenzhen Graduate School Tsinghua University
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 Shenzhen Graduate School Tsinghua University filed Critical Shenzhen Graduate School Tsinghua University
Priority to CN201210004333.2A priority Critical patent/CN102592268B/en
Publication of CN102592268A publication Critical patent/CN102592268A/en
Priority to HK12109352.9A priority patent/HK1168681A1/en
Application granted granted Critical
Publication of CN102592268B publication Critical patent/CN102592268B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a method for segmenting a foreground image. The method comprises the following steps of: obtaining a conspicuity map of an original image by using a central peripheral histogram algorithm; carrying out threshold segmentation on the conspicuity map so as to obtain a rectangle R including a conspicuity object; using an image outside the rectangle R region as a background region; initializing a GrabCut algorithm; and iteratively operating the GrabCut algorithm so as to execute foreground segmentation of the original image. Compared with the prior art, the method disclosed by the invention can be used for increasing the foreground segmentation efficiency.

Description

A kind of method of segmenting foreground image
Technical field
The present invention relates to image processing techniques, particularly relate to a kind of method of segmenting foreground image.
Background technology
Salient region detection and foreground segmentation are two fundamental operations in Computer Image Processing.Wherein, salient region detects and refers to the salient region judging image from picture, and notices the pith of image.Foreground segmentation refers to and allows computing machine judge which is foreground object from a width picture, and which is background object, and is therefrom partitioned into interested prospect critical object.Although the vision system of people can judge salient region and foreground object easily, computing machine is difficult to possess this understandability under inartificial help.If computing machine can be allowed independently to complete foreground segmentation work rapidly, to be convenient to analyze image further, identify, follow the tracks of, understand, compressed encoding etc., and the accuracy extracting result directly will affect the validity of follow-up work, how interested target being split from the background of complexity quickly and efficiently, tool is of great significance.
People have carried out large quantifier elimination on salient region detects, and have summed up the algorithm of a lot of maturation, have mainly contained HC, RC, LC, CA and FT scheduling algorithm, these algorithms can obtain the good Saliency maps of effect (saliencymap) all to a certain extent.And image segmentation algorithm can be roughly divided into 5 classes at present, Boundary algorithm, clustering algorithm, zone algorithm, the partitioning algorithm of segmentation blending algorithm and specific area, in foreground segmentation techniques, mainly contain based on the method for pixel (Pixel-based), based on the method for border (Edge-based) and the method based on region (Region-based).Method based on pixel requires that user specifies prospect or background in single Pixel-level, and therefore workload is very huge.Method based on border allows user around the boundary mapping curve of foreground object, then carries out subsection optimization to this curve, but the curve plotting that user must be careful, still need a large amount of user interactions.The information that method based on region allows user to specify some loose, and use optimized algorithm to extract actual foreground object border.
Summary of the invention
Technical matters to be solved by this invention is, provides a kind of method of segmenting foreground image, and the requirement of reduction operation to user interactions, improves foreground segmentation efficiency.
Technical matters of the present invention is solved by the following technical programs:
A method for segmenting foreground image, is characterized in that, comprises the following steps:
1) central peripheral histogramming algorithm is used to obtain the Saliency maps of original image;
2) Threshold segmentation is carried out to described Saliency maps, obtain the rectangle R comprising conspicuousness object;
3) the image region as a setting using described rectangle Zone R overseas, initialization Grabcut algorithm, iteration runs the foreground segmentation of GrabCut algorithm execution to original image.
Compared with prior art, present invention utilizes the conspicuousness segmentation of image and the relevance of foreground segmentation, the initializes GrabCut algorithm utilizing conspicuousness to split, eliminate the step that user draws rectangle frame initialization GrabCut algorithm in the target image, user zero input can be realized in whole cutting procedure, automatically complete all foreground segmentation actions by computer class, improve the efficiency of foreground segmentation.
Preferably, described step 2) comprise the following steps: utilize predetermined gray threshold to carry out binaryzation to Saliency maps and obtain binary map; Binary map is carried out twice or repeatedly opening operation; UNICOM region maximum in image after measuring and calculating opening operation, selects the rectangle R of certain size and coordinate position, this UNICOM region is included in this rectangle R just.
Described gray threshold is the average gray of Saliency maps.
Preferably, interactive editor's step is also comprised: the partial pixel of original image is set to prospect or background by the input instruction according to user.This preferred version allows user to revise segmentation, makes up the weak point of auto Segmentation.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of the specific embodiment of the invention.
Embodiment
Contrast accompanying drawing below and in conjunction with preferred embodiment, the present invention be explained in detail.
One, the existing ripe image processing techniques that the present invention relates to
In order to help the understanding to technical solution of the present invention, hereafter first the image processing techniques of maturation involved in the present invention is described:
(1) conspicuousness object Examined effect
The Saliency maps of image adopts center-surround algorithm (central peripheral histogramming algorithm) to calculate: the grey level histogram first adding up three Color Channels of two rectangle inside, R ifor the grey level histogram of image in center rectangular area, for the grey level histogram of image in surround rectangular area.Histogrammic fitting degree in center region and surround region is calculated according to formula (1)
χ 2 ( R , R S ) = 1 2 Σ ( R i - R S i ) 2 R i + R S i - - - ( 1 )
f h ( x , I ) ∝ Σ [ x ′ | x ∈ R * ( x ′ ) ] ω xx ′ χ 2 ( R * ( x ′ ) , R S * ( x ′ ) ) - - - ( 2 )
ω xx ′ = exp ( - 0.5 σ x ′ - 2 | | x - x ′ | | 2 ) - - - ( 3 )
The eigenwert wherein R of x pixel is determined according to formula (2) *(x '), represent the center rectangle centered by x ' and periphery rectangle respectively, x ' represents all can become R *(x '), center and this R *(x '), the pixel of pixel x can be comprised, wherein ω xx' for Gauss's attenuation function is such as formula shown in (3), ‖ x-x ' ‖ is the Euclidean distance of pixel x apart from center pixel x ', and K is normaliztion constant.
(2) GrabCut foreground segmentation algorithm
GrabCut algorithm improves on the basis of GraphCut algorithm, and wherein GraphCut algorithm is as described below:
Image is seen as figure G={V, a ε }, V is all nodes, and ε is the limit connecting adjacent node.Iamge Segmentation can be used as a binary flag problem, each i ∈ V, has a unique x i{ prospect is 1 to ∈, and background is that 0} is corresponding with it.All x iset X can obtain by minimizing Gibbs ENERGY E (X):
E ( X ) = Σ i ∈ V E 1 ( x i ) + λ Σ ( i , j ) ∈ E E 2 ( x i , x j )
Same, according to the curve that user draws, we have foreground node collection F and background Node B, unknown node collection U.First use K-Mean method by the node clustering of F, B, calculate the average color of each class, represent the average color set of all prospect classes, background classes is calculate the minor increment of each node i to each prospect class d i B = min | | C ( i ) - K n F | | , With corresponding back pitch from d i B = min | | C ( i ) - K n B | | , Defined formula:
E 1 ( x i = 1 ) = 0 E 1 ( x i = 0 ) = ∞ ∀ i ∈ F E 1 ( x i = 1 ) = ∞ E 1 ( x i = 0 ) = 0 ∀ i ∈ B E 1 ( x i = 1 ) = d i F d i F + d i B E 1 ( x i = 0 ) = d i B d i F + d i B ∀ i ∈ U
Front two groups of equatioies ensure that definition inputs consistent with user, and the 3rd group of equation means that the color phase recency with front background decides the mark of unknown point.
E 2be defined as a function relevant to gradient:
E 2(x i,x j)=|x i-x j|·g(C ij)
g ( ϵ ) = 1 ϵ + 1 C ij=‖C(i)-C(j)‖ 2
E 2effect be reduce between the pixel that color is close, exist mark change possibility, even if it only occurs on border.
Finally, with E 1and E 2as the weights of figure, figure is split, the node division of zone of ignorance in prospect set or background set, just obtain the result of foreground extraction.
GrabCut algorithm improves on the basis of GraphCut: utilize gauss hybrid models (Gaussian MixtureModel, GMM) to replace histogram, gray level image is expanded to coloured image.
In GrabCut algorithm, GMM model is used to set up color image data model.Each GMM can regard the covariance of a K dimension as.Conveniently process GMM, in optimizing process, introduce vectorial k=(k 1..., k n..., k n) as the independent GMM parameter of each pixel, and k n∈ 1,2 ..., K}, the opacity α on respective pixel point n=0 or 1.
Gibbs energy function is written as:
E(α,k,θ,z)=U(α,k,θ,z)+V(α,z)
In formula, α is opacity, α ∈ 1,0}, 0 is background, and 1 is foreground target; Z is image intensity value array,
z=(z 1,…,z n,…,z N)。
Introduce GMM color data model, its data item may be defined as:
U ( α , k , θ , z ) = Σ n D ( α n , k n , θ , z n )
In formula, D (α n, k n, θ, z n)=-logp (z n| α n, k n, θ) and-logn (α n, k n),
P () is gaussian probability distribution, and π () is hybrid weight coefficient (Cumulate Sum is constant).So have:
D ( α n , k n , θ , z n ) = - log π ( α n , k n ) + 1 2 log det ( α n , k n ) + 1 2 [ z n - μ ( α n , k n ) ] T Σ ( α n , k n ) [ z n - μ ( α n , k n ) ]
The parameter of such model is just defined as:
θ={π(α,k),μ(α,k),∑(α,k),k=1,2,…,K}
The level and smooth item of coloured image is,
V ( α , z ) = γ Σ ( m , n ) ∈ c [ α m ≠ α n ] exp ( - β | | z m - z n | | 2 )
Wherein, constant beta is determined by following formula: β=(2 < (z m-z n) 2>) -1, the β obtained by such formula is guaranteed that above formula middle finger is several and suitably changes between high low value.
Two, a specific embodiment of the present invention
The foreground segmentation method of the present embodiment comprises the following steps: use central peripheral histogramming algorithm to obtain the Saliency maps of original image; Threshold segmentation is carried out to described Saliency maps, obtains the rectangle R comprising conspicuousness object; Use the image region as a setting that described rectangle Zone R is overseas, initialization GrabCut algorithm, iteration runs the foreground segmentation of GrabCut algorithm execution to original image.
Hereafter for the concrete processing procedure to original image A, technical scheme of the present invention is further produced:
1) input original image A, in scan image A, the central point of all possible central rectangular R as center-surround histogramming algorithm and periphery rectangle Rs, calculates the grey level histogram R of image in corresponding R, Rs region iand R i s, the length and width of the present embodiment rectangle R are 4/3 times that the length and width of 1/5, Rs of image A length and width get R length and width; The eigenwert of each central point is calculated according to previously described formula (1) ~ (3).Histogrammic fitting degree in center region and surround region is calculated according to formula (2); The significance value of x pixel is determined according to formula (2).For meeting R, the significance value of the pixel at Rs center is directly set to 0.
2) choosing certain threshold value, to carry out to Saliency maps the binary map that binaryzation obtains be C, and the threshold value herein chosen is preferably the average gray of Saliency maps B.Twice corrosion expansion i.e. twice opening operation is carried out to binary map C, thus reduces the interference of isolated noise.UNICOM region maximum in measuring and calculating C, selects the rectangle frame of certain size and relevant position, this UNICOM region is included in this rectangle frame just.If this rectangle frame is R.
3) start to use GrabCut algorithm to split to original image A, comprise the following steps:
A) use rectangle 2) in the rectangle R initialization GrabCut algorithm that obtains: the region outside original image rectangle R is considered as background T bcarry out initialization ternary diagram T (specify prospect, background on the original image and do not determine that the figure that region obtains is exactly ternary diagram T), prospect is set to sky, namely do not determine region T uget the supplementary set of background
B) for all pixel n ∈ T g, make opacity α n=0; N ∈ T uthere is α n=1.
C) α is used respectively n=0 and α n=1 two set carrys out the GMM model of initialization prospect and background.
4) iteration minimizes, and comprises the following steps:
D) T is tried to achieve uin the GMM parameter k corresponding to each pixel n n, k n=arg mind n(α, k n, θ, z n), (this formula represents makes D n{ α, k n, θ, z n) k when getting minimum value nvalue, lower with).
E) from data Z, GMM parameter θ is obtained, θ=argminU (α, k, θ, z).
F) initial segmentation is obtained with least energy revise ternary diagram T.
G) according to segmentation ternary diagram T f) obtained, from steps d) iteration repeat, until E (α, k, θ, z) convergence, namely after iteration E (α, k, θ, z) compared with last time change very little time stop iteration.
5) if user is to the division of respective pixel satisfaction not, interactive editor can be used to specify indivedual point to be prospect by force, and indivedual point is background, even respective pixel opacity α n=0 (background) or α n=1 (prospect), the correction according to user upgrades ternary diagram T accordingly, performs step f).So far display foreground has been split.
Above content is in conjunction with concrete preferred implementation further description made for the present invention, can not assert that specific embodiment of the invention is confined to these explanations.For those skilled in the art, without departing from the inventive concept of the premise, some equivalent to substitute or obvious modification can also be made, and performance or purposes identical, all should be considered as belonging to protection scope of the present invention.

Claims (2)

1. a method for segmenting foreground image, is characterized in that, comprises the following steps:
1) use central peripheral histogramming algorithm to obtain the Saliency maps of original image, comprise the following steps:
Input original image A, in scan image A, the central point of all possible central rectangular R as central peripheral histogramming algorithm and periphery rectangle Rs, calculates the grey level histogram R of image in corresponding R, Rs region iand R i s, the length and width of rectangle R are 4/3 times that the length and width of 1/5, Rs of image A length and width get R length and width; The eigenwert of each central point is calculated according to following formula (1) ~ (3), histogrammic fitting degree in Zone R territory and Rs region is calculated according to formula (1), the significance value of x pixel is determined according to formula (2), for meeting R, the significance value of the pixel at Rs center is directly set to 0;
&chi; 2 ( R , R S ) = 1 2 &Sigma; i ( R i - R S i ) 2 R i + R S i - - - ( 1 )
f n ( x , I ) &Proportional; &Sigma; { x &prime; | x &Element; R * ( x &prime; ) } &omega; xx &prime; &chi; 2 ( R * ( x &prime; ) , R S * ( x &prime; ) ) - - - ( 2 )
&omega; xx &prime; = exp ( - 0.5 &sigma; x &prime; - 2 | | x - x &prime; | | 2 ) - - - ( 3 )
Wherein, R *(x'), represent the center rectangle centered by x ' and periphery rectangle respectively, x ' represents all can become R *(x'), center and this R *(x'), the pixel of pixel x can be comprised, wherein ω xx' is Gauss's attenuation function;
2) Threshold segmentation is carried out to described Saliency maps, obtains the rectangle S comprising conspicuousness object, comprise the following steps:
It is C that the average gray choosing Saliency maps carries out to Saliency maps the binary map that binaryzation obtains, twice corrosion expansion is carried out to binary map C, thus reduce the interference of isolated noise, calculate connected region maximum in the binary map C after corrosion is expanded, select the rectangle frame S of certain size and relevant position, make this connected region just be included in this rectangle frame;
3) use the extra-regional image of described rectangle S region as a setting, initialization GrabCut algorithm, iteration runs the foreground segmentation of GrabCut algorithm execution to original image.
2. the method for segmenting foreground image according to claim 1, is characterized in that, also comprises interactive editor's step: the partial pixel of original image is set to prospect or background by the input instruction according to user.
CN201210004333.2A 2012-01-06 2012-01-06 Method for segmenting foreground image Active CN102592268B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201210004333.2A CN102592268B (en) 2012-01-06 2012-01-06 Method for segmenting foreground image
HK12109352.9A HK1168681A1 (en) 2012-01-06 2012-09-21 A method for segmenting a foreground image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210004333.2A CN102592268B (en) 2012-01-06 2012-01-06 Method for segmenting foreground image

Publications (2)

Publication Number Publication Date
CN102592268A CN102592268A (en) 2012-07-18
CN102592268B true CN102592268B (en) 2015-04-01

Family

ID=46480860

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210004333.2A Active CN102592268B (en) 2012-01-06 2012-01-06 Method for segmenting foreground image

Country Status (2)

Country Link
CN (1) CN102592268B (en)
HK (1) HK1168681A1 (en)

Families Citing this family (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831609B (en) * 2012-08-10 2014-10-22 清华大学深圳研究生院 Graphcut-based switch mode image matting technology
CN103632361B (en) * 2012-08-20 2017-01-18 阿里巴巴集团控股有限公司 An image segmentation method and a system
CN103051915B (en) * 2013-01-14 2015-02-18 清华大学 Manufacture method and manufacture device for interactive three-dimensional video key frame
CN103208123B (en) * 2013-04-19 2016-03-02 广东图图搜网络科技有限公司 Image partition method and system
JP6355746B2 (en) * 2014-02-19 2018-07-11 クアルコム,インコーポレイテッド Image editing techniques for devices
CN103903006A (en) * 2014-03-05 2014-07-02 中国科学院合肥物质科学研究院 Crop pest identification method and system based on Android platform
CN104036272A (en) * 2014-06-24 2014-09-10 联想(北京)有限公司 Text detection method and electronic device
CN104036517B (en) * 2014-07-01 2017-02-15 成都品果科技有限公司 Image matting method based on gradient sampling
CN104835146A (en) * 2015-04-14 2015-08-12 上海大学 Salient object segmenting method in stereo image based on depth information and image cutting
CN105069779B (en) * 2015-07-20 2017-12-26 童垸林 A kind of architectural pottery surface detail pattern quality detection method
CN105258680B (en) * 2015-09-30 2017-12-01 西安电子科技大学 A kind of object pose measuring method and device
CN105989604A (en) * 2016-02-18 2016-10-05 合肥工业大学 Target object three-dimensional color point cloud generation method based on KINECT
CN105894523A (en) * 2016-04-28 2016-08-24 北京联合大学 Image segmentation method based on structure tensor and image segmentation model
US10015504B2 (en) * 2016-07-27 2018-07-03 Qualcomm Incorporated Compressing image segmentation data using video coding
CN106570830A (en) * 2016-09-29 2017-04-19 北京联合大学 GrabCut improvement-based image segmentation method
CN106548185B (en) * 2016-11-25 2019-05-24 三星电子(中国)研发中心 A kind of foreground area determines method and apparatus
CN106780513B (en) * 2016-12-14 2019-08-30 北京小米移动软件有限公司 The method and apparatus of picture conspicuousness detection
CN106815848A (en) * 2017-01-17 2017-06-09 厦门可睿特信息科技有限公司 Portrait background separation and contour extraction method based on grubcut and artificial intelligence
CN107463622A (en) * 2017-07-06 2017-12-12 西南交通大学 A kind of automatic Symbolic method for keeping landmark shape facility
CN107480644B (en) * 2017-08-21 2019-11-19 吉林大学 The positioning of optic disk and dividing method, device and storage medium in eye fundus image
CN107610126A (en) * 2017-08-31 2018-01-19 浙江工业大学 A kind of interactive image segmentation method based on local prior distribution
CN107610148B (en) * 2017-09-19 2020-07-28 电子科技大学 Foreground segmentation method based on binocular stereo vision system
CN110111293B (en) * 2018-01-29 2021-05-11 国科赛思(北京)科技有限公司 Failure identification method and device for plastic package device
CN108537239B (en) * 2018-04-18 2020-11-17 西南科技大学 Method for detecting image saliency target
CN109740611A (en) * 2019-01-25 2019-05-10 中电健康云科技有限公司 Tongue image analysis method and device
CN111507287B (en) * 2020-04-22 2023-10-24 山东省国土测绘院 Method and system for extracting road zebra crossing corner points in aerial image
CN113936049A (en) * 2021-10-21 2022-01-14 北京的卢深视科技有限公司 Monocular structured light speckle image depth recovery method, electronic device and storage medium
CN116342629A (en) * 2023-06-01 2023-06-27 深圳思谋信息科技有限公司 Image interaction segmentation method, device, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102254325B (en) * 2011-07-21 2012-12-05 清华大学 Method and system for segmenting motion blur scene and extracting foreground

Also Published As

Publication number Publication date
HK1168681A1 (en) 2013-01-04
CN102592268A (en) 2012-07-18

Similar Documents

Publication Publication Date Title
CN102592268B (en) Method for segmenting foreground image
CN111986099B (en) Tillage monitoring method and system based on convolutional neural network with residual error correction fused
CN111444821A (en) Automatic identification method for urban road signs
US8238660B2 (en) Hybrid graph model for unsupervised object segmentation
CN102651128B (en) Image set partitioning method based on sampling
Liasis et al. Building extraction in satellite images using active contours and colour features
CN102810158B (en) High-resolution remote sensing target extraction method based on multi-scale semantic model
CN104899877A (en) Method for extracting image foreground based on super pixel and fast trimap image
CN104424629A (en) X-ray chest radiography lung segmentation method and device
CN104537676A (en) Gradual image segmentation method based on online learning
CN102903110A (en) Segmentation method for image with deep image information
Liu et al. Road centerlines extraction from high resolution images based on an improved directional segmentation and road probability
CN102903102A (en) Non-local-based triple Markov random field synthetic aperture radar (SAR) image segmentation method
CN103136757A (en) SAR image segmentation method based on manifold distance two-stage clustering algorithm
CN104636761A (en) Image semantic annotation method based on hierarchical segmentation
CN104732551A (en) Level set image segmentation method based on superpixel and graph-cup optimizing
CN103198479A (en) SAR image segmentation method based on semantic information classification
CN114120141A (en) All-weather remote sensing monitoring automatic analysis method and system thereof
CN114913321A (en) Object attention mining method and system based on local-to-global knowledge migration
CN112419335B (en) Shape loss calculation method of cell nucleus segmentation network
Song et al. Object detection based on cortex hierarchical activation in border sensitive mechanism and classification-GIou joint representation
CN113096080A (en) Image analysis method and system
Siva et al. Grid seams: A fast superpixel algorithm for real-time applications
Xu et al. Identification of contour lines from average-quality scanned topographic maps
CN103456019A (en) Image segmentation method of semi-supervised kernel k-mean clustering based on constraint pairs

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1168681

Country of ref document: HK

C14 Grant of patent or utility model
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1168681

Country of ref document: HK