CN111445376A - Video watermark detection method and device, electronic equipment and storage medium - Google Patents

Video watermark detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111445376A
CN111445376A CN202010212767.6A CN202010212767A CN111445376A CN 111445376 A CN111445376 A CN 111445376A CN 202010212767 A CN202010212767 A CN 202010212767A CN 111445376 A CN111445376 A CN 111445376A
Authority
CN
China
Prior art keywords
video frame
watermark
quadrant
image
binary
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.)
Granted
Application number
CN202010212767.6A
Other languages
Chinese (zh)
Other versions
CN111445376B (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.)
Wuba Co Ltd
Original Assignee
Wuba 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 Wuba Co Ltd filed Critical Wuba Co Ltd
Priority to CN202010212767.6A priority Critical patent/CN111445376B/en
Publication of CN111445376A publication Critical patent/CN111445376A/en
Application granted granted Critical
Publication of CN111445376B publication Critical patent/CN111445376B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/15Correlation function computation including computation of convolution operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2201/00General purpose image data processing
    • G06T2201/005Image watermarking
    • G06T2201/0065Extraction of an embedded watermark; Reliable detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Computational Mathematics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • Algebra (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The application discloses a method and a device for detecting video watermarks, electronic equipment and a storage medium, wherein the method comprises the steps of firstly acquiring a preset number of binary video frame images from a video file; then carrying out convolution operation on the binary video frame image by using the binary watermark image to obtain a target sub-block corresponding to the maximum convolution result in the binary video frame image; then, whether the binary video frame image contains the watermark or not is judged by comparing the watermark image with the binary pixel value of the corresponding position of the target sub-block; and finally, determining whether the video file contains the watermark or not according to the judgment result corresponding to the partial or all binary video frame images. The method can realize the detection of the video watermark under the condition of the moving position of the watermark speed, and has extremely low error rate and omission ratio.

Description

Video watermark detection method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of watermark detection technologies, and in particular, to a method and an apparatus for detecting a video watermark, an electronic device, and a storage medium.
Background
The watermark is embedded in the video, so that the video can be prevented from being tampered, the video source is marked, other people are prevented from stealing the video, and the effects of protecting the video copyright and the interests of copyright parties are achieved. For example, in the field of real estate renting and selling information services, a copyright party accesses a watermark detection service and a watermark embedding service to a real estate information platform, when the real estate information platform receives a real estate source video uploaded by a user (such as a real estate agent), the copyright party detects whether the real estate source video contains a watermark through the watermark detection service, if the watermark is detected, the video is determined to be an embezzled video and then prevented from being published, if the watermark is not detected, the video is determined not to be embezzled, and at this time, the watermark is embedded in the real estate source video through the watermark embedding service and then published.
The video watermark can be divided into a static watermark and a dynamic watermark according to the motion state of the watermark in the video, the position of the static watermark in the video is fixed, and the dynamic watermark moves along with the playing of the video. A method for detecting dynamic watermark includes extracting multiple frame from video according to certain rule on premise of known watermark motion speed, carrying out gradient calculation on each frame of image by utilizing Sobel operator to obtain gradient image, carrying out translation superposition on obtained gradient image according to motion speed of watermark to enhance part of image containing watermark and finally using pre-trained classification model to predict whether enhanced image contains watermark or not.
It can be seen that the above watermark detection method relies on the watermark motion speed, and if the watermark speed is unknown, detection cannot be performed.
Disclosure of Invention
The application provides a video watermark detection method, a video watermark detection device, electronic equipment and a storage medium, which are used for solving the watermark detection problem under the condition that the motion speed of a watermark is unknown.
In a first aspect, the present application provides a method for detecting a video watermark, where the method includes:
acquiring a preset number of binary video frame images from a video file;
obtaining a binary watermark image, carrying out convolution operation on the binary video frame image by taking the binary watermark image as a convolution kernel to obtain a convolution result matrix, and determining a target sub-block in the binary video frame image, wherein the convolution result matrix comprises at least one convolution result, each convolution result corresponds to one sub-block in the binary video frame image, and the target sub-block is a sub-block corresponding to the maximum convolution result in the convolution result matrix;
judging whether the binarized video frame image contains a watermark or not by comparing the binarized watermark image with the binarized pixel value of the pixel point at the corresponding position of the target sub-block;
and determining whether the video file contains the watermark or not according to the judgment result corresponding to part or all of the binarized video frame images.
Further, the acquiring the binary watermark image includes:
acquiring a watermark image, and carrying out edge detection processing on the watermark image to obtain an edge watermark image;
carrying out binarization processing on the marginalized watermark image to obtain a binarization watermark image;
acquiring a preset number of binary video frame images from a video file:
acquiring a video frame sequence from a video file, wherein the video frame sequence comprises a preset number of video frame images;
performing edge detection on the preset number of video frame images to obtain a preset number of video frame edge images;
and carrying out binarization processing on the preset number of video frame edge images to obtain the preset number of binarization video frame images.
Further, the step of judging whether the binarized video frame image contains a watermark or not by comparing the binarized watermark image with the binarized pixel value of the pixel point at the corresponding position of the target sub-block includes:
counting the number of pixel points falling into each preset quadrant according to the preset watermark image and the binary pixel value of the pixel points at the corresponding positions of the target sub-block, the preset quadrant comprises a quadrant A, a quadrant B, a quadrant C and a quadrant D, the binarized pixel values of pixel points of the binarized watermark image and the target sub-block at corresponding positions in the quadrant A are respectively 1 and 1, the binary pixel values of the pixel points of the binary watermark image and the target sub-block at the corresponding positions in the quadrant B are respectively 0 and 1, the binary pixel values of the pixel points of the binary watermark image and the target sub-block at the corresponding positions in the quadrant C are respectively 1 and 0, the binarization pixel values of pixel points of the binarization watermark image and the target sub-block at corresponding positions in the quadrant D are respectively 0 and 0;
judging whether the number of the pixel points falling into each quadrant accords with the number range preset by the quadrant;
if the number of the pixel points falling into each quadrant accords with the number range preset by the quadrant, determining that the binary video frame image contains the watermark;
and if the number of the pixel points falling into at least one quadrant does not accord with the number range preset by the quadrant, determining that the binaryzation video frame image does not contain the watermark.
Further, the determining whether the video file contains the watermark according to the judgment result corresponding to part or all of the binarized video frame images includes:
if the binarized video frame images corresponding to the first m frames of video frame images in the video frame sequence do not contain watermarks, determining that the video file does not contain watermarks;
if the binaryzation video frame images corresponding to at least n video frame images in the video frame sequence contain watermarks, determining that the video file contains the watermarks;
wherein m and n are preset detection threshold values, and n is more than or equal to 1 and more than m and less than the preset number.
Further, the performing convolution operation on the binarized video frame image by using the binarized watermark image as a convolution kernel includes:
respectively converting the binary watermark image and the binary video frame image into a watermark matrix and a video frame matrix;
and carrying out convolution operation on the video frame matrix according to a preset moving direction and a preset step length by taking the watermark matrix as a convolution kernel to obtain a convolution result matrix.
In a second aspect, the present application further provides an apparatus for detecting a video watermark, where the apparatus includes:
the acquisition module is used for acquiring a preset number of binary video frame images from a video file and acquiring binary watermark images;
the convolution module is used for carrying out convolution operation on the binarized video frame image by taking the binarized watermark image as a convolution kernel to obtain a convolution result matrix, and determining a target sub-block in the binarized video frame image, wherein the convolution result matrix comprises at least one convolution result, each convolution result corresponds to one sub-block in the binarized video frame image, and the target sub-block is a sub-block corresponding to the maximum convolution result in the convolution result matrix;
the judging module is used for judging whether the binarized video frame image contains the watermark or not by comparing the binarized watermark image with the binarized pixel value of the pixel point at the corresponding position of the target sub-block;
and the determining module is used for determining whether the video file contains the watermark or not according to the judgment result corresponding to part or all of the binarized video frame images.
Further, the obtaining module includes:
the first acquisition unit is used for acquiring a watermark image and carrying out edge detection processing on the watermark image to obtain an edge watermark image; carrying out binarization processing on the marginalized watermark image to obtain a binarization watermark image; acquiring a preset number of binary video frame images from a video file:
the second acquisition unit is used for acquiring a video frame sequence from the video file, wherein the video frame sequence comprises a preset number of video frame images; performing edge detection on the preset number of video frame images to obtain a preset number of video frame edge images; and carrying out binarization processing on the preset number of video frame edge images to obtain the preset number of binarization video frame images.
Further, the judging module comprises:
a counting unit for counting the number of pixels falling into each preset quadrant according to the preset watermark image and the binary pixel value of the pixel at the corresponding position of the target sub-block, the preset quadrant comprises a quadrant A, a quadrant B, a quadrant C and a quadrant D, the binarized pixel values of pixel points of the binarized watermark image and the target sub-block at corresponding positions in the quadrant A are respectively 1 and 1, the binary pixel values of the pixel points of the binary watermark image and the target sub-block at the corresponding positions in the quadrant B are respectively 0 and 1, the binary pixel values of the pixel points of the binary watermark image and the target sub-block at the corresponding positions in the quadrant C are respectively 1 and 0, the binarization pixel values of pixel points of the binarization watermark image and the target sub-block at corresponding positions in the quadrant D are respectively 0 and 0;
the judging unit is used for judging whether the number of the pixel points falling into each quadrant accords with the preset number range of the quadrant; if the number of the pixel points falling into each quadrant accords with the number range preset by the quadrant, determining that the binary video frame image contains the watermark; and if the number of the pixel points falling into at least one quadrant does not accord with the number range preset by the quadrant, determining that the binaryzation video frame image does not contain the watermark.
Further, the determining module is specifically configured to:
if the binarized video frame images corresponding to the first m frames of video frame images in the video frame sequence do not contain watermarks, determining that the video file does not contain watermarks;
if the binaryzation video frame images corresponding to at least n video frame images in the video frame sequence contain watermarks, determining that the video file contains the watermarks;
wherein m and n are preset detection threshold values, and n is more than or equal to 1 and more than m and less than the preset number.
Further, the convolution module includes:
a matrix conversion unit, configured to convert the binarized watermark image and the binarized video frame image into a watermark matrix and a video frame matrix, respectively;
and the convolution operation unit is used for performing convolution operation on the video frame matrix according to a preset moving direction and step length by taking the watermark matrix as a convolution kernel to obtain a convolution result matrix.
In a third aspect, the present application further provides an electronic device, including:
a memory for storing program instructions;
a processor for calling and executing the program instructions in the memory to implement the method of the first aspect.
In a fourth aspect, the present application further provides a storage medium having a computer program stored therein, which when executed by at least one processor of the apparatus of the second aspect, performs the method of the first aspect.
According to the technical scheme, the embodiment of the application provides a method, a device, electronic equipment and a storage medium for detecting video watermarks, wherein the method comprises the steps of firstly acquiring a preset number of binary video frame images from a video file; then carrying out convolution operation on the binary video frame image by using the binary watermark image to obtain a target sub-block corresponding to the maximum convolution result in the binary video frame image; then, whether the binary video frame image contains the watermark or not is judged by comparing the binary watermark image with the binary pixel value at the corresponding position of the target sub-block; and finally, determining whether the video file contains the watermark or not according to the judgment result corresponding to the partial or all binary video frame images. The method can realize the detection of the video watermark under the condition of the moving position of the watermark speed, and has extremely low error rate and omission ratio.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without any creative effort.
Fig. 1 is a flow chart illustrating a method for detecting a video watermark according to an exemplary embodiment of the present application;
fig. 2 is a block diagram of a video watermark detection apparatus according to an exemplary embodiment of the present application;
fig. 3 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the field of digital watermarking, a watermark embedding algorithm is used for embedding a watermark image into a video file, so that the video can be prevented from being tampered, the video source is marked, other people are prevented from stealing the video, and the effects of protecting the video copyright and the interests of copyright parties are achieved. However, if the watermark embedding algorithm is broken by the video embedder, it means that the watermark in the video will be perfectly removed by the embedder.
The dynamic watermark embedding algorithm is a research product of the static watermark embedding algorithm after being broken by a embezzler. The moving speed of the dynamic watermark is the key for cracking the watermark embedding algorithm. Because the watermark motion speeds of all the video files obtained by using the same embedding algorithm are the same, if a pirate obtains the watermark motion speed of one video and breaks the watermark embedding algorithm used by the video, the method is equivalent to breaking the watermark embedding algorithm used by all the videos, thereby realizing the batch processing of the videos.
In order to further improve the anti-attack capability of the watermark embedding algorithm, when each watermark-free video is subjected to watermark embedding processing, a watermark embedding algorithm randomly generates a watermark motion speed value for completing watermark embedding of the video, so that the obtained watermark motion speeds of the watermark videos are different, and further, the cracking of a pirate is prevented.
However, the randomization of the motion speed of the watermarks in different watermark videos can prevent a pirate from cracking the embedding algorithm, but also brings obstacles to the watermark detection technology. The existing watermark detection method is characterized in that on the premise that the motion speed of the watermark is known, a plurality of picture frames are extracted from a video according to a certain rule, then a Sobel operator is used for carrying out gradient calculation on each frame of picture to obtain a gradient image, the obtained gradient image is subjected to translation superposition according to the motion speed of the watermark to enhance the part of the picture containing the watermark, and finally a pre-trained classification model is used for predicting whether the enhanced image contains the watermark or not. That is, the conventional watermark detection method depends on the watermark motion speed, and if the watermark motion speed is unknown, the detection cannot be performed.
In order to implement detection of a video watermark under the condition that a motion speed of the watermark is unknown, an embodiment of the present application provides a method for detecting a video watermark, fig. 1 is a flowchart of an exemplary embodiment of the method, and as shown in fig. 1, the method may include:
step 100, acquiring a preset number of binary video frame images from a video file.
In step 100, frames of a video file to be detected are extracted, the number of the extracted frames is a preset number N, and the extracted N frames of video frame images form a video frame sequence. In some embodiments, m < N < 50, where m is a preset first detection threshold; then carrying out edge detection on each video frame image to obtain a preset number of video frame edge images; and then, carrying out binarization processing on the edge images of each video frame to obtain a preset number of binarized video frame images.
200, acquiring a binary watermark image, performing convolution operation on the binary video frame image by taking the binary watermark image as a convolution kernel to obtain a convolution result matrix, and determining a target sub-block in the binary video frame image, wherein the convolution result matrix comprises at least one convolution result, each convolution result corresponds to one sub-block in the binary video frame image, and the target sub-block is a sub-block corresponding to the maximum convolution result in the convolution result matrix.
The watermark image is a detection target of the method, and the method aims to detect whether the watermark image is in a video file or not.
As a possible implementation manner, the acquiring of the binary watermark image specifically includes: firstly, acquiring a watermark image, and carrying out edge detection processing on the watermark image to obtain an edge watermark image; and then carrying out binarization processing on the marginalized watermark image to obtain the binarized watermark image.
It should be noted that there are many methods for implementing the edge detection process, such as search-based and zero-crossing-based edge detection algorithms. In this, the search-based edge detection method first calculates the edge strength, usually expressed in terms of a first derivative, such as a gradient mode, and then estimates the local direction of the edge, usually the direction of the gradient, and uses this direction to find the maximum of the local gradient mode. Zero-crossing based methods find the zero-crossing points of the second derivative derived from the image to locate the edges, typically using the laplace operator or the zero-crossing points of a non-linear differential equation. Since the method for implementing the edge detection process is well known to those skilled in the art, it is not described in detail herein.
In the embodiments, by performing edge detection processing on the watermark image and the video frame image, irrelevant information can be removed on the basis of keeping important structural attributes of the image, and the data calculation amount is greatly reduced.
One implementation of the binarization operation is described by taking an edge video frame image as an example. Firstly, graying an edge video frame image by adopting an average value method to obtain a grayscale video frame image, and then carrying out binarization processing on the grayscale video frame image by adopting a threshold value method, namely: dividing the pixel value distribution of the gray-scale video frame image into two parts by taking a preset threshold value T as a boundary, if the pixel value of a certain pixel point is greater than or equal to T, making the binary pixel value of the pixel point be 1, and if the pixel value of the certain pixel point is less than T, making the binary pixel value of the pixel point be 0, so as to obtain the binary video frame image with the pixel value of 0 or 1, wherein the preset threshold value T can be 128.
In step 200, for each binarized frame video image, the features of the binarized video frame image are extracted by image convolution, with the intention of determining the portion of the binarized video frame image most similar to the binarized watermark image from the feature extraction result (convolution result).
In the concrete implementation, firstly, respectively converting a binary watermark image and a binary video frame image into a watermark matrix and a video frame matrix; then, taking the watermark matrix as a convolution kernel, and performing convolution operation on the video frame matrix according to a preset moving direction and a preset step length to obtain a convolution result matrix, wherein the convolution result matrix comprises a plurality of convolution results, and each convolution result corresponds to one subblock in the video frame image; and finally, selecting the sub-block corresponding to the maximum convolution result as a target sub-block.
Illustratively, assuming that the watermark image size a × b, the matrix transformation matrix to obtain the watermark matrix is [ a × b ] (matrix of a row and b column), the video frame image size is x × y, the matrix transformation matrix to obtain the video frame matrix is [ x × y ] (matrix of x row and y column), the convolution operation is performed on [ x × y ] with [ a × b ] as a convolution kernel and 1 as a moving step to obtain a convolution result matrix of [ (y-b +1) × (x-a +1) ], the convolution result matrix comprises (y-b +1) × (x-a +1) elements, each element is a convolution result, each convolution result corresponds to a sub-block in the video frame image, the size of the convolution result represents the similarity degree of the watermark image and the corresponding sub-block of the convolution result, and the sub-block corresponding to the largest convolution result in (y-b +1) × (x-a +1) is similar to the watermark image, and therefore the sub-block corresponding to the largest convolution result is selected as the target sub-block.
And step 300, comparing the binary watermark image with the binary pixel value of the pixel point at the corresponding position of the target sub-block, and judging whether the binary video frame image contains the watermark or not.
In this embodiment, the pixel point of the binarized watermark image and the pixel point of the target sub-block at the corresponding position form a pixel pair, and for convenience of distinguishing and explaining, the pixel point belonging to the watermark image in the pixel pair is referred to as a first pixel point, and the pixel point belonging to the target sub-block in the pixel pair is referred to as a second pixel point.
Specifically, whether the video frame image contains the watermark or not can be judged as follows:
according to four possible combination modes of a first pixel point and a second pixel point, dividing four preset quadrants which are a quadrant A, a quadrant B, a quadrant C and a quadrant D respectively, wherein the binarization pixel values of the binarization watermark image and the pixel points of the target sub-block at the corresponding positions in the quadrant A are respectively 1 and 1, namely the binarization pixel values of the first pixel point and the second pixel point are respectively 1 and 1, the binarization pixel values of the binarization watermark image and the pixel points of the target sub-block at the corresponding positions in the quadrant B are respectively 0 and 1, namely the binarization pixel values of the first pixel point and the second pixel point are respectively 0 and 1, the binarization pixel values of the binarization watermark image and the pixel points of the target sub-block at the corresponding positions in the quadrant C are respectively 1 and 0, namely the binarization pixel values of the first pixel point and the second pixel point are respectively 1 and 0, and in the quadrant D, the binarization pixel values of pixel points of the binarization watermark image and the target sub-block at corresponding positions are respectively 0 and 0, namely the binarization pixel values of the first pixel point and the second pixel point are respectively 0 and 0.
And then, counting the number of the pixel points falling into each preset quadrant according to the preset watermark image and the binarization pixel value of the pixel points at the corresponding positions of the target sub-block.
And then respectively judging whether the number of the pixel pairs falling into each quadrant accords with the preset number range of the quadrant, if so, determining that the binary video frame image contains the watermark, and if not, determining that the binary video frame image does not contain the watermark.
And step 400, determining whether the video file contains the watermark or not according to the judgment result corresponding to part or all of the binarized video frame images.
Specifically, if the binarized video frame images corresponding to the first m frames of video frame images in the video frame sequence do not contain watermarks, determining that the video file does not contain watermarks; if the binaryzation video frame images corresponding to at least n video frame images in the video frame sequence contain the watermark, determining that the video file contains the watermark; wherein m and N are both preset detection threshold values, m is a first detection threshold value, N is a second detection threshold value, and N is more than or equal to 1 and more than m and less than N (the preset number).
During specific implementation, the judgment result corresponding to each video frame image in the video frame sequence is stored in the array S, and the arrangement sequence of the judgment results in the array S is matched with the arrangement sequence of the video frame images in the video frame sequence. On the basis, the judgment results stored in the array S are sequentially read, if the mth judgment result (namely the judgment result corresponding to the mth frame of video frame image) is read, the result containing the watermark is not read, the previous m frames of video frame images in the video frame sequence do not contain the watermark, the reading is stopped at the moment, the video file is considered not to contain the watermark, if the mth judgment result is read, the n results containing the watermark are read, the reading is stopped when the nth result containing the watermark is read, and the video file is considered to contain the watermark; and if the m-th judgment result is read, the results containing the watermarks are already read but the number of the results is less than n, the m + 1-th judgment result is continuously read until at least n results containing the watermarks are read, the reading is stopped, and the video file is considered to contain the watermarks.
The video watermark detection method provided by the embodiment of the application is tested by using 1859 watermarked videos and 1860 non-watermarked videos as test samples, and the test results are shown in table 1:
TABLE 1
Test specimen Total number of Detecting the number of watermarks contained Detecting watermark-free quantities Error rate Rate of missed examination
Watermarked video 1859 1776 83 0 4.47%
Watermark-free video 1000 4 1856 0.20 0
The condition of missed detection is checked and found, and the main reason of missed detection is that the video is too fuzzy.
As can be seen from the test results shown in table 1, the video watermark detection method provided by the present application has an extremely low error rate and false drop rate.
As can be seen from the foregoing embodiments, the present application provides a method for detecting a video watermark, which includes first obtaining a preset number of binarized video frame images from a video file; then carrying out convolution operation on the binary video frame image by using the binary watermark image to obtain a target sub-block corresponding to the maximum convolution result in the binary video frame image; then, whether the binary video frame image contains the watermark or not is judged by comparing the binary watermark image with the binary pixel value at the corresponding position of the target sub-block; and finally, determining whether the video file contains the watermark or not according to the judgment result corresponding to the partial or all binary video frame images. The method can realize the detection of the video watermark under the condition of the moving position of the watermark speed, and has extremely low error rate and omission ratio.
According to the method for detecting a video watermark provided in the foregoing embodiment, an embodiment of the present application further provides a device for detecting a video watermark, and as shown in fig. 2, the device may include:
an obtaining module 210, configured to obtain a preset number of binarized video frame images from a video file, and obtain binarized watermark images; a convolution module 220, configured to perform convolution operation on the binarized video frame image by using the binarized watermark image as a convolution kernel to obtain a convolution result matrix, and determine a target sub-block in the binarized video frame image, where the convolution result matrix includes at least one convolution result, each convolution result corresponds to one sub-block in the binarized video frame image, and the target sub-block is a sub-block corresponding to a maximum convolution result in the convolution result matrix; a determining module 230, configured to determine whether the binarized video frame image contains a watermark by comparing the binarized watermark image with the binarized pixel value of the pixel point at the corresponding position of the target sub-block; a determining module 240, configured to determine whether the video file contains a watermark according to a determination result corresponding to part or all of the binarized video frame images.
In some embodiments, the obtaining module comprises: the first acquisition unit is used for acquiring a watermark image and carrying out edge detection processing on the watermark image to obtain an edge watermark image; carrying out binarization processing on the marginalized watermark image to obtain a binarization watermark image; acquiring a preset number of binary video frame images from a video file: the second acquisition unit is used for acquiring a video frame sequence from the video file, wherein the video frame sequence comprises a preset number of video frame images; performing edge detection on the preset number of video frame images to obtain a preset number of video frame edge images; and carrying out binarization processing on the preset number of video frame edge images to obtain the preset number of binarization video frame images.
In some embodiments, the determining module comprises: a counting unit for counting the number of pixels falling into each preset quadrant according to the preset watermark image and the binary pixel value of the pixel at the corresponding position of the target sub-block, the preset quadrant comprises a quadrant A, a quadrant B, a quadrant C and a quadrant D, the binarized pixel values of pixel points of the binarized watermark image and the target sub-block at corresponding positions in the quadrant A are respectively 1 and 1, the binary pixel values of the pixel points of the binary watermark image and the target sub-block at the corresponding positions in the quadrant B are respectively 0 and 1, the binary pixel values of the pixel points of the binary watermark image and the target sub-block at the corresponding positions in the quadrant C are respectively 1 and 0, the binarization pixel values of pixel points of the binarization watermark image and the target sub-block at corresponding positions in the quadrant D are respectively 0 and 0; the judging unit is used for judging whether the number of the pixel points falling into each quadrant accords with the preset number range of the quadrant; if the number of the pixel points falling into each quadrant accords with the number range preset by the quadrant, determining that the binary video frame image contains the watermark; and if the number of the pixel points falling into at least one quadrant does not accord with the number range preset by the quadrant, determining that the binaryzation video frame image does not contain the watermark.
In some embodiments, the determining module is specifically configured to: if the binarized video frame images corresponding to the first m frames of video frame images in the video frame sequence do not contain watermarks, determining that the video file does not contain watermarks; if the binaryzation video frame images corresponding to at least n video frame images in the video frame sequence contain watermarks, determining that the video file contains the watermarks; wherein m and n are preset detection threshold values, and n is more than or equal to 1 and more than m and less than the preset number.
In some embodiments, the convolution module comprises: a matrix conversion unit, configured to convert the binarized watermark image and the binarized video frame image into a watermark matrix and a video frame matrix, respectively; and the convolution operation unit is used for performing convolution operation on the video frame matrix according to a preset moving direction and step length by taking the watermark matrix as a convolution kernel to obtain a convolution result matrix.
Fig. 3 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application. As shown in fig. 3, the electronic device may include: a memory 301 for storing program instructions; and the processor 302 is used for calling and executing the program instructions in the memory so as to realize the video watermark detection method.
In this embodiment, the processor and the memory may be connected by a bus or other means. The processor may be a general-purpose processor, such as a central processing unit, a digital signal processor, an application specific integrated circuit, or one or more integrated circuits configured to implement embodiments of the present invention. The memory may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, a hard disk, or a solid state disk.
In a specific implementation, the present invention further provides a computer storage medium, where the computer storage medium may store a computer program, and when at least one processor of the video watermark detection apparatus executes the computer program, the video watermark detection apparatus executes some or all of the steps in the embodiments of the video watermark detection method of the present application. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The same and similar parts in the various embodiments in this specification may be referred to each other. In particular, as for the device, the electronic apparatus and the storage medium embodiments, since they are substantially similar to the method embodiments, the description is simple, and the relevant points can be referred to the description in the method embodiments.
The above-described embodiments of the present invention should not be construed as limiting the scope of the present invention.

Claims (12)

1. A method for detecting a video watermark, the method comprising:
acquiring a preset number of binary video frame images from a video file;
obtaining a binary watermark image, carrying out convolution operation on the binary video frame image by taking the binary watermark image as a convolution kernel to obtain a convolution result matrix, and determining a target sub-block in the binary video frame image, wherein the convolution result matrix comprises at least one convolution result, each convolution result corresponds to one sub-block in the binary video frame image, and the target sub-block is a sub-block corresponding to the maximum convolution result in the convolution result matrix;
judging whether the binarized video frame image contains a watermark or not by comparing the binarized watermark image with the binarized pixel value of the pixel point at the corresponding position of the target sub-block;
and determining whether the video file contains the watermark or not according to the judgment result corresponding to part or all of the binarized video frame images.
2. The method of claim 1, wherein the obtaining a binary watermark image comprises:
acquiring a watermark image, and carrying out edge detection processing on the watermark image to obtain an edge watermark image;
carrying out binarization processing on the marginalized watermark image to obtain a binarization watermark image;
acquiring a preset number of binary video frame images from a video file:
acquiring a video frame sequence from a video file, wherein the video frame sequence comprises a preset number of video frame images;
performing edge detection on the preset number of video frame images to obtain a preset number of video frame edge images;
and carrying out binarization processing on the preset number of video frame edge images to obtain the preset number of binarization video frame images.
3. The method according to claim 1, wherein said determining whether the binarized video frame image contains a watermark by comparing the binarized pixel values of the pixel points at the corresponding positions of the binarized watermark image and the target sub-block comprises:
counting the number of pixel points falling into each preset quadrant according to the preset watermark image and the binary pixel value of the pixel points at the corresponding positions of the target sub-block, the preset quadrant comprises a quadrant A, a quadrant B, a quadrant C and a quadrant D, the binarized pixel values of pixel points of the binarized watermark image and the target sub-block at corresponding positions in the quadrant A are respectively 1 and 1, the binary pixel values of the pixel points of the binary watermark image and the target sub-block at the corresponding positions in the quadrant B are respectively 0 and 1, the binary pixel values of the pixel points of the binary watermark image and the target sub-block at the corresponding positions in the quadrant C are respectively 1 and 0, the binarization pixel values of pixel points of the binarization watermark image and the target sub-block at corresponding positions in the quadrant D are respectively 0 and 0;
judging whether the number of the pixel points falling into each quadrant accords with the number range preset by the quadrant;
if the number of the pixel points falling into each quadrant accords with the number range preset by the quadrant, determining that the binary video frame image contains the watermark;
and if the number of the pixel points falling into at least one quadrant does not accord with the number range preset by the quadrant, determining that the binaryzation video frame image does not contain the watermark.
4. The method according to claim 2, wherein said determining whether the video file contains a watermark according to the determination result corresponding to part or all of the binarized video frame images comprises:
if the binarized video frame images corresponding to the first m frames of video frame images in the video frame sequence do not contain watermarks, determining that the video file does not contain watermarks;
if the binaryzation video frame images corresponding to at least n video frame images in the video frame sequence contain watermarks, determining that the video file contains the watermarks;
wherein m and n are preset detection threshold values, and n is more than or equal to 1 and more than m and less than the preset number.
5. The method according to claim 2, wherein the performing a convolution operation on the binarized video frame image by using the binarized watermark image as a convolution kernel comprises:
respectively converting the binary watermark image and the binary video frame image into a watermark matrix and a video frame matrix;
and carrying out convolution operation on the video frame matrix according to a preset moving direction and a preset step length by taking the watermark matrix as a convolution kernel to obtain a convolution result matrix.
6. An apparatus for detecting a video watermark, the apparatus comprising:
the acquisition module is used for acquiring a preset number of binary video frame images from a video file and acquiring binary watermark images;
the convolution module is used for carrying out convolution operation on the binarized video frame image by taking the binarized watermark image as a convolution kernel to obtain a convolution result matrix, and determining a target sub-block in the binarized video frame image, wherein the convolution result matrix comprises at least one convolution result, each convolution result corresponds to one sub-block in the binarized video frame image, and the target sub-block is a sub-block corresponding to the maximum convolution result in the convolution result matrix;
the judging module is used for judging whether the binarized video frame image contains the watermark or not by comparing the binarized watermark image with the binarized pixel value of the pixel point at the corresponding position of the target sub-block;
and the determining module is used for determining whether the video file contains the watermark or not according to the judgment result corresponding to part or all of the binarized video frame images.
7. The apparatus of claim 6, wherein the obtaining module comprises:
the first acquisition unit is used for acquiring a watermark image and carrying out edge detection processing on the watermark image to obtain an edge watermark image; carrying out binarization processing on the marginalized watermark image to obtain a binarization watermark image; acquiring a preset number of binary video frame images from a video file:
the second acquisition unit is used for acquiring a video frame sequence from the video file, wherein the video frame sequence comprises a preset number of video frame images; performing edge detection on the preset number of video frame images to obtain a preset number of video frame edge images; and carrying out binarization processing on the preset number of video frame edge images to obtain the preset number of binarization video frame images.
8. The apparatus of claim 6, wherein the determining module comprises:
a counting unit for counting the number of pixels falling into each preset quadrant according to the preset watermark image and the binary pixel value of the pixel at the corresponding position of the target sub-block, the preset quadrant comprises a quadrant A, a quadrant B, a quadrant C and a quadrant D, the binarized pixel values of pixel points of the binarized watermark image and the target sub-block at corresponding positions in the quadrant A are respectively 1 and 1, the binary pixel values of the pixel points of the binary watermark image and the target sub-block at the corresponding positions in the quadrant B are respectively 0 and 1, the binary pixel values of the pixel points of the binary watermark image and the target sub-block at the corresponding positions in the quadrant C are respectively 1 and 0, the binarization pixel values of pixel points of the binarization watermark image and the target sub-block at corresponding positions in the quadrant D are respectively 0 and 0;
the judging unit is used for judging whether the number of the pixel points falling into each quadrant accords with the preset number range of the quadrant; if the number of the pixel points falling into each quadrant accords with the number range preset by the quadrant, determining that the binary video frame image contains the watermark; and if the number of the pixel points falling into at least one quadrant does not accord with the number range preset by the quadrant, determining that the binaryzation video frame image does not contain the watermark.
9. The apparatus of claim 7, wherein the determining module is specifically configured to:
if the binarized video frame images corresponding to the first m frames of video frame images in the video frame sequence do not contain watermarks, determining that the video file does not contain watermarks;
if the binaryzation video frame images corresponding to at least n video frame images in the video frame sequence contain watermarks, determining that the video file contains the watermarks;
wherein m and n are preset detection threshold values, and n is more than or equal to 1 and more than m and less than the preset number.
10. The apparatus of claim 7, wherein the convolution module comprises:
a matrix conversion unit, configured to convert the binarized watermark image and the binarized video frame image into a watermark matrix and a video frame matrix, respectively;
and the convolution operation unit is used for performing convolution operation on the video frame matrix according to a preset moving direction and step length by taking the watermark matrix as a convolution kernel to obtain a convolution result matrix.
11. An electronic device, comprising:
a memory for storing program instructions;
a processor for calling and executing program instructions in said memory to implement the method of any of claims 1-5.
12. A storage medium, characterized in that the storage medium has stored therein a computer program, which, when executed by at least one processor of an apparatus according to any one of claims 6-10, causes the apparatus to perform the method according to any one of claims 1-5.
CN202010212767.6A 2020-03-24 2020-03-24 Video watermark detection method, device, electronic equipment and storage medium Active CN111445376B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010212767.6A CN111445376B (en) 2020-03-24 2020-03-24 Video watermark detection method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010212767.6A CN111445376B (en) 2020-03-24 2020-03-24 Video watermark detection method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111445376A true CN111445376A (en) 2020-07-24
CN111445376B CN111445376B (en) 2023-08-18

Family

ID=71652459

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010212767.6A Active CN111445376B (en) 2020-03-24 2020-03-24 Video watermark detection method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111445376B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112102141A (en) * 2020-09-24 2020-12-18 腾讯科技(深圳)有限公司 Watermark detection method, watermark detection device, storage medium and electronic equipment
CN112419132A (en) * 2020-11-05 2021-02-26 广州华多网络科技有限公司 Video watermark detection method and device, electronic equipment and storage medium
CN114513680A (en) * 2021-12-28 2022-05-17 上海瑞家信息技术有限公司 Video processing method, device and apparatus and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020126870A1 (en) * 2001-03-08 2002-09-12 Sony Corporation And Sony Electronics, Inc. Method to detect watermark resistant to resizing and translation
CN1567353A (en) * 2003-06-13 2005-01-19 上海师范大学 Method for embedding watermark to and extracting watermark from binary image
US6983056B1 (en) * 1999-08-06 2006-01-03 International Business Machines Corporation Method and device for embedding and detecting watermarking information into a black and white binary document image
EP2410726A2 (en) * 2004-02-02 2012-01-25 Nippon Telegraph And Telephone Corporation Digital watermark detection apparatus, method and program
US20130259294A1 (en) * 2012-03-27 2013-10-03 Infosys Limited Method, system, and computer-readable medium for embedding and extracting a watermark in a video
CN106096668A (en) * 2016-08-18 2016-11-09 携程计算机技术(上海)有限公司 The recognition methods of watermarked image and the system of identification
CN106331746A (en) * 2016-09-19 2017-01-11 北京小度互娱科技有限公司 Method and device for identifying position of watermark in video file
CN110532871A (en) * 2019-07-24 2019-12-03 华为技术有限公司 The method and apparatus of image procossing

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6983056B1 (en) * 1999-08-06 2006-01-03 International Business Machines Corporation Method and device for embedding and detecting watermarking information into a black and white binary document image
US20020126870A1 (en) * 2001-03-08 2002-09-12 Sony Corporation And Sony Electronics, Inc. Method to detect watermark resistant to resizing and translation
CN1567353A (en) * 2003-06-13 2005-01-19 上海师范大学 Method for embedding watermark to and extracting watermark from binary image
EP2410726A2 (en) * 2004-02-02 2012-01-25 Nippon Telegraph And Telephone Corporation Digital watermark detection apparatus, method and program
US20130259294A1 (en) * 2012-03-27 2013-10-03 Infosys Limited Method, system, and computer-readable medium for embedding and extracting a watermark in a video
CN106096668A (en) * 2016-08-18 2016-11-09 携程计算机技术(上海)有限公司 The recognition methods of watermarked image and the system of identification
CN106331746A (en) * 2016-09-19 2017-01-11 北京小度互娱科技有限公司 Method and device for identifying position of watermark in video file
CN110532871A (en) * 2019-07-24 2019-12-03 华为技术有限公司 The method and apparatus of image procossing

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
GUOYIN ZHANG: "A Fragile Watermarking Scheme of Anti-deleting Features for 2D Vector Map" *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112102141A (en) * 2020-09-24 2020-12-18 腾讯科技(深圳)有限公司 Watermark detection method, watermark detection device, storage medium and electronic equipment
CN112419132A (en) * 2020-11-05 2021-02-26 广州华多网络科技有限公司 Video watermark detection method and device, electronic equipment and storage medium
CN114513680A (en) * 2021-12-28 2022-05-17 上海瑞家信息技术有限公司 Video processing method, device and apparatus and storage medium

Also Published As

Publication number Publication date
CN111445376B (en) 2023-08-18

Similar Documents

Publication Publication Date Title
Rosin Thresholding for change detection
CN111445376B (en) Video watermark detection method, device, electronic equipment and storage medium
CN107808358B (en) Automatic detection method for image watermark
JP4626886B2 (en) Method and apparatus for locating and extracting captions in digital images
Wang et al. A survey of passive image tampering detection
CN108564579B (en) Concrete crack detection method and detection device based on time-space correlation
KR20060080179A (en) Detecting a watermark using a subset of available detection methods
Andriotis et al. JPEG steganography detection with Benford's Law
CN111681273A (en) Image segmentation method and device, electronic equipment and readable storage medium
Alwan et al. Data embedding based on better use of bits in image pixels
El-Sayed et al. New edge detection technique based on the shannon entropy in gray level images
CN111079816A (en) Image auditing method and device and server
Hou et al. Detection of hue modification using photo response nonuniformity
CN112070159A (en) Multi-scale sliding window similar picture detection method
CN112001362A (en) Image analysis method, image analysis device and image analysis system
CN112580668A (en) Background fraud detection method and device and electronic equipment
CN113538263A (en) Motion blur removing method, medium, and device based on improved DeblurgAN model
CN112235305A (en) Malicious traffic detection method based on convolutional neural network
CN114429577B (en) Flag detection method, system and equipment based on high confidence labeling strategy
CN111967345A (en) Method for judging shielding state of camera in real time
CN116485779A (en) Adaptive wafer defect detection method and device, electronic equipment and storage medium
CN111339368A (en) Video retrieval method and device based on video fingerprints and electronic equipment
Guan et al. An effective image steganalysis method based on neighborhood information of pixels
Sari et al. The effect of error level analysis on the image forgery detection using deep learning
Mungmode et al. A modified high frequency adaptive security approach using steganography for region selection based on threshold value

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
GR01 Patent grant
GR01 Patent grant