CN109040784A - Commercial detection method and device - Google Patents

Commercial detection method and device Download PDF

Info

Publication number
CN109040784A
CN109040784A CN201811076425.5A CN201811076425A CN109040784A CN 109040784 A CN109040784 A CN 109040784A CN 201811076425 A CN201811076425 A CN 201811076425A CN 109040784 A CN109040784 A CN 109040784A
Authority
CN
China
Prior art keywords
video frame
detected
hash value
perceptual hash
advertising copy
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811076425.5A
Other languages
Chinese (zh)
Inventor
李琢
王克
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Blue Topology Polytron Technologies Inc
Original Assignee
Beijing Blue Topology Polytron Technologies Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Blue Topology Polytron Technologies Inc filed Critical Beijing Blue Topology Polytron Technologies Inc
Priority to CN201811076425.5A priority Critical patent/CN109040784A/en
Publication of CN109040784A publication Critical patent/CN109040784A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/23418Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
    • 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/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81Monomedia components thereof
    • H04N21/812Monomedia components thereof involving advertisement data

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The present invention relates to purposes of commercial detection technical field, a kind of commercial detection method and device are provided.Wherein, commercial detection method comprises determining that video frame to be detected;Calculate the perceptual hash value of the video frame to be detected;Judge the perceptual hash value of the video frame to be detected, if match with the perceptual hash value of the video frame of the advertising copy in advertising copy library;If matching, the advertising copy where video frame that perceptual hash value matches is determined as the corresponding advertisement of the video frame to be detected.This method matches to detect whether video frame belongs to advertisement by perceptual hash value, and detection efficiency is high, affected by noise small, can effectively meet the needs of related services such as monitoring of the advertisement.

Description

Commercial detection method and device
Technical field
The present invention relates to purposes of commercial detection technical fields, in particular to a kind of commercial detection method and device.
Background technique
With gradually deeply developing for digital technology, public media video and audio resource is more and more abundant, the broadcast electricity of various regions Television stations, content supplier also sharply increase, how from the video/audio of TV programme, using the means of modernization, quickly Advertisement video content is effectively detected out, has become the important topic of monitoring of the advertisement industry.
However, commercial detection method in the prior art is perhaps excessively complicated or more sensitive to noise, can not expire Demand of the sufficient monitoring of the advertisement business in terms of high efficiency, real-time.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of commercial detection method and device, to solve the above technical problems.
To achieve the above object, the invention provides the following technical scheme:
In a first aspect, the embodiment of the present invention provides a kind of commercial detection method, comprising:
Determine video frame to be detected;
Calculate the perceptual hash value of video frame to be detected;
Judge the perceptual hash value of video frame to be detected, if the sense with the video frame of the advertising copy in advertising copy library Know that cryptographic Hash matches;
If matching, the advertising copy where video frame that perceptual hash value matches is determined as video frame pair to be detected The advertisement answered.
The above method matches to detect whether video frame belongs to advertisement by perceptual hash value, and detection efficiency is high, by noise It influences small, can effectively meet the needs of related services such as monitoring of the advertisement.This method can be used for detecting television program video In advertisement, can be used for detecting the advertisement in other videos, the detection of other content can also be generalized to, be not limited to advertisement Detection.
With reference to first aspect, in the first possible implementation of the first aspect, perceptual hash value is divided into multiple areas Section, judges the perceptual hash value of video frame to be detected, if the perception with the video frame of the advertising copy in advertising copy library is breathed out Uncommon value matches, comprising:
Judge any zone in the perceptual hash value of video frame to be detected, if with the advertising copy in advertising copy library Video frame perceptual hash value in the section of same position match;
If matching, it is determined that the perceptual hash value of video frame to be detected, the view with the advertising copy in advertising copy library The perceptual hash value of frequency frame matches, if not matching that, it is determined that the perceptual hash value of video frame to be detected, with advertising copy library In the perceptual hash value of video frame of advertising copy do not match that.
Perceptual hash value is divided into multiple sections and matched respectively by above-mentioned implementation, and perceptual hash value can be improved Matched efficiency.
The possible implementation of with reference to first aspect the first, in second of possible implementation of first aspect In, judge any zone in the perceptual hash value of video frame to be detected, if the view with the advertising copy in advertising copy library The section of same position matches in the perceptual hash value of frequency frame, comprising:
Judge any zone in the perceptual hash value of video frame to be detected, the view with the advertising copy in advertising copy library Whether the Hamming distance in the perceptual hash value of frequency frame between the section of same position is less than preset threshold;
If being less than preset threshold, it is determined that any zone in the perceptual hash value of video frame to be detected, with advertising copy The section of same position matches in the perceptual hash value of the video frame of advertising copy in library;
If being not less than preset threshold, it is determined that any zone in the perceptual hash value of video frame to be detected, with advertisement sample The section of same position does not match that in the perceptual hash value of the video frame of advertising copy in this library.
With reference to first aspect, in a third possible implementation of the first aspect, determine video frame to be detected it Afterwards, before the perceptual hash value for calculating video frame to be detected, method further include:
Video frame to be detected is pre-processed, the region in video frame to be detected comprising interference information is cropped.
Cutting processing is carried out to video frame to be detected, while the video frame of the advertising copy in advertising copy library is also carried out Cutting processing, then Hash values match is carried out, due to eliminating interference information, matching result is more acurrate.
The third possible implementation with reference to first aspect, in the 4th kind of possible implementation of first aspect In, interference information includes at least one of black surround, subtitle, TV logo information.
With reference to first aspect, in the fifth possible implementation of the first aspect, the sense of video frame to be detected is calculated Know cryptographic Hash, comprising:
Video frame to be detected is subjected to diminution processing;
Grayscale image is converted by the video frame to be detected after diminution;
Discrete cosine transform (Discrete Cosine Transform, DCT) is carried out to grayscale image, obtains DCT matrix;
Calculate the mean value of the DCT value of all pixels in DCT matrix;
Judge whether the DCT value of each pixel in DCT matrix is less than mean value, if being less than mean value, determines perceptual hash value In position corresponding with the pixel be 0, if more than mean value, determine in perceptual hash value that position corresponding with the pixel is 1.
Perceptual hash algorithm is calculated based on the low frequency mean value of image, and calculation method is simple, the scaling of image, brightness, Influence of the change of contrast or color to calculated perceptual hash value is all little, therefore is used for purposes of commercial detection, can Obtain preferable effect.
With reference to first aspect or first aspect the first to any one possible implementation in the 5th kind, In 6th kind of possible implementation of one side, video frame to be detected is determined, comprising:
Obtain video data packet to be detected;
The key frame in video data packet to be detected is extracted, decoded key frame is determined as video frame to be detected.
Key frame (also referred to as intra prediction frame, I frame), forward predicted frame (P frame) and double are generally comprised in video data packet To prediction frame (B frame), wherein key frame decrement is smaller, and the information content for including is more, and decoding is relatively easy, and adjacent view Similarity between frequency frame is very high, therefore can greatly improve detection efficiency, while base for key frame as video frame to be detected This does not influence the accuracy of testing result.
The 6th kind of possible implementation with reference to first aspect, in the 7th kind of possible implementation of first aspect In, obtain video data packet to be detected, comprising:
Extract transmitting stream (Transport Stream, TS) data packet in the source data of TV programme;
TS data packet is parsed according to pre-arranged code standard, obtains the TV program information in TS data packet;
The program identification for needing to carry out the TV programme of purposes of commercial detection is determined based on TV program information;
Video data packet to be detected is obtained from TS data packet based on program identification.
The 7th kind of possible implementation with reference to first aspect, in the 8th kind of possible implementation of first aspect In, extract the transmitting stream TS data packet in the source data of TV programme, comprising:
Determine the data type of source data;
If data type is real-time IP data stream, it is based on IP agreement, by the TS data in the IP data payload obtained in real time It is determined as TS data packet;
If data type is video and audio file, it is based on file sharing protocol, by the video and audio TS in the shared disk of reading File is determined as TS data packet.
At least there are two types of presentation modes for source data, and one is streamings, and one is file-types, two kinds in above-mentioned implementation Mode can be handled.
Second aspect, the embodiment of the present invention provide a kind of purposes of commercial detection device, comprising:
Video frame determining module to be detected, for determining video frame to be detected;
Perceptual hash value computing module, for calculating the perceptual hash value of video frame to be detected;
Matching judgment module, for judging the perceptual hash value of video frame to be detected, if with it is wide in advertising copy library The perceptual hash value for accusing the video frame of sample matches;
Matching result determining module, if the advertisement sample for matching, where the video frame that perceptual hash value is matched Originally it is determined as the corresponding advertisement of video frame to be detected.
The third aspect, the embodiment of the present invention provide a kind of computer storage medium, meter are stored in computer storage medium Calculation machine program instruction when computer program instructions are read and run by the processor of computer, executes first aspect or first party The step of method that the possible embodiment of any one of face provides.
Fourth aspect, the embodiment of the present invention provide a kind of electronic equipment, including processor and computer storage medium, meter It is stored with computer program instructions in calculation machine storage medium, when computer program instructions are read out by the processor and run, executes the The step of method that the possible embodiment of any one of one side or first aspect provides.
To enable above-mentioned purpose of the invention, technical scheme and beneficial effects to be clearer and more comprehensible, special embodiment below, and Cooperate appended attached drawing, is described in detail below.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only certain embodiments of the present invention, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 shows a kind of structural block diagram that can be applied to the electronic equipment in the embodiment of the present invention;
Fig. 2 shows the flow charts for the commercial detection method that first embodiment of the invention provides;
Fig. 3 shows the flow chart of the step S11 of the commercial detection method of first embodiment of the invention offer;
Fig. 4 shows the flow chart of the commercial detection method of second embodiment of the invention offer;
Fig. 5 shows the functional block diagram of the purposes of commercial detection device of third embodiment of the invention offer.
Specific embodiment
Below in conjunction with attached drawing in the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete Ground description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Usually exist The component of the embodiment of the present invention described and illustrated in attached drawing can be arranged and be designed with a variety of different configurations herein.Cause This, is not intended to limit claimed invention to the detailed description of the embodiment of the present invention provided in the accompanying drawings below Range, but it is merely representative of selected embodiment of the invention.Based on the embodiment of the present invention, those skilled in the art are not doing Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.Meanwhile of the invention In description, term " first ", " second " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
Fig. 1 shows the structural schematic diagram of electronic equipment 100 provided in an embodiment of the present invention.Referring to Fig.1, electronic equipment 100 include memory 102, storage control 104, one or more (one is only shown in figure) processors 106, Peripheral Interface 108, radio-frequency module 110, audio-frequency module 112, display module 114 etc..These components pass through one or more communication bus/signal Line 116 mutually communicates.
Memory 102 can be used for storing software program and module, as in the embodiment of the present invention commercial detection method and Corresponding program instruction/the module of device, the software program and module that processor 106 is stored in memory 102 by operation, Thereby executing various function application and data processing, such as commercial detection method provided in an embodiment of the present invention and device.
Memory 102 may be, but not limited to, random access memory (Random Access Memory, RAM), only It reads memory (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM), Electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only Memory, EEPROM) Deng.Processor 106 and other possible components can carry out the access of memory 102 under the control of storage control 104.
Processor 106 can be a kind of IC chip, the processing capacity with signal.It specifically can be general procedure Device, including central processing unit (Central Processing Unit, CPU), micro-control unit (Micro Controller Unit, MCU), network processing unit (Network Processor, NP) or other conventional processors;It can also be dedicated processes Device, including digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuits, ASIC), field programmable gate array (Field Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hardware components.It can be with Realize or execute disclosed each method, step and the logic diagram in the embodiment of the present invention.
Various input/output devices are couple processor 106 and memory 102 by Peripheral Interface 108.In some implementations In example, Peripheral Interface 108, processor 106 and storage control 104 can be realized in one single chip.In some other reality In example, they can be realized by independent chip respectively.
Radio-frequency module 110 is used to receive and transmit electromagnetic wave, realizes the mutual conversion of electromagnetic wave and electric signal, thus with Communication network or other equipment are communicated.
Audio-frequency module 112 provides a user audio interface, may include one or more microphones, one or more raises Sound device and voicefrequency circuit.
Display module 114 provides a display interface between electronic equipment 100 and user.Specifically, display module 114 Video output is shown to user, and the content of these videos output may include text, figure, video and any combination thereof.
It is appreciated that structure shown in FIG. 1 is only to illustrate, electronic equipment 100 may also include it is more than shown in Fig. 1 or Less component, or with the configuration different from shown in Fig. 1.Each component shown in Fig. 1 can using hardware, software or its Combination is realized.In the embodiment of the present invention, electronic equipment 100 can be server, personal computer, Intelligent mobile equipment, intelligence It can the equipment with calculation processing power such as wearable device and intelligent vehicle-carried equipment.
First embodiment
Fig. 2 shows the flow charts for the commercial detection method that first embodiment of the invention provides.Referring to Fig.1, this method packet It includes:
S10: the processor of electronic equipment determines video frame to be detected.
Video frame to be detected can be any one frame in video to be detected, typically, in the video after compressed encoding There are three kinds of video frames, are key frame (I frame), forward predicted frame (P frame) and bi-directional predicted frames (B frame) respectively.It is wherein crucial Frame decrement is smaller, and the information content for including is more, and in view of the similarity between adjacent video frame is very high, therefore the It, can be using key frame as video frame to be detected in a kind of embodiment of one embodiment.Due to key frame quantity relatively It is few, and because using only intra prediction in coding, decoding is relatively easy to, therefore using key frame as video to be detected Frame can significantly improve purposes of commercial detection efficiency, while have substantially no effect on the accuracy of testing result.
Certainly in other embodiments, by one of above-mentioned three kinds of video frames or a variety of conducts video frame to be detected It is possible.
S11: the processor of electronic equipment calculates the perceptual hash value of video frame to be detected.
The perceptual hash value for calculating video frame to be detected, can use, but be not limited to using following calculation method:
Fig. 3 shows the flow chart of the step S11 of the commercial detection method of first embodiment of the invention offer.Reference Fig. 3, Step S11 may include:
S110: video frame to be detected is carried out diminution processing by the processor of electronic equipment.
Diminution handles the high frequency detail data that can remove image, retains the key messages such as light and shade, the structure of image, simultaneously Reduce the operand of subsequent DCT operation.Meanwhile the perceptual hash value characteristic insensitive to zoom operations is determined and is carried out at diminution Reason is feasible.For example, original video frame to be detected can be reduced into the image of 8x8 resolution ratio, it is reduced into other certainly Resolution ratio is also possible.
S111: the video frame to be detected after diminution is converted grayscale image by the processor of electronic equipment.
For example, formula Gray=R*0.299+G* can be used for the case where video frame to be detected is RGB image 0.587+B*0.114 is converted, wherein Gray indicates the gray value of pixel after conversion, and R, G, B respectively indicate conversion preceding pixel Red channel, green channel, blue channel value.
S112: the processor of electronic equipment carries out DCT to grayscale image, obtains DCT matrix.
For example, for the image of 8x8 resolution ratio two-dimensional dct can be carried out by following equation, and then obtain the DCT of 8x8 Matrix, the pixel value of each pixel is known as the DCT value of the pixel in DCT matrix.
S113: the processor of electronic equipment calculates the mean value of the DCT value of all pixels in DCT matrix.
S114: the processor of electronic equipment judges whether the DCT value of each pixel in DCT matrix is less than mean value, if small In mean value, determine in perceptual hash value that position corresponding with the pixel is 0, if more than mean value, determine in perceptual hash value with the picture The corresponding position of element is 1.
For example, for the DCT matrix of 8x8, perceptual hash value totally 64, in each of these corresponding DCT matrix One pixel, and calculated and obtained by the method in step S114.
By step S111 to step S114 it is found that perceptual hash value is calculated based on the low frequency mean value of image, embody The main feature of image, calculation method is simple, and the scaling of image, the change of brightness, contrast or color is to calculating The influence of perceptual hash value out is all little, therefore can effectively characterize the main feature of video frame to be detected.
It can also include to be checked before step S11 after step S10 in a kind of embodiment of first embodiment It surveys video frame and carries out pretreated step, pretreatment here is primarily referred to as cropping in video frame to be detected comprising interference information Region.
Wherein, interference information may include at least one of black surround, subtitle, TV logo information.Interference information may Have an adverse effect to follow-up l detecting step.For example, some advertisement when some TV station plays, can fold on its picture It is powered on the logo of television stations, causes advertisement picture and original advertising copy inconsistent.In another example playing high definition on Standard Definition Television When TV programme, due to the difference of resolution ratio, there can be black surround in video, but may and this be not present in original advertising copy A little black surrounds.
In pre-treatment step, these interference informations are got rid of by cutting method, subsequent progress cryptographic Hash can be made The result matched is more accurate.It should be understood that it is able to confirm that in video frame to be detected that there is no interference informations if realized, it can also Not pre-processed to video frame to be detected.
It is exemplified below, it is assumed that video frame to be detected is the video frame in Standard Definition Television program video, original resolution Rate is 720x576.Can be cut to 520x376 (resolution ratio for referring to remaining area after cutting), avoid subtitle, logo it is dry It disturbs.If there are black surrounds for the left and right of video frame to be detected, it can be further cut to 390x376;If video to be detected There is black surround up and down, can be further cut to 520x282;If existing up and down for video frame to be detected is black Side can be further cut to 390x282.It is appreciated that above-mentioned method of cutting out and specific value are merely illustrative, it is specific to cut out The process of cutting can determine according to actual needs.
It may be noted that once video to be detected is pre-processed, then the advertising copy in advertising copy library will also carry out Same pretreatment, to ensure the validity of calculated perceptual hash value in step S12.
S12: the processor of electronic equipment judges the perceptual hash value of video frame to be detected, if in advertising copy library The perceptual hash value of the video frame of advertising copy matches.
S13: the processor of electronic equipment by the advertising copy where video frame that perceptual hash value matches be determined as to Detect the corresponding advertisement of video frame.
Step S12 and step S13 is contacted more closely, combines two steps be illustrated below.
Advertising copy library is usually the set for the advertising copy that may be detected, can be to every before step S12 execution Each video frame in a advertising copy also uses the method in similar step S11 to calculate its perceptual hash value.For example, for The case where video frame to be detected is key frame, each advertising copy can also extract key frame and to calculate each key frame corresponding Perceptual hash value forms perceptual hash value sequence.
In step s 12, each perception in the perceptual hash value of video frame to be detected and above-mentioned sequence of hash values is breathed out Uncommon value successively compares, if matching with one of those, thens follow the steps S13, and the matched perceptual hash value is corresponding Video frame where advertising copy be determined as the corresponding advertisement of video frame to be detected, that is, detect an advertisement, no longer need to after Remaining perceptual hash value in continuous comparison sequence of hash values.If the not no perceptual hash with video frame to be detected in sequence of hash values It is worth matched perceptual hash value, then shows that video frame to be detected is not the video frame in advertisement, that is, advertisement is not detected.
Judge whether two perceptual hash values match, the Hamming distance between two perceptual hash values can be calculated, if It less than some preset threshold, then matches, otherwise mismatches.Certainly, the matching of two perceptual hash values can also pass through its other party Formula is defined.
In a kind of embodiment of first embodiment, perceptual hash value can also be divided into multiple sections, for example, right In 64 perceptual hash values, 4 sections, each section 16 can be divided into.For the perceptual hash of video frame to be detected Value, and adopted based on each perceptual hash value in the calculated perceptual hash value sequence of advertising copy in advertising copy library Section partition is carried out in the same way.
In this embodiment, by each sense in the perceptual hash value of video frame to be detected and above-mentioned sequence of hash values When knowing that cryptographic Hash compares, first section of two perceptual hash values can be first compared by the way of by section comparison, Such as first 16, without continuing to compare if matching, if mismatching second section for continuing to compare two perceptual hash values, Until all section comparisons finish.The section of any one group of corresponding position matches, and can think two perceptual hash values Match, while not having to be further continued for comparing remaining section.
Judge whether two perceptual hash values match in the section of same position, the Hamming between two sections can be calculated Distance is matched, is otherwise mismatched if being less than some preset threshold.Certainly, the matching of two sections can also pass through its other party Formula is defined.According to long-term practice as a result, for perceptual hash value be 64, each section be 16 the case where, preset threshold Value can take 5, take other values also possible certainly.
In this embodiment, it perceptual hash value is divided into multiple sections carries out matched side respectively due to using Formula so as to improve the matched efficiency of perceptual hash value, and then improves the speed of purposes of commercial detection.
In conclusion the commercial detection method that first embodiment of the invention provides matches to detect view by perceptual hash value Whether frequency frame belongs to advertisement, and detection efficiency is high, and robustness is good, can effectively meet the need of the related services such as monitoring of the advertisement It asks.This method can be used for detecting the advertisement in television program video, can be used for detecting the advertisement in other videos, may be used also To be generalized to the detection of other content, it is not limited to purposes of commercial detection.
Second embodiment
Fig. 4 shows the flow chart of the commercial detection method of second embodiment of the invention offer.It is wide in second embodiment It accuses detection method and is considered as the commercial detection method of first embodiment offer in terms of the advertisement in detection television program video Concrete application.Referring to Fig. 4, this method comprises:
Step S20: the processor of electronic equipment extracts the TS data packet in the source data of TV programme.
At least there are two types of data types for the source data of TV programme: one is real-time IP data stream (TS Over IP), separately One is video and audio files.The data type that can determine source data first, is then based on different data types and takes difference Operation.
If data type is real-time IP data stream, it is based on IP agreement, by the TS number in the IP data payload obtained in real time According to being determined as TS data packet;If data type is video and audio file, it is based on file sharing protocol, it will be in the shared disk of reading Video and audio TS file is determined as TS data packet.
Step S21: the processor of electronic equipment parses TS data packet according to pre-arranged code standard, obtains TS data TV program information in packet.
Here pre-arranged code standard may be, but not limited to, country of People's Republic of China (PRC) mark " information technology motion diagram The universal coding of picture and its audio signal " (each revision including the standard).TS data are parsed based on the coding standard Packet demultiplexes TV programme therein, obtains the TV program information for including in TS data packet.
Step S22: the processor of electronic equipment determines the TV Festival for needing to carry out purposes of commercial detection based on TV program information Purpose program identification.
It include the program identification (Program ID, PID) of each TV programme in TV program information, for distinguishing difference TV programme.If it is desired to carry out purposes of commercial detection to some TV programme, it is first determined the corresponding program mark of the TV programme Know.
Step S23: the processor of electronic equipment is based on program identification and obtains video data packet to be detected from TS data packet.
All views corresponding with the program identification of TV programme to be detected in video data packet to be detected, that is, TS data packet Frequency evidence.
Step S24: the processor of electronic equipment extracts the key frame in video data packet to be detected, by decoded key Frame is determined as video frame to be detected.
Typically, include multiple key frames in video data packet to be detected, constitute a keyframe sequence, it can should Each key frame in keyframe sequence is used as video frame to be detected, in some embodiments, also can choose therein Some key frames are as video frame to be detected.
Step S25: the processor of electronic equipment carries out advertisement by the matching of perceptual hash value to each video frame to be detected Detection.
Commercial detection method in first embodiment can be used to each video frame progress purposes of commercial detection to be detected, Elaboration is not repeated herein.After step S25 has been executed, the existing advertisement in video data packet to be detected has been marked, The number that can be played on this basis to advertisement, the frequency etc. that different advertisements occur is counted, to realize monitoring of the advertisement Business demand.
The commercial detection method has real-time good, the accurate advantage of testing result.
3rd embodiment
Fig. 5 shows the functional block diagram of the purposes of commercial detection device 200 of third embodiment of the invention offer.Referring to Fig. 5, originally The purposes of commercial detection device 200 that invention 3rd embodiment provides, including video frame determining module 210 to be detected, perceptual hash value meter Calculate module 220, matching judgment module 230 and matching result determining module 240.
Wherein, video frame determining module 210 to be detected is for determining video frame to be detected;
Perceptual hash value computing module 220 is used to calculate the perceptual hash value of video frame to be detected;
Matching judgment module 230 is used to judge the perceptual hash value of video frame to be detected, if in advertising copy library The perceptual hash value of the video frame of advertising copy matches;
If matching result determining module 240 is for matching, the advertisement where the video frame that perceptual hash value is matched Sample is determined as the corresponding advertisement of video frame to be detected.
The technical effect of the purposes of commercial detection device 200 that third embodiment of the invention provides, realization principle and generation is preceding It states in embodiment and has illustrated, to briefly describe, Installation practice part does not refer to place, can refer in preceding method embodiment Corresponding contents.
Fourth embodiment
Fourth embodiment of the invention provides a kind of computer storage medium, and computer journey is stored in computer storage medium Sequence instruction when computer program instructions are read and run by the processor of computer, is executed and is provided in first embodiment of the invention Method the step of.The computer storage medium can be implemented as, but be not limited to memory 102 shown in fig. 1.
5th embodiment
Fifth embodiment of the invention provides a kind of electronic equipment, including processor and computer storage medium, computer It is stored with computer program instructions in storage medium and executes the present invention when computer program instructions are read out by the processor and run The step of method provided in first embodiment.The electronic equipment can be implemented as, but be not limited to electronic equipment shown in fig. 1 100。
It should be noted that all the embodiments in this specification are described in a progressive manner, each embodiment weight Point explanation is the difference from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For device class embodiment, since it is basically similar to the method embodiment, so being described relatively simple, related place ginseng See the part explanation of embodiment of the method.
In several embodiments provided herein, it should be understood that disclosed device and method can also pass through it Its mode is realized.The apparatus embodiments described above are merely exemplary, for example, the flow chart and block diagram in attached drawing are aobvious The device of multiple embodiments according to the present invention, architectural framework in the cards, the function of method and computer program product are shown It can and operate.In this regard, each box in flowchart or block diagram can represent one of a module, section or code Point, a part of the module, section or code includes one or more for implementing the specified logical function executable Instruction.It should also be noted that function marked in the box can also be attached to be different from some implementations as replacement The sequence marked in figure occurs.For example, two continuous boxes can actually be basically executed in parallel, they sometimes may be used To execute in the opposite order, this depends on the function involved.It is also noted that each of block diagram and or flow chart The combination of box in box and block diagram and or flow chart can be based on the defined function of execution or the dedicated of movement The system of hardware is realized, or can be realized using a combination of dedicated hardware and computer instructions.
In addition, each functional module in each embodiment of the present invention can integrate one independent portion of formation together Point, it is also possible to modules individualism, an independent part can also be integrated to form with two or more modules.
It, can be with if the function is realized and when sold or used as an independent product in the form of software function module It is stored in computer-readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words to existing Having the part for the part or the technical solution that technology contributes can be embodied in the form of software products, the computer Software product is stored in a storage medium, including some instructions are used so that computer equipment executes each embodiment institute of the present invention State all or part of the steps of method.Computer equipment above-mentioned includes: personal computer, server, mobile device, intelligently wears The various equipment with execution program code ability such as equipment, the network equipment, virtual unit are worn, storage medium above-mentioned includes: U Disk, mobile hard disk, read-only memory, random access memory, magnetic disk, tape or CD etc. are various to can store program code Medium.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.It should also be noted that similar label and letter exist Similar terms are indicated in following attached drawing, therefore, once being defined in a certain Xiang Yi attached drawing, are then not required in subsequent attached drawing It is further defined and explained.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.

Claims (10)

1. a kind of commercial detection method characterized by comprising
Determine video frame to be detected;
Calculate the perceptual hash value of the video frame to be detected;
Judge the perceptual hash value of the video frame to be detected, if the sense with the video frame of the advertising copy in advertising copy library Know that cryptographic Hash matches;
If matching, the advertising copy where video frame that perceptual hash value matches is determined as the video frame pair to be detected The advertisement answered.
2. commercial detection method according to claim 1, which is characterized in that the perceptual hash value is divided into multiple sections, The perceptual hash value of the judgement video frame to be detected, if the sense with the video frame of the advertising copy in advertising copy library Know that cryptographic Hash matches, comprising:
Judge any zone in the perceptual hash value of the video frame to be detected, if with the advertising copy in advertising copy library Video frame perceptual hash value in the section of same position match;
If matching, it is determined that the perceptual hash value of the video frame to be detected, the view with the advertising copy in advertising copy library The perceptual hash value of frequency frame matches, if not matching that, it is determined that the perceptual hash value of the video frame to be detected, with advertisement sample The perceptual hash value of the video frame of advertising copy in this library does not match that.
3. commercial detection method according to claim 2, which is characterized in that the sense of the judgement video frame to be detected Know any zone in cryptographic Hash, if with same position in the perceptual hash value of the video frame of the advertising copy in advertising copy library The section set matches, comprising:
Judge any zone in the perceptual hash value of the video frame to be detected, the view with the advertising copy in advertising copy library Whether the Hamming distance in the perceptual hash value of frequency frame between the section of same position is less than preset threshold;
If being less than the preset threshold, it is determined that any zone in the perceptual hash value of the video frame to be detected, with advertisement The section of same position matches in the perceptual hash value of the video frame of advertising copy in sample database;
If being not less than the preset threshold, it is determined that any zone in the perceptual hash value of the video frame to be detected, and it is wide The section for accusing same position in the perceptual hash value of the video frame of the advertising copy in sample database does not match that.
4. the commercial detection method described in any one of according to claim 1, which is characterized in that in determination video to be detected After frame, before the perceptual hash value for calculating the video frame to be detected, the method also includes:
The video frame to be detected is pre-processed, the region in the video frame to be detected comprising interference information is cropped.
5. commercial detection method according to claim 4, which is characterized in that the interference information includes black surround, subtitle, electricity At least one of television stations mark information.
6. commercial detection method according to claim 1, which is characterized in that the sense for calculating the video frame to be detected Know cryptographic Hash, comprising:
The video frame to be detected is subjected to diminution processing;
Grayscale image is converted by the video frame to be detected after diminution;
Discrete cosine transform is carried out to the grayscale image, obtains DCT matrix;
Calculate the mean value of the DCT value of all pixels in the DCT matrix;
Judge whether the DCT value of each pixel in the DCT matrix is less than the mean value, if being less than the mean value, determines institute Stating in perceptual hash value position corresponding with the pixel is 0, if more than the mean value, determine in the perceptual hash value with the pixel Corresponding position is 1.
7. commercial detection method according to claim 1 to 6, which is characterized in that the determination view to be detected Frequency frame, comprising:
Obtain video data packet to be detected;
The key frame in the video data packet to be detected is extracted, decoded key frame is determined as the video to be detected Frame.
8. commercial detection method according to claim 7, which is characterized in that described to obtain video data packet to be detected, packet It includes:
Extract the transmitting stream TS data packet in the source data of TV programme;
The TS data packet is parsed according to pre-arranged code standard, obtains the TV program information in the TS data packet;
The program identification for needing to carry out the TV programme of purposes of commercial detection is determined based on the TV program information;
The video data packet to be detected is obtained from the TS data packet based on the program identification.
9. commercial detection method according to claim 8, which is characterized in that in the source data for extracting TV programme Transmitting stream TS data packet, comprising:
Determine the data type of the source data;
If the data type is real-time IP data stream, it is based on IP agreement, by the TS data in the IP data payload obtained in real time It is determined as the TS data packet;
If the data type is video and audio file, it is based on file sharing protocol, by the video and audio TS in the shared disk of reading File is determined as the TS data packet.
10. a kind of purposes of commercial detection device characterized by comprising
Video frame determining module to be detected, for determining video frame to be detected;
Perceptual hash value computing module, for calculating the perceptual hash value of the video frame to be detected;
Matching judgment module, for judging the perceptual hash value of the video frame to be detected, if with it is wide in advertising copy library The perceptual hash value for accusing the video frame of sample matches;
Matching result determining module, if the advertising copy where the video frame that perceptual hash value matches is true for matching It is set to the corresponding advertisement of the video frame to be detected.
CN201811076425.5A 2018-09-14 2018-09-14 Commercial detection method and device Pending CN109040784A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811076425.5A CN109040784A (en) 2018-09-14 2018-09-14 Commercial detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811076425.5A CN109040784A (en) 2018-09-14 2018-09-14 Commercial detection method and device

Publications (1)

Publication Number Publication Date
CN109040784A true CN109040784A (en) 2018-12-18

Family

ID=64622391

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811076425.5A Pending CN109040784A (en) 2018-09-14 2018-09-14 Commercial detection method and device

Country Status (1)

Country Link
CN (1) CN109040784A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110830836A (en) * 2019-11-18 2020-02-21 电子科技大学 Video advertisement broadcasting monitoring method
CN110969202A (en) * 2019-11-28 2020-04-07 上海观安信息技术股份有限公司 Portrait collection environment verification method and system based on color component and perceptual hash algorithm
CN111898587A (en) * 2020-08-14 2020-11-06 广州盈可视电子科技有限公司 Video coding processing method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101162470A (en) * 2007-11-16 2008-04-16 北京交通大学 Video frequency advertisement recognition method based on layered matching
CN102905189A (en) * 2011-07-25 2013-01-30 北京国微集成技术有限公司 Multi-program transport stream separating method and multi-program transport stream separating device
US8494234B1 (en) * 2007-03-07 2013-07-23 MotionDSP, Inc. Video hashing system and method
CN103984776A (en) * 2014-06-05 2014-08-13 北京奇虎科技有限公司 Repeated image identification method and image search duplicate removal method and device
CN105718861A (en) * 2016-01-15 2016-06-29 北京市博汇科技股份有限公司 Method and device for identifying video streaming data category
CN107657629A (en) * 2017-10-27 2018-02-02 广东工业大学 The tracking and tracking system of a kind of target

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8494234B1 (en) * 2007-03-07 2013-07-23 MotionDSP, Inc. Video hashing system and method
CN101162470A (en) * 2007-11-16 2008-04-16 北京交通大学 Video frequency advertisement recognition method based on layered matching
CN102905189A (en) * 2011-07-25 2013-01-30 北京国微集成技术有限公司 Multi-program transport stream separating method and multi-program transport stream separating device
CN103984776A (en) * 2014-06-05 2014-08-13 北京奇虎科技有限公司 Repeated image identification method and image search duplicate removal method and device
CN105718861A (en) * 2016-01-15 2016-06-29 北京市博汇科技股份有限公司 Method and device for identifying video streaming data category
CN107657629A (en) * 2017-10-27 2018-02-02 广东工业大学 The tracking and tracking system of a kind of target

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110830836A (en) * 2019-11-18 2020-02-21 电子科技大学 Video advertisement broadcasting monitoring method
CN110830836B (en) * 2019-11-18 2020-10-27 电子科技大学 Video advertisement broadcasting monitoring method
CN110969202A (en) * 2019-11-28 2020-04-07 上海观安信息技术股份有限公司 Portrait collection environment verification method and system based on color component and perceptual hash algorithm
CN110969202B (en) * 2019-11-28 2023-12-19 上海观安信息技术股份有限公司 Portrait acquisition environment verification method and system based on color component and perceptual hash algorithm
CN111898587A (en) * 2020-08-14 2020-11-06 广州盈可视电子科技有限公司 Video coding processing method and device

Similar Documents

Publication Publication Date Title
Du et al. Server-driven video streaming for deep learning inference
Zhang et al. Efficient video frame insertion and deletion detection based on inconsistency of correlations between local binary pattern coded frames
CN101374234B (en) Method and apparatus for monitoring video copy base on content
US8494234B1 (en) Video hashing system and method
Shi et al. A fast and robust key frame extraction method for video copyright protection
US20110142348A1 (en) Signature Derivation for Images
CN109040784A (en) Commercial detection method and device
CN103873852A (en) Multi-mode parallel video quality fault detection method and device
CN108933935A (en) Detection method, device, storage medium and the computer equipment of video communication system
US20090290752A1 (en) Method for producing video signatures and identifying video clips
Yu et al. Exposing frame deletion by detecting abrupt changes in video streams
CN101389029B (en) Method and apparatus for video image encoding and retrieval
CN102890778A (en) Content-based video detection method and device
CN105975939A (en) Video detection method and device
CN105718861A (en) Method and device for identifying video streaming data category
WO2017032245A1 (en) Method and device for generating video file index information
US20190188221A1 (en) Using cross-matching between users and matching against reference data to facilitate content identification
CN106375771B (en) Image Feature Matching method and apparatus
CN113382284B (en) Pirate video classification method and device
CN104853244A (en) Method and apparatus for managing audio visual, audio or visual content
US20130101014A1 (en) Layered Screen Video Encoding
CN111914649A (en) Face recognition method and device, electronic equipment and storage medium
Bozkurt et al. Detection and localization of frame duplication using binary image template
CN101339662B (en) Method and device for creating video frequency feature data
CN103716635A (en) Method and device for improving intelligent analysis performance

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

Application publication date: 20181218

RJ01 Rejection of invention patent application after publication