CN109710365A - A kind of barrage display methods, device, electronic equipment and medium - Google Patents
A kind of barrage display methods, device, electronic equipment and medium Download PDFInfo
- Publication number
- CN109710365A CN109710365A CN201811626377.2A CN201811626377A CN109710365A CN 109710365 A CN109710365 A CN 109710365A CN 201811626377 A CN201811626377 A CN 201811626377A CN 109710365 A CN109710365 A CN 109710365A
- Authority
- CN
- China
- Prior art keywords
- view
- barrier bed
- barrage
- location parameter
- target object
- 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
Landscapes
- Processing Or Creating Images (AREA)
Abstract
The invention discloses a kind of barrage display methods, device, electronic equipment and media, comprising: obtains the location parameter and dimensional parameters of the target object shown in current video;According to the location parameter and the dimensional parameters, the barrier bed view of the transparent covering target object is drawn, the barrier bed view and barrage view are preset as exclusive or and show relationship;When the barrage view is Chong Die with the barrier bed view, relationship is shown based on the exclusive or, cuts the lap of the barrage view Yu the barrier bed view.It solves barrage in the prior art to slide at random, it is existing to block key object, influence the technical issues of spectators obtain video main contents.Improve the sufficient degree that spectators obtain video content.
Description
Technical field
The present invention relates to Internet technical field more particularly to a kind of barrage display methods, device, electronic equipment and Jie
Matter.
Background technique
Currently, with the progress of network communication technology and the speed-raising of broadband network, network video has been obtained more and more
Development and application, video provide the service providers such as platform and live streaming platform and provide video tastes abundant for user.
In order to reinforce sense of participation and interactivity of the user when watching video, many service providers both provide barrage function.
Barrage in traditional scheme slides at random in whole screen, and will appear barrage when the quantity of barrage is very more will
The problem of key objects such as face are blocked can seriously affect the effect that user watches video program.
As it can be seen that barrage in the prior art slides at random, exist and block key object, it is mainly interior to influence spectators' acquisition video
The technical issues of appearance.
Summary of the invention
The embodiment of the present application solves existing skill by providing a kind of barrage display methods, device, electronic equipment and medium
Barrage in art slides at random, existing to block key object, influences the technical issues of spectators obtain video main contents.
In a first aspect, providing a kind of barrage display methods, comprising:
Obtain the location parameter and dimensional parameters of the target object shown in current video;
According to the location parameter and the dimensional parameters, the barrier bed view of the transparent covering target object is drawn
Figure, the barrier bed view and barrage view are preset as exclusive or and show relationship;
When the barrage view is Chong Die with the barrier bed view, relationship is shown based on the exclusive or, cuts the bullet
The lap of curtain view and the barrier bed view.
Optionally, the target object is face.
Optionally, described according to the location parameter and the dimensional parameters, draw the transparent covering target object
Barrier bed view, comprising: the constructed fuction of the Paint class in calling system instantiates the mPaint object of Paint type;
Canvas object in calling system is joined using the mPaint object of building according to the location parameter and the size
Number draws out maskView object on the Canvas, and the maskView object is the transparent covering target object
Barrier bed view.
Optionally, the location parameter and dimensional parameters are four vertex that can block the minimum rectangle of the target object
Coordinate;Canvas object in the calling system, using the mPaint object of building, according to the location parameter and institute
It states dimensional parameters and draws out maskView object on the Canvas, comprising: call in canvas object
Canvas.drawRect (left, top, right, bottom, mPaint) mode draws maskView object, wherein left,
Top, right, bottom are respectively four apex coordinates.
Optionally, which comprises call paint.setXfermode (new PorterDuffXfermode
(Mode.SRC_XOR)) method come construct exclusive or show relationship Paint object;It calls in canvas object
Canvas.drawBitmap (danmuVIew, 0f, 0f, paint) method presets the barrier bed view with barrage view
Relationship is shown for exclusive or, wherein danmuView mark is the barrage view, and canvas mark is the barrier bed view
Figure shows relationship based on the exclusive or specified by paint object when the barrage view is Chong Die with the barrier bed view,
Cut the lap of the barrage view Yu the barrier bed view.
Optionally, which comprises obtain the profile parameters of the target object shown in the current video;Institute
It states according to the location parameter and the dimensional parameters, draws the barrier bed view of the transparent covering target object, comprising:
According to the location parameter and the dimensional parameters, the barrier bed view of the transparent covering target object is drawn;Using institute
It states profile parameters and corrects the barrier bed view, the barrier bed view is made to be modified to the shape of the profile parameters characterization.
Optionally, described to correct the barrier bed view using the profile parameters, comprising: raw according to the profile parameters
At profile view;It is superimposed the profile view and the barrier bed view, with the profile view and the barrier bed view weight
Folded region is as the revised barrier bed view.
Second aspect provides a kind of barrage display device, comprising:
Module is obtained, for obtaining the location parameter and dimensional parameters of the target object shown in current video;
Drafting module, for drawing the transparent covering target pair according to the location parameter and the dimensional parameters
The barrier bed view of elephant, the barrier bed view and barrage view are preset as exclusive or and show relationship;
Module is cut, for being closed based on exclusive or display when the barrage view is Chong Die with the barrier bed view
System, cuts the lap of the barrage view Yu the barrier bed view.
The third aspect, provides a kind of electronic equipment, including memory, processor and storage on a memory and can handled
The computer program run on device, which is characterized in that the processor realizes that first aspect is any described when executing described program
Method.
Fourth aspect provides a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that
First aspect any method is realized when the program is executed by processor.
One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
Barrage display methods, device, electronic equipment and medium provided by the embodiments of the present application, by the way that transparent block is arranged
Layer view, and barrier bed view and barrage view are set and show relationship for exclusive or, when barrage view and barrier bed view weight
When folded, relationship is shown based on the exclusive or, the lap of barrage view and barrier bed view is cut, sufficiently shows target pair
As.In barrage view and not be overlapped barrier bed view, the transparence setting of barrier bed view also can sufficiently show target pair
As.To realize that target object is not blocked by barrage, the complete image for obtaining target object in video at any time is allowed a user to, is mentioned
The sufficient degree of high Video Key acquisition of information.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, for this
For the those of ordinary skill of field, without creative efforts, it can also be obtained according to these attached drawings others
Attached drawing.
Fig. 1 is the flow chart of barrage display methods in the embodiment of the present application one;
Fig. 2 is the structural schematic diagram of device in the embodiment of the present application two;
Fig. 3 is the structural schematic diagram of electronic equipment in the embodiment of the present application;
Fig. 4 is the structural schematic diagram of computer readable storage medium in the embodiment of the present application.
Specific embodiment
The embodiment of the present application solves existing skill by providing a kind of barrage display methods, device, electronic equipment and medium
Barrage in art slides at random, existing to block key object, influences the technical issues of spectators obtain video main contents.Pass through
Transparent barrier bed view is set, and barrier bed view and barrage view are set and show relationship for exclusive or, to work as barrage view
When Chong Die with barrier bed view, relationship is shown based on the exclusive or, the lap of barrage view and barrier bed view is cut, fills
Divide and shows target object.In barrage view and not be overlapped barrier bed view, the transparence setting of barrier bed view can also fill
Divide and shows target object.To realize that target object is not blocked by barrage, allow a user to obtain target pair in video at any time
The complete image of elephant improves the sufficient degree of Video Key acquisition of information.
In order to better understand the above technical scheme, in conjunction with appended figures and specific embodiments to upper
Technical solution is stated to be described in detail.
Embodiment one
As shown in Figure 1, present embodiments providing a kind of barrage display methods, comprising:
Step S101 obtains the location parameter and dimensional parameters of the target object shown in current video;
Step S102 draws the transparent covering target object according to the location parameter and the dimensional parameters
Barrier bed view, the barrier bed view and barrage view are preset as exclusive or and show relationship;
Step S103 shows relationship based on the exclusive or, cuts out when the barrage view is Chong Die with the barrier bed view
Cut the lap of the barrage view Yu the barrier bed view.
In the embodiment of the present application, the method can be applied to smart phone, notebook, desktop computer and tablet computer
Etc. the electronic equipment that can play video, this is not restricted.The current video can be live video, be also possible to broadcasting
The video recorded in the past, herein also with no restriction.Preferably, method provided in this embodiment is applied to the electricity of installation Android system
Sub- equipment.
The target object can be face, human body or object of movement etc., and this is not restricted.In the embodiment of the present application
In, it is illustrated so that the target object is face as an example.
In the following, the specific implementation step of barrage display methods provided by the embodiments of the present application is discussed in detail in conjunction with Fig. 1:
Step S101 obtains the location parameter and dimensional parameters of the target object shown in current video.
Specifically, existing identification module can be first passed through to identify target object from current video, then passed through
The location parameter and dimensional parameters of identification module return target object.Specific recognition methods can be feature Comparison Method, profile
Comparison Method, machine learning algorithm etc., this is not restricted does not also enumerate.
Assuming that target object is face, then face recognition module will recognise that the face in current video, and return to face
Location parameter and dimensional parameters, the location parameter and dimensional parameters can be face coordinate information on a display screen or people
Distance and angle information etc. of coordinate information or face of the face in current video away from default flag bit, this is not restricted.
For example, for the ease of the drafting of barrier bed view, face recognition module can be set by recognition of face at one
A rectangular patterns (preferably, which is that can block the minimum rectangle of the target object), then by a left side for the rectangle
Inferior horn and the coordinate information in the upper right corner return, and the coordinate information of return is labeled as (x1, y1) and (x2, y2) by us.Setting should
Four sides of rectangle are parallel to current video display bezel, then can calculate rectangle by coordinate information (x1, y1) and (x2, y2)
The coordinate on four vertex of pattern: left (x1, y1), top (x1, y2), right (x2, y2), bottom (x2, y1), wherein
Left mark is lower-left angular vertex, and top mark is top left corner apex, and right mark is upper right angular vertex, bottom mark
What is shown is bottom right angular vertex.This four coordinates can characterize the positions and dimensions of target object.The coordinate information can be with face
Movement and be dynamically changed.
Certainly, in specific implementation process, barrier bed view may be circle, ellipse etc., and this is not restricted.
Step S102 draws the transparent covering target object according to the location parameter and the dimensional parameters
Barrier bed view, the barrier bed view and barrage view are preset as exclusive or and show relationship.
In Android system, setting barrier bed view is maskView object, in order to pass through maskView object
Stackable display can make the performances such as the logic calculations such as exclusive or with other view objects and avoid barrage view shelter target pair to realize
As.
In specific implementation process, location parameter and dimensional parameters difference, the specific method for drawing barrier bed view is also different,
It is set forth below for two kinds:
The first, location parameter and dimensional parameters are coordinate.
Such situation can instantiate mPaint pairs of Paint type with the constructed fuction of the Paint class in calling system
As;The Canvas object in system is recalled, using the mPaint object of building, according to the location parameter and the ruler
Very little parameter draws out maskView object on the Canvas, and the maskView object is the transparent covering target pair
The barrier bed view of elephant.
Specifically, paintbrush can first be constructed, i.e., the constructed fuction of the Paint class in first calling system instantiates
The mPaint object of Paint type, specific instructions are mPaint=new Paint ().The mPaint object for reusing building is made
MaskView object, i.e. canvas.drawRect () order in calling canvas object are drawn out on Canvas for paintbrush
To draw maskView object.For example, location parameter and dimensional parameters are the square for the coverage goal object that identification module identifies
Four apex coordinates of shape pattern are then drawn by canvas.drawRect (left, top, right, bottom, mPaint)
MaskView object, wherein left, top, right, bottom are respectively four apex coordinates.One is constructed to draw
A vertex is in left, top, right, the maskView object of the rectangle of bottom, i.e., the described barrier bed view, the category of the view
Property is preset as transparent.
Second, location parameter and dimensional parameters are label.
I.e. after identifying target object, the setting flag at target object, then according to the positions and dimensions of label come
Draw barrier bed view.Do not make tired state herein.
Certainly, the mode of drafting barrier bed view is not limited to above two, and this is not restricted.
Further, when each coordinate information is dynamically changed with the movement of target object, structure can be triggered
New maskView object barrier bed view instead preceding as the barrier bed view is built out, to guarantee maskView
Object can follow the movement of target object in video in real time and move.
It is described below and the barrier bed view and barrage view is preset as the method that exclusive or shows relationship:
There is such a mixed method in the mixed mode that android system provides, when two views are overlapped
Time system automatically cuts two views according to the difference of hybrid parameter, therefore the present embodiment transmits hybrid parameter at " different
Or " when, system can retain the part of two view non-overlaps, and the view of the part of overlapping can be cut, according to this
Characteristic dexterously realizes the logic requirement blocked between barrier bed view and barrage view.
Specifically first we by new PorterDuffXfermode (Mode.SRC_XOR) method it can construct one
The object of mixed mode, wherein mixed mode is provided that Mode.SRC_XOR exclusive or mode;It recalls
Paint.setXfermode (new PorterDuffXfermode (Mode.SRC_XOR)) method shows relationship to construct exclusive or
Paint object, wherein SRC_XOR characterize exclusive or relationship.It also needs maskView object (barrier bed view) being transformed into one
A canvas object, the method for being specifically transformed into canvas object is by calling Canvas canvas=new Canvas
(maskView) process of transformation is realized.Then, the canvas.drawBitmap in canvas object is called
The barrier bed view and barrage view are preset as exclusive or and show relationship by (danmuVIew, 0f, 0f, paint) method,
In, danmuView mark is the barrage view, and canvas mark is the barrier bed view, when the barrage view
When Chong Die with the barrier bed view, relationship is shown based on the exclusive or specified by paint object, cuts the barrage view
With the lap of the barrier bed view.
In another embodiment, barrier bed view can also be modified, more meets target object shape to obtain
The barrier bed view of shape.The profile parameters for obtaining the target object shown in the current video can be set.In root
According to the location parameter and the dimensional parameters, draws the barrier bed view of the transparent covering target object and then adopt
The barrier bed view is corrected with the profile parameters, the barrier bed view is made to be modified to the shape of the profile parameters characterization
Shape.Wheel can be generated by the profile parameters according to by specifically using the profile parameters to correct the barrier bed view realization mode
Wide view;It is superimposed the profile view and the barrier bed view, it is Chong Die with the barrier bed view with the profile view
Region is as the revised barrier bed view.
For example, face recognition module identifies the profile parameters of face, and generates profile view according to facial contour,
By the way that the logical relation of profile view and barrier bed view is arranged, barrier bed Viewport Clipping is regarded only to retain with profile to realize
Scheme overlapping part, thereby realize the cutting to barrier bed view, it made more to meet the shape of face, then subsequently through
When barrier bed view avoids barrage view from blocking, cutting barrage view that can be few as far as possible is guaranteeing that user obtains complete object pair
On the basis of image, the cropped amount of reduction barrage view few as far as possible realizes that barrage appears in the effect at face edge.
In another embodiment, barrier bed view can not also be drawn, but loads the transparent picture conduct prestored
Barrier bed view.
Specifically, it is previously stored with transparent picture in local resource file, first defines ImageView type in memory
MaskView object.It is pre- in triggering load local resource file after receiving new location parameter and dimensional parameters every time
The transparent picture deposited is to the maskView object, using the maskView object as the barrier bed view.Due to
It is more much smaller than drawing performance cost brought by a picture to load a picture, by loading the transparent picture prestored, and
It is not after receiving new location parameter and dimensional parameters every time, real-time rendering barrier bed view can reduce system performance and open
Pin saves the system asset information of a part.
The method that is specifically defined that the maskView object for defining ImageView type can be set is setting private
ImageView maskView=null, that is, when definition by maskView object initialization be null sky object.Each
After receiving new location parameter and dimensional parameters (or new coordinate data), first judge whether maskView is loaded
It crosses, determines particular by whether judgement maskView object is equal to null sky object, if maskView object is equal to
Null sky object illustrates that maskview was never loaded at this time, is just needed to load it at this time, is otherwise carried out
Subsequent logic.
In order to finally realize that barrier bed view is maskView object, need that the transparent picture of load is made repeatedly to turn
It changes, specifically: the BitmapFactory.decodeFile (path) for first passing through android system offer is described transparent to load
Picture generates the bitmap object of Bbitmap type, wherein and path is the store path information of the transparent picture prestored,
Then, the constructed fuction Drawable drawable=new BitmapDrawable of BitmapDrawable is called
(bitmap) the bitmap object is transformed into the drawable object of Drawable type.Turned again by forced type
It changes, i.e., the drawable object is transformed into ImageView type by calling (ImageView) drawable method
ImageView object, and by the ImageView object value to the maskView object of definition.To realize life
At the maskView object as barrier bed view.
After receiving new location parameter and dimensional parameters, i.e., triggering loads transparent picture, can greatly improve view
The opening speed of the frequency page.Further, the present embodiment is after loading the transparent picture, can to the transparent picture after the load into
Row caching (the ImageView object that caching is changed into ImageView type), by caching realize receive next time it is new
After location parameter and dimensional parameters, do not need directly to obtain from caching from the new load for carrying out transparent picture and format conversion again
It takes the assignment of ImageView object to maskView object, greatly improves loading velocity, improve program and execute effect
Rate.
After transparent picture is completed in load, the size of the barrier bed view is adjusted further according to the dimensional parameters, and according to
The barrier bed view is arranged the location of in the current video in the location parameter, to cover the target object,
Wherein, the barrier bed view and barrage view are preset as exclusive or and show relationship.
In the embodiment of the present application, it is assumed that dimensional parameters and location parameter are the coordinate of target object, then can will
The size scaling of maskView object is coordinate characterization as the coordinate position by the display position of maskView object
Size, to realize suitable coverage goal object.
For example, it is assumed that set parameter and dimensional parameters are the four of the rectangular patterns for covering face that identification module identifies
A apex coordinate, eft (x1, y1), top (x1, y2), right (x2, y2), bottom (x2, y1), wherein left mark be
Lower-left angular vertex, top mark is top left corner apex, and right mark be upper right angular vertex, bottom mark is the lower right corner
Vertex.
Firstly, being ((x1+ according to the center point coordinate that the basic knowledge of mathematical coordinates system can be quickly obtained face
x2)/2,(y1+y2)/2).The width of face is the absolute value of (x2-x1), and height is the absolute value of (y2-y1), can be by width
Highly it is respectively labeled as width and height.Then by calling the side Math.max (width, height) in Math class
Method obtains the maximum value information in height and width, and the maximum value information that will acquire is labeled as maxLength.
Then, position adjusting is carried out, the params object of placement position is constructed, especially by LayoutParams
Params=new LayoutParams () is constructed.Then by calling params.leftMargin=(x1+x2)/2 He
The midpoint coordinates of face is arranged into params object the method for params.topMargin=(y1+y2)/2.Then it adjusts
MaskView object is moved to recognition of face with the maskview.setParams (params) in maskView object
Midpoint is gone.
Carry out size adjusting again, call maskview.setWidth (maxLength/2) in maskView object and
Maskview.setHeight (maxLength/2) method is arranged the specific size information of maskView object.It is thus real
The method that one layer of maskView object is covered on face is showed.
It should be noted that be in above-mentioned example be arranged maskView object barrier bed view be maxLength/2
Square may result in the barrier bed view of human face region slightly larger than face range in this way, but be avoided that in this way due to face
Length and width are indefinite, it is caused scaling rectangularity will appear the problems such as drawing high deformation.
Certainly, in the specific implementation process, barrier bed view may be rectangle, circle, ellipse etc., not make herein
Limitation.
In another embodiment, it is dynamically changed in each coordinate information with the movement of target object
When, it can first judge whether the Chinese and Western position of target object changes, and judge whether the dimensional parameters of target object change.If two
Person does not change, then does not change to maskView object;If only midpoint changes, only need to update
MaskView object is to new position;If only dimensional parameters change, only needs to zoom in and out maskView object, avoid
Duplicate progress picture load, duplicate progress position or size scaling setting, further save system resource overhead, improve
Treatment effeciency.
Step S103 shows relationship based on the exclusive or, cuts out when the barrage view is Chong Die with the barrier bed view
Cut the lap of the barrage view Yu the barrier bed view.
It should be noted that being for the leftmost roll mode from the rightmost of screen to screen with barrage display mode
Example, implement process are as follows: first calculate barrage view starting point coordinate (tartX, StartY) s and terminal point coordinate (endX,
EndY), in general, startX=screenWidth, endX=0, screenWidth are the width that video is shown on the screen
Degree.Barrage shows that height is a random value, often endY=StartY, can by view.getHeight () function come
It is random obtain height number, it is assumed that the random number is exactly StartY, so that it is determined that the coordinate information of entire barrage view.It connects down
Come by calling TranslateAnimation translateAnimation=new TranslateAnimation
(startX, startY, endX, endY) method constructs the translateAnimation of TranslateAnimation type
Object.TranslateAnimation.setDuration (time) method is recalled week time that entire animation executes is arranged
Phase, wherein time is the time cycle.Then, by calling the side view.startAnimation (translateAnimation)
Method can realize the rolling animation process of entire barrage view.
In another embodiment, barrage display mode can be with are as follows: the timer T of design cycle property first, then
Add up a bit of time shifting dt after each timing cycle time-out of timer T, then passes through the onlayout of barrage view
(left, top, right, bottom) function dynamically sets accumulated result to the location information of barrage view, due to
An onlayout function can be all triggered every the T period, changes will occur to cause barrage position every the T period, thus real
The effect for rolling animation is showed.
After set-up mode above-mentioned, when barrage view is Chong Die with barrier bed view, shown based on the exclusive or
Relationship cuts the lap of barrage view and barrier bed view, sufficiently shows target object.In barrage view and barrier bed
When view is not overlapped, the transparence setting of barrier bed view also can sufficiently show target object.To realize target object not
It is blocked by barrage, allows a user to the complete image for obtaining target object in video at any time, improve Video Key acquisition of information
Sufficient degree.
Based on the same inventive concept, this application provides the corresponding Installation practice of embodiment one, detailed in Example two.
Embodiment two
The present embodiment provides a kind of barrage display devices, as shown in Figure 2, comprising:
Module 201 is obtained, for obtaining the location parameter and dimensional parameters of the target object shown in current video;
Drafting module 202, for drawing the transparent covering target according to the location parameter and the dimensional parameters
The barrier bed view of object, the barrier bed view and barrage view are preset as exclusive or and show relationship;
Module 203 is cut, for being shown based on the exclusive or when the barrage view is Chong Die with the barrier bed view
Relationship cuts the lap of the barrage view Yu the barrier bed view.
In the embodiment of the present application, described device can be the energy such as smart phone, notebook, desktop computer and tablet computer
The electronic equipment of video is played, this is not restricted.The current video can be live video, be also possible to play previous
The video of recording, herein also with no restriction.Preferably, device provided in this embodiment is the electronic equipment for installing Android system.
The target object can be face, human body or object of movement etc., and this is not restricted.
Since the device that the present embodiment is introduced is device used by method in implementation the embodiment of the present application one, so base
The method described in the embodiment of the present application one, those skilled in the art can understand the specific of the device of the present embodiment
Embodiment and its various change form, so how to realize the method in the embodiment of the present application no longer for the device at this
It is discussed in detail.As long as those skilled in the art implement equipment used by the method in the embodiment of the present application, this is belonged to
Apply for the range to be protected.
Based on the same inventive concept, this application provides the corresponding apparatus embodiments of embodiment one, detailed in Example three.
Embodiment three
The present embodiment provides a kind of electronic equipment, as shown in figure 3, including memory 310, processor 320 and being stored in
On reservoir 310 and the computer program 311 that can run on the processor 320, processor 320 execute real when computer program 311
It is existing:
Obtain the location parameter and dimensional parameters of the target object shown in current video;
According to the location parameter and the dimensional parameters, the barrier bed view of the transparent covering target object is drawn
Figure, the barrier bed view and barrage view are preset as exclusive or and show relationship;
When the barrage view is Chong Die with the barrier bed view, relationship is shown based on the exclusive or, cuts the bullet
The lap of curtain view and the barrier bed view.
Since the electronic equipment that the present embodiment is introduced is equipment used by method in implementation the embodiment of the present application one, therefore
And based on method described in the embodiment of the present application one, the electronics that those skilled in the art can understand the present embodiment is set
Standby specific embodiment and its various change form, so how to realize the embodiment of the present application for the electronic equipment herein
In method be no longer discussed in detail.As long as those skilled in the art implement to set used by the method in the embodiment of the present application
It is standby, belong to the range to be protected of the application.
Based on the same inventive concept, this application provides the corresponding storage medium of embodiment one, detailed in Example four.
Example IV
The present embodiment provides a kind of computer readable storage mediums 400, as shown in figure 4, being stored thereon with computer program
411, realization when which is executed by processor:
Obtain the location parameter and dimensional parameters of the target object shown in current video;
According to the location parameter and the dimensional parameters, the barrier bed view of the transparent covering target object is drawn
Figure, the barrier bed view and barrage view are preset as exclusive or and show relationship;
When the barrage view is Chong Die with the barrier bed view, relationship is shown based on the exclusive or, cuts the bullet
The lap of curtain view and the barrier bed view.
In the specific implementation process, it when which is executed by processor, may be implemented any in embodiment one
Embodiment.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic
Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as
It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.
Claims (10)
1. a kind of barrage display methods characterized by comprising
Obtain the location parameter and dimensional parameters of the target object shown in current video;
According to the location parameter and the dimensional parameters, the barrier bed view of the transparent covering target object, institute are drawn
It states barrier bed view and barrage view is preset as exclusive or and shows relationship;
When the barrage view is Chong Die with the barrier bed view, relationship is shown based on the exclusive or, cuts the barrage view
The lap of figure and the barrier bed view.
2. the method as described in claim 1, which is characterized in that
The target object is face.
3. the method as described in claim 1, which is characterized in that it is described according to the location parameter and the dimensional parameters, it draws
Make the barrier bed view of the transparent covering target object, comprising:
The constructed fuction of Paint class in calling system instantiates the mPaint object of Paint type;
Canvas object in calling system, using the mPaint object of building, according to the location parameter and the ruler
Very little parameter draws out maskView object on the Canvas, and the maskView object is the transparent covering target pair
The barrier bed view of elephant.
4. method as claimed in claim 3, which is characterized in that
The location parameter and dimensional parameters are four apex coordinates that can block the minimum rectangle of the target object;
Canvas object in the calling system, using the mPaint object of building, according to the location parameter and institute
It states dimensional parameters and draws out maskView object on the Canvas, comprising:
Canvas.drawRect (left, top, right, bottom, the mPaint) mode in canvas object is called to draw
MaskView object, wherein left, top, right, bottom are respectively four apex coordinates.
5. the method as described in claim 1 characterized by comprising
Paint.setXfermode (new PorterDuffXfermode (Mode.SRC_XOR)) method is called to construct exclusive or
The Paint object of display relationship;
Call canvas.drawBitmap (danmuVIew, 0f, 0f, the paint) method in canvas object by the screening
Barrier view and barrage view are preset as exclusive or and show relationship, wherein and danmuView mark is the barrage view,
Canvas mark is the barrier bed view, when the barrage view is Chong Die with the barrier bed view, is based on paint pairs
As the specified exclusive or display relationship, the lap of the barrage view Yu the barrier bed view is cut.
6. the method as described in claim 1, which is characterized in that further include: obtain the mesh shown in the current video
Mark the profile parameters of object;
It is described according to the location parameter and the dimensional parameters, draw the barrier bed view of the transparent covering target object
Figure, comprising:
According to the location parameter and the dimensional parameters, the barrier bed view of the transparent covering target object is drawn;
The barrier bed view is corrected using the profile parameters, the barrier bed view is made to be modified to the profile parameters characterization
Shape.
7. method as claimed in claim 6, which is characterized in that described to correct the barrier bed view using the profile parameters
Figure, comprising:
Profile view is generated according to the profile parameters;
It is superimposed the profile view and the barrier bed view, with the profile view region Chong Die with the barrier bed view
As the revised barrier bed view.
8. a kind of barrage display device characterized by comprising
Module is obtained, for obtaining the location parameter and dimensional parameters of the target object shown in current video;
Drafting module, for drawing the transparent covering target object according to the location parameter and the dimensional parameters
Barrier bed view, the barrier bed view and barrage view are preset as exclusive or and show relationship;
Module is cut, for relationship being shown based on the exclusive or, being cut out when the barrage view is Chong Die with the barrier bed view
Cut the lap of the barrage view Yu the barrier bed view.
9. a kind of electronic equipment including memory, processor and stores the calculating that can be run on a memory and on a processor
Machine program, which is characterized in that the processor realizes method as claimed in claim 1 to 7 when executing described program.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor
Method as claimed in claim 1 to 7 is realized when execution.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811626377.2A CN109710365A (en) | 2018-12-28 | 2018-12-28 | A kind of barrage display methods, device, electronic equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811626377.2A CN109710365A (en) | 2018-12-28 | 2018-12-28 | A kind of barrage display methods, device, electronic equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109710365A true CN109710365A (en) | 2019-05-03 |
Family
ID=66258043
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811626377.2A Pending CN109710365A (en) | 2018-12-28 | 2018-12-28 | A kind of barrage display methods, device, electronic equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109710365A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111698533A (en) * | 2020-06-12 | 2020-09-22 | 上海极链网络科技有限公司 | Video processing method, device, equipment and storage medium |
CN111954060A (en) * | 2019-05-17 | 2020-11-17 | 上海哔哩哔哩科技有限公司 | Barrage mask rendering method, computer device and readable storage medium |
CN115086738A (en) * | 2022-06-07 | 2022-09-20 | 广州博冠信息科技有限公司 | Information adding method and device, computer equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106648337A (en) * | 2016-12-30 | 2017-05-10 | 智车优行科技(北京)有限公司 | Method and apparatus for displaying contents in display list, and electronic device |
CN108401177A (en) * | 2018-02-27 | 2018-08-14 | 上海哔哩哔哩科技有限公司 | Video broadcasting method, server and audio/video player system |
CN109089170A (en) * | 2018-09-11 | 2018-12-25 | 传线网络科技(上海)有限公司 | Barrage display methods and device |
-
2018
- 2018-12-28 CN CN201811626377.2A patent/CN109710365A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106648337A (en) * | 2016-12-30 | 2017-05-10 | 智车优行科技(北京)有限公司 | Method and apparatus for displaying contents in display list, and electronic device |
CN108401177A (en) * | 2018-02-27 | 2018-08-14 | 上海哔哩哔哩科技有限公司 | Video broadcasting method, server and audio/video player system |
CN109089170A (en) * | 2018-09-11 | 2018-12-25 | 传线网络科技(上海)有限公司 | Barrage display methods and device |
Non-Patent Citations (4)
Title |
---|
(美)(D.卡尔林斯)DAVID KARLINS著;孙守迁等译: "《CorelDRAW 9 24学时教程》", 30 November 1999, 机械工业出版社 * |
SSSSSS1008: "bitmap之相交模式", 《HTTPS://BLOG.CSDN.NET/SSSSSS1008/ARTICLE/DETAILS/53544049》 * |
存远: "基于Mask rcnn的行人检测与安卓客户端的移动监控***", 《HTTPS://BLOG.CSDN.NET/INTFLOJX/ARTICLE/DETAILS/83032142》 * |
邱陆陆: "爱奇艺蒙版AI:弹幕穿人过,爱豆心中坐", 《HTTPS://WWW.SOHU.COM/A/274725106_129720》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111954060A (en) * | 2019-05-17 | 2020-11-17 | 上海哔哩哔哩科技有限公司 | Barrage mask rendering method, computer device and readable storage medium |
CN111954060B (en) * | 2019-05-17 | 2022-05-10 | 上海哔哩哔哩科技有限公司 | Barrage mask rendering method, computer device and readable storage medium |
CN111698533A (en) * | 2020-06-12 | 2020-09-22 | 上海极链网络科技有限公司 | Video processing method, device, equipment and storage medium |
CN115086738A (en) * | 2022-06-07 | 2022-09-20 | 广州博冠信息科技有限公司 | Information adding method and device, computer equipment and storage medium |
CN115086738B (en) * | 2022-06-07 | 2024-06-11 | 广州博冠信息科技有限公司 | Information adding method, information adding device, computer equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109688457A (en) | A kind of anti-occlusion method of video, device, electronic equipment and medium | |
CN110136229B (en) | Method and equipment for real-time virtual face changing | |
TWI490772B (en) | Method and apparatus for adapting custom control components to a screen | |
CN109166159B (en) | Method and device for acquiring dominant tone of image and terminal | |
CN109710365A (en) | A kind of barrage display methods, device, electronic equipment and medium | |
CN109102560B (en) | Three-dimensional model rendering method and device | |
CN110286992A (en) | The method and device that interface figure is redrawn | |
CN108337547B (en) | Character animation realization method, device, terminal and storage medium | |
CN110148203B (en) | Method and device for generating virtual building model in game, processor and terminal | |
CN110347317A (en) | Window switching method and device, storage medium and interactive intelligent panel | |
CN110070551A (en) | Rendering method, device and the electronic equipment of video image | |
US10685472B1 (en) | Animation brushes | |
CN105407323A (en) | Screen splitting method and device of monitor video | |
CN110177295A (en) | Processing method, device and the electronic equipment that subtitle crosses the border | |
US9177412B2 (en) | Techniques for multiple pass rendering | |
CN111008928A (en) | Method and system for realizing special effect of dripping and scratching ripples of raindrops of image | |
CN107861711B (en) | Page adaptation method and device | |
US20230405460A1 (en) | In-game display controlling method, device and electronic equipment | |
CN108989872B (en) | Android television background fast switching method, framework, server and storage medium | |
CN110502305B (en) | Method and device for realizing dynamic interface and related equipment | |
CN117455753B (en) | Special effect template generation method, special effect generation device and storage medium | |
CN106909263A (en) | The interactive display method and system of 3-D view | |
CN114419322B (en) | Image instance segmentation method and device, electronic equipment and storage medium | |
CN109658495A (en) | Rendering method, device and the electronic equipment of environment light screening effect | |
CN114385061A (en) | Operation method, device, electronic equipment and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190503 |