CN102395008A - Color key processing method - Google Patents

Color key processing method Download PDF

Info

Publication number
CN102395008A
CN102395008A CN2011103709425A CN201110370942A CN102395008A CN 102395008 A CN102395008 A CN 102395008A CN 2011103709425 A CN2011103709425 A CN 2011103709425A CN 201110370942 A CN201110370942 A CN 201110370942A CN 102395008 A CN102395008 A CN 102395008A
Authority
CN
China
Prior art keywords
layer
chroma key
pixel
source
component
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
CN2011103709425A
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.)
Shenzhen Ipanel TV Inc
Original Assignee
Shenzhen Ipanel TV 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 Shenzhen Ipanel TV Inc filed Critical Shenzhen Ipanel TV Inc
Priority to CN2011103709425A priority Critical patent/CN102395008A/en
Publication of CN102395008A publication Critical patent/CN102395008A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Processing Of Color Television Signals (AREA)
  • Studio Circuits (AREA)

Abstract

Embodiments of the invention disclose a color key processing method which is applied in the image processing field. The method comprises the following steps: providing a source layer formed by a pixel and a color key condition, wherein the color key condition is the single pixel; comparing the each pixel in the source layer with the color key condition; performing zero setting to an Alpha component of the pixel which matches with the color key condition in the source layer if the pixel in the source layer matches with the color key condition so as to form a color key layer; providing an object layer which is formed by the pixel; performing translucent mixing to the color key layer and the object layer so as to form a color key pattern. In the embodiments of the invention, the layer is directly processed and then the layer is mixed so as to realize a color key function.

Description

A kind of chroma key processing method
Technical field
The present invention relates to image processing field, particularly a kind of chroma key processing method.
Background technology
Nowadays chroma key is used as a kind of special image processing method widely.
Chroma key is a kind of trick play functionality of being accomplished with the electronics technical method, controls a high speed electronic switch through the keying signal of taking from chromatic component.For example: video camera A takes performer or the material object in the studio, and it makes background (adopting blue usually) with the monochromatic curtain of dark saturation after one's death, picture is exported as source signal again.Video camera B film the exterior picture or other program materials (moving frame) of resetting again with picture signal output as a setting.Source signal and background signal are input to the chroma key device and handle, and the chromatic component of being selected in the source signal by the chroma key signal generator in the chroma key device produces keying signal.When keying signal satisfies the chromatic component value of setting (blueness), electronic switch will select background signal promptly as output in the stunt switch of chroma key device.When discontented degree component value of standard purity, selecting source signal is that performer's picture signal is as output.Just exportable performer places oneself in the midst of the stingy picture picture in the outdoor scene background.
Hardware switch need be applied in the prior art and the chroma key effect could be accomplished.
Summary of the invention
The embodiment of the invention provides and need not hardware switch, directly the figure layer is handled, and again the figure layer is mixed the chroma key processing method that realizes the chroma key function.
The embodiment of the invention provides a kind of chroma key processing method, comprising:
Source figure layer and the chroma key condition be made up of pixel are provided, and said chroma key condition is single pixel;
Each pixel and chroma key condition in the figure layer of source are compared, if pixel in the figure layer of source and chroma key condition coupling then with Alpha's component zero setting of the pixel of mating with the chroma key condition in the figure layer of source, form chroma key figure layer;
The target figure that is made up of pixel is provided layer, chroma key figure layer is carried out translucent the mixing with target figure layer, generate the chroma key pattern.
In the technical scheme that the embodiment of the invention provides; The source figure layer figure layer that pixel with Alpha's component is formed of serving as reasons; Alpha's component is the unit of tolerance pixel opacity, and Alpha's component is that zero pixel is transparent, through the Alpha's component zero setting with the pixel that satisfies the chroma key condition in the figure layer of source; Promptly can be in figure layer mixes in the figure layer of source Alpha's component be the speed limit of zero the direct display-object figure in locations of pixels place layer, realize the chroma key function.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art; To do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below; Obviously, the accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills; Under the prerequisite of not paying creative work property, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the chroma key processing method first embodiment sketch map in the embodiment of the invention;
Fig. 2 is the chroma key processing method second embodiment sketch map in the embodiment of the invention;
Fig. 3 is chroma key processing method the 3rd an embodiment sketch map in the embodiment of the invention.
Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
The embodiment of the invention provides the chroma key processing method, need not hardware switch, directly the figure layer is handled, and the figure layer is mixed realize the chroma key function again, below is elaborated.
See also Fig. 1, chroma key processing method first embodiment comprises in the embodiment of the invention:
101, the source figure layer be made up of pixel and the chroma key condition of single pixel are provided;
Source figure layer is the figure layer of being made up of a plurality of pixels, and the chroma key condition is single pixel, and for example background is the source figure layer of the material picture of blueness, and the chroma key condition is a blue pixel.
102, each pixel and chroma key condition in the figure layer of source are compared, if pixel in the figure layer of source and chroma key condition coupling then with Alpha's component zero setting of the pixel of mating with the chroma key condition in the figure layer of source, form chroma key figure layer;
Background is all compared with the chroma key condition of blue pixel for each pixel in the source figure layer of blue material picture; If coupling; Then revise the value of Alpha's component of the pixel of this and chroma key condition coupling; With Alpha's component zero setting of this pixel in the figure layer of source, obtain chroma key figure layer after all pixels are all handled in the figure layer of source.Described coupling mainly is whether the value of judging other components except Alpha's component in the pixel equates respectively; Whether the value that also can judge whole components of pixel equates respectively; Alpha's component is the unit of tolerance pixel opacity; Alpha's component has that pixel is opaque peaked the time; Pixel was transparent when the value of Alpha's component was zero, and the pixel of the value of Alpha's component between maximum and zero is translucent, and transparency is evenly increased progressively to zero by maximum.For example blue pixel is formed in the material picture of background the Alpha's component zero setting with the blue pixel of chroma key condition coupling, the value that forms Alpha's component is the material picture that zero pixel is formed background.
103, the target figure that is made up of pixel is provided layer, chroma key figure layer is carried out translucent the mixing with target figure layer, generate the chroma key pattern;
The target figure that is made up of pixel is provided layer, the target figure layer of landscape pattern is for example arranged, the chroma key figure layer that forms in the last step is carried out translucent the mixing with target figure layer, having generated in background is the chroma key pattern of the material picture of landscape pattern.Translucent mixing is a kind of special effect processing of figure interlayer copy; Two values of scheming each component of the pixel on the layer relevant position are calculated the new pixel that produces new component value composition through formula; Each locational new pixel is formed new image, makes a figure layer can be presented on another figure layer.When the value of Alpha's component of certain pixel of source figure layer is zero; Then with target figure layer relevant position on pixel carry out translucent the mixing after; Generate new pixel with the pixel on the direct display-object figure layer relevant position; When the alpha value of certain pixel of source figure layer is maximum, then with target figure layer relevant position on pixel carry out translucent the mixing after, generate this pixel that new pixel will directly show source figure layer; If when the alpha value of certain pixel of source figure layer is zero value in the middle of the maximum, the value that generates each component of new pixel after the translucent mixing will be calculated by formula.
In the present embodiment through Alpha's component zero setting with the pixel that satisfies the chroma key condition in the figure layer of source, promptly can be in figure layer mixes in the figure layer of source Alpha's component be the pixel of zero the direct display-object figure in locations of pixels place layer, realize the chroma key function.
See also Fig. 2, chroma key processing method second embodiment comprises in the embodiment of the invention:
201, the chroma key condition of the single pixel of the source figure layer be made up of the pixel of ARGB form and ARGB form is provided;
Wherein the pixel of ARGB form is the pixel with Alpha's component, red component, green component and blue component.
202, judge whether and need back up source figure layer, if not, then carry out 204, if yes, then carry out 203.
203, source figure layer is backed up;
Because source figure layer is handled meeting destruction source figure layer, therefore in practical application, need back up source figure layer sometimes, source figure layer is copied to the memory headroom that is different from source figure layer.
204, judge whether each component in the chroma key condition is zero, if be zero, then with source figure layer directly as chroma key figure layer, and carry out 206, if be not zero, then carry out 205.
205; Each pixel and chroma key condition in the figure layer of source are compared, if pixel and chroma key condition in the figure layer of source coupling, then with Alpha's component zero setting of the pixel of mating with the chroma key condition in the figure layer of source; Form chroma key figure layer, said coupling is that the value of each component equates respectively;
Each pixel and chroma key condition in the figure layer of source are compared; If the value of each component of pixel equates respectively with the value of each component of the pixel of chroma key condition in the figure layer of source; Each component comprises Alpha's component, red component, blue component and green component, then revises the value of Alpha's component of this pixel in the figure layer of source, with Alpha's component zero setting of this pixel in the figure layer of source; After all pixels are all handled in the figure layer of source, obtain chroma key figure layer.
206, the target figure that is made up of pixel is provided layer, chroma key figure layer is carried out translucent the mixing with target figure layer, generate the chroma key pattern.
207, judge whether and need mix again said chroma key figure layer, if yes, then carry out 206, if not, process ends then;
If carry out 206, then chroma key figure layer carries out translucent the mixing with the target figure layer that newly provides, and forms new chroma key pattern, and a chroma key figure layer can mix the different chroma key pattern of generation with a plurality of different target figure layers.
A kind of chroma key processing method of mating each component of the source figure layer that the pixel of ARGB form forms is provided in the present embodiment.
See also Fig. 2, the 3rd embodiment of chroma key processing method comprises in the embodiment of the invention:
301, the chroma key condition of the single pixel of the source figure layer be made up of the pixel of ARGB form and ARGB form is provided.
302, judge whether and need back up source figure layer, if not, then carry out 304, if yes, then carry out 303.
303, source figure layer is backed up.
304, judge whether each component in the chroma key condition is zero, if be zero, then with source figure layer directly as chroma key figure layer, and carry out 306, if be not zero, then carry out 305.
305; Each pixel and chroma key condition in the figure layer of source are compared; If pixel in the figure layer of source and chroma key condition coupling; Then with Alpha's component zero setting of the pixel of mating with the chroma key condition in the figure layer of source, form chroma key figure layer, said coupling is that the value of red component, blue component and green component equates respectively;
Each pixel and chroma key condition in the figure layer of source are compared; If the value of red component, blue component and the green component of pixel equates respectively with the value of red component, blue component and the green component of the pixel of chroma key condition in the figure layer of source; Then revise the value of Alpha's component of this pixel in the figure layer of source; With Alpha's component zero setting of this pixel in the figure layer of source, after all pixels are all handled in the figure layer of source, obtain chroma key figure layer.When the processing that compares; The value of Alpha's component of the pixel in the source figure layer that can will compare earlier and Alpha's component of chroma key condition is arranged to same value; The Alpha's component of the pixel in the source figure layer that for example will compare and the equal zero setting of Alpha's component of chroma key condition; Again with the pixel in the source figure layer after the zero setting of Alpha's component the institute of the chroma key condition after important and the zero setting of Alpha's component is important compares respectively; If pixel in the opisthogenesis figure layer is set, and each component of chroma key condition equates respectively with being provided with afterwards; Then revise the value of Alpha's component of this pixel in the figure layer of source, with in the figure layer of source should with Alpha's component zero setting of chroma key condition matched pixel.
306, the target figure that is made up of pixel is provided layer, chroma key figure layer is carried out translucent the mixing with target figure layer, generate the chroma key pattern.
307, judge whether and need mix again said chroma key figure layer, if yes, then carry out 306, if not, then finish the chroma key processing method;
If carry out 306, then chroma key figure layer carries out translucent the mixing with the target figure layer that newly provides, and forms new chroma key pattern, and a chroma key figure layer can mix the different chroma key pattern of generation with a plurality of different target figure layers.
The chroma key processing method of a compared pixels RGB component is provided in the present embodiment; Alpha's component is not compared; As long as make the pixel that same color is arranged, can reduce to have leaked and handle this pixel because of the difference of Alpha's component all with the value zero setting of its Alpha's component.
More than a kind of chroma key processing method that the embodiment of the invention provided has been carried out detailed introduction; Used concrete example among this paper principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that on embodiment and range of application, all can change, in sum, this description should not be construed as limitation of the present invention.

Claims (6)

1. a chroma key processing method is characterized in that, comprising:
Source figure layer and the chroma key condition be made up of pixel are provided, and said chroma key condition is single pixel;
Each pixel and chroma key condition in the figure layer of source are compared, if pixel in the figure layer of source and chroma key condition coupling then with Alpha's component zero setting of the pixel of mating with the chroma key condition in the figure layer of source, form chroma key figure layer;
The target figure that is made up of pixel is provided layer, chroma key figure layer is carried out translucent the mixing with target figure layer, generate the chroma key pattern.
2. chroma key processing method according to claim 1 is characterized in that: the step that each pixel and chroma key condition in the figure layer of source are compared comprises:
Judge whether each component in the chroma key condition is all zero; If each component of chroma key condition is zero, then figure layer in source is directly as chroma key figure layer, if each component of chroma key condition is not zero; Each pixel and chroma key condition in the figure layer of source are compared; If pixel in the figure layer of source and chroma key condition coupling then with Alpha's component zero setting of the pixel of mating with the chroma key condition in the figure layer of source, form chroma key figure layer.
3. chroma key processing method according to claim 1 and 2; It is characterized in that: said chroma key condition is the pixel of ARGB form; The pixel of said source figure layer is the ARGB form, and said coupling is that the value of each component of pixel in the figure layer of source equates respectively with the value of each component of chroma key condition.
4. chroma key processing method according to claim 1 and 2; It is characterized in that: said chroma key condition is the pixel of ARGB form; The pixel of said source figure layer is the ARGB form, and said coupling is that the value of red component, green component and the blue component of pixel in the figure layer of source equates respectively with the value of red component, green component and the blue component of chroma key condition pixel.
5. according to claim 3 or 4 described chroma key processing methods, it is characterized in that: said source figure layer and the chroma key condition step be made up of pixel of providing comprises afterwards:
Judge whether and to back up source figure layer; If judge not; The step that execution compares each pixel and chroma key condition in the figure layer of source is judged and then source figure layer is backed up if yes, carries out the step that each pixel and chroma key condition in the figure layer of source are compared behind the Backup end.
6. according to claim 3,4 or 5 described chroma key processing methods, it is characterized in that: said step provides the target figure that is made up of pixel layer, and chroma key figure layer is carried out translucent the mixing with target figure layer, comprises a step behind the generation chroma key pattern:
Judging whether and need mix said chroma key figure layer again, if be judged as not, then accomplish the chroma key processing method, is then chroma key figure layer to be carried out translucent the mixing with new target figure layer if be judged as.
CN2011103709425A 2011-11-21 2011-11-21 Color key processing method Pending CN102395008A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011103709425A CN102395008A (en) 2011-11-21 2011-11-21 Color key processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011103709425A CN102395008A (en) 2011-11-21 2011-11-21 Color key processing method

Publications (1)

Publication Number Publication Date
CN102395008A true CN102395008A (en) 2012-03-28

Family

ID=45862207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011103709425A Pending CN102395008A (en) 2011-11-21 2011-11-21 Color key processing method

Country Status (1)

Country Link
CN (1) CN102395008A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103024294A (en) * 2012-09-20 2013-04-03 深圳市茁壮网络股份有限公司 Chroma key implementation method and device
CN111813482A (en) * 2020-07-09 2020-10-23 长沙景嘉微电子股份有限公司 2D desktop color key method and device in GPGPU and graphics processor

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1625230A (en) * 2003-12-01 2005-06-08 北京中视联数字系统有限公司 Method of merging displaying any graphic
CN1801888A (en) * 2005-01-05 2006-07-12 英华达(上海)电子有限公司 Method for realizing picture background transformation in digital camera
CN101668144A (en) * 2009-09-24 2010-03-10 深圳市同洲电子股份有限公司 Method for realizing semitransparent effect of image layer on video layer, device and set top box
KR20110124222A (en) * 2009-02-10 2011-11-16 톰슨 라이센싱 Video matting based on foreground-background constraint propagation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1625230A (en) * 2003-12-01 2005-06-08 北京中视联数字系统有限公司 Method of merging displaying any graphic
CN1801888A (en) * 2005-01-05 2006-07-12 英华达(上海)电子有限公司 Method for realizing picture background transformation in digital camera
KR20110124222A (en) * 2009-02-10 2011-11-16 톰슨 라이센싱 Video matting based on foreground-background constraint propagation
CN101668144A (en) * 2009-09-24 2010-03-10 深圳市同洲电子股份有限公司 Method for realizing semitransparent effect of image layer on video layer, device and set top box

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103024294A (en) * 2012-09-20 2013-04-03 深圳市茁壮网络股份有限公司 Chroma key implementation method and device
CN103024294B (en) * 2012-09-20 2016-04-27 深圳市茁壮网络股份有限公司 Chroma key implementation method and device
CN111813482A (en) * 2020-07-09 2020-10-23 长沙景嘉微电子股份有限公司 2D desktop color key method and device in GPGPU and graphics processor

Similar Documents

Publication Publication Date Title
US10679543B2 (en) Image processing method, image processing device and display panel
US9232199B2 (en) Method, apparatus and computer program product for capturing video content
CN110572637B (en) Image anomaly detection method, terminal device and storage medium
CN108012131A (en) Projector image edge blending system and method
CN102665031A (en) Video signal processing method and photographic equipment
US9813638B2 (en) Lightpainting live view
JP7500869B2 (en) White balance correction method, device and electronic device
CN108717691A (en) A kind of image interfusion method, device, electronic equipment and medium
CN106031156A (en) Control method and device for photographic light compensation and terminal
CN104143182A (en) Panoramic image splicing method and terminal device
CN104680518A (en) Blue screen image matting method based on chroma overflowing processing
Yu et al. Saturation improvement in hue-preserving color image enhancement without gamut problem
CN104077792A (en) Image processing method with cartoon effect
CN102395008A (en) Color key processing method
US10621769B2 (en) Simplified lighting compositing
WO2014035642A1 (en) Light painting live view
CN106254790A (en) Take pictures processing method and processing device
Majumder et al. Display gamut reshaping for color emulation and balancing
CN106791741B (en) Multi-screen marching method and device
GB2519364A (en) Method, apparatus and computer program product for facilitating color communication
Liu et al. The color calibration across multi-projector display
CN101409765B (en) Image-processing method and apparatus
CN103024294B (en) Chroma key implementation method and device
CN114500965A (en) Projection equipment control method and device, readable storage medium and projection equipment
KR102372215B1 (en) Method and apparatus for genertaing an image combining color information and infrared information

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: 1168967

Country of ref document: HK

C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20120328