CN102685397A - Method for overlaying pictures in video - Google Patents
Method for overlaying pictures in video Download PDFInfo
- Publication number
- CN102685397A CN102685397A CN2011100933096A CN201110093309A CN102685397A CN 102685397 A CN102685397 A CN 102685397A CN 2011100933096 A CN2011100933096 A CN 2011100933096A CN 201110093309 A CN201110093309 A CN 201110093309A CN 102685397 A CN102685397 A CN 102685397A
- Authority
- CN
- China
- Prior art keywords
- picture
- value
- pixel
- alpha
- video
- 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
Links
Images
Landscapes
- Studio Circuits (AREA)
Abstract
The invention discloses a method for overlaying pictures in a video, which comprises the steps: constructing a filter chart according to Directshow standards and adding a picture overlaying filter assembly into the filter chart; connecting input and output PIN ports of the picture overlaying filter assembly; setting a storage position of the pictures at one interface of the picture overlaying filter assembly and setting starting coordinates of a placing position of the pictures at another interface, and adding an ALPHA channel value into the pictures; reading data of pictures by the picture overlaying filter assembly and converting the data into a YUV structure; obtaining frame images of the decoded source video and overlaying the pictures; and sending the frame images overlaid with the pictures to a filter of next level. With the adoption of the technical scheme, the pictures in the video are enabled to be displayed more clearly and beautifully, convenience is provided for subsequent operation, and the time spent in overlaying the pictures is saved.
Description
Technical field
The present invention relates to the video technique field, relate in particular to a kind of method of the picture that in video, superposes.
Background technology
When making video, often need in video, squeeze into the LOGO sign.At present, employing is that video adds LOGO with the method that the LOGO picture value directly covers video image usually.Do not have transparent fade effect but the shortcoming of this method is the picture and the video image junction, source of adding, feel stiff not nature, and picture need be consistent with the source video image format.
Summary of the invention
The objective of the invention is to propose a kind of method of the picture that in video, superposes, can guarantee that picture shows clear attractive in appearancely in video, and, practice thrift the time of stack picture for subsequent operation facilitates.
For reaching this purpose, the present invention adopts following technical scheme:
A kind of method of the picture that in video, superposes may further comprise the steps:
A, according to Directshow standard structure filter chart, the picture filter assemblies that superposes is added in the filter chart;
B, the superpose input and output PIN mouth of filter assemblies of picture is connected respectively with the next stage filter with the upper level filter;
An interface of C, picture stack filter assemblies is provided with the memory location of picture, and another interface is provided with the origin coordinates of picture placement location, is added with the alpha channel value in the said picture;
D, picture stack filter assemblies read in the data of picture, with picture type of converting into YUV structure;
Two field picture behind E, the acquisition source video decode, and stack picture;
The two field picture of F, the picture that will superpose sends to the next stage filter.
Picture is the picture of BMP32 form.
The information of said type of all pixels of YUV structure recordable picture, the information of each pixel comprises Y value, U value and the V value of pixel position coordinates, pixel, and the alpha channel value of pixel.
The position coordinates of each pixel is confirmed according to the origin coordinates of picture.
In the step e, the stack picture further may further comprise the steps:
E1, judge whether Y value, U value or the sampling of V value to each pixel according to the yuv format of class YUV structure;
E2, calculate the deposit position of each pixel Y value, U value and V value;
E3, employing alpha channel mode write Y value, U value and the V value of each pixel of picture in the video frame images of source.
In the step e 2,, calculate the deposit position of each pixel Y value, U value and V value according to the position coordinates and type yuv format of YUV structure of each pixel.
In the step e 3; DES_Y=LOGO_Y * (1 – ALPHA/255)+SOURCE_Y * ALPHA/255; Wherein DES_Y is the Y value of the pixel of two field picture behind the stack picture; LOGO_Y is the Y value of the pixel of picture, and SOURCE_Y is the Y value of former video frame images, and ALPHA is the alpha channel value of the pixel of picture;
DES_U=LOGO_U * (1 – ALPHA/255)+SOURCE_U * ALPHA/255; Wherein DES_U is the U value of the pixel of two field picture behind the stack picture; LOGO_ U is the U value of the pixel of picture; SOURCE_ U is the U value of former video frame images, and ALPHA is the alpha channel value of the pixel of picture;
DES_V=LOGO_V * (1 – ALPHA/255)+SOURCE_V * ALPHA/255; Wherein DES_V is the V value of the pixel of two field picture behind the stack picture; LOGO_ V is the V value of the pixel of picture; SOURCE_ V is the V value of former video frame images, and ALPHA is the alpha channel value of the pixel of picture.
Adopted technical scheme of the present invention, with alpha channel technology stack picture, it is clear attractive in appearance to guarantee that picture shows in video; For subsequent operation facilitates; Practice thrift the time of stack picture, and module can be arranged in pairs or groups neatly with multiplexing based on the DirectShow technique construction.
Description of drawings
Fig. 1 be in the specific embodiment of the invention in video the stack picture flow chart.
Embodiment
Further specify technical scheme of the present invention below in conjunction with accompanying drawing and through embodiment.
Technological thought of the present invention mainly is based on the Directshow technology, uses transform filter assembly as the video superimpose module.The Directshow technology is a kind of application programming interface that can let the software developer that audio-video document is handled by Microsoft's exploitation.Possess the filter of specific function through interpolation in filter chart (FilterGraph), and make up in a certain order, realize various video processing function.Picture stack filter (LogoFilter) is independently Directshow Filter of function.Position in system is between video decode module and video encoding module.
Behind video decode, will obtain the source video frame images of yuv format in the picture stack filter (LogoFilter).At this moment, can pictorial information be superimposed in the two field picture, and the two field picture after will upgrading delivers in the video encoder (VideoCoder) and encode, realize the picture stack.
Fig. 1 be in the specific embodiment of the invention in video the stack picture flow chart.As shown in Figure 1, this flow process may further comprise the steps:
The information of such all pixels of YUV structure recordable picture, the information of each pixel comprise Y value, U value and the V value of pixel position coordinates, pixel, and the alpha channel value of pixel.Wherein the position coordinates of each pixel is confirmed according to the origin coordinates of picture.The source code example is following:
struct?YUVpixel{
int?position;
int?ValueY;
int?ValueU;
int?ValueV;
int?ValueAlpha;
};
struct?LOGOYUV{
int?long;
int?width;
struct?YUVpixel?myLOGO[long*width];
};
Two field picture behind step 105, the acquisition source video decode, and stack picture.Further may further comprise the steps:
At first, the yuv format according to class YUV structure judges whether Y value, U value or the sampling of V value to each pixel.
Secondly, according to the position coordinates and type yuv format of YUV structure of each pixel, calculate the deposit position of each pixel Y value, U value and V value.
At last, adopt the alpha channel mode in the video frame images of source, to write Y value, U value and the V value of each pixel of picture.
Wherein, DES_Y=LOGO_Y * (1 – ALPHA/255)+SOURCE_Y * ALPHA/255; Wherein DES_Y is the Y value of the pixel of two field picture behind the stack picture; LOGO_Y is the Y value of the pixel of picture, and SOURCE_Y is the Y value of former video frame images, and ALPHA is the alpha channel value of the pixel of picture.
DES_U=LOGO_U * (1 – ALPHA/255)+SOURCE_U * ALPHA/255; Wherein DES_U is the U value of the pixel of two field picture behind the stack picture; LOGO_ U is the U value of the pixel of picture; SOURCE_ U is the U value of former video frame images, and ALPHA is the alpha channel value of the pixel of picture.
DES_V=LOGO_V * (1 – ALPHA/255)+SOURCE_V * ALPHA/255; Wherein DES_V is the V value of the pixel of two field picture behind the stack picture; LOGO_ V is the V value of the pixel of picture; SOURCE_ V is the V value of former video frame images, and ALPHA is the alpha channel value of the pixel of picture.
The two field picture of step 106, the picture that will superpose sends to the next stage filter.
The above; Be merely the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, anyly is familiar with this technological people in the technical scope that the present invention disclosed; The variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of claim.
Claims (7)
1. the method for a stack picture in video is characterized in that, may further comprise the steps:
A, according to Directshow standard structure filter chart, the picture filter assemblies that superposes is added in the filter chart;
B, the superpose input and output PIN mouth of filter assemblies of picture is connected respectively with the next stage filter with the upper level filter;
An interface of C, picture stack filter assemblies is provided with the memory location of picture, and another interface is provided with the origin coordinates of picture placement location, is added with the alpha channel value in the said picture;
D, picture stack filter assemblies read in the data of picture, with picture type of converting into YUV structure;
Two field picture behind E, the acquisition source video decode, and stack picture;
The two field picture of F, the picture that will superpose sends to the next stage filter.
2. the method for a kind of picture that in video, superposes according to claim 1 is characterized in that picture is the picture of BMP32 form.
3. the method for a kind of picture that in video, superposes according to claim 1; It is characterized in that; The information of said type of all pixels of YUV structure recordable picture; The information of each pixel comprises Y value, U value and the V value of pixel position coordinates, pixel, and the alpha channel value of pixel.
4. the method for a kind of picture that in video, superposes according to claim 3 is characterized in that the position coordinates of each pixel is confirmed according to the origin coordinates of picture.
5. the method for a kind of picture that in video, superposes according to claim 3 is characterized in that, in the step e, the stack picture further may further comprise the steps:
E1, judge whether Y value, U value or the sampling of V value to each pixel according to the yuv format of class YUV structure;
E2, calculate the deposit position of each pixel Y value, U value and V value;
E3, employing alpha channel mode write Y value, U value and the V value of each pixel of picture in the video frame images of source.
6. the method for a kind of picture that in video, superposes according to claim 5 is characterized in that, in the step e 2, according to the position coordinates and type yuv format of YUV structure of each pixel, calculates the deposit position of each pixel Y value, U value and V value.
7. the method for a kind of picture that in video, superposes according to claim 5; It is characterized in that, in the step e 3, DES_Y=LOGO_Y * (1 – ALPHA/255)+SOURCE_Y * ALPHA/255; Wherein DES_Y is the Y value of the pixel of two field picture behind the stack picture; LOGO_Y is the Y value of the pixel of picture, and SOURCE_Y is the Y value of former video frame images, and ALPHA is the alpha channel value of the pixel of picture;
DES_U=LOGO_U * (1 – ALPHA/255)+SOURCE_U * ALPHA/255; Wherein DES_U is the U value of the pixel of two field picture behind the stack picture; LOGO_ U is the U value of the pixel of picture; SOURCE_ U is the U value of former video frame images, and ALPHA is the alpha channel value of the pixel of picture;
DES_V=LOGO_V * (1 – ALPHA/255)+SOURCE_V * ALPHA/255; Wherein DES_V is the V value of the pixel of two field picture behind the stack picture; LOGO_ V is the V value of the pixel of picture; SOURCE_ V is the V value of former video frame images, and ALPHA is the alpha channel value of the pixel of picture.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011100933096A CN102685397A (en) | 2011-04-14 | 2011-04-14 | Method for overlaying pictures in video |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011100933096A CN102685397A (en) | 2011-04-14 | 2011-04-14 | Method for overlaying pictures in video |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102685397A true CN102685397A (en) | 2012-09-19 |
Family
ID=46816705
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2011100933096A Pending CN102685397A (en) | 2011-04-14 | 2011-04-14 | Method for overlaying pictures in video |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102685397A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108830803A (en) * | 2018-05-17 | 2018-11-16 | 昆明理工大学 | A kind of traffic video image defogging optimization algorithm |
CN108924657A (en) * | 2018-06-13 | 2018-11-30 | 上海熙菱信息技术有限公司 | A method of it being superimposed flicker free figure in video frame |
CN113382264A (en) * | 2020-07-07 | 2021-09-10 | 谷歌有限责任公司 | Alpha channel post-processing in image transcoding |
CN115550624A (en) * | 2022-12-02 | 2022-12-30 | 成都索贝数码科技股份有限公司 | HDMI video data transmission method carrying alpha channel value |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6839734B1 (en) * | 1998-09-21 | 2005-01-04 | Microsoft Corporation | Multimedia communications software with network streaming and multi-format conferencing |
CN101227565A (en) * | 2007-01-17 | 2008-07-23 | 华硕电脑股份有限公司 | System and method for adding dynamic picture in real time image |
CN101472090A (en) * | 2007-12-27 | 2009-07-01 | 新奥特(北京)视频技术有限公司 | Method for monitoring beforehand hardware self-adapting multi-channel multi-mode video of video server |
CN101499172A (en) * | 2009-03-06 | 2009-08-05 | 深圳华为通信技术有限公司 | ActiveX drafting method and device |
-
2011
- 2011-04-14 CN CN2011100933096A patent/CN102685397A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6839734B1 (en) * | 1998-09-21 | 2005-01-04 | Microsoft Corporation | Multimedia communications software with network streaming and multi-format conferencing |
CN101227565A (en) * | 2007-01-17 | 2008-07-23 | 华硕电脑股份有限公司 | System and method for adding dynamic picture in real time image |
CN101472090A (en) * | 2007-12-27 | 2009-07-01 | 新奥特(北京)视频技术有限公司 | Method for monitoring beforehand hardware self-adapting multi-channel multi-mode video of video server |
CN101499172A (en) * | 2009-03-06 | 2009-08-05 | 深圳华为通信技术有限公司 | ActiveX drafting method and device |
Non-Patent Citations (1)
Title |
---|
DISKONLINE: "《CSDN论坛》", 10 April 2008 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108830803A (en) * | 2018-05-17 | 2018-11-16 | 昆明理工大学 | A kind of traffic video image defogging optimization algorithm |
CN108924657A (en) * | 2018-06-13 | 2018-11-30 | 上海熙菱信息技术有限公司 | A method of it being superimposed flicker free figure in video frame |
CN108924657B (en) * | 2018-06-13 | 2021-08-31 | 上海熙菱信息技术有限公司 | Method for superimposing flicker-free graphics on video frame |
CN113382264A (en) * | 2020-07-07 | 2021-09-10 | 谷歌有限责任公司 | Alpha channel post-processing in image transcoding |
CN115550624A (en) * | 2022-12-02 | 2022-12-30 | 成都索贝数码科技股份有限公司 | HDMI video data transmission method carrying alpha channel value |
CN115550624B (en) * | 2022-12-02 | 2023-07-18 | 成都索贝数码科技股份有限公司 | HDMI video data transmission method carrying alpha channel value |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8682107B2 (en) | Apparatus and method for creating 3D content for oriental painting | |
US8265167B2 (en) | Application specific video format | |
US9235914B2 (en) | Image editing apparatus | |
US8422801B2 (en) | Image encoding method for stereoscopic rendering | |
CN108235055B (en) | Method and device for realizing transparent video in AR scene | |
EP2632155A2 (en) | Moving image shooting apparatus and method of using a camera device | |
CN106851386B (en) | Method and device for realizing augmented reality in television terminal based on Android system | |
CN101690216B (en) | Transmission device, information transmission method, reception device, and information processing method | |
CN102045578B (en) | Image processing apparatus and image processing method | |
CN104023172A (en) | Shooting method and shooting device of dynamic image | |
CN105744180A (en) | Image generating device, electronic device and image generating method | |
KR101349699B1 (en) | Apparatus and method for extracting and synthesizing image | |
JP6079297B2 (en) | Editing apparatus, editing method, and editing program | |
CN102498720A (en) | Method for embedding subtitles and/or graphic overlays in a 3D or multi-view video data | |
JP6283348B2 (en) | Reference card for scene-based metadata capture | |
US20210287337A1 (en) | Methods and apparatus for multi-encoder processing of high resolution content | |
EP2896203A1 (en) | Methods and device for efficient resampling and resizing of digital images | |
CN102685397A (en) | Method for overlaying pictures in video | |
JP2010286811A (en) | Assembling display equipment, and methdo and system for control of screen thereof | |
CN105491396A (en) | Multimedia information processing method and server | |
CN105554416A (en) | FPGA (Field Programmable Gate Array)-based high-definition video fade-in and fade-out processing system and method | |
CN103209312A (en) | Video player, mobile terminal and method for mobile terminal to play videos | |
CN102572219B (en) | Mobile terminal and image processing method thereof | |
US20100253850A1 (en) | Video presentation system | |
JP7218786B2 (en) | Image processing device, image processing method and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20120919 |