CN104735466B - The method and device of pictorial trademark in a kind of replacing video - Google Patents
The method and device of pictorial trademark in a kind of replacing video Download PDFInfo
- Publication number
- CN104735466B CN104735466B CN201510149676.1A CN201510149676A CN104735466B CN 104735466 B CN104735466 B CN 104735466B CN 201510149676 A CN201510149676 A CN 201510149676A CN 104735466 B CN104735466 B CN 104735466B
- Authority
- CN
- China
- Prior art keywords
- pixel
- pictorial trademark
- target image
- frame target
- original
- 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
Links
Landscapes
- Image Analysis (AREA)
- Processing Or Creating Images (AREA)
- Image Processing (AREA)
Abstract
A kind of method and device for changing pictorial trademark in video provided in an embodiment of the present invention.This method includes:The first front pattern template based on predetermined original pictorial trademark, position the target image for including original pictorial trademark in target video file;Determine the coordinate of the first kind pixel in target image;Determine the coordinate of the second class pixel in the first front pattern template;Using the coordinate of the first kind pixel in respective objects image and the coordinate of the second class pixel, calculate respectively per the respective perspective transformation matrices of frame target image;Utilize the perspective transformation matrices corresponding to respective objects image and the second front pattern template corresponding to pictorial trademark to be implanted, perspective change process is carried out to the pixel of the original pictorial trademark region of every frame target image respectively, original pictorial trademark in target video file is replaced by pictorial trademark to be implanted so as to realize.It can be seen that pictorial trademark in the replaceable video of this programme.
Description
Technical field
The present invention relates to technical field of image processing, more particularly to a kind of method and dress for changing pictorial trademark in video
Put.
Background technology
Product placement is more and more used by film and TV play.And for the implantation of pictorial trademark, lead to
Often pictorial trademark to be implanted is located in shooting environmental, then allows the pictorial trademark to appear in camera lens, so as to wrap in video
The target image that the pictorial trademark to be implanted is shown in image-region is contained.
But with the development of product placement business, the ad content for deriving implantation is replaced after cooperation expires
Demand, or, same video must be implanted into the new demand of different advertisements when different channels play.
So, how on the premise of Consumer's Experience is not influenceed, it is one urgently to be resolved hurrily to change pictorial trademark in video
Problem.
The content of the invention
The purpose of the embodiment of the present invention is existed in providing a kind of method and device for changing pictorial trademark in video with realization
On the premise of not influenceing Consumer's Experience, pictorial trademark in video is changed.Concrete technical scheme is as follows:
In a first aspect, the embodiments of the invention provide a kind of method for changing pictorial trademark in video, including:
The first front pattern template based on predetermined original pictorial trademark, position in target video file and include institute
State an at least frame target image for original pictorial trademark;
It is determined that per the coordinate of the first kind pixel in frame target image, wherein, per the first kind picture in frame target image
Vegetarian refreshments can position the region where original pictorial trademark described in the frame target image;
The coordinate of the second class pixel in the pattern template of first front is determined, wherein, the second class pixel
The region where the original pictorial trademark can be positioned, per frame target image in first kind pixel with second class
The number of pixel is identical, and with one-to-one corresponding property;
Using the coordinate of the first kind pixel in respective objects image and the coordinate of the second class pixel, count respectively
Calculate the perspective transformation matrices each corresponding per frame target image;
Utilize the perspective transformation matrices corresponding to respective objects image and second corresponding to the pictorial trademark to be implanted
Front pattern template, perspective change is carried out to each pixel in the original pictorial trademark region of every frame target image respectively
Change is handled, and original pictorial trademark described in the target video file is replaced by into the pictorial trademark to be implanted so as to realize;
Wherein, second front pattern template is identical with the size of first front pattern template.
Optionally, the perspective transformation matrices using corresponding to respective objects image and the pictorial trademark institute to be implanted
Corresponding second front pattern template, the pixel of the original pictorial trademark region of every frame target image is carried out thoroughly respectively
Depending on change process, including:
Using the perspective transformation matrices corresponding to respective objects image, the original trademark image per frame target image is determined respectively
The pixel in the second front pattern template corresponding to each pixel in case region;
Based on the respective pixel point in second front pattern template determined, respectively to every frame target image
The pixel value of each pixel in original pictorial trademark region is adjusted processing.
Optionally, the respective pixel point based in second front pattern template determined, respectively to every
The pixel value of each pixel in the original pictorial trademark region of frame target image is adjusted processing, including:
The pixel value of each pixel in the original pictorial trademark region of every frame target image is changed to respectively:
The pixel value of respective pixel point in second front pattern template determined.
Optionally, the respective pixel point based in second front pattern template determined, respectively to every
The pixel value of each pixel in the original pictorial trademark region of frame target image is adjusted processing, including:
The pixel value of each pixel in the original pictorial trademark region of every frame target image is changed to respectively:
The pixel value interpolation of at least two neighbor pixels of the respective pixel point in second front pattern template determined.
Second aspect, the embodiment of the present invention additionally provide a kind of device for changing pictorial trademark in video, including:
Target image locating module, it is fixed for the first front pattern template based on predetermined original pictorial trademark
An at least frame target image for the original pictorial trademark is included in the target video file of position;
First kind pixel point coordinates determining module, for determining the coordinate of the first kind pixel in every frame target image,
Wherein, can be positioned described in the frame target image where original pictorial trademark per the first kind pixel in frame target image
Region;
Second class pixel point coordinates determining module, for determining the second class pixel in the pattern template of first front
Coordinate, wherein, the second class pixel can position the region where the original pictorial trademark, per frame target image in
First kind pixel it is identical with the number of the second class pixel, and with correspond property;
Transformation matrices computing module is had an X-rayed, for the coordinate using the first kind pixel in respective objects image and described
The coordinate of second class pixel, the perspective transformation matrices each corresponding per frame target image are calculated respectively;
Pictorial trademark changes module, for utilizing perspective transformation matrices corresponding to respective objects image and described to be implanted
The second front pattern template corresponding to pictorial trademark, respectively in the original pictorial trademark region of every frame target image
Each pixel carries out perspective change process, is replaced by original pictorial trademark described in the target video file so as to realize
The pictorial trademark to be implanted;Wherein, second front pattern template is identical with the size of first front pattern template.
Optionally, the pictorial trademark changes module, including:
Pixel determining unit, for using the perspective transformation matrices corresponding to respective objects image, determining respectively per frame
The pixel in the second front pattern template corresponding to each pixel in the original pictorial trademark region of target image
Point;
Pixel value adjustment unit, for based on the respective pixel point in second front pattern template determined,
Processing is adjusted to the pixel value of each pixel in the original pictorial trademark region of every frame target image respectively.
Optionally, the pixel value adjustment unit, is specifically used for:
The pixel value of each pixel in the original pictorial trademark region of every frame target image is changed to respectively:
The pixel value of respective pixel point in second front pattern template determined.
Optionally, the pixel value adjustment unit, is specifically used for:
The pixel value of each pixel in the original pictorial trademark region of every frame target image is changed to respectively:
The pixel value interpolation of at least two neighbor pixels of the respective pixel point in second front pattern template determined.
In the embodiment of the present invention, the first front pattern template based on predetermined original pictorial trademark, target is positioned
An at least frame target image for original pictorial trademark is included in video file;It is it is determined that original per can position in frame target image
The coordinate of the first kind pixel of pictorial trademark region;Determine that in the first front pattern template original trade mark can be positioned
The coordinate of second class pixel of pattern region;Utilize the coordinate and second of the first kind pixel in respective objects image
The coordinate of class pixel, the perspective transformation matrices each corresponding per frame target image are calculated respectively;Utilize respective objects image
The second front pattern template corresponding to corresponding perspective transformation matrices and pictorial trademark to be implanted, respectively to every frame target figure
The pixel of the original pictorial trademark region of picture carries out perspective change process, will be original in target video file so as to realize
Pictorial trademark is replaced by pictorial trademark to be implanted.It can be seen that pass through this programme, it is possible to achieve do not influenceing the premise of Consumer's Experience
Under, the purpose of pictorial trademark in replacing video.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with
Other accompanying drawings are obtained according to these accompanying drawings.
The flow chart of the method for pictorial trademark in a kind of replacing video that Fig. 1 is provided by the embodiment of the present invention;
Fig. 2 is the position view on first kind pixel;
Fig. 3 is that the pixel in pixel and the second front pattern template in target image has an X-rayed transforming relationship signal
Figure;
The structural representation of the device of pictorial trademark in a kind of replacing video that Fig. 4 is provided by the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made
Embodiment, belong to the scope of protection of the invention.
In order to realize on the premise of Consumer's Experience is not influenceed, the purpose of pictorial trademark in video is changed, the present invention is implemented
Example provides a kind of method and device for changing pictorial trademark in video.
The method of pictorial trademark is introduced in a kind of replacing video provided first below the embodiment of the present invention.
It should be noted that in a kind of replacing video that the embodiment of the present invention is provided the method for pictorial trademark execution master
Body can be a kind of device for changing pictorial trademark in video, and the device of pictorial trademark is located at electronic equipment in the replacing video
It is interior.
As shown in figure 1, a kind of method for changing pictorial trademark in video, can include:
S101, the first front pattern template based on predetermined original pictorial trademark, position in target video file
An at least frame target image comprising the original pictorial trademark;
When needing to change pictorial trademark in video, original trademark image to be replaced can be determined by manual type first
First front pattern template of case;And then the first front pattern template based on predetermined original pictorial trademark, by existing
Some image trace technologies, at least frame target image for including the original pictorial trademark in target video file is positioned, wherein,
The original pictorial trademark is included in an at least frame target image, but the angles of display of the original pictorial trademark may be with front elevation
The angles of display of original pictorial trademark has differences in case template.
It is understood that the first front pattern template of the predetermined original pictorial trademark, can include:From
First front pattern template of the original pictorial trademark determined in target video file.Certainly, the first front pattern template
Determined in other videos or image that can also be beyond target video file, this is also rational.
S102, it is determined that the coordinate per the first kind pixel in frame target image;
After an at least frame target image for the original pictorial trademark is included in positioning target video file, for follow-up business
The perspective transformation matrices marked on a map needed for the replacing of case, it may be determined that per the coordinate of the first kind pixel in frame target image, its
In, the coordinate of the first kind pixel in every frame target image can be determined using prior art.
Wherein, the original pictorial trademark in the frame target image can be positioned per the first kind pixel in frame target image
The region at place, also, in order to adapt to the replacing of the pictorial trademark of all kinds of shapes, original pictorial trademark location in target image
Domain can be the quadrilateral area for showing the original pictorial trademark.
It should be noted that it according to intended pixel point selection mode can determine that this can be positioned by manual type
The first kind pixel of the original pictorial trademark region of this in frame target image, and then after first kind pixel is determined,
The coordinate of the first kind pixel in every frame target image can be automatically determined out.Wherein, it is directed to the pre- of first kind pixel
Fixation vegetarian refreshments selection mode can be such as:It is related to original pictorial trademark in the different boundary of original pictorial trademark region
Pixel, or, the pixel for being related to original pictorial trademark on the different corners of original pictorial trademark region, etc.
Deng.Also, number typically at least four of the first kind pixel in target image.
For example:As shown in Fig. 2 when selecting first kind pixel, the four of pictorial trademark region can be selected
The borderline pixel for being related to the pictorial trademark of bar.
S103, determine the coordinate of the second class pixel in the first front pattern template;
For the perspective transformation matrices needed for the replacing of follow-up pictorial trademark, it may be determined that in the first front pattern template
The second class pixel coordinate, wherein it is possible to determine the second class picture in the first front pattern template by prior art
The coordinate of vegetarian refreshments.
Wherein, the second class pixel can position the area in the first front pattern template where the original pictorial trademark
Domain, it is identical with the number of the second class pixel per the first kind pixel in frame target image, and with one-to-one corresponding property.And
And the first region where the original pictorial trademark in the pattern template of front can be quadrilateral area.
It should be noted that can be according to the intended pixel point selection mode for being directed to first kind pixel, by artificial
Mode determines to position the second class pixel in the region where the original pictorial trademark, saturating to be subsequently used for pixel
Depending on the validity of the perspective transformation matrices of change process, wherein, for any one frame target image, its internal first kind
Pixel is the pixel on the same position point on original pictorial trademark with the second corresponding class pixel.
S104, using the coordinate of the first kind pixel in respective objects image and the coordinate of the second class pixel, divide
Ji Suan per frame target image each corresponding to perspective transformation matrices;
Wherein, second in the coordinate and the first front pattern template of the first kind pixel in determining target image
After the coordinate of class pixel, the coordinate of the first kind pixel in respective objects image and the seat of the second class pixel are utilized
Mark, calculates the perspective transformation matrices each corresponding per frame target image respectively, and the perspective transformation matrices characterize respective objects figure
The perspective variation relation of the corresponding second class pixel of the first kind pixel of picture and the first front pattern template.
For clarity, target image institute subsequently will be introduced exemplified by it 4 first kind pixels be present in every frame target image
The calculation of corresponding perspective transformation matrices.It is understood that of the first kind pixel in per frame target image
Number be 4 when, target image can also be calculated with reference to the given calculation corresponding to perspective transformation matrices.
S105, utilize the perspective transformation matrices corresponding to respective objects image and second corresponding to pictorial trademark to be implanted
Front pattern template, perspective change is carried out to each pixel in the original pictorial trademark region of every frame target image respectively
Change is handled.
After the perspective transformation matrices corresponding to determining target image each, it can utilize saturating corresponding to target image
Showed depending on transformation matrices in the target image in original pictorial trademark region (i.e. first kind pixel institute localization region)
Each pixel coordinate and the first front pattern template in (the second class pixel is determined for pictorial trademark region to be implanted
Position region) in respective pixel point coordinate perspective variation relation.Meanwhile first front pattern template and the second front pattern
Template belongs to the direct picture of pictorial trademark, also, the chi of the second front pattern template and the first front pattern template
It is very little identical, i.e., shown by the size of the pictorial trademark to be implanted shown by the second front pattern template and the first front pattern template
Original pictorial trademark size it is identical, therefore, the frame can be characterized using the perspective transformation matrices corresponding to target image
Business to be implanted in the coordinate of each pixel and the second front pattern template in original pictorial trademark region in target image
The perspective variation relation of the coordinate of respective pixel point in case of marking on a map region.
According to the above, the perspective transformation matrices and the trademark image to be implanted corresponding to respective objects image can be utilized
The second front pattern template corresponding to case, respectively to each picture in the original pictorial trademark region of every frame target image
Vegetarian refreshments carries out perspective change process, and the original pictorial trademark in the target video file is replaced by into the business to be implanted so as to realize
Mark on a map case.
Specifically, corresponding to the perspective transformation matrices using corresponding to respective objects image and pictorial trademark to be implanted
The second front pattern template, respectively in the original pictorial trademark region of every frame target image each pixel carry out
Change process is had an X-rayed, can be included:
Using the perspective transformation matrices corresponding to respective objects image, the original trademark image per frame target image is determined respectively
The pixel in the second front pattern template corresponding to each pixel in case region;
Based on the respective pixel point in the second front pattern template determined, respectively to the original of every frame target image
The pixel value of each pixel in pictorial trademark region is adjusted processing.
In a kind of specific implementation, the respective pixel based in the second front pattern template determined
Point, place is adjusted to the pixel value of each pixel in the original pictorial trademark region of every frame target image respectively
Reason, can include:
The pixel value of each pixel in the original pictorial trademark region of every frame target image is changed to respectively:
The pixel value of respective pixel point in second front pattern template determined.
In another implementation, in order to further improve image smoothing, it is described based on determined this second
Respective pixel point in the pattern template of front, respectively to each picture in the original pictorial trademark region of every frame target image
The pixel value of vegetarian refreshments is adjusted processing, can include:
The pixel value of each pixel in the original pictorial trademark region of every frame target image is changed to respectively:
The pixel value interpolation of at least two neighbor pixels of the respective pixel point in the second front pattern template determined.
Wherein, at least two neighbor pixel can be two pixels, such as upside pixel and downside pixel, or
Person, left pixel point and right pixel point;Can also be four pixels, such as four pixels, etc. up and down.Also,
The pixel value interpolation of at least two neighbor pixel is the picture at least two neighbor pixel using existing interpolation algorithm
Value obtained by after element value computing, the existing interpolation algorithm can be such as:Bilinear interpolation.
In addition, for using pixel value carry out pixel value change when, can also be respectively by the original of every frame target image
The pixel value of each pixel in beginning pictorial trademark region is changed to:In the second front pattern template determined
Respective pixel point and at least one neighbor pixel pixel value interpolation.
In the embodiment of the present invention, the first front pattern template based on predetermined original pictorial trademark, target is positioned
An at least frame target image for original pictorial trademark is included in video file;It is it is determined that original per can position in frame target image
The coordinate of the first kind pixel of pictorial trademark region;Determine that in the first front pattern template original trade mark can be positioned
The coordinate of second class pixel of pattern region;Utilize the coordinate and second of the first kind pixel in respective objects image
The coordinate of class pixel, the perspective transformation matrices each corresponding per frame target image are calculated respectively;Utilize respective objects image
The second front pattern template corresponding to corresponding perspective transformation matrices and pictorial trademark to be implanted, respectively to every frame target figure
The pixel of the original pictorial trademark region of picture carries out perspective change process, will be original in target video file so as to realize
Pictorial trademark is replaced by pictorial trademark to be implanted.It can be seen that pass through this programme, it is possible to achieve do not influenceing the premise of Consumer's Experience
Under, the purpose of pictorial trademark in replacing video.
Below exemplified by it 4 first kind pixels be present in every frame target image, the calculating side of perspective transformation matrices is introduced
Formula, and perspective change process process.
Assuming that the coordinate of a frame target image and 4 groups of pixels in the first front pattern template is:First kind pixel
(ui',vi', 1) and the second class pixel (ui,vi, 1), i=1,2,3,4, this 4 groups of pixels meet equation below group:
Wherein,For the matrix corresponding to the coordinate of first kind pixel, MsTo have an X-rayed transformation matrices.By above-mentioned equation group
Can solution obtain the perspective transformation matrices M corresponding to the target imagesFor:
It is understood that the calculation of the perspective transformation matrices corresponding to any one frame target image is referred to
Above-mentioned given calculation.
After the perspective transformation matrices corresponding to a target image are determined, as shown in figure 3, to the original in the target image
The perspective change process process of a pixel A in beginning pictorial trademark region (first kind pixel institute localization region) is such as
Under:
Based on above-mentioned formula (1), due to pixel A coordinate (ui',vi', 1) and pixel A places target image
Corresponding perspective transformation matrices MsIt has been shown that therefore, it can obtain the seat of the respective pixel point a in the second front pattern template
Mark (ui,vi, 1), and according to (ui,vi, 1) and the pixel value interpolation (such as bilinear interpolation) of adjacent 4 pixels obtains the pixel
Pixel value to be changed corresponding to point A, so as to which pixel A pixel value to be changed to the resulting pixel to be changed
Value.Certainly, the coordinate (u of the respective pixel point a in the second front pattern template is determinedi,vi, 1) after, can also directly by
Pixel a pixel value is defined as pixel value to be changed corresponding to pixel A, so as to by pixel A pixel value
It is changed to the resulting pixel value to be changed.
It is understood that each pixel to the first kind pixel institute localization region in any one frame target image
Perspective change process can be realized using above-mentioned perspective change process process, also, in each frame target image
After each pixel perspective change process of first kind pixel institute localization region, being finally completed will be somebody's turn to do in the target video file
Original pictorial trademark is replaced by the pictorial trademark to be implanted.
Corresponding to above method embodiment, the embodiments of the invention provide a kind of device for changing pictorial trademark in video,
As shown in figure 4, the device can include:
Target image locating module 410, for the first front pattern template based on predetermined original pictorial trademark,
An at least frame target image for the original pictorial trademark is included in positioning target video file;
First kind pixel point coordinates determining module 420, for determining the seat of the first kind pixel in every frame target image
Mark, wherein, it can position original pictorial trademark institute described in the frame target image per the first kind pixel in frame target image
Region;
Second class pixel point coordinates determining module 430, for determining the second class picture in the pattern template of first front
The coordinate of vegetarian refreshments, wherein, the second class pixel can position the region where the original pictorial trademark, per frame target figure
First kind pixel as in is identical with the number of the second class pixel, and with one-to-one corresponding property;
Have an X-rayed transformation matrices computing module 440, for the coordinate using the first kind pixel in respective objects image and
The coordinate of the second class pixel, the perspective transformation matrices each corresponding per frame target image are calculated respectively;
Pictorial trademark changes module 450, for using the perspective transformation matrices corresponding to respective objects image and described treating
The second front pattern template corresponding to pictorial trademark is implanted into, respectively to the original pictorial trademark region of every frame target image
Interior each pixel carries out perspective change process, so as to realize original pictorial trademark described in the target video file more
It is changed to the pictorial trademark to be implanted;Wherein, the size of second front pattern template and first front pattern template
It is identical.
In the embodiment of the present invention, the first front pattern template based on predetermined original pictorial trademark, target is positioned
An at least frame target image for original pictorial trademark is included in video file;It is it is determined that original per can position in frame target image
The coordinate of the first kind pixel of pictorial trademark region;Determine that in the first front pattern template original trade mark can be positioned
The coordinate of second class pixel of pattern region;Utilize the coordinate and second of the first kind pixel in respective objects image
The coordinate of class pixel, the perspective transformation matrices each corresponding per frame target image are calculated respectively;Utilize respective objects image
The second front pattern template corresponding to corresponding perspective transformation matrices and pictorial trademark to be implanted, respectively to every frame target figure
The pixel of the original pictorial trademark region of picture carries out perspective change process, will be original in target video file so as to realize
Pictorial trademark is replaced by pictorial trademark to be implanted.It can be seen that pass through this programme, it is possible to achieve do not influenceing the premise of Consumer's Experience
Under, the purpose of pictorial trademark in replacing video.
Specifically, the pictorial trademark changes module 450, can include:
Pixel determining unit, for using the perspective transformation matrices corresponding to respective objects image, determining respectively per frame
The pixel in the second front pattern template corresponding to each pixel in the original pictorial trademark region of target image
Point;
Pixel value adjustment unit, for based on the respective pixel point in second front pattern template determined,
Processing is adjusted to the pixel value of each pixel in the original pictorial trademark region of every frame target image respectively.
In a kind of specific implementation, the pixel value adjustment unit, it is specifically used for:
The pixel value of each pixel in the original pictorial trademark region of every frame target image is changed to respectively:
The pixel value of respective pixel point in second front pattern template determined.
In another specific implementation, the pixel value adjustment unit, it is specifically used for:
The pixel value of each pixel in the original pictorial trademark region of every frame target image is changed to respectively:
The pixel value interpolation of at least two neighbor pixels of the respective pixel point in second front pattern template determined.
It should be noted that herein, such as first and second or the like relational terms are used merely to a reality
Body or operation make a distinction with another entity or operation, and not necessarily require or imply and deposited between these entities or operation
In any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant are intended to
Nonexcludability includes, so that process, method, article or equipment including a series of elements not only will including those
Element, but also the other element including being not expressly set out, or it is this process, method, article or equipment also to include
Intrinsic key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that
Other identical element also be present in process, method, article or equipment including the key element.
Each embodiment in this specification is described by the way of related, identical similar portion between each embodiment
Divide mutually referring to what each embodiment stressed is the difference with other embodiment.It is real especially for system
For applying example, because it is substantially similar to embodiment of the method, so description is fairly simple, related part is referring to embodiment of the method
Part explanation.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equally replacing, the improvement etc. made within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
Claims (6)
- A kind of 1. method for changing pictorial trademark in video, it is characterised in that including:The first front pattern template based on predetermined original pictorial trademark, position in target video file and include the original An at least frame target image for beginning pictorial trademark;It is determined that per the coordinate of the first kind pixel in frame target image, wherein, per the first kind pixel in frame target image The region where original pictorial trademark described in the frame target image can be positioned;The coordinate of the second class pixel in the pattern template of first front is determined, wherein, the second class pixel can Position the region where the original pictorial trademark, per frame target image in first kind pixel with the second class pixel The number of point is identical, and with one-to-one corresponding property;Using the coordinate of the first kind pixel in respective objects image and the coordinate of the second class pixel, calculate respectively every The respective corresponding perspective transformation matrices of frame target image;Utilize the perspective transformation matrices corresponding to respective objects image and the second front pattern corresponding to pictorial trademark to be implanted Template, perspective change process is carried out to each pixel in the original pictorial trademark region of every frame target image respectively, Original pictorial trademark described in the target video file is replaced by the pictorial trademark to be implanted so as to realize;Wherein, institute It is identical with the size of first front pattern template to state the second front pattern template;Wherein, it is described using corresponding to respective objects image perspective transformation matrices and pictorial trademark to be implanted corresponding to second Front pattern template, respectively the pixel of the original pictorial trademark region of every frame target image have an X-rayed at change Reason, including:Using the perspective transformation matrices corresponding to respective objects image, the original pictorial trademark institute per frame target image is determined respectively The pixel in the second front pattern template corresponding to each pixel in region;Based on the respective pixel point in second front pattern template determined, respectively to the original of every frame target image The pixel value of each pixel in pictorial trademark region is adjusted processing.
- 2. according to the method for claim 1, it is characterised in that described based on the second front pattern mould determined Respective pixel point in plate, respectively to the pixel of each pixel in the original pictorial trademark region of every frame target image Value is adjusted processing, including:The pixel value of each pixel in the original pictorial trademark region of every frame target image is changed to respectively:Institute is really The pixel value of respective pixel point in second front pattern template made.
- 3. according to the method for claim 1, it is characterised in that described based on the second front pattern mould determined Respective pixel point in plate, respectively to the pixel of each pixel in the original pictorial trademark region of every frame target image Value is adjusted processing, including:The pixel value of each pixel in the original pictorial trademark region of every frame target image is changed to respectively:Institute is really The pixel value interpolation of at least two neighbor pixels of the respective pixel point in second front pattern template made.
- A kind of 4. device for changing pictorial trademark in video, it is characterised in that including:Target image locating module, for the first front pattern template based on predetermined original pictorial trademark, position mesh An at least frame target image for the original pictorial trademark is included in mark video file;First kind pixel point coordinates determining module, for determining the coordinate of the first kind pixel in every frame target image, wherein, The region described in the frame target image where original pictorial trademark can be positioned per the first kind pixel in frame target image;Second class pixel point coordinates determining module, for determining the seat of the second class pixel in the pattern template of first front Mark, wherein, the second class pixel can position the region where the original pictorial trademark, per frame target image in the A kind of pixel is identical with the number of the second class pixel, and with one-to-one corresponding property;Transformation matrices computing module is had an X-rayed, for the coordinate and described second using the first kind pixel in respective objects image The coordinate of class pixel, the perspective transformation matrices each corresponding per frame target image are calculated respectively;Pictorial trademark changes module, for utilizing the perspective transformation matrices corresponding to respective objects image and pictorial trademark to be implanted The second corresponding front pattern template, respectively to each pixel in the original pictorial trademark region of every frame target image Point carries out perspective change process, described waits to plant so as to realize original pictorial trademark described in the target video file being replaced by Enter pictorial trademark;Wherein, second front pattern template is identical with the size of first front pattern template;Wherein, the pictorial trademark changes module, including:Pixel determining unit, for using the perspective transformation matrices corresponding to respective objects image, determining respectively per frame target The pixel in the second front pattern template corresponding to each pixel in the original pictorial trademark region of image;Pixel value adjustment unit, for based on the respective pixel point in second front pattern template determined, difference Processing is adjusted to the pixel value of each pixel in the original pictorial trademark region of every frame target image.
- 5. device according to claim 4, it is characterised in that the pixel value adjustment unit, be specifically used for:The pixel value of each pixel in the original pictorial trademark region of every frame target image is changed to respectively:Institute is really The pixel value of respective pixel point in second front pattern template made.
- 6. device according to claim 4, it is characterised in that the pixel value adjustment unit, be specifically used for:The pixel value of each pixel in the original pictorial trademark region of every frame target image is changed to respectively:Institute is really The pixel value interpolation of at least two neighbor pixels of the respective pixel point in second front pattern template made.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510149676.1A CN104735466B (en) | 2015-03-31 | 2015-03-31 | The method and device of pictorial trademark in a kind of replacing video |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510149676.1A CN104735466B (en) | 2015-03-31 | 2015-03-31 | The method and device of pictorial trademark in a kind of replacing video |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104735466A CN104735466A (en) | 2015-06-24 |
CN104735466B true CN104735466B (en) | 2018-04-10 |
Family
ID=53458830
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510149676.1A Active CN104735466B (en) | 2015-03-31 | 2015-03-31 | The method and device of pictorial trademark in a kind of replacing video |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104735466B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109377502A (en) * | 2018-10-15 | 2019-02-22 | 深圳市中科明望通信软件有限公司 | A kind of image processing method, image processing apparatus and terminal device |
CN110992251B (en) * | 2019-11-29 | 2023-11-10 | 北京金山云网络技术有限公司 | Logo replacing method and device in video and electronic equipment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1199530A (en) * | 1995-09-08 | 1998-11-18 | 奥瑞德高技术***有限公司 | Method and apparatus for automatic electronic replacement of billboards in video image |
CN101072289A (en) * | 2007-06-11 | 2007-11-14 | 北京中星微电子有限公司 | Automatic generating method and device for image special effect |
WO2014135910A1 (en) * | 2013-03-08 | 2014-09-12 | JACQUEMET, Jean-Philippe | Method of replacing objects in a video stream and computer program |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
ATE192622T1 (en) * | 1993-02-14 | 2000-05-15 | Orad Inc | DEVICE AND METHOD FOR DETECTING, IDENTIFYING AND INSERTING INTO A VIDEO |
US8566865B2 (en) * | 2006-03-07 | 2013-10-22 | Sony Computer Entertainment America Llc | Dynamic insertion of cinematic stage props in program content |
CN101398829B (en) * | 2007-09-30 | 2013-10-23 | 国际商业机器公司 | Method and apparatus for marking and modifying video, and video processing method and apparatus |
CN103024480B (en) * | 2012-12-28 | 2016-06-01 | 杭州泰一指尚科技有限公司 | A kind of method embedding advertisement in video |
JP6267789B2 (en) * | 2013-06-27 | 2018-01-24 | インテル・コーポレーション | Adaptive embedding of visual advertising content in media content |
CN104066003B (en) * | 2014-06-16 | 2017-05-10 | 百度在线网络技术(北京)有限公司 | Method and device for playing advertisement in video |
-
2015
- 2015-03-31 CN CN201510149676.1A patent/CN104735466B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1199530A (en) * | 1995-09-08 | 1998-11-18 | 奥瑞德高技术***有限公司 | Method and apparatus for automatic electronic replacement of billboards in video image |
CN101072289A (en) * | 2007-06-11 | 2007-11-14 | 北京中星微电子有限公司 | Automatic generating method and device for image special effect |
WO2014135910A1 (en) * | 2013-03-08 | 2014-09-12 | JACQUEMET, Jean-Philippe | Method of replacing objects in a video stream and computer program |
Also Published As
Publication number | Publication date |
---|---|
CN104735466A (en) | 2015-06-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104735465A (en) | Method and device for implanting planar pattern advertisements into video frame | |
CN103395301B (en) | A kind of laser marking machine three-dimensional correction method and device | |
CN104331872B (en) | Image split-joint method | |
CN103888741B (en) | The geometry correction householder method of project image, Apparatus and system | |
CN103974126B (en) | A kind of method and device of product placement in video | |
CN110008779B (en) | Three-dimensional two-dimensional code processing method and device | |
CN104657982A (en) | Calibration method for projector | |
CN103686107A (en) | Processing method and device based on projected image | |
CN103843329B (en) | Methods and apparatus for conditional display of a stereoscopic image pair | |
CN107122774A (en) | A kind of adaptive chart pasting method moved with key point in image and system | |
US10771776B2 (en) | Apparatus and method for generating a camera model for an imaging system | |
CN105678740B (en) | A kind of camera geometric calibration processing method and processing device | |
CN104735467B (en) | Video picture-in-pictures advertisement generation method and device | |
CN102254299A (en) | System and method of image processing | |
CN102609941A (en) | Three-dimensional registering method based on ToF (Time-of-Flight) depth camera | |
CN103414910B (en) | Low-distortion three-dimensional picture outer polar line correcting method | |
CN105307397A (en) | Circuit board exposure method and device | |
CN103253193A (en) | Method and system of calibration of panoramic parking based on touch screen operation | |
CN104735466B (en) | The method and device of pictorial trademark in a kind of replacing video | |
CN112288826A (en) | Calibration method and device of binocular camera and terminal | |
TW201243764A (en) | Orthoimage color correction method using multiple aerial images | |
CN105427244A (en) | Remote sensing image splicing method and device | |
CN104924753A (en) | Method for digital board installing and board installing machine of method | |
CN107749986A (en) | Instructional video generation method, device, storage medium and computer equipment | |
CN110989949A (en) | Method and device for special-shaped splicing display |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |