CN106952270A - A kind of quickly stingy drawing method of uniform background image - Google Patents

A kind of quickly stingy drawing method of uniform background image Download PDF

Info

Publication number
CN106952270A
CN106952270A CN201710115845.9A CN201710115845A CN106952270A CN 106952270 A CN106952270 A CN 106952270A CN 201710115845 A CN201710115845 A CN 201710115845A CN 106952270 A CN106952270 A CN 106952270A
Authority
CN
China
Prior art keywords
background
image
foreground
point
components
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710115845.9A
Other languages
Chinese (zh)
Inventor
谭光华
蔡青宏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan University
Original Assignee
Hunan 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 Hunan University filed Critical Hunan University
Priority to CN201710115845.9A priority Critical patent/CN106952270A/en
Publication of CN106952270A publication Critical patent/CN106952270A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/011Arrangements for interaction with the human body, e.g. for user immersion in virtual reality

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The present invention is directed to the deficiency of blue screen image cutting method, discloses a kind of quickly stingy drawing method of uniform background image.This method includes background colour automatic identification, three components and automatically generated and alpha value three steps of calculating.First, by the background colour for automatic identification image of being sampled to image boundary, and RGB color model is converted into HSI color model, the influence of illumination is reduced, so as to realize the automatic segmentation of foreground and background;Secondly, three components are obtained by the corrosion respectively to foreground and background;Based on three components, the thought based on color samples calculates the alpha value of each pixel of zone of ignorance, and smooth, the noise in reduction calculating is finally carried out to the alpha value that calculating is obtained using the method for guiding filtering.This method realization is simple, can reach in real time without user's specific context, alpha value computational accuracy height, calculating speed, and the synthesis for virtual studio, video display animation is significant.

Description

A kind of quickly stingy drawing method of uniform background image
Technical field
The present invention relates to technical field of virtual reality, more particularly to virtual studio, video display special effect making.
Background technology
Stingy figure is a kind of special image Segmentation Technology.Image segmentation only need to be by picture segmentation into foreground area and background area Each pixel in domain two parts, image is not that prospect is exactly background.However, in practice in the borderline region of foreground and background, Often there is the hair of the phenomenon that foreground and background is mutually merged, such as people, the color C of this partial pixel is by foreground F and the back of the body Scenery B linear combinations are obtained, i.e.,:
C=(1- α) B+ α F
Therefore, stingy diagram technology is not only it needs to be determined that the foreground F of pixel, background colour B, also need to determine the opacity of each pixel α.Given piece image, for each pixel, it is known that variable there was only 3, the i.e. RGB component of the color, it is unknown Variable but has 7, foreground F and background colour B rgb value and opacity α, therefore, and the problem is a height morbid state Problem, need to could be solved by some prioris.
In existing method, using it is most be that blue screen image cutting or green screen are scratched as technology.It is indigo plant that background is assumed in this method Color or green, therefore three components are specified by hand without user, background and prospect can be easily separated, but this method is for field The illumination of scape has the harsh requirement of comparison, and alpha precision is not high.Other class method is then the base that three components are specified in user On plinth, realize finer stingy figure effect, including the stingy drawing method based on color samples thought, i.e., by searching recently before Scape sample point and background sample point estimation foreground and background colour, then estimate alpha value, such as Robust matting, Share Matting and Bayes scratch figure, and the stingy drawing method based on similarity principle, including Poisson matting, closed Form matting, spectral matting.Although this kind of method alpha ratios of precision are higher, the natural field of complexity can be handled Scape, but it is computationally intensive, be difficult in real time, and need user to manually enter three fine components of a comparison, for regarding in real time The processing of frequency stream is not applied to simultaneously.
The content of the invention
In order to overcome the above-mentioned deficiencies of the prior art, the invention provides a kind of figure for only including uniform background color The quickly stingy drawing method of picture.This method, can Auto-Sensing without assuming that background colour is blue or green in picture blue screen image cutting technology Background color in image;With reference to the thought of the stingy diagram technology based on color samples, the alpha in blue screen image cutting technology can be improved It is worth precision;And three components are specified without man-machine interactively, calculating speed is fast, and real-time video matting can be achieved.
The technical solution adopted in the present invention is:
Image under uniform background, which quickly scratches drawing method, mainly includes four steps:Background colour automatic identification and prospect point Cut, three components are automatically generated, alpha value calculating and the optimization of alpha value based on three components.
The automatic identification of background colour to the upper left of image, upper right, lower-left, the borderline region of bottom right four by carrying out sampling realization. It is HSI first by the color space conversion of image to reduce the influence of illumination, merely with the H components in HSI color spaces, I.e. chrominance information carrys out the background colour of automatic identification image.If the width of image and it is high be respectively w and h, respectively image (15, 15), (w-15,15), (15, h-15), one 5X5 of (w-15, h-15) four positions samplings subregion is calculated per sub-regions Average H values, the H values of image background color are the intermediate value of the average H values of four sub-regions.The back of the body of the image obtained using calculating Scenery, for each pixel in image, if the difference of the H values of pixel and the H values of background colour is less than given threshold value, the picture Element belongs to background area, otherwise belongs to foreground area.So, it is achieved that the segmentation of the prospect and background of image.
Result based on segmentation, by corroding respectively to foreground and background, can automatically generate three components.It is rotten Prospect after erosion constitutes the foreground part in three components, and the background after corrosion constitutes the background parts in three components, remaining picture It is plain then constitute the zone of ignorance in three components.The template of corrosion is as shown in figure 1, be 5X5 rectangle template.
Based on three obtained components, the alpha value of each pixel in three component zone of ignorances is calculated.Specific method is:It is right Each pixel P of zone of ignorance, the background dot nearest from the point is found out in background area, the face of the point is counted in three components Color is B, and nearest from the point foreground point is found out in foreground area, centered on the point, the foreground point in the range of selection 5X5, right In each foreground point, corresponding α values are calculated by formula (1).Point P alpha value is then the minimum α of all these errors of centralization Value.Shown in the calculating of error such as formula (2).
Finally optimized, reduced in calculating process using the method for guiding filtering for calculating obtained alpha value Error and noise.Navigational figure in guiding filtering is original image, and image to be filtered is the image that alpha value is constituted.
Compared with prior art, beneficial benefit of the invention is that of avoiding man-machine interactively, without specifying three components and assuming background Color;Computation complexity is reduced, computational efficiency is improved, can be achieved to scratch figure in real time, therefore be applicable to the void such as virtual studio Intend application on site.
Brief description of the drawings
Fig. 1 is the 5X5 templates applied during Image erosion.
Fig. 2 scratches the flow chart of figure for the image under uniform background.
Embodiment
The present invention is further described below in conjunction with the accompanying drawings.
As shown in Fig. 2 the image under uniform background quickly scratches drawing method, it is main to include four steps:Background colour is known automatically Not and image segmentation, three components are automatically generated, and Alpha values are calculated and the Alpha values optimization based on guiding filtering.
Piece image is inputted, is HSI color spaces first by color space conversion.If the width of image and it is high be respectively w and H, respectively in (15,15) of image, (w-15,15), (15, h-15), one 5X5 of (w-15, h-15) four positions samplings son Region, calculates the average H values per sub-regions.The intermediate value of the average H values of four sub-regions is the H values of background colour.For image In each pixel, if the threshold value (usual value is 20) that the H value differences of the H values of the pixel and background colour little Yu not give, this Pixel belongs to background area, otherwise belongs to foreground area, so as to realize the automatic segmentation of image.
For the foreground and background obtained after segmentation, corroded using the template shown in Fig. 1, so as to automatically generate one finely Three components.
Three components based on generation, for each pixel in zone of ignorance, the nearest foreground point of lookup and background dot, profit The alpha value with minimal error is calculated with formula (1).
Finally, the mode based on guiding filtering carries out smoothly, depositing to reduce in calculating process to the alpha value that calculating is obtained Noise.

Claims (5)

1. the image under a kind of uniform background quickly scratches drawing method, it is characterised in that including the following steps:
Step 1:Background colour automatic identification and foreground segmentation;
Step 2:Three components are automatically generated;
Step 3:Alpha value based on three components is calculated;
Step 4:Alpha value optimizes.
2. the image under uniform background according to claim 1 quickly scratches drawing method, it is characterised in that:
Background colour automatic identification in step 1 carries out sampling realization by the border to image.Specific method is:First by image Color space conversion be HSI, then sampled 5X5 sub-blocks in four corner areas of image, calculate the average H of each sub-block Value, the intermediate value of four H values is the background colour of image.Using the H values of the background colour, if in image pixel H values and background colour H values difference be less than given threshold value then be background, be otherwise background.
3. the image under uniform background according to claim 1 quickly scratches drawing method, it is characterised in that:
Three points of map generalizations in step 2 are obtained by the corrosion to foreground and background, and the template of corrosion is 5X5 template, rotten Foreground and background after erosion respectively constitutes the foreground and background part in three components, and remaining part is then to be unknown in three components Region.
4. the image under uniform background according to claim 1 quickly scratches drawing method, it is characterised in that:
The calculating of alpha value in step 3 is calculated by searching immediate outlook point and background dot using least square method Arrive.Specific method is:For each pixel P of zone of ignorance in three components, found out in background area nearest from the point Background dot, the color for counting the point is B, and nearest from the point foreground point is found out in foreground area, centered on the point, selects 5X5 In the range of foreground point, for each foreground point, corresponding value is calculated by formula (1).
α = m i n ( 1 , m a x ( 0 , ( C - B ) · ( F - B ) | | F - B | | 2 ) ) - - - ( 1 )
Wherein C is point P RGB color, and F, B are respectively the color of foreground point and background dot.Point P alpha value then for it is all this The minimum α values of a little point errors of centralization.Shown in the calculating of error such as formula (2).
Err=| | C- (1- α) B- α F | |2 (2)
5. the image under uniform background according to claim 1 quickly scratches drawing method, it is characterised in that:
Alpha value optimization in step 4 is realized by guiding filtering.Navigational figure in guiding filtering is original image, to be filtered The image of ripple is the image that alpha value is constituted.
CN201710115845.9A 2017-03-01 2017-03-01 A kind of quickly stingy drawing method of uniform background image Pending CN106952270A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710115845.9A CN106952270A (en) 2017-03-01 2017-03-01 A kind of quickly stingy drawing method of uniform background image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710115845.9A CN106952270A (en) 2017-03-01 2017-03-01 A kind of quickly stingy drawing method of uniform background image

Publications (1)

Publication Number Publication Date
CN106952270A true CN106952270A (en) 2017-07-14

Family

ID=59467131

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710115845.9A Pending CN106952270A (en) 2017-03-01 2017-03-01 A kind of quickly stingy drawing method of uniform background image

Country Status (1)

Country Link
CN (1) CN106952270A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107516319A (en) * 2017-09-05 2017-12-26 中北大学 A kind of high accuracy simple interactive stingy drawing method, storage device and terminal
CN107610041A (en) * 2017-08-16 2018-01-19 南京华捷艾米软件科技有限公司 Video portrait based on 3D body-sensing cameras scratches drawing method and system
CN108537799A (en) * 2018-03-21 2018-09-14 广西师范大学 A kind of color samples method counted based on pixel type and weight
CN109166135A (en) * 2018-10-17 2019-01-08 东北大学 A kind of blue screen image cutting method based on hsv color space and chroma key
CN110047034A (en) * 2019-03-27 2019-07-23 北京大生在线科技有限公司 Stingy figure under online education scene changes background method, client and system
CN110335279A (en) * 2019-07-02 2019-10-15 武汉瑞宏峰科技有限公司 Real-time green curtain is scratched as method, apparatus, equipment and storage medium
CN110503704A (en) * 2019-08-27 2019-11-26 北京迈格威科技有限公司 Building method, device and the electronic equipment of three components
CN111223108A (en) * 2019-12-31 2020-06-02 上海影卓信息科技有限公司 Method and system based on backdrop matting and fusion
CN111862110A (en) * 2020-06-30 2020-10-30 辽宁向日葵教育科技有限公司 Green curtain image matting method, system, equipment and readable storage medium
CN114078139A (en) * 2021-11-25 2022-02-22 四川长虹电器股份有限公司 Image post-processing method based on portrait segmentation model generation result
WO2022041865A1 (en) * 2020-08-28 2022-03-03 稿定(厦门)科技有限公司 Automatic image matting method and apparatus employing computation on multiple background colors

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1479254A (en) * 2003-05-18 2004-03-03 浙江大学 Natural image scratching method in digital image treatment based on HVS precessing
CN101673400A (en) * 2008-09-08 2010-03-17 索尼株式会社 Image processing apparatus, method, and program
CN103177446A (en) * 2013-03-13 2013-06-26 北京航空航天大学 Image foreground matting method based on neighbourhood and non-neighbourhood smoothness prior
CN103473780A (en) * 2013-09-22 2013-12-25 广州市幸福网络技术有限公司 Portrait background cutout method
CN103955918A (en) * 2014-04-03 2014-07-30 吉林大学 Full-automatic fine image matting device and method
CN104504745A (en) * 2015-01-16 2015-04-08 成都品果科技有限公司 Identification photo generation method based on image segmentation and image matting
CN104680518A (en) * 2015-02-03 2015-06-03 长春理工大学 Blue screen image matting method based on chroma overflowing processing
CN105139415A (en) * 2015-09-29 2015-12-09 小米科技有限责任公司 Foreground and background segmentation method and apparatus of image, and terminal
CN105590312A (en) * 2014-11-12 2016-05-18 株式会社理光 Foreground image segmentation method and apparatus

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1479254A (en) * 2003-05-18 2004-03-03 浙江大学 Natural image scratching method in digital image treatment based on HVS precessing
CN101673400A (en) * 2008-09-08 2010-03-17 索尼株式会社 Image processing apparatus, method, and program
CN103177446A (en) * 2013-03-13 2013-06-26 北京航空航天大学 Image foreground matting method based on neighbourhood and non-neighbourhood smoothness prior
CN103473780A (en) * 2013-09-22 2013-12-25 广州市幸福网络技术有限公司 Portrait background cutout method
CN103955918A (en) * 2014-04-03 2014-07-30 吉林大学 Full-automatic fine image matting device and method
CN105590312A (en) * 2014-11-12 2016-05-18 株式会社理光 Foreground image segmentation method and apparatus
CN104504745A (en) * 2015-01-16 2015-04-08 成都品果科技有限公司 Identification photo generation method based on image segmentation and image matting
CN104680518A (en) * 2015-02-03 2015-06-03 长春理工大学 Blue screen image matting method based on chroma overflowing processing
CN105139415A (en) * 2015-09-29 2015-12-09 小米科技有限责任公司 Foreground and background segmentation method and apparatus of image, and terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
俞克强等: "例样相似性的全局最优抠图算法", 《工业控制计算机》 *

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107610041B (en) * 2017-08-16 2020-10-27 南京华捷艾米软件科技有限公司 Video portrait matting method and system based on 3D somatosensory camera
CN107610041A (en) * 2017-08-16 2018-01-19 南京华捷艾米软件科技有限公司 Video portrait based on 3D body-sensing cameras scratches drawing method and system
CN107516319A (en) * 2017-09-05 2017-12-26 中北大学 A kind of high accuracy simple interactive stingy drawing method, storage device and terminal
CN107516319B (en) * 2017-09-05 2020-03-10 中北大学 High-precision simple interactive matting method, storage device and terminal
CN108537799A (en) * 2018-03-21 2018-09-14 广西师范大学 A kind of color samples method counted based on pixel type and weight
CN108537799B (en) * 2018-03-21 2021-03-23 广西师范大学 Color sampling method based on pixel type and weight statistics
CN109166135A (en) * 2018-10-17 2019-01-08 东北大学 A kind of blue screen image cutting method based on hsv color space and chroma key
CN109166135B (en) * 2018-10-17 2021-10-29 东北大学 Blue screen keying method based on HSV color space and chroma key
CN110047034A (en) * 2019-03-27 2019-07-23 北京大生在线科技有限公司 Stingy figure under online education scene changes background method, client and system
CN110335279A (en) * 2019-07-02 2019-10-15 武汉瑞宏峰科技有限公司 Real-time green curtain is scratched as method, apparatus, equipment and storage medium
CN110503704A (en) * 2019-08-27 2019-11-26 北京迈格威科技有限公司 Building method, device and the electronic equipment of three components
CN111223108A (en) * 2019-12-31 2020-06-02 上海影卓信息科技有限公司 Method and system based on backdrop matting and fusion
CN111862110A (en) * 2020-06-30 2020-10-30 辽宁向日葵教育科技有限公司 Green curtain image matting method, system, equipment and readable storage medium
WO2022041865A1 (en) * 2020-08-28 2022-03-03 稿定(厦门)科技有限公司 Automatic image matting method and apparatus employing computation on multiple background colors
CN114078139A (en) * 2021-11-25 2022-02-22 四川长虹电器股份有限公司 Image post-processing method based on portrait segmentation model generation result
CN114078139B (en) * 2021-11-25 2024-04-16 四川长虹电器股份有限公司 Image post-processing method based on human image segmentation model generation result

Similar Documents

Publication Publication Date Title
CN106952270A (en) A kind of quickly stingy drawing method of uniform background image
CN109145922B (en) Automatic cutout system
Li et al. Video object cut and paste
US7609888B2 (en) Separating a video object from a background of a video sequence
CN103473780B (en) The method of portrait background figure a kind of
CN101945223B (en) Video consistent fusion processing method
JP3812763B2 (en) Key signal generating apparatus and method
CN101371274B (en) Edge comparison in video sequence partition
CN103985098B (en) Method and system for removing highlight of certificate image
CN111161313B (en) Multi-target tracking method and device in video stream
CN113240626B (en) Glass cover plate concave-convex type flaw detection and classification method based on neural network
CN103544685B (en) A kind of image composition beautification method adjusted based on main body and system
CN102024156B (en) Method for positioning lip region in color face image
CN102800094A (en) Fast color image segmentation method
CN101425179A (en) Face image relighting method and device
CN103295219B (en) Method and device for segmenting image
CN102202224A (en) Caption flutter-free method and apparatus used for plane video stereo transition
CN102831584A (en) Data-driven object image restoring system and method
CN111951345B (en) GPU-based real-time image video oil painting stylization method
CN107133964A (en) A kind of stingy image space method based on Kinect
Wang et al. Robust image chroma-keying: a quadmap approach based on global sampling and local affinity
CN105373798A (en) K neighbor image matting and mathematical morphology-based calligraphy character extracting method
JP4697923B2 (en) Counting system and counting method for moving object in water or water surface
AU2016273984A1 (en) Modifying a perceptual attribute of an image using an inaccurate depth map
CN105741263A (en) Hand contour extraction and orientation-positioning algorithm

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20170714

WD01 Invention patent application deemed withdrawn after publication