CN107392111B - Advertisement identification method and device - Google Patents

Advertisement identification method and device Download PDF

Info

Publication number
CN107392111B
CN107392111B CN201710501289.9A CN201710501289A CN107392111B CN 107392111 B CN107392111 B CN 107392111B CN 201710501289 A CN201710501289 A CN 201710501289A CN 107392111 B CN107392111 B CN 107392111B
Authority
CN
China
Prior art keywords
advertisement
video stream
character
identification
template
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
Application number
CN201710501289.9A
Other languages
Chinese (zh)
Other versions
CN107392111A (en
Inventor
曹哲
李沈阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Visual Technology Co Ltd
Original Assignee
Hisense Visual Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Visual Technology Co Ltd filed Critical Hisense Visual Technology Co Ltd
Priority to CN201710501289.9A priority Critical patent/CN107392111B/en
Publication of CN107392111A publication Critical patent/CN107392111A/en
Application granted granted Critical
Publication of CN107392111B publication Critical patent/CN107392111B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/635Overlay text, e.g. embedded captions in a TV program
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • H04N21/4316Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations for displaying supplemental content in a region of the screen, e.g. an advertisement in a separate window
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/454Content or additional data filtering, e.g. blocking advertisements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses an advertisement identification method and device, and belongs to the field of multimedia. The method comprises the following steps: extracting key frames of the video stream in the playing process of the video stream; identifying characters in a designated area of the key frame based on the identification template; and if the character is identified to contain a number by the identification template, determining the type of the video stream as the advertisement, wherein the number is used for indicating the remaining playing time of the video stream. The invention identifies whether the characters in the appointed area of the key frame of the current playing video stream contain numbers or not through the identification template, thereby determining whether the video stream is an advertisement or not. The advertisement is identified through the play countdown characteristic of the advertisement, only the digital information used for embodying the play countdown characteristic in the designated area of the play picture needs to be identified, the identification process of the whole play picture and other non-digital characters such as Chinese characters is avoided, the identification process can be greatly simplified, and the identification efficiency and accuracy are improved.

Description

Advertisement identification method and device
Technical Field
The invention relates to the field of multimedia, in particular to an advertisement identification method and device.
Background
When people watch network videos, due to the current operating strategy of a video website, advertisements are inserted in the playing process of the videos, the playing time of the advertisements can be at the head, in the middle or at the tail of a film, and the playing time can be different from several seconds to several minutes. The playing of the advertisement interrupts the user's viewing of the current video, and affects the viewing experience of the user, so there is an urgent need for an advertisement identification method to identify the advertisement inserted during the video playing process, so as to automatically skip the identified advertisement.
Currently, the method of advertisement identification may be as follows: a plurality of known advertisements are collected to be used as advertisement samples, one or more frames of pictures of the advertisement samples are extracted to be used as the characteristics of the advertisement samples, and the characteristics are stored in an advertisement database. In the video playing process, extracting the playing picture of the current video, comparing the playing picture of the current video with the pictures of the advertisement samples in the advertisement database one by one to search the advertisement samples which are the same as or similar to the current video, if the advertisement samples can be found, determining that the current video is the advertisement which is inserted, and if the advertisement samples cannot be found, determining that the current video is not the advertisement which is inserted.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
the technology needs to rely on an advertisement database when identifying the advertisement, needs to compare the current video with the advertisement samples in the advertisement database one by one when identifying, needs to compare all image characteristics in the current frame image with the advertisement samples, has long advertisement identification time and low identification efficiency, can only identify the advertisement with the same or similar picture as the advertisement sample, even if the current video is non-advertisement, but if the playing picture of the current video is the same or similar to the advertisement sample, the current video is easily identified as the advertisement by mistake, and the identification accuracy is low.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide an advertisement identification method and apparatus. The technical scheme is as follows:
in a first aspect, a method for identifying an advertisement is provided, the method comprising:
extracting key frames of a video stream in the playing process of the video stream;
identifying characters in a designated area of the key frame based on an identification template, wherein the identification template is obtained by analyzing a plurality of advertisement samples, and the identification template is one or more;
and if the characters are identified to contain numbers in the identification template, determining that the type of the video stream is an advertisement, wherein the numbers are used for indicating the remaining playing time of the video stream.
In a first implementation manner of the first aspect, the recognizing, based on a recognition template, characters in a specified region of the key frame includes:
determining a number area in the character area according to a character combination rule in the recognition template and the character area in the designated area, wherein each character area only contains one character;
and identifying the digital area based on a digital identification model to obtain the number contained in the character.
In a second implementation manner of the first aspect, before the identifying, based on the identification template, numbers included in characters in a specified area of the key frame, the method further includes:
intercepting an image of the designated area of the key frame;
carrying out color filtering and binarization processing on the image of the designated area to obtain a first image;
performing expansion processing on the first image to obtain a second image containing at least one connected region;
intercepting the first image according to a connected region at a specified position in the second image to obtain a third image, wherein the connected region at the specified position is formed by the characters in the specified region of the key frame;
and adopting a vertical projection algorithm to segment the third image to obtain the character area in the designated area.
In a third implementation manner of the first aspect, after the recognizing, based on the recognition template, the characters in the specified area of the key frame, the method further includes:
if the recognition template can not recognize that the characters contain numbers and the latest recognition template is already included in the recognition template, determining the type of the video stream as a non-advertisement;
and if the recognition template cannot recognize that the characters contain numbers and does not comprise the latest recognition template, acquiring the latest recognition template, and recognizing the characters in the specified area of the key frame based on the latest recognition template.
In a fourth implementation manner of the first aspect, after determining that the type of the video stream is an advertisement, the method further includes:
skipping to the end of the video stream according to the identified number, and continuing to play the next segment of the video stream; or the like, or, alternatively,
and downloading and playing the next video stream based on the address of the next video stream of the video stream.
In a second aspect, there is provided an advertisement recognition apparatus, the apparatus comprising:
the extraction module is used for extracting key frames of the video stream in the playing process of the video stream;
the identification module is used for identifying characters in the appointed area of the key frame based on an identification template, wherein the identification template is obtained by analyzing a plurality of advertisement samples, and the identification template is one or more;
and the determining module is used for determining that the type of the video stream is an advertisement if the character is identified to contain a number by the identification template, wherein the number is used for indicating the remaining playing time of the video stream.
In a first implementation manner of the second aspect, the recognition module is configured to determine a number region in the character region according to a character combination rule in the recognition template and a character region in the designated region, where each character region includes one character; and identifying the digital area based on a digital identification model to obtain the number contained in the character.
In a second implementation manner of the second aspect, the apparatus further includes:
the intercepting module is used for intercepting the image of the specified area of the key frame;
the binarization module is used for carrying out color filtering and binarization processing on the image of the designated area to obtain a first image;
the expansion module is used for performing expansion processing on the first image to obtain a second image containing at least one connected region;
the intercepting module is further configured to intercept the first image according to a connected region at a specified position in the second image to obtain a third image, where the connected region at the specified position is formed by the characters in the specified region of the key frame;
and the segmentation module is used for segmenting the third image by adopting a vertical projection algorithm to obtain the character area in the designated area.
In a third implementation form of the second aspect, the apparatus further includes:
the determining module is further configured to determine that the type of the video stream is a non-advertisement if the recognition template cannot recognize that the characters contain numbers and the recognition template already includes a latest recognition template;
an obtaining module, configured to obtain a latest recognition template if the recognition template cannot recognize that the character includes a number and the recognition template does not include the latest recognition template, and recognize the character in the designated area of the key frame based on the latest recognition template.
In a fourth implementation form of the second aspect, the apparatus further comprises:
the playing module is used for jumping to the end of the video stream according to the identified number and continuing to play the next section of the video stream; or the like, or, alternatively,
and the downloading module is used for downloading and playing the next section of video stream based on the address of the next section of video stream of the video stream.
In a third aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus; a memory for storing a computer program; a processor configured to execute the computer program stored in the memory to implement the method steps of any of the implementations of the first aspect.
In a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program implements the method steps of any of the implementations of the first aspect.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
and identifying whether the characters in the designated area of the key frame of the currently played video stream contain numbers through the identification template so as to determine whether the video stream is an advertisement. In the embodiment of the invention, one or more identification templates are preset, so that when an advertisement is identified, only whether the number corresponding to the character in the designated area of the key frame image is matched with the identification template is needed to be judged, and when the number corresponding to the character in the designated area is matched with the identification template, the video stream is judged to be the advertisement; the advertisement is identified through the play countdown characteristic of the advertisement, only the designated area used for displaying the play countdown information in the play picture and the digital information used for embodying the play countdown characteristic in the designated area are needed to be identified, the identification process of the whole play picture and other non-digital characters such as Chinese characters is avoided, the identification process can be greatly simplified, and the identification efficiency and the accuracy are improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow chart of an advertisement identification method according to an embodiment of the present invention;
FIG. 2 is a flow chart of an advertisement identification method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a designated area according to an embodiment of the present invention;
FIG. 4A is a diagram of a key frame according to an embodiment of the present invention;
FIG. 4B is a diagram of an image of a designated area according to an embodiment of the present invention;
FIG. 4C is a schematic diagram of a first image according to an embodiment of the present invention;
FIG. 4D is a diagram of a second image according to an embodiment of the present invention;
FIG. 4E is a diagram of a third image according to an embodiment of the present invention;
FIG. 4F is a diagram of a character area according to an embodiment of the present invention;
FIG. 4G is a schematic diagram of a number provided by an embodiment of the present invention;
FIG. 5 is a schematic diagram illustrating a corresponding pattern of advertisement countdown information and an identification template according to an embodiment of the present invention;
FIG. 6 is a flow chart of an advertisement identification process provided by an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of an advertisement recognition device according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of an advertisement recognition device according to an embodiment of the present invention;
FIG. 9 is a schematic structural diagram of an advertisement recognition device according to an embodiment of the present invention;
FIG. 10 is a schematic structural diagram of an advertisement recognition device according to an embodiment of the present invention;
FIG. 11 is a schematic structural diagram of an advertisement recognition device according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of an electronic device 1200 according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Fig. 1 is a flowchart of an advertisement identification method according to an embodiment of the present invention. Referring to fig. 1, the method includes:
101. in the playing process of the video stream, the key frame of the video stream is extracted.
102. And identifying characters in the appointed area of the key frame based on an identification template, wherein the identification template is obtained by analyzing a plurality of advertisement samples, and the identification template is one or more.
103. And if the character is identified to contain a number by the identification template, determining the type of the video stream as the advertisement, wherein the number is used for indicating the remaining playing time of the video stream.
The method provided by the embodiment of the invention identifies whether the characters in the appointed area of the key frame of the currently played video stream contain numbers or not through the identification template, thereby determining whether the video stream is an advertisement or not. The advertisement is identified through the play countdown characteristic of the advertisement, only the designated area used for displaying the play countdown information in the play picture and the digital information used for embodying the play countdown characteristic in the designated area are needed to be identified, the identification process of the whole play picture and other non-digital characters such as Chinese characters is avoided, the identification process can be greatly simplified, and the identification efficiency and the accuracy are improved.
Optionally, the recognizing the characters in the designated area of the key frame based on the recognition template includes:
determining a number area in the character area according to a character combination rule in the recognition template and the character area in the designated area, wherein each character area only contains one character;
and identifying the number area based on a number identification model to obtain the number contained in the character.
Optionally, before the recognizing, based on the recognition template, the number included in the character in the designated area of the key frame, the method further includes:
intercepting the image of the appointed area of the key frame;
carrying out color filtering and binarization processing on the image of the designated area to obtain a first image;
performing expansion processing on the first image to obtain a second image containing at least one connected region;
intercepting the first image according to a connected region at a specified position in the second image to obtain a third image, wherein the connected region at the specified position is formed by characters in the specified region of the key frame;
and adopting a vertical projection algorithm to segment the third image to obtain a character area in the designated area.
Optionally, after recognizing the characters in the designated area of the key frame based on the recognition template, the method further includes:
if the recognition template can not recognize that the characters contain numbers and the latest recognition template is already included in the recognition template, determining the type of the video stream as a non-advertisement;
and if the recognition template cannot recognize that the characters contain numbers and does not comprise the latest recognition template, acquiring the latest recognition template, and recognizing the characters in the specified area of the key frame based on the latest recognition template.
Optionally, after determining that the type of the video stream is an advertisement, the method further includes:
jumping to the end of the video stream according to the recognized number, and continuing to play the next video stream of the video stream; or the like, or, alternatively,
and downloading and playing the next video stream based on the address of the next video stream of the video stream.
All the above-mentioned optional technical solutions can be combined arbitrarily to form the optional embodiments of the present invention, and are not described herein again.
Fig. 2 is a flowchart of an advertisement identification method according to an embodiment of the present invention. The method is performed by an electronic device, see fig. 2, the method comprising:
201. in the playing process of the video stream, the key frame of the video stream is extracted.
Each picture in the video stream is called a frame, and a key frame of the video stream may be a certain picture in the video stream, that is, key image data of the video stream, such as an I frame (IFrame), also called an intra picture (intra picture), which is an important frame in inter-frame compression coding and is a full-frame compressed coding frame, and a complete image can be reconstructed by using only data of the I frame during decoding.
In the embodiment of the invention, after the electronic device downloads the network video stream segment each time, any video key frame extraction algorithm can be adopted, and the key frame of the video stream segment is extracted after the video stream segment is decoded based on a Decoder part of a bottom multimedia middleware.
It is considered that the electronic device generally displays the countdown information of the advertisement in the form of characters in the playing picture of the advertisement. Therefore, if the currently played video stream is an advertisement, the countdown information of the advertisement will be available on each frame of the playing screen of the advertisement, and the countdown information on the playing screen at different times is different, for example, the countdown information on the playing screen at the current time is "advertisement 29 seconds". The countdown information on the play screen at the previous time may be "advertisement 30 seconds". The electronic device can determine whether the key frame contains the countdown information by identifying characters in a designated area of the key frame of the currently played video stream, and further determine whether the currently played video stream is the advertisement.
202. And acquiring character areas in the designated area of the key frame, wherein each character area comprises a character.
Referring to fig. 3, fig. 3 is a schematic diagram of a designated area provided by an embodiment of the present invention, and considering that advertisement countdown information is generally in the upper right corner of a currently playing screen, an electronic device may use the upper right corner area of the key frame as the designated area, and a size ratio of the upper right corner area to the key frame may be a preset ratio, such as 1/16 or 1/8. Of course, the designated area may also have other alternative areas, for example, the alternative area in fig. 3 may be an upper left corner area, a lower right corner area, or a lower left corner area of the currently played picture, which is not limited in the embodiment of the present invention.
In the embodiment of the invention, if the currently played video stream is an advertisement, the character area in the specified area of the key frame is the area for displaying the advertisement countdown information, so that the electronic equipment can firstly acquire the character area in the specified area of the key frame and obtain the specific advertisement countdown information by identifying the characters in the character area. In one possible implementation, the process of acquiring the character region in the designated region of the key frame may include the following steps a1 to a5:
a1, intercepting the image of the appointed area of the key frame;
referring to fig. 4A and 4B, fig. 4A is a schematic diagram of a key frame provided by an embodiment of the present invention, and fig. 4B is a schematic diagram of an image of a designated area provided by an embodiment of the present invention, and the image shown in fig. 4B can be obtained by cutting the designated area in fig. 4A.
The image of the appointed area containing the advertisement countdown information is intercepted, so that the electronic equipment can recognize the advertisement without processing the whole image of the key frame and only processing the image of the appointed area; meanwhile, the whole video picture does not need to be analyzed and judged, so that the interference of the images of other areas in the key frame to the specified area is correspondingly eliminated, and the accuracy of advertisement identification is improved.
and a2, performing color filtering and binarization processing on the image of the designated area to obtain a first image.
The color filtering of the image means that only the white part of the image is reserved, and all other colors in the image are set to be black, and the binarization processing is to set the gray value of a pixel point on the image to be 0 or 255, that is, the whole image is obviously black and white.
In step a2, the electronic device performs color filtering on the image to obtain a grayscale image, and then performs binarization processing on the grayscale image to obtain a binary image, i.e., the first image, wherein the grayscale image has many colors of different depth levels between black and white, but the binary image has only two colors, namely black and white. Referring to fig. 4C, fig. 4C is a schematic diagram of a first image according to an embodiment of the present invention, where the first image is a completely white image with black background.
a3, performing expansion processing on the first image to obtain a second image containing at least one connected region.
In step a3, the electronic device may perform dilation processing on the first image (binary image) in fig. 4C by using any dilation method to obtain a second image. Referring to fig. 4D, fig. 4D is a schematic diagram of a second image according to an embodiment of the present invention, where the second image includes a plurality of connected regions, each connected region is formed by a string of continuous characters, and a string of continuous characters can be determined through each connected region.
a4, cutting the first image according to the connected region of the appointed position in the second image to obtain a third image, wherein the connected region of the appointed position is formed by the characters in the appointed region of the key frame.
The connected region at the designated position may be the first connected region in the upper right corner of the second image in fig. 4D. Referring to fig. 4E, fig. 4E is a schematic diagram of a third image according to an embodiment of the present invention, the electronic device may determine a string of consecutive characters "advertisement 9 seconds" in the first image through a connected region at a specified position in the second image, and intercept an image of the consecutive characters from the first image, that is, the third image shown in fig. 4E.
a5, segmenting the third image by adopting a vertical projection algorithm to obtain a character area in the appointed area of the key frame.
In step a5, the electronic device may use any vertical projection algorithm to segment consecutive characters in the third image, so as to obtain character regions. Referring to fig. 4F, fig. 4F is a schematic diagram of character regions, each of which includes a character, according to an embodiment of the present invention, and the segmentation of the third image in fig. 4E can obtain 4 character regions, such as "advertisement 9 seconds".
After acquiring the character area in the designated area of the key frame, the electronic device only knows the number of characters in the designated area of the key frame, but does not determine the specific form of the character corresponding to each character area, and then the electronic device can identify the character corresponding to the character area through the subsequent step 203, and determine the type (advertisement or non-advertisement) of the currently played video stream according to the identification result.
203. And identifying characters in the appointed area of the key frame based on an identification template, wherein the identification template is obtained by analyzing a plurality of advertisement samples, and the identification template is one or more.
The advertisement samples can be known advertisements on the Internet, each advertisement sample can have advertisement countdown information, different types of advertisement countdown information can be obtained by analyzing the countdown information of a plurality of advertisement samples on the Internet, one or more identification templates can be obtained according to the different types of advertisement countdown information, and the one or more identification templates can be stored locally in the electronic equipment. Referring to fig. 5, fig. 5 is a schematic diagram of a corresponding mode of advertisement countdown information and an identification template provided by an embodiment of the present invention, for example, for advertisement countdown information of the type "advertisement 29 seconds", for example, advertisement countdown information of advertisement sample 1 is "advertisement 60 seconds", advertisement countdown information of advertisement sample 2 is "advertisement 45 seconds", and advertisement countdown information of advertisement sample 3 is "advertisement 10 seconds", an identification template "WWAAW" can be obtained by analyzing advertisement sample 1, advertisement sample 2, and advertisement sample 3, where "W" represents hanzi, and "a" represents number. Similarly, for the type of advertisement countdown information of "continue after 8 seconds of wonderful", the identification template may be "WWAWWWW"; for this type of advertisement countdown information of "29", the identification template may be "AA"; for advertisement countdown information of the type "please wait 120 seconds" the identification template may be "WWWAAAW"; for the type of advertisement countdown information "ad 9 seconds," the identification template may be "WWAW".
It should be noted that, in order to ensure the diversity and comprehensiveness of the identification template and implement dynamic acquisition and update of the identification template, the electronic device may acquire other identification templates from other devices (such as a server) in addition to a part of the identification templates preset locally at the time of factory shipment.
In one possible implementation manner, the step 203 of recognizing the characters in the designated area of the key frame based on a plurality of recognition templates may include the following steps a and b:
a. determining a number area in the character area according to a character combination rule in the identification template and the character area in the appointed area of the key frame;
the character combination rule can be a combination rule among numbers, Chinese characters, letters or symbols, and each number area comprises a number.
In the step a, the electronic device may determine, according to the character combination rule in the recognition template and the character area in the designated area of the key frame, a number area in the character area by: determining the number of character areas in the appointed area of the key frame obtained by segmentation, selecting a target recognition template with the same number of characters as the character areas from the recognition templates according to the number of the character areas, and determining the number areas in the character areas according to the character combination rule in the target recognition template. For example, if there are 4 character areas such as "advertisement 9 seconds" in the designated area of the key frame, the recognition template "WWAW" can be selected as the target recognition template, and the rules of character combination are that the left two character areas are the chinese character area "advertisement", the right one character area is the chinese character area "seconds", and the remaining middle one character area is the number area "9". Of course, referring to fig. 6, fig. 6 is a flowchart of an advertisement recognition process according to an embodiment of the present invention, and the electronic device may also not determine the target recognition template, but sequentially select each recognition template of the multiple recognition templates, and each time one recognition template is selected, determine the number area in the character areas according to the character combination rule in the current recognition template, and recognize the number in the number area through step b.
b. And identifying the number area based on a number identification model to obtain the number contained in the character.
In step b, the electronic device may build a number recognition model according to a plurality of known arabic numbers (e.g., 0, 1, 2, … …, 9), so that the electronic device may recognize the numbers contained in the number area according to the number recognition model. For example, in the process of creating the number recognition model, a technician may train the number recognition model based on a plurality of number regions whose numbers are known, so that the number recognition model created based on the plurality of number regions and training data such as corresponding numbers can recognize the numbers contained in any one of the number regions. Referring to fig. 4G, fig. 4G is a schematic diagram of a number provided by the embodiment of the present invention, and the number 9 can be obtained by identifying the number area "9" in fig. 4F.
The characters in the designated area of the key frame are identified through the identification template, the digital information in the characters can be directly positioned, the identification process of other non-digital characters such as Chinese characters is avoided, and the identification efficiency is improved.
204. And if the character is identified to contain a number by the identification template, determining the type of the video stream as the advertisement, wherein the number is used for indicating the remaining playing time of the video stream.
In the embodiment of the present invention, each identification template may be obtained by analyzing a plurality of advertisement samples, and each advertisement sample may have advertisement countdown information, where the advertisement countdown information often includes a number for indicating a remaining playing time of the advertisement. Referring to fig. 6, if any of the local recognition templates can recognize that the characters in the designated area of the key frame contain numbers, the electronic device may determine that the type of the video stream corresponding to the key frame is an advertisement.
Alternatively, considering that the user is generally unwilling to watch the advertisement, the electronic device may skip the currently played video stream and play the next video stream of the video stream in any of the following manners after determining that the type of the video stream is the advertisement.
In the first way, according to the recognized number, the terminal of the video stream is jumped to, and the next video stream of the video stream is played continuously.
The method is that the electronic equipment still can normally download the current video stream and the next video stream of the current video stream, but the current video stream is the advertisement, so the electronic equipment can determine the residual playing time of the advertisement according to the identified number, and then carry out seek jump action according to the residual playing time, namely, the current playing time is jumped to the time point of the playing end of the advertisement, so as to achieve the effect of skipping the advertisement, and the jump action carried out by the electronic equipment is equivalent to the effect of pulling the playing progress bar by a user.
In the second mode, the next video stream is downloaded and played based on the address of the next video stream of the video stream.
After the electronic device determines that the current video Stream is an advertisement and the advertisement is an independent video TS (Transport Stream), the electronic device may directly address the next video Stream without downloading the current video Stream from the address of the advertisement because the independent TS Stream has its own download address, that is, obtain the address of the next video Stream and download the next video Stream based on the address for playing, thereby achieving the effect of skipping the advertisement.
The invention only needs to identify the number used for reflecting the play countdown characteristic in the play picture, avoids the identification process of other non-numeric characters such as Chinese characters and the like, and compared with the identification of the whole play picture by the related technology, the invention can greatly simplify the identification process and improve the identification efficiency. In addition, in the prior art, identification is performed through a playing picture, if the currently played video is a non-advertisement and has the same or similar playing picture as an advertisement sample, the currently played video is identified as an advertisement, or if the currently played video is an advertisement and is greatly different from the playing picture of the advertisement sample, the currently played video is identified as a non-advertisement, and the identification accuracy is low; the invention identifies through the characteristic of playing countdown, and because the characteristic of playing countdown is the general characteristic of the advertisement, the general advertisement will have the characteristic of playing countdown, compared with the prior art, the identification accuracy of the invention is higher.
The above steps 201 to 204 are processes in which the electronic device identifies the character containing number in the designated area of the key frame based on the identification template, so as to determine that the currently played video stream is an advertisement, and of course, the electronic device may not identify the character containing number in the designated area of the key frame based on the identification template, in which case the electronic device may further determine the type of the currently played video stream through the following step 205.
205. If the recognition template can not recognize that the character contains a number and the latest recognition template is already included in the recognition template, the type of the video stream is determined to be non-advertisement.
In the embodiment of the invention, considering that the advertisement layer is endless, new advertisement countdown information may be adopted by a new advertisement, that is, a new identification template appears, the new identification templates may be stored in the server, and the electronic device may periodically acquire the latest identification template from the server, so as to update the locally existing identification template, thereby realizing the advancement of the identification template with time. Referring to fig. 6, if the electronic device performs step 203 after acquiring the latest identification template, the identification template currently existing in the electronic device already includes the latest identification template, and the latest identification template cannot identify that the characters contain numbers, the electronic device may determine that the currently played video stream is not an advertisement, and the electronic device may continue to play the video stream normally.
Of course, referring to fig. 6, if the electronic device may execute step 203 before acquiring the latest recognition template, and the current existing recognition template of the electronic device does not include the latest recognition template, at this time, the electronic device may acquire the latest recognition template from the server and recognize the characters in the specified area of the key frame based on the latest recognition template. Similarly, if the latest recognition template recognizes that the characters in the designated area of the key frame contain numbers, the electronic device may determine that the currently playing video stream is an advertisement, otherwise, may determine that the currently playing video stream is not an advertisement.
The type of the current video stream is further determined by obtaining the latest identification template and according to the identification result of the latest identification template, and the comprehensiveness of the identification template can be ensured by dynamically adapting the identification template aiming at the new type of advertisement, so that the identification accuracy is improved. Moreover, because the electronic device can acquire the latest identification template from the server and update the existing local template, devices of different platforms, such as a television, a mobile phone or a Personal Computer (PC), can recognize the advertisement by using the advertisement recognition method, thereby improving the portability of the cross-platform.
The method provided by the embodiment of the invention identifies whether the characters in the appointed area of the key frame of the currently played video stream contain numbers or not through the identification template, thereby determining whether the video stream is an advertisement or not. The advertisement is identified through the play countdown characteristic of the advertisement, only the designated area used for displaying the play countdown information in the play picture and the digital information used for embodying the play countdown characteristic in the designated area are needed to be identified, the identification process of the whole play picture and other non-digital characters such as Chinese characters is avoided, the identification process can be greatly simplified, and the identification efficiency and the accuracy are improved.
In addition, when the local multiple recognition templates cannot recognize whether the characters in the designated area of the key frame contain numbers, the latest recognition template can be further acquired from the server, and the type of the current video stream is determined according to the recognition result of the latest recognition template, so that the recognition accuracy is further improved.
Fig. 7 is a schematic structural diagram of an advertisement recognition device according to an embodiment of the present invention. Referring to fig. 7, the apparatus includes:
an extracting module 701, configured to extract a key frame of a video stream in a playing process of the video stream;
a recognition module 702, configured to recognize characters in a designated area of the key frame based on a recognition template, where the recognition template is obtained by analyzing a plurality of advertisement samples, and the recognition template is one or more types;
a determining module 703, configured to determine that the type of the video stream is an advertisement if the character is identified by the identifying template, where the number is used to indicate the remaining playing time of the video stream.
Optionally, the recognition module 702 is configured to determine a number region in the character region according to a character combination rule in the recognition template and a character region in the designated region, where each character region includes a character; and identifying the number area based on a number identification model to obtain the number contained in the character.
Optionally, referring to fig. 8, the apparatus further comprises:
an intercepting module 704, configured to intercept an image of a specified region of the key frame;
a binarization module 705, configured to perform color filtering and binarization processing on the image in the designated area to obtain a first image;
an expansion module 706, configured to perform expansion processing on the first image to obtain a second image including at least one connected region;
the intercepting module 704 is further configured to intercept the first image according to a connected region at a specified position in the second image to obtain a third image, where the connected region at the specified position is formed by characters in the specified region of the key frame;
and a segmentation module 707, configured to segment the third image by using a vertical projection algorithm to obtain a character region in the designated region.
Optionally, referring to fig. 9, the apparatus further comprises:
a determining module 703, configured to determine that the type of the video stream is a non-advertisement if the recognition template cannot recognize that the character includes a number and the recognition template already includes a latest recognition template;
an obtaining module 708, configured to, if the recognition template cannot recognize that the character includes a number and the recognition template does not include a latest recognition template, obtain the latest recognition template, and recognize the character in the specified area of the key frame based on the latest recognition template.
Optionally, referring to fig. 10, the apparatus further comprises:
a playing module 709, configured to skip to the end of the video stream according to the identified number, and continue to play a next segment of the video stream; or the like, or, alternatively,
referring to fig. 11, the apparatus further includes: the downloading module 710 is configured to download and play the next segment of video stream based on the address of the next segment of video stream.
In the embodiment of the invention, whether the characters in the appointed area of the key frame of the currently played video stream contain numbers is identified through the identification template, so that whether the video stream is an advertisement is determined. The advertisement is identified through the play countdown characteristic of the advertisement, only the designated area used for displaying the play countdown information in the play picture and the digital information used for embodying the play countdown characteristic in the designated area are needed to be identified, the identification process of the whole play picture and other non-digital characters such as Chinese characters is avoided, the identification process can be greatly simplified, and the identification efficiency and the accuracy are improved.
In addition, when the local multiple recognition templates cannot recognize whether the characters in the designated area of the key frame contain numbers, the latest recognition template can be further acquired from the server, and the type of the current video stream is determined according to the recognition result of the latest recognition template, so that the recognition accuracy is further improved.
It should be noted that: the advertisement recognition device provided in the above embodiment is only illustrated by the division of the above functional modules when recognizing the advertisement, and in practical applications, the above function allocation may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the advertisement identification device and the advertisement identification method provided by the above embodiments belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments and will not be described herein again.
Fig. 12 is a schematic structural diagram of an electronic device 1200 according to an embodiment of the present invention. Referring to fig. 12, the electronic device 1200 includes a processor, a communication interface, a memory, and a communication bus, and may further include an input/output interface and a display device, wherein the processor, the memory, the input/output interface, the display device, and the communication interface complete communication with each other through the communication bus. The memory stores a computer program, and the processor is configured to execute the computer program stored in the memory to implement the advertisement identification method in the embodiment of fig. 1 or fig. 2.
A communication bus is a circuit that connects the described elements and enables transmission between the elements. For example, the processor receives commands from other elements through the communication bus, decrypts the received commands, and performs calculations or data processing according to the decrypted commands. The memory may include program modules such as a kernel (kernel), middleware (middleware), an Application Programming Interface (API), and applications. The program modules may be comprised of software, firmware or hardware, or at least two of the same. The input-output interface forwards commands or data input by a user via an input-output device (e.g., sensor, keyboard, touch screen). The display device displays various information to a user. The communication interface connects the electronic device 1200 with other network devices, user equipment, networks. For example, the communication interface may be connected to a network by wire or wirelessly to connect to external other network devices or user devices. The wireless communication may include at least one of: wireless Fidelity (WiFi), Bluetooth (BT), Near Field Communication (NFC), Global Positioning System (GPS) and cellular Communication (cellular Communication) (e.g., Long Term Evolution (LTE)), Long Term Evolution (Long Term Evolution) followed by Long Term Evolution (LTE-Advanced), Code Division Multiple Access (CDMA), Wideband code division Multiple Access (CDMA, WCDMA), Universal Mobile telecommunications System (Universal Mobile telecommunications System, UMTS), Wireless broadband Access (Wireless broadband bro) and Global System for Mobile communications (GSM) may include at least one of the following Wireless Communication systems (WiFi), Wireless Multimedia Communication (Bluetooth, BT), Wireless broadband Communication (GSM) and Wireless Multimedia System (GSM) Communication (GSM) Interface, Wireless Multimedia Communication (HDMI, USB) Interface, RS-232), and Plain Old Telephone Service (POTS). The network may be a telecommunications network and a communications network. The communication network may be a computer network, the internet of things, a telephone network. The electronic device 1200 may be connected to a network through a communication Interface, and a protocol used for the electronic device 1200 to communicate with other network devices may be supported by at least one of an Application, an Application Programming Interface (API), middleware, a kernel, and a communication Interface.
In an exemplary embodiment, a computer-readable storage medium, for example a memory, storing a computer program is also provided, which when executed by a processor implements the advertisement identification method in fig. 1 or fig. 2 of the above embodiments. For example, the computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a Compact Disc Read-Only Memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (8)

1. An advertisement identification method, the method comprising:
extracting key frames of a video stream in the playing process of the video stream;
determining the number of character areas in an appointed area of the key frame, selecting a target recognition template with the same number of characters as the number of the character areas from recognition templates according to the number of the character areas, and determining a number area in the character areas according to a character combination rule in the target recognition template, wherein each character area only contains one character, the recognition template is obtained by analyzing a plurality of advertisement samples, and the recognition templates are one or more;
identifying the digital area based on a digital identification model to obtain the number contained in the character in the designated area;
and if the character is identified to contain a number by the identification template, determining that the type of the video stream is an advertisement, wherein the number is used for indicating the remaining playing time of the video stream.
2. The method of claim 1, further comprising:
intercepting an image of the designated area of the key frame;
carrying out color filtering and binarization processing on the image of the designated area to obtain a first image;
performing expansion processing on the first image to obtain a second image containing at least one connected region;
intercepting the first image according to a connected region at a specified position in the second image to obtain a third image, wherein the connected region at the specified position is formed by the characters in the specified region of the key frame;
and adopting a vertical projection algorithm to segment the third image to obtain the character area in the designated area.
3. The method of claim 1, further comprising:
if the recognition template can not recognize that the characters contain numbers and the latest recognition template is already included in the recognition template, determining the type of the video stream as a non-advertisement;
and if the recognition template cannot recognize that the characters contain numbers and does not comprise the latest recognition template, acquiring the latest recognition template, and recognizing the characters in the specified area of the key frame based on the latest recognition template.
4. The method of claim 1, wherein after determining that the type of the video stream is an advertisement, the method further comprises:
skipping to the end of the video stream according to the identified number, and continuing to play the next segment of the video stream; or the like, or, alternatively,
and downloading and playing the next video stream based on the address of the next video stream of the video stream.
5. An advertisement recognition apparatus, comprising:
the extraction module is used for extracting key frames of the video stream in the playing process of the video stream;
the identification module is used for determining the number of character areas in an appointed area of the key frame, selecting a target identification template with the same number of characters as the character areas from identification templates according to the number of the character areas, determining a number area in the character areas according to a character combination rule in the target identification template, and identifying the number area based on a number identification model to obtain the number contained in the characters in the appointed area, wherein each character area only contains one character, the identification template is obtained by analyzing a plurality of advertisement samples, and the identification templates are one or more;
and the determining module is used for determining that the type of the video stream is an advertisement if the character is identified to contain a number by the identification template, wherein the number is used for indicating the remaining playing time of the video stream.
6. The apparatus of claim 5, further comprising:
the determining module is further configured to determine that the type of the video stream is a non-advertisement if the recognition template cannot recognize that the characters contain numbers and the recognition template already includes a latest recognition template;
an obtaining module, configured to obtain a latest recognition template if the recognition template cannot recognize that the character includes a number and the recognition template does not include the latest recognition template, and recognize the character in the designated area of the key frame based on the latest recognition template.
7. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus; a memory for storing a computer program; a processor for executing a computer program stored on a memory for carrying out the method steps of any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1-4.
CN201710501289.9A 2017-06-27 2017-06-27 Advertisement identification method and device Active CN107392111B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710501289.9A CN107392111B (en) 2017-06-27 2017-06-27 Advertisement identification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710501289.9A CN107392111B (en) 2017-06-27 2017-06-27 Advertisement identification method and device

Publications (2)

Publication Number Publication Date
CN107392111A CN107392111A (en) 2017-11-24
CN107392111B true CN107392111B (en) 2020-06-23

Family

ID=60333633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710501289.9A Active CN107392111B (en) 2017-06-27 2017-06-27 Advertisement identification method and device

Country Status (1)

Country Link
CN (1) CN107392111B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108710458B (en) * 2018-05-09 2020-10-30 维沃移动通信有限公司 Split screen control method and terminal equipment
CN109151496B (en) * 2018-07-25 2021-04-23 维沃移动通信有限公司 Music playing method and mobile terminal
CN109145919A (en) * 2018-08-20 2019-01-04 贵州宜行智通科技有限公司 A kind of uncivil poster detection method and device
CN109089146A (en) * 2018-08-30 2018-12-25 维沃移动通信有限公司 A kind of method and terminal device controlling video playing
CN109618230B (en) * 2018-12-21 2022-03-11 深圳Tcl数字技术有限公司 Advertisement filtering method, intelligent terminal and computer readable storage medium
CN109977779B (en) * 2019-02-26 2021-04-23 北京交通大学 Method for identifying advertisement inserted in video creative
CN111988651A (en) * 2019-05-22 2020-11-24 奇酷互联网络科技(深圳)有限公司 Video playing method, mobile terminal and wearable device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103594A (en) * 2009-12-22 2011-06-22 北京大学 Character data recognition and processing method and device
CN102375991A (en) * 2010-08-24 2012-03-14 北京中星微电子有限公司 Classifier training method and device, and character recognition method and device
CN102722707A (en) * 2012-06-11 2012-10-10 复旦大学 License plate character segmentation method based on connected region and gap model
CN104202668A (en) * 2014-09-09 2014-12-10 安一恒通(北京)科技有限公司 Filtering method and device for video advertisement

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103594A (en) * 2009-12-22 2011-06-22 北京大学 Character data recognition and processing method and device
CN102375991A (en) * 2010-08-24 2012-03-14 北京中星微电子有限公司 Classifier training method and device, and character recognition method and device
CN102722707A (en) * 2012-06-11 2012-10-10 复旦大学 License plate character segmentation method based on connected region and gap model
CN104202668A (en) * 2014-09-09 2014-12-10 安一恒通(北京)科技有限公司 Filtering method and device for video advertisement

Also Published As

Publication number Publication date
CN107392111A (en) 2017-11-24

Similar Documents

Publication Publication Date Title
CN107392111B (en) Advertisement identification method and device
CN109582463B (en) Resource allocation method, device, terminal and storage medium
CN106911943B (en) Video display method and device and storage medium
CN106454434B (en) Bullet screen playing method and device
US20050262548A1 (en) Terminal device, contents delivery system, information output method and information output program
US11178450B2 (en) Image processing method and apparatus in video live streaming process, and storage medium
WO2015001437A1 (en) Image processing method and apparatus, and electronic device
CN108236784B (en) Model training method and device, storage medium and electronic device
CN103136746A (en) Image processing device and image processing method
US10701301B2 (en) Video playing method and device
CN111954052A (en) Method for displaying bullet screen information, computer equipment and readable storage medium
CN108304368B (en) Text information type identification method and device, storage medium and processor
EP4345591A1 (en) Prop processing method and apparatus, and device and medium
CN107911280A (en) Information push method, intelligent terminal and computer-readable recording medium
CN111432274A (en) Video processing method and device
CN112163993A (en) Image processing method, device, equipment and storage medium
CN114020196A (en) Video interaction method, device, storage medium and computer program product
CN107291468B (en) Method for playing power-on/power-off animation, terminal and computer readable storage medium
CN104159158A (en) Hotspot playing method and device of video file
CN108572985B (en) Page display method and device
CN111954041A (en) Video loading method, computer equipment and readable storage medium
CN110636361B (en) Intelligent mobile phone APP setting platform, method and storage medium
CN115690664A (en) Image processing method and device, electronic equipment and storage medium
CN105491400B (en) Video stream downloading method and device
CN111954082B (en) Mask file structure, mask file reading method, computer device and 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
CB02 Change of applicant information

Address after: 266555 Qingdao economic and Technological Development Zone, Shandong, Hong Kong Road, No. 218

Applicant after: Hisense Video Technology Co., Ltd

Address before: 266555 Qingdao economic and Technological Development Zone, Shandong, Hong Kong Road, No. 218

Applicant before: HISENSE ELECTRIC Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant