CN113015004B - Watermark video frame identification method, watermark video frame production method, watermark video frame identification device and electronic equipment - Google Patents

Watermark video frame identification method, watermark video frame production method, watermark video frame identification device and electronic equipment Download PDF

Info

Publication number
CN113015004B
CN113015004B CN202110275124.0A CN202110275124A CN113015004B CN 113015004 B CN113015004 B CN 113015004B CN 202110275124 A CN202110275124 A CN 202110275124A CN 113015004 B CN113015004 B CN 113015004B
Authority
CN
China
Prior art keywords
pixel value
video frame
rule
pixel
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110275124.0A
Other languages
Chinese (zh)
Other versions
CN113015004A (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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202110275124.0A priority Critical patent/CN113015004B/en
Publication of CN113015004A publication Critical patent/CN113015004A/en
Application granted granted Critical
Publication of CN113015004B publication Critical patent/CN113015004B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/835Generation of protective data, e.g. certificates
    • H04N21/8358Generation of protective data, e.g. certificates involving watermark

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the invention provides a watermark video frame identification method, a watermark video frame production method, a watermark video frame identification device and electronic equipment, wherein the watermark video frame identification method comprises the following steps: acquiring a video to be detected; detecting each video frame to be detected in the video to be detected, and determining whether the video frame contains a preset pixel value adjustment area or not; the pixel value adjustment area is: adjusting pixel values in the video frame based on a target pixel value rule, and conforming to the region of the target pixel value rule; the target pixel value rule includes: a change rule of the pixel value between each pixel value in the pixel value adjustment region; and determining the video frame to be detected containing the preset pixel value adjustment area as the video frame added with the watermark. The embodiment of the invention can automatically identify the video frame containing the watermark from the video, thereby improving the efficiency.

Description

Watermark video frame identification method, watermark video frame production method, watermark video frame identification device and electronic equipment
Technical Field
The present invention relates to the field of video processing technologies, and in particular, to a method and apparatus for identifying a watermark video frame, and an electronic device.
Background
Currently, many internet companies begin to homemade videos, or by buying royalties for a certain video, and playing it on the video website of the company. In order to prevent a user from recording video during the process of watching the video, or recording a screen, when the user plays the video, a video frame can be selected from the played video to add a watermark, and the watermark contains user information. When the suspected pirated video is found, the pirated user can be determined by identifying the watermark in the suspected pirated video. In order to improve the concealment of the watermark and prevent the user from finding the watermark when watching the video, the watermark can be encrypted in the process of adding the watermark to the video frame.
In the prior art, a manual identification method is generally adopted to identify each video frame in a suspected pirated video one by one, a video frame containing a watermark is identified, then the watermark is identified from the video frame, and further user information is determined. This way of manually identifying the watermarked video frame is less efficient.
Moreover, since the watermark may be encrypted during the process of adding the watermark to the video frame, the difficulty in identifying the encrypted watermark may be increased. That is, if the watermark added in the video frame is an encrypted watermark, the difficulty of identifying the video frame containing the encrypted watermark is further increased, and the efficiency of manual identification is lower.
Disclosure of Invention
The embodiment of the invention aims to provide a method for identifying video frames containing watermarks from video, a method and a device for producing watermark video frames and electronic equipment, so as to automatically identify the video frames containing watermarks from the video and improve the efficiency. The specific technical scheme is as follows:
in a first aspect of an embodiment of the present invention, there is provided a method for identifying a watermark video frame, the method including:
acquiring a video to be detected;
detecting each video frame to be detected in the video to be detected, and determining whether the video frame contains a preset pixel value adjustment area or not; the pixel value adjustment area is: adjusting pixel values in the video frame based on a target pixel value rule, and conforming to the region of the target pixel value rule; the target pixel value rule includes: a change rule of the pixel value between each pixel value in the pixel value adjustment region;
and determining the video frame to be detected containing the preset pixel value adjustment area as the video frame added with the watermark.
Optionally, the pixel value adjustment area is specifically: and aiming at the video frame added with the watermark, adjusting the pixel value in the video frame based on the target pixel value rule, and conforming to the region of the target pixel value rule.
Optionally, the step of detecting each video frame to be detected in the video to be detected and determining whether the video frame includes a preset pixel value adjustment area includes:
extracting gradient characteristics of each video frame to be detected;
each element in the gradient feature represents: the pixel value of the pixel with the same position as the element in the video frame to be detected and the pixel value of the adjacent pixel are in a size relation;
judging whether each pixel value in the video frame to be detected accords with the change rule of the pixel value between each pixel value in the pixel value adjusting area in the target pixel value rule according to the gradient characteristics of the video frame to be detected;
if yes, the video frame to be detected comprises a preset pixel value adjusting area.
Optionally, the target pixel value rule further includes: the size of the pixel value adjustment region;
before the step of extracting gradient features of each of the video frames to be detected, the method further comprises:
traversing each video frame to be detected based on the size of a pixel value adjustment area included in the target pixel value rule, and obtaining a plurality of undetermined areas with the area size being the size of the pixel value adjustment area in the video frame to be detected;
The step of detecting each video frame to be detected in the video to be detected and determining whether the video frame contains a preset pixel value adjustment area comprises the following steps:
extracting gradient characteristics of each undetermined area aiming at each undetermined area; each element in the gradient characteristics of the undetermined region represents: a magnitude relation between a pixel value of a pixel having the same position as the element in the undetermined area and a pixel value of an adjacent pixel;
judging whether each pixel value in the undetermined area accords with the change rule of the pixel value between each pixel value in the pixel value adjusting area in the target pixel value rule according to the gradient characteristics of the undetermined area;
and if the undetermined area accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule, the video frame where the undetermined area is located contains a preset pixel value adjustment area.
Optionally, in the target pixel value rule, a change rule of the pixel value between each pixel value in the pixel value adjustment area includes: a first proportion of pixels that are increased compared to adjacent pixel values to total pixels of the pixel value adjustment area, and a second proportion of pixels that are decreased compared to adjacent pixel values to total pixels of the pixel value adjustment area;
The gradient characteristic of the undetermined area comprises the following steps: the pixel value of each pixel is increased or decreased by a corresponding mark compared with the adjacent pixel value;
the step of judging whether each pixel value in the undetermined area accords with the change rule of the pixel value between each pixel value in the pixel value adjusting area according to the gradient characteristics of the undetermined area, comprising the following steps:
based on the marks that the pixel value of each pixel is increased or decreased compared with the adjacent pixel value in the gradient feature, counting a third proportion of the pixel increased compared with the adjacent pixel value to the total pixel of the pixel value adjustment area, and counting a fourth proportion of the pixel decreased compared with the adjacent pixel value to the total pixel of the pixel value adjustment area;
judging whether the difference value between the counted third proportion and the first proportion is smaller than or equal to a first preset threshold value, if so, enabling the undetermined area to conform to the change rule of the pixel value among all the pixel values in the pixel value adjusting area in the target pixel value rule;
or judging whether the difference value between the fourth proportion and the second proportion is smaller than or equal to a second preset threshold value, if so, the undetermined area accords with the change rule of the pixel value among all the pixel values in the pixel value adjusting area in the target pixel value rule.
Optionally, the target pixel value rule further includes: pixels whose pixel values are increased compared to adjacent pixel values in the pixel value adjustment region, and pixels whose pixel values are decreased compared to adjacent pixel values are arranged in this order;
judging whether the absolute value of the difference value between the counted third proportion and the first proportion is smaller than or equal to a first preset threshold value, if so, the undetermined area accords with the change rule of the pixel value among all the pixel values in the pixel value adjusting area, and the method comprises the following steps:
judging whether the absolute value of the difference between the third proportion and the first proportion is smaller than or equal to the first preset threshold value, if so, judging whether the arrangement sequence of marks for increasing or decreasing the pixel value of each pixel compared with the adjacent pixel value accords with the arrangement sequence in the target pixel value rule, and if so, judging that the undetermined area accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule;
judging whether the absolute value of the difference value between the fourth proportion and the second proportion is smaller than or equal to a second preset threshold value, if so, the undetermined area accords with the change rule of the pixel value among all the pixel values in the pixel value adjusting area, and the method comprises the following steps:
Judging whether the absolute value of the difference between the fourth proportion and the second proportion is smaller than or equal to the first preset threshold value, if so, judging whether the arrangement sequence of the marks for increasing or decreasing the pixel value of each pixel compared with the adjacent pixel value accords with the arrangement sequence in the target pixel value rule, and if so, judging that the undetermined area accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule.
Optionally, for any pixel, the adjacent pixels of the pixel are in the same horizontal direction or the same vertical direction as the pixel.
Optionally, after the step of determining whether each pixel value in the pending area meets the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule according to the gradient feature of the pending area, the method further includes:
and if each undetermined area does not accord with the change rule of the pixel value among the pixel values in the pixel value adjustment area in the target pixel value rule, selecting one pixel value rule from a plurality of pixel value rules acquired in advance, determining the pixel value rule as the target pixel value rule, and returning to the step of judging whether each pixel value in each undetermined area accords with the change rule of the pixel value among the pixel value adjustment areas in the target pixel value rule according to the gradient characteristics of each undetermined area.
Optionally, after the step of determining the video frame to be detected including the preset pixel value adjustment area as the watermarked video frame, the method further includes:
outputting and displaying the video frame added with the watermark.
Optionally, the target pixel value rule further includes: a relative positional relationship between the pixel value adjustment region and the watermark region;
after the step of determining the video frame to be detected including the preset pixel value adjustment area as the watermarked video frame, the method further includes:
determining the watermark region based on the relative positional relationship between the pixel value adjustment region and the watermark region, and the pixel value adjustment region;
highlighting the watermark region.
In a second aspect of the embodiment of the present invention, there is provided a method for producing a watermark video frame, the method comprising:
acquiring an operation request of a video to be processed;
selecting a video frame to be processed from the video to be processed;
adding a target watermark into the video frame to be processed to obtain a video frame added with the watermark;
and for the video frame added with the watermark, adjusting pixel values in the video frame based on a target pixel value rule so that an adjusted pixel value adjustment area accords with the target pixel value rule, wherein the target pixel value rule comprises the following steps: and the pixel value adjustment region is used for adjusting the change rule of the pixel value between the pixel values.
Optionally, the target pixel value rule further includes: a relative positional relationship between the pixel value adjustment region and the watermark region;
before the step of adding the target watermark to the video frame to be processed, obtaining a watermarked video frame, the method further comprises:
determining a watermark area from the video frame to be processed, wherein the watermark area is an area for adding a target watermark;
determining a region to be adjusted from the video frame to be processed according to the relative position relationship between the pixel value adjustment region and the watermark region and the size of the pixel value adjustment region in the target pixel value rule, wherein the region to be adjusted is a region for adjusting the pixel value;
or alternatively, the process may be performed,
the size of the region is adjusted based on the pixel value in the target pixel value rule, and the region to be adjusted is determined from the video frame to be processed;
and determining a watermark region according to the region to be adjusted and the relative position relationship between the pixel value adjustment region and the watermark region.
Optionally, the target pixel value rule further includes: in the pixel value adjustment region, a first proportion of pixels increased compared with adjacent pixel values to the total pixels of the pixel value adjustment region, and a second proportion of pixels decreased compared with adjacent pixel values to the total pixels of the pixel value adjustment region;
The step of adjusting the pixel value in the video frame based on the target pixel value rule for the watermarked video frame so that the pixel value adjustment area obtained after adjustment conforms to the target pixel value rule includes:
generating a feature matrix according to the first proportion, the second proportion and the size of the pixel value adjustment area in the target pixel value rule; each element in the feature matrix represents: in the pixel value adjustment area, the pixel value of the pixel having the same position as the element and the pixel value of the adjacent pixel have a magnitude relation;
traversing each pixel in the region to be adjusted, and judging whether the size relationship between the pixel value of the pixel and the pixel value of the adjacent pixel corresponds to the element in the feature matrix; if not, increasing or decreasing the pixel value of the pixel according to the feature matrix.
Optionally, the target pixel value rule further includes: pixels whose pixel values are increased compared to adjacent pixel values in the pixel value adjustment region, and pixels whose pixel values are decreased compared to adjacent pixel values are arranged in this order;
the step of generating a feature matrix according to the first proportion, the second proportion, and the size of the pixel value adjustment area in the target pixel value rule includes:
And generating a feature matrix according to the first proportion, the second proportion, the arrangement sequence in the target pixel value rule and the size of the pixel value adjustment area in the target pixel value rule.
Optionally, before the step of adjusting, for the watermarked video frame, pixel values in the video frame based on a target pixel value rule, so that the pixel value adjustment area obtained after adjustment conforms to the target pixel value rule, the method further includes:
acquiring a plurality of pixel value rules and version information corresponding to each pixel value rule;
and selecting the pixel value rule with the latest version information from the plurality of pixel value rules, and determining the pixel value rule as the target pixel value rule.
Optionally, the step of adding the target watermark to the video frame to be processed to obtain a watermarked video frame includes:
obtaining regional pixel values of each pixel in the watermark region; obtaining watermark pixel values of all pixels in the target watermark;
calculating a first product between the regional pixel value and a first preset weight coefficient; and calculating a second product between the watermark pixel value and a second preset weight coefficient;
Calculating the sum of the first product and the second product as a target pixel value;
and updating the pixel value of the pixel in the watermark area to the target pixel value.
Optionally, the operation request includes: play request, upload request, or post request.
In a third aspect of an embodiment of the present invention, there is provided an apparatus for identifying a watermark video frame, the apparatus including:
the video to be detected acquisition module is used for acquiring the video to be detected;
the video frame detection module to be detected is used for detecting each video frame to be detected in the video to be detected and determining whether the video frame contains a preset pixel value adjustment area or not; the pixel value adjustment area is: adjusting pixel values in the video frame based on a target pixel value rule, and conforming to the region of the target pixel value rule; the target pixel value rule includes: a change rule of the pixel value between each pixel value in the pixel value adjustment region;
and the video frame determining module is used for determining the video frame to be detected containing the preset pixel value adjustment area as the video frame added with the watermark.
In a fourth aspect of an embodiment of the present invention, there is provided an apparatus for producing a watermarked video frame, the apparatus including:
The operation request acquisition module is used for acquiring an operation request of the video to be processed;
the to-be-processed video frame selection module is used for selecting to-be-processed video frames from the to-be-processed video;
the target watermark adding module is used for adding a target watermark into the video frame to be processed to obtain a video frame added with the watermark;
the pixel value adjusting module is configured to adjust, for the watermarked video frame, a pixel value in the video frame based on a target pixel value rule, so that a pixel value adjustment area obtained after adjustment conforms to the target pixel value rule, where the target pixel value rule includes: and the pixel value adjustment region is used for adjusting the change rule of the pixel value between the pixel values.
In a fifth aspect of the embodiment of the present invention, an electronic device is provided, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the watermark video frame identification method according to any one of the first aspect when executing the program stored in the memory.
In a sixth aspect of the embodiment of the present invention, there is provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
A memory for storing a computer program;
and a processor, configured to implement any one of the methods for producing a watermarked video frame provided in the second aspect when executing the program stored in the memory.
A seventh aspect of an embodiment of the present invention provides a computer readable storage medium, in which a computer program is stored, the computer program implementing the method for identifying a watermarked video frame according to any one of the first aspects, when executed by a processor.
An eighth aspect of an embodiment of the present invention provides a computer readable storage medium having stored therein a computer program which when executed by a processor implements the method for producing a watermarked video frame according to any one of the second aspects above.
The embodiment of the invention has the beneficial effects that:
the embodiment of the invention provides a watermark video frame identification method, a watermark video frame identification production method, a watermark video frame identification device and electronic equipment, wherein a video to be detected is obtained; detecting each video frame to be detected in the video to be detected, and determining whether the video frame contains a preset pixel value adjusting area, wherein the pixel value adjusting area is an area which accords with the target pixel value rule after the pixel value in the video frame added with the watermark is adjusted in advance. Therefore, when a video frame containing the pixel value adjustment area is identified from the video to be detected, the video frame is the video frame added with the watermark, i.e. the video frame to be detected containing the preset pixel value adjustment area can be determined as the video frame added with the watermark. Therefore, the embodiment of the invention can automatically identify the video frame containing the watermark from the video to be detected.
The method, the device and the electronic equipment for identifying the watermark video frame provided by the embodiment of the invention acquire the operation request of the video to be processed; selecting a video frame to be processed from the video to be processed; adding the target watermark into a video frame to be processed to obtain a video frame added with the watermark; for a video frame added with the watermark, adjusting pixel values in the video frame based on a target pixel value rule so that a pixel value adjustment area obtained after adjustment accords with the target pixel value rule, wherein the target pixel value rule comprises the following steps: the size of the pixel value adjustment region and the variation law of the pixel value size between the individual pixel values in the pixel value adjustment region. The video frame added with the watermark is characterized in that the pixel value in the video frame is adjusted based on the target pixel value rule, so that the pixel value adjustment area obtained after adjustment accords with the target pixel value rule, and therefore the video frame added with the watermark also comprises the pixel value adjustment area.
Of course, it is not necessary for any one product or method of practicing the invention to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are necessary for the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention and that other embodiments may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a first method for identifying a watermark video frame according to an embodiment of the present invention;
FIG. 2a is a specific flow of S102 in the method for identifying a watermark video frame shown in FIG. 1;
FIG. 2b is another specific flow of S102 in the method for identifying a watermarked video frame shown in FIG. 1;
FIG. 3 is a specific flow of S207 in the method for identifying a watermarked video frame shown in FIG. 2 b;
fig. 4 is a second flowchart of a method for identifying a watermark video frame according to an embodiment of the present invention;
fig. 5a is a third flowchart of a method for identifying a watermark video frame according to an embodiment of the present invention;
Fig. 5b is a fourth flowchart of a method for identifying a watermark video frame according to an embodiment of the present invention;
FIG. 5c is a schematic diagram of a watermarked video frame according to an embodiment of the present invention;
fig. 6 is a schematic flow chart of a first method for producing a watermark video frame according to an embodiment of the present invention;
fig. 7 is a second flowchart of a method for producing a watermarked video frame according to an embodiment of the present invention;
fig. 8 is a third flowchart of a method for producing a watermarked video frame according to an embodiment of the present invention;
fig. 9 is a specific flow of S604 in the method for producing a watermarked video frame shown in fig. 6;
fig. 10 is a fourth flowchart of a method for producing a watermarked video frame according to an embodiment of the present invention;
fig. 11 is a specific flow of S603 in the method for producing a watermarked video frame shown in fig. 6;
fig. 12 is a schematic structural diagram of a watermark video frame recognition device according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of a watermark video frame generating apparatus according to an embodiment of the present invention;
fig. 14 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 15 is a schematic structural diagram of another electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the prior art, a manual identification method is generally adopted to identify each video frame in a suspected pirated video one by one, a video frame containing a watermark is identified, then the watermark is identified from the video frame, and further user information is determined. This way of manually identifying the watermarked video frame is less efficient.
Moreover, since the watermark may be encrypted during the process of adding the watermark to the video frame, the difficulty in identifying the encrypted watermark may be increased. That is, if the watermark added in the video frame is an encrypted watermark, the difficulty of identifying the video frame containing the encrypted watermark is further increased, and the efficiency of manual identification is lower.
In view of this, the embodiments of the present invention provide a method, a device, and an electronic apparatus for identifying a watermark video frame, which are generally in the production process of the watermark video frame: acquiring an operation request of a video to be processed; selecting a video frame to be processed from the video to be processed; adding the target watermark into a video frame to be processed to obtain a video frame added with the watermark; and adjusting the pixel value in the video frame based on the target pixel value rule aiming at the video frame added with the watermark, so that the pixel value adjustment area obtained after adjustment accords with the target pixel value rule. In the process of identifying the watermark video frame: acquiring a video to be detected; detecting each video frame to be detected in the video to be detected, and determining whether the video frame contains a preset pixel value adjustment area or not; and determining the video frame to be detected containing the preset pixel value adjustment area as the video frame added with the watermark, so as to realize automatic identification of the video frame containing the watermark from the video.
It should be noted that, the method for identifying and producing the watermark video frame provided in the embodiment of the present invention may be applied to electronic devices with information processing capability, such as a terminal where a server or a client is located. However, for convenience of description, the following will take an example that the identification method of the watermark video frame is applied to the server and the production method of the watermark video frame is applied to the client, to describe the embodiment of the present invention in detail.
As shown in fig. 1, an embodiment of the present invention provides a method for identifying a watermark video frame, which may include:
s101, acquiring a video to be detected.
S102, detecting each video frame to be detected in the video to be detected, and determining whether the video frame contains a preset pixel value adjustment area or not; the pixel value adjustment area is: adjusting pixel values in the video frame based on a target pixel value rule, and conforming to the region of the target pixel value rule; the target pixel value rule includes: and the pixel value adjustment region is used for adjusting the change rule of the pixel value between the pixel values.
S103, determining the video frame to be detected containing the preset pixel value adjustment area as the video frame added with the watermark.
The method for identifying the watermark video frame provided by the embodiment of the invention comprises the steps of obtaining a video to be detected; detecting each video frame to be detected in the video to be detected, and determining whether the video frame contains a preset pixel value adjusting area, wherein the pixel value adjusting area is an area which accords with the target pixel value rule after the pixel value in the video frame added with the watermark is adjusted in advance. Therefore, when a video frame containing the pixel value adjustment area is identified from the video to be detected, the video frame is the video frame added with the watermark, i.e. the video frame to be detected containing the preset pixel value adjustment area can be determined as the video frame added with the watermark. Therefore, the embodiment of the invention can automatically identify the video frame containing the watermark from the video to be detected.
Further, in step S101 of the embodiment shown in fig. 1, the video to be detected may be a video suspected of being pirated, for example, a video not allowed to be played in some specific websites or video APP (Application). These videos are usually recorded by the user through other video recording devices during the watching process, or obtained through a terminal screen where the video APP is located, and then streamed to some specific websites or video APPs, which may be referred to as videos to be detected.
Further, in step S102 of the embodiment shown in fig. 1, after the video to be detected is obtained, detection may be performed one by one for each video frame to be detected in the video to be detected, and it is determined whether the video frame to be detected includes a preset pixel value adjustment area. Since the pixel value adjustment area is: the pixel value in the video frame is adjusted based on the target pixel value rule, and then the region conforming to the target pixel value rule is included, and the watermark is also added in the video frame to be detected including the pixel value adjustment region, and the pixel value adjustment region may specifically be a region conforming to the target pixel value rule after the pixel value in the video frame is adjusted based on the target pixel value rule for the video frame to which the watermark is added. Therefore, when a video frame containing the pixel value adjustment area is identified from the video to be detected, the video frame is the video frame containing the watermark.
In this embodiment, the target pixel value rule includes: and the pixel value adjustment region is used for adjusting the change rule of the pixel value between the pixel values. The change rule of the pixel value between each pixel value in the pixel value adjustment area may include: the magnitude relation between the pixel values of two adjacent pixels, or the pixel values of the pixels in the same row from left to right gradually increase, gradually decrease, or the number of pixel values increasing or decreasing, etc.
Further, in step S103 of the embodiment shown in fig. 1, since the pixel value in the video frame to which the watermark is added can be adjusted based on the target pixel value rule in the process of adjusting the pixel value, the pixel value adjustment area is obtained, and therefore, the video frame includes both the watermark and the pixel value adjustment area. Therefore, when the video frame to be detected contains the pixel value adjustment area, it indicates that the watermark is added in the video frame to be detected, and the video frame to be detected containing the preset pixel value adjustment area can be determined as the video frame to be added with the watermark.
In the specific watermark extraction process, after a plurality of frames of video frames added with watermarks are determined from the video to be detected, the watermarks can be identified from the video frames through manual repeated comparison.
As an optional implementation manner of the embodiment of the present invention, as shown in fig. 2a, step S102 of the embodiment shown in fig. 1, detecting each video frame to be detected in the video to be detected, and determining whether the video frame includes a preset pixel value adjustment area, may include:
s201, extracting gradient characteristics of each video frame to be detected.
In the embodiment of the invention, all pixel values in the video frame can be adjusted to obtain the pixel value adjustment area, and the size of the pixel value adjustment area is the same as that of the video frame. Thus, in this case, gradient features of the respective video frame to be detected can be extracted, each element of the gradient features representing: the pixel value of the pixel having the same position as the element in the video frame to be detected, and the pixel value of the adjacent pixel.
S202, judging whether each pixel value in the video frame to be detected accords with the change rule of the pixel value among the pixel values in the pixel value adjustment area in the target pixel value rule according to the gradient characteristics of the video frame to be detected.
Since the gradient feature can represent the magnitude relation between each pixel value and the adjacent pixel value in the video frame to be detected, after the gradient feature of each video frame to be detected is obtained, whether each pixel value in each video frame to be detected accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule can be judged.
It should be noted that, for any pixel, the adjacent pixel of the pixel and the pixel are located in the same horizontal direction or the same vertical direction, and the adjacent pixel of the pixel may be the previous pixel or the next pixel of the pixel.
S203, if yes, the video frame to be detected comprises a preset pixel value adjusting area.
S204, if not, the video frame to be detected does not contain a preset pixel value adjustment area.
In the embodiment of the invention, the gradient characteristics of each video frame to be detected are extracted, and the video frame to be detected which accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule is obtained according to whether the video frame to be detected accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule. Because the gradient characteristics can well represent the change rule of the pixel value between each pixel value in the pixel adjustment area, the embodiment of the invention can more accurately judge whether the video frame to be detected contains the pixel value adjustment area or not based on the gradient characteristics.
As an optional implementation manner of the embodiment of the present invention, the target pixel value rule further includes: the pixel value adjusts the size of the region. The size of the pixel value adjustment region may include: the length and width of the pixel value adjustment region, and the size of the pixel value adjustment region may be set according to actual needs, for example, may be set to be the same as the size of the video frame; it may also be set smaller than the size of the video frame, e.g., 300 x 300 or 400 x 400, etc.
As shown in fig. 2b, step S102 of the embodiment shown in fig. 1, the step of detecting each video frame to be detected in the video to be detected and determining whether the video frame includes a preset pixel value adjustment area may include:
and S205, traversing each video frame to be detected based on the size of the pixel value adjustment area included in the target pixel value rule, and obtaining a plurality of undetermined areas with the size of the pixel value adjustment area in the video frame to be detected.
For each video frame to be detected, a plurality of undetermined areas with the sizes of the pixel value adjustment areas can be obtained from the video frame to be detected. Specifically, each pixel of the video frame to be detected may be traversed in the order from top to bottom and from left to right, and the pixel is taken as the top left corner vertex of the pending area, so as to obtain the pending area, until the size of the area that can be selected is smaller than the size of the pixel value adjustment area when a certain pixel is taken as the top left corner vertex, so that multiple pending areas may be obtained for each video frame to be detected.
For example, when the length and width of the undetermined area are both 300, and the length and width of the video frame to be detected are both 400, the pixel is taken as the top left corner vertex for the pixel of the first row and first column in the video frame to be detected, and the undetermined area can be determined to be an area enclosed by the pixel of the first row and first column, the pixel of the first row and 300 th column, the pixel of the 300 th row and 1 st column, and the pixel of the 300 th row and 300 th column. For the pixel in row 301 and column 1, if the pixel is taken as the top left corner vertex, the determinable maximum width is 200, which is smaller than the width of the pixel value adjustment region, so that the pixel cannot be taken as the top left corner vertex to select the undetermined region.
S206, extracting gradient characteristics of the undetermined areas for each undetermined area.
Extracting gradient characteristics of each undetermined area, wherein each element in the gradient characteristics of each undetermined area represents: a magnitude relationship between a pixel value of a pixel in the undetermined region that has the same position as the element and a pixel value of an adjacent pixel.
The gradient characteristics of each region to be determined can be extracted by the following method:
first, traversing each pixel in each undetermined area, and judging the magnitude relation between the pixel value of each pixel and the pixel value of the adjacent pixel.
And step two, according to different judging results, obtaining a first mark or a second mark corresponding to each pixel.
According to different judging results, a first mark or a second mark corresponding to each pixel can be obtained, wherein the pixel value of the pixel corresponding to the first mark is larger than that of the adjacent pixel, and the pixel value of the pixel corresponding to the second mark is smaller than that of the adjacent pixel. That is, when the judgment result is greater than the first identification, the identification corresponding to the pixel is the first identification; and when the judging result is smaller than the first judging result, the mark corresponding to the pixel is the second mark. Specifically, for example, the first identifier may be 1, and the second identifier may be 0.
And thirdly, forming the first mark or the second mark corresponding to each pixel into gradient characteristics.
After the first mark or the second mark corresponding to each pixel in the to-be-determined area is obtained, the first mark or the second mark can be formed into gradient features according to the length and the width of the to-be-determined area. The length of the gradient feature is the same as the length of the region to be determined, and the width of the gradient feature is the same as the width of the region to be determined.
To further improve the accuracy of identification of the video frame containing the watermark, the gradient features may include: a horizontal gradient feature and a vertical gradient feature.
The horizontal gradient characteristics of each region to be determined can be extracted by the following method:
and traversing each pixel of the undetermined area row by row for each undetermined area, and judging the magnitude relation between the pixel value of each pixel and the pixel value of the adjacent pixel in the same row. Generating a third mark or a fourth mark corresponding to each pixel according to different judging results; and forming a third mark or a fourth mark corresponding to each pixel into a horizontal gradient characteristic. Specifically, for example, the third identifier may be 1, and the fourth identifier may be 0.
The vertical gradient characteristics of each region to be determined can be extracted by the following method:
And traversing each pixel of the undetermined area column by column for each undetermined area, and judging the magnitude relation between the pixel value of each pixel and the pixel value of the adjacent pixels in the same column. And generating a fifth mark or a sixth mark corresponding to each pixel according to different judging results. And forming a fifth mark or a sixth mark corresponding to each pixel into a vertical gradient characteristic. Specifically, for example, the fifth identifier may be 1, and the sixth identifier may be 0. It should be noted that, the method for extracting the gradient features of the undetermined area is also applicable to the extracting process of the gradient features of the video frame to be detected.
S207, judging whether each pixel value in the to-be-determined area accords with the change rule of the pixel value among the pixel values in the pixel value adjustment area in the target pixel value rule according to the gradient characteristics of the to-be-determined area.
Since the gradient feature can represent the magnitude relation between each pixel value in the pending area and the adjacent pixel values, after the gradient feature of each pending area is obtained, it can be determined whether each pixel value in each pending area accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule.
When the gradient features comprise horizontal gradient features and vertical gradient features, judging whether each pixel value in each region to be determined accords with a change rule of the pixel value between each pixel value in a pixel value adjusting region in a target pixel value rule according to the horizontal gradient features; and judging whether each pixel value in each to-be-positioned area accords with the change rule of the pixel value among each pixel value in the pixel value adjusting area in the target pixel value rule according to the vertical gradient characteristics. When each pixel value in each region to be determined accords with the change rule of the pixel value among the pixel values in the pixel value adjustment region in the target pixel value rule according to the horizontal gradient characteristic and the vertical gradient characteristic, the region to be determined accords with the change rule of the pixel value among the pixel values in the pixel value adjustment region in the target pixel value rule.
In the embodiment of the invention, the horizontal gradient characteristic is generated according to the magnitude relation between the pixel value of each pixel in the same row and the pixel value of the adjacent pixel, the vertical gradient characteristic is generated according to the magnitude relation between the pixel value of each pixel in the same column and the pixel value of the adjacent pixel, and when judging that the to-be-determined area meets the target pixel value rule according to the horizontal gradient characteristic and the vertical gradient characteristic, the video frame where the to-be-determined area is positioned is judged to meet the target pixel value rule, so that the recognition difficulty of the pixel value adjustment area is increased, the recognition difficulty of the watermark video frame is increased, and the watermark added in the video frame can be better prevented from being damaged.
S208, if the undetermined area accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule, the video frame where the undetermined area is located contains a preset pixel value adjustment area.
It should be noted that, generally, a to-be-detected video frame may include a pixel value adjustment area, and a plurality of to-be-determined areas are determined from the to-be-detected video frame, so that whether the plurality of to-be-determined areas conform to a target pixel value rule or not may be determined one by one, and when one of the to-be-determined areas conforms to a change rule of pixel values among all pixel values in the pixel value adjustment area, the determination of other to-be-determined areas is not required, that is, the determination process is stopped, so that computing resources may be saved.
S209, if all the undetermined areas in the video frame to be detected do not accord with the change rule of the pixel value among the pixel values in the pixel value adjustment area in the target pixel value rule, the video frame in which the undetermined areas are located does not contain the preset pixel value adjustment area.
In the embodiment of the invention, the gradient characteristics of each to-be-detected region are extracted by acquiring a plurality of to-be-detected regions corresponding to each to-be-detected video frame, and the to-be-detected video frame where the to-be-detected region accords with the change rule of the pixel values among the pixel values in the pixel value adjustment region in the target pixel value rule is obtained according to whether the to-be-detected region accords with the change rule of the pixel values among the pixel values in the pixel value adjustment region in the target pixel value rule.
As an optional implementation manner of the embodiment of the present invention, in the target pixel value rule, a change rule of a pixel value between each pixel value in the pixel value adjustment area includes: a pixel that increases compared to the adjacent pixel value occupies a first proportion of the total pixels of the pixel value adjustment area, and a pixel that decreases compared to the adjacent pixel value occupies a second proportion of the total pixels of the pixel value adjustment area. For example, the first ratio and the second ratio are respectively 50%, or the first ratio is 40%, the second ratio is 60%, or the like.
Among the gradient characteristics of the undetermined region are: the pixel value of each pixel is increased or decreased by a corresponding identification compared to the adjacent pixel value. For a specific procedure for obtaining gradient characteristics of each undetermined area, reference may be made to step S206 of the flow shown in fig. 2 b.
As shown in fig. 3, in step S207 of the embodiment shown in fig. 2b, the step of determining whether each pixel value in the to-be-determined area accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule according to the gradient feature of the to-be-determined area may include:
s301, based on the indication that the pixel value of each pixel increases or decreases compared to the adjacent pixel value in the gradient feature, counting a third proportion of pixels increased compared to the adjacent pixel value to the total pixel of the pixel value adjustment region and a fourth proportion of pixels decreased compared to the adjacent pixel value to the total pixel of the pixel value adjustment region.
Since each element in the gradient feature represents the magnitude relation between the pixel value of the pixel having the same position as the element in the region to be determined and the pixel value of the adjacent pixel, it is possible to count the third proportion of the pixel increased compared to the adjacent pixel value to the total pixel of the pixel value adjustment region and the fourth proportion of the pixel decreased compared to the adjacent pixel value to the total pixel of the pixel value adjustment region.
Specifically, since the gradient feature may include the first identifier and the second identifier, the number of the first identifiers and the number of the second identifiers in the gradient feature may be counted respectively; and counting the total element number in the gradient feature. The ratio between the first number of identifications and the total number of elements is calculated as a third ratio, and the ratio between the second number of identifications and the total number of elements is calculated as a fourth ratio.
S302, judging whether the absolute value of the difference value between the counted third proportion and the first proportion is smaller than or equal to a first preset threshold value.
A difference between the third ratio and the first ratio may be calculated and it may be determined whether an absolute value of the calculated difference is less than or equal to a first preset threshold. For example, when the first ratio is 0.5, the length and width of the undetermined area are 300, the first number of marks is 40000, the second number of marks is 50000, the sum of the first number of marks and the second number of marks is 90000, the first ratio is 40000/90000=0.44, and the absolute value of the difference between the third ratio and the first ratio is |0.44-0.5|=0.06. When the first preset threshold is 0.07, the difference is smaller than the first preset threshold.
S303, if so, the undetermined area accords with the change rule of the pixel value between each pixel value in the pixel value adjusting area in the target pixel value rule.
S304, if not, the undetermined area does not accord with the change rule of the pixel value among the pixel values in the pixel value adjusting area in the target pixel value rule.
If the absolute value of the difference between the third proportion and the first proportion is smaller than or equal to a first preset threshold value, the fact that the undetermined area accords with the change rule of the pixel value among all the pixel values in the pixel value adjusting area in the target pixel value rule is indicated, and otherwise, the undetermined area does not accord with the change rule.
It should be noted that, in addition to determining whether the absolute value of the difference between the third ratio and the first ratio is smaller than or equal to the first preset threshold in step S302 to determine whether the to-be-determined area meets the change rule of the pixel values between the pixel values in the pixel value adjustment area, the change rule of the pixel values between the pixel values in the pixel value adjustment area may also be determined whether the to-be-determined area meets the target pixel value rule by determining whether the absolute value of the difference between the fourth ratio and the second ratio is smaller than or equal to the second preset threshold. In the above-mentioned steps S301-S304, the method for determining whether the pending area meets the rule of the target pixel value is simpler.
As an optional implementation manner of the embodiment of the present invention, the target pixel value rule may further include: pixels whose pixel values are increased compared with adjacent pixel values in the pixel value adjustment region are arranged in order of pixels whose pixel values are decreased compared with adjacent pixel values. For example, the arrangement order may be: pixels having increased values compared to adjacent pixels are arranged at intervals from pixels having decreased values compared to adjacent pixels. Illustrating: the second pixel increases in pixel value compared to the first pixel, the third pixel decreases in pixel value compared to the second pixel, the fourth pixel increases in pixel value compared to the third pixel, and so on.
In the embodiment shown in fig. 3, in steps S302 and S303, it is determined whether the absolute value of the difference between the third ratio and the first ratio is smaller than or equal to the first preset threshold, and if yes, the predetermined area conforms to the change rule of the pixel value between each pixel value in the pixel value adjustment area, where the step includes:
judging whether the absolute value of the difference between the third proportion and the first proportion is smaller than or equal to a first preset threshold value, if so, judging whether the arrangement sequence of the marks for increasing or decreasing the pixel value of each pixel compared with the adjacent pixel value accords with the arrangement sequence in the target pixel value rule, and if so, judging whether the undetermined area accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule.
When the first proportion of pixels increased from the adjacent pixel value to the total pixels of the pixel value adjustment area and the second proportion of pixels decreased from the adjacent pixel value to the total pixels of the pixel value adjustment area are determined in the pixel value adjustment area, there may be a plurality of different arrangement orders of pixels increased from the adjacent pixel value to pixels decreased from the adjacent pixel value. Therefore, when the absolute value of the difference between the third proportion and the first proportion is judged to be smaller than or equal to the first preset threshold value, whether the arrangement sequence of the marks that the pixel value of each pixel is increased or decreased compared with the adjacent pixel value accords with the arrangement sequence in the target pixel value rule can be further judged, and if so, the fact that the undetermined area accords with the change rule in the target pixel value rule is indicated.
Judging whether the absolute value of the difference value between the fourth proportion and the second proportion is smaller than or equal to a second preset threshold value, if so, the undetermined area accords with the change rule of the pixel value among all the pixel values in the pixel value adjusting area, and the method comprises the following steps:
judging whether the absolute value of the difference between the fourth proportion and the second proportion is smaller than or equal to a first preset threshold value, if so, judging whether the arrangement sequence of the marks for increasing or decreasing the pixel value of each pixel compared with the adjacent pixel value accords with the arrangement sequence in the target pixel value rule, and if so, judging whether the undetermined area accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule.
Since there may be a plurality of different arrangement orders of pixels that are increased compared to adjacent pixel values and pixels that are decreased compared to adjacent pixel values when the first proportion and the second proportion are included in the change order of the pixel value between the pixel values in the pixel value adjustment area, when the absolute value of the difference between the fourth proportion and the second proportion is determined to be less than or equal to the first preset threshold value, it may be further determined whether the arrangement order of the identifiers that the pixel values of the respective pixels are increased or decreased compared to the adjacent pixel values accords with the arrangement order in the target pixel value rule, and if so, it is indicated that the region to be determined accords with the change order in the target pixel value rule.
As an optional implementation manner of the embodiment of the present invention, before step S207 of the embodiment flow shown in fig. 2b, according to the gradient characteristics of the to-be-determined area, it is determined whether each pixel value in the to-be-determined area accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule, the method for identifying the watermark video frame provided by the embodiment of the present invention may further include:
first, a new pixel value rule is acquired at regular time.
In order to prevent the pixel value rule from being broken maliciously, so that the video frame added with the watermark is identified maliciously, the pixel value rule may be updated at intervals; or updating the pixel value rule after finding that the pixel value rule is broken. In this way, a plurality of pixel value rules are maintained in the server. The new pixel value rule may be predetermined by a developer and stored in a storage server from which the server may retrieve the new pixel value rule. Of course, the new change rule may be predetermined by a developer and stored in the server applied in the embodiment of the present invention.
The size of the pixel value adjustment region in the different pixel value rules, the pixel value of the change rule of the pixel value size among the pixel values in the pixel value adjustment region, and the relative position relationship between the adjustment region and the watermark region are different.
And a second step of generating new version information corresponding to the new pixel value rule based on the version information of the existing pixel value rule.
When the server obtains one pixel value rule, version information is generated and used for representing the sequence of the corresponding pixel value rule and other pixel value rules stored in the server. New version information may be generated based on version information of existing pixel value rules. Specifically, the version information may be a value, and may be obtained by adding a preset value according to the version information of the pixel value rule acquired last time by the server, for example, adding one to the version information of the pixel value rule acquired last time, so as to obtain new version information.
And thirdly, creating a corresponding relation between the new pixel value rule and the new version information.
Then, a corresponding relation between the new pixel value rule and the new version information is created and stored.
And fourthly, selecting a pixel value rule corresponding to the latest version information from the plurality of pixel value rules, and determining the pixel value rule as a target pixel value rule.
Because the probability of the pixel value rule conforming to the latest version information of the undetermined region in the acquired video to be detected is higher, the pixel value rule with the latest version information can be selected from a plurality of pixel value rules and used as the target pixel value rule.
As shown in fig. 4, in step S207 of the embodiment shown in fig. 2b, according to the gradient characteristics of the to-be-determined area, it is determined whether each pixel value in the to-be-determined area meets the change rule of the pixel value between each pixel value in the pixel value adjustment area, and after the step of determining whether each pixel value meets the target pixel value rule, the method for identifying a watermark video frame according to the embodiment of the present invention may further include:
s401, if each undetermined area does not accord with the change rule of the pixel value among the pixel values in the pixel value adjustment area, selecting one pixel value rule from a plurality of pixel value rules acquired in advance, determining the pixel value rule as the target pixel value rule, returning to S207, and judging whether each pixel value in each undetermined area accords with the change rule of the pixel value among the pixel values in the pixel value adjustment area according to the gradient characteristics of each undetermined area.
If each pending area does not conform to the change rule of the pixel value between the pixel values in the pixel value adjustment area, it indicates that each video frame to be detected in the video to be detected does not include the pixel value adjustment area conforming to the target pixel value rule, but the video frame to be detected in the video to be detected may include the pixel value adjustment area conforming to the other pixel value rules stored in the server, so that the pixel value rule corresponding to the adjacent version information may be selected from the multiple pixel value rules, determined as the target pixel value rule, and whether each video frame to be detected in the video to be detected includes the pixel value adjustment area conforming to the redetermined target pixel value rule is determined again, that is, step S207 is returned. Wherein the adjacent version information is adjacent version information of the current version information.
In addition, when the server receives a request for acquiring a pixel value rule sent by the client, the stored plurality of pixel value rules and the version information corresponding to each may be sent to the client. Or the server may send the updated pixel value rule to the client after updating the pixel value rule.
S402, until at least one undetermined area in the video frames to be detected in the video to be detected accords with the change rule of the pixel value among the pixel values in the pixel value adjustment area in the target pixel value rule, or all undetermined areas in the video frames to be detected do not accord with all the pixel value rules.
When the undetermined area in at least one to-be-detected video frame in the to-be-detected video accords with the change rule of the pixel value among the pixel values in the pixel value adjustment area in the target pixel value rule, whether the undetermined area in each to-be-detected video frame in the to-be-detected video accords with other pixel value rules or not is not needed to be detected. When the undetermined areas in all the video frames to be detected do not accord with all the pixel value rules, the undetermined areas indicate that all the video frames to be detected do not contain the pixel value adjustment areas, and then the video to be detected can be determined to not contain the watermark.
In the embodiment of the invention, the pixel value rule is updated regularly, and the pixel value rule with the latest version information is used as the target pixel value rule, so that the identification difficulty of the watermark video frame can be further improved.
As an optional implementation manner of the embodiment of the present invention, as shown in fig. 5a, after determining a video frame to be detected including a preset pixel value adjustment area as a video frame to which a watermark is added in step S103 of the flow shown in fig. 1, the method for identifying a watermark video frame in the embodiment of the present invention further includes:
S501, outputting and displaying the video frame with the watermark added. After the video frame added with the watermark is determined, the video frame added with the watermark can be output and displayed, so that a researcher can conveniently identify the watermark further aiming at the video frame added with the watermark.
In addition, after determining the video frame added with the watermark, besides adopting a method of outputting and displaying the video frame to enable a developer to identify the watermark in the video frame, the method can also adopt the frame number output of the video frame to enable the developer to search the video frame added with the watermark from the video to be detected according to the frame number and further identify the watermark from the video frame.
As an optional implementation manner of the embodiment of the present invention, the target pixel value rule further includes: a relative positional relationship between the pixel value adjustment region and the watermark region; the relative positional relationship may include: the pixel value adjusts the difference in coordinates between the center of the region and the center of the watermarking region. The relative positional relationship between the pixel value adjustment area and the watermarking area may be established in advance.
As shown in fig. 5b, after determining a video frame to be detected including a preset pixel value adjustment area as a video frame to which a watermark is added in step S103 in the embodiment of fig. 1, the method for identifying a watermark video frame according to the embodiment of the present invention may further include:
S502, determining the watermark area based on the relative position relation between the pixel value adjustment area and the watermark area and the pixel value adjustment area.
When each video frame to be detected in the video to be detected is detected, whether the video frame contains a preset pixel value adjustment area or not is determined, and if the video frame contains the pixel value adjustment area, the position of the pixel value adjustment area in the video frame can be determined. And then, according to the relative position relation and the position of the pixel value adjustment area, determining a watermark area from the video frame to be detected, further conveniently extracting the watermark therefrom, determining user information according to the watermark, and positioning the pirated user.
S503, highlighting the watermark area.
Since the watermark area is already determined, the watermark area may be highlighted. Referring to fig. 5c, the region in the frame is a watermark region, "zhangsan" is a watermark, and when the watermark is identified, only the region in the frame can be identified, so that the efficiency of identifying the watermark can be further improved. The watermark shown in fig. 5c is an unencrypted watermark, if the watermark is an encrypted watermark, the watermark image is relatively blurred, the watermark area is highlighted, and the effect of improving the efficiency is more obvious for the subsequent manual identification of the watermark.
It should be noted that, in one video to be detected, there may be one video frame to be detected to which a watermark is added and also include a pixel value adjustment area, or there may be a plurality of video frames to be detected to which a watermark is added and also include a pixel value adjustment area. Because the watermark is more difficult to identify due to the fact that the pixel values of the pixels in the original video frame are relatively close to each other when the watermark is added to the client, the watermark is added to the plurality of video frames to be detected, and the pixel value adjusting area is included, after the plurality of video frames containing the watermark are determined, multiple comparison and verification can be performed on the plurality of video frames, and therefore accuracy of watermark extraction is improved.
As shown in fig. 6, an embodiment of the present invention further provides a method for producing a watermark video frame, where the method may include:
s601, acquiring an operation request of a video to be processed.
S602, selecting a video frame to be processed from the video to be processed.
And S603, adding the target watermark into the video frame to be processed, and obtaining the video frame added with the watermark.
S604, for the watermarked video frame, adjusting the pixel value in the video frame based on a target pixel value rule, so that the pixel value adjustment area obtained after adjustment conforms to the target pixel value rule, where the target pixel value rule includes: and the pixel value adjustment region is used for adjusting the change rule of the pixel value between the pixel values.
The method for producing the watermark video frame acquires the operation request of the video to be processed; selecting a video frame to be processed from the video to be processed; adding the target watermark into a video frame to be processed to obtain a video frame added with the watermark; for a video frame added with the watermark, adjusting pixel values in the video frame based on a target pixel value rule so that a pixel value adjustment area obtained after adjustment accords with the target pixel value rule, wherein the target pixel value rule comprises the following steps: the size of the pixel value adjustment region and the variation law of the pixel value size between the individual pixel values in the pixel value adjustment region. The video frame added with the watermark is characterized in that the pixel value in the video frame is adjusted based on the target pixel value rule, so that the pixel value adjustment area obtained after adjustment accords with the target pixel value rule, and therefore the video frame added with the watermark also comprises the pixel value adjustment area.
Further, in step S601 of the embodiment shown in fig. 6, the operation request may include: play request, upload request, or post request. The video to be processed can be the video which the user wants to watch, upload or release in the client, when the user clicks, uploads or releases a certain video in the display page of the video APP, an operation request for the video is sent to the user client, the video is the video to be processed, and the client can acquire the operation request of the video to be processed.
Because the operated video is possibly suspected to be the video which is stolen in the process of playing, uploading and publishing by the user, after the playing request, the uploading request and the publishing request are acquired, the video frame to be processed aiming at the request can be added with the watermark so as to obtain the video frame added with the watermark. Thus, by the identification method of the watermark video frames, not only can users carrying out video recording and playing or video recording be traced, but also users uploading and publishing the video can be traced.
Further, in step S602 of the embodiment shown in fig. 6, after the operation request of the video to be processed is obtained, the frame of the video to be processed may be selected from the video to be processed. In the specific implementation process, the video frames to be processed can be randomly selected from the video to be processed; the position of the selected video frame in the video may also be preset, for example, the number of frames in the video to be processed in which the selected video frame to be processed is located is preset, and the video frame to be processed is obtained from the video to be processed according to the preset position.
In the process of selecting the video frames to be processed from the video to be processed, one video frame to be processed can be selected, a plurality of video frames to be processed can be selected, and the specific number can be preset.
Further, in the flow step S603 of the embodiment shown in fig. 6, since in the embodiment of the present invention, one of the purposes of adding the watermark to the video frame to be processed is: and detecting the suspected pirated video to be detected, extracting the watermark added in the video to be detected, and determining the user revealing the video based on the watermark. Thus, the content contained in the watermark may typically be capable of representing the user's information, for example, an account number used by the user when logging into the video APP, or the user's ID (Identity document, identification number), or the identity of the user's client. Specifically, after the operation request of the video to be processed is acquired, user information may be acquired, and a target watermark may be generated based on the user information, where the target watermark may be an image, and pixels representing the user information and background pixels respectively adopt different pixel values. The added watermark can be a common watermark or an encrypted watermark.
In the process of adding the target watermark to the video frame to be processed, the target watermark and the video frame to be processed can be fused.
Further, in step S604 of the embodiment shown in fig. 6, the target pixel value rule includes: and the pixel value adjustment region is used for adjusting the change rule of the pixel value between the pixel values. The change rule of the pixel value between each pixel value in the pixel value adjustment area may include: the magnitude relation between the pixel values of two adjacent pixels, or the pixel values of the pixels in the same row from left to right gradually increase, gradually decrease, or the number of pixel values increasing or decreasing, etc.
In addition, the target pixel value rule may further include a size of a pixel value adjustment region, and the size of the pixel value adjustment region may include: the length and width of the pixel value adjustment region, and the size of the pixel value adjustment region may be set as needed, for example, may be set to be the same as the size of the video frame; it may be set to a value of 300 x 300 or 400 x 400, for example.
For the video frame added with the watermark, the area to be adjusted can be selected randomly from the video frame added with the watermark according to the size of the pixel value adjustment area, and then the pixel value of the area to be adjusted in the video frame is adjusted based on the target pixel value rule, so that the pixel value adjustment area obtained after adjustment accords with the target pixel value rule. The setting of the pixel value adjustment area is not limited by the watermark area. For facilitating the identification of the watermark, the pixel value adjustment area and the watermark area may not overlap at all, but may also overlap partially or entirely.
As an optional implementation manner of the embodiment of the present invention, the target pixel value rule further includes: the pixel value adjusts the relative positional relationship between the region and the watermark region.
As shown in fig. 7, in step S603 of the embodiment shown in fig. 6, before the step of adding the target watermark to the video frame to be processed to obtain the watermarked video frame, the method for producing the watermarked video frame according to the embodiment of the present invention may further include:
s701, determining a watermark region from a video frame to be processed.
The watermark region size may be predetermined, and then a watermark region of the size of the watermark region, which is the region for adding the target watermark, may be randomly selected from the video frame to be processed.
S702, determining a region to be adjusted from the video frame to be processed according to the watermark region, the relative position relation between the pixel value adjustment region and the watermark region, and the size of the pixel value adjustment region in the target pixel value rule.
After the watermark area is determined, an area to be adjusted is determined from the video frame to be processed according to the relative position relationship among the watermark area, the pixel value adjustment area and the watermark area and the size of the pixel value adjustment area in the target pixel value rule, wherein the area to be adjusted is an area for adjusting the pixel value.
As an optional implementation manner of the embodiment of the present invention, as shown in fig. 8, in step S603 of the embodiment of fig. 6, before the step of adding the target watermark to the video frame to be processed to obtain the watermarked video frame, the method for producing the watermarked video frame provided by the embodiment of the present invention may further include:
s801, the size of the region is adjusted based on the pixel value in the target pixel value rule, and the region to be adjusted is determined from the video frame to be processed.
When the size of the pixel value adjustment region in the target pixel value rule only includes the length and the width of the pixel value adjustment region, a region to be adjusted can be randomly selected from the video frames to be processed according to the length and the width. Specifically, a pixel may be randomly selected from the video frame to be processed as a center point or a vertex of the region to be adjusted, and then the region to be adjusted is determined according to the length and the width. Of course, if the method is adopted to select the area to be adjusted, a random selection method is adopted every time the area to be adjusted is selected, and therefore, the selected area to be adjusted is different for different broadcasting times. In the practical application process, the situation that a competitor or other unconscious people maliciously extracts the watermark in the video frame often exists, and the random selection method is adopted, so that the difficulty in identifying the video frame containing the watermark can be increased, the difficulty in extracting and falsifying the watermark in the video frame is increased, and further, the recorded and broadcast video can be better prevented.
When the size of the pixel value adjustment region in the target pixel value rule includes the length, the width and the coordinate positions of the vertices of the pixel value adjustment region, the vertices may be determined in the video frame to be processed first, and then the region to be adjusted may be determined according to the length and the width.
S802, determining a watermark region according to the region to be adjusted and the relative position relationship between the pixel value adjustment region and the watermark region.
After the relative positional relationship is obtained, the watermark region can be determined from the video frame to be processed according to the relative positional relationship and the region to be adjusted. For example, the relative positional relationship may include: the pixel value adjusts the difference in coordinates between the center of the region and the center of the watermarking region. When the watermark area is determined according to the relative position relation, the relative position relation between the watermark area and the pixel value adjusting area is indicated, so that after the server acquires the video frame to be detected, the pixel value adjusting area and the relative position relation can be determined first, the watermark area in the pixel value adjusting area is determined, and the watermark is further conveniently extracted from the pixel value adjusting area.
In addition, after the watermark region is determined, a target watermark may be added to the watermark region of the video frame to be processed, to obtain a watermarked video frame. When the region to be adjusted is determined, the pixel value of the region to be adjusted in the video frame can be adjusted based on the target pixel value rule aiming at the video frame added with the watermark, so that the pixel value adjustment region obtained after adjustment accords with the target pixel value rule.
As an optional implementation manner of the embodiment of the present invention, the target pixel value rule further includes: in the pixel value adjustment region, a pixel increased in comparison with the adjacent pixel value occupies a first proportion of the total pixels of the pixel value adjustment region, and a pixel decreased in comparison with the adjacent pixel value occupies a second proportion of the total pixels of the pixel value adjustment region.
Further, since the first ratio is a ratio of the pixel having an increased pixel value compared to the pixel value of the adjacent pixel to the total pixel of the pixel value adjustment region in the pixel value adjustment region, when the first ratio is known, the second ratio can be obtained by subtracting the first ratio from 1. Therefore, only the first scale or the second scale may be included in the target pixel value rule.
In this case, as shown in fig. 9, in step S604 of the embodiment shown in fig. 6, for a watermarked video frame, the step of adjusting the pixel values in the video frame based on the target pixel value rule so that the pixel value adjustment area obtained after the adjustment conforms to the target pixel value rule may include:
s901, generating a feature matrix according to the first proportion, the second proportion and the size of the pixel value adjustment area in the target pixel value rule.
In generating the feature matrix, elements in the feature matrix may be predetermined, as each element in the feature matrix represents: in the pixel value adjustment area, the magnitude relation between the pixel value of the pixel having the same position as the element and the pixel value of the adjacent pixel may include more or less, and thus, the element in the feature matrix may be set to two different identifications, which may be a numerical value, a letter, or a character, for convenience of description, are named as a seventh identification and an eighth identification, respectively. For example, the seventh flag may indicate that the pixel value of the pixel is greater than the pixel value of the adjacent pixel and may be 1, and the eighth flag may indicate that the pixel value of the pixel is less than the pixel value of the adjacent pixel and may be 0.
The process of generating the feature matrix may specifically be: according to the size of the pixel value adjustment area in the target pixel value rule, determining the total number of elements in the feature matrix; then, a first number of pixels that are increased compared to the pixel value of the neighboring pixel may be determined, and a second number of pixels that are decreased compared to the pixel value of the neighboring pixel may be determined, based on the first ratio and the second ratio; and then the first number of seventh marks and the second number of eighth marks are formed into a feature matrix according to a preset composition rule. The preset composition rule may be an arrangement rule of each element in the feature matrix.
For example, assume that the length and width in the size information are both 300, the first ratio is 0.5, the seventh is labeled 1, and the eighth is labeled 0. The total number of elements in the feature matrix is 90000; the first number is 45000, the second number is 45000, when the preset composition rule is: the elements of each column are the same, and two adjacent elements in each row are different, so that the feature matrix is: the elements of the first row are 1, 0, 1 … …, respectively, the elements of the second row are 1, 0, 1 … …, respectively, and so on.
S902, traversing each pixel in the area to be adjusted, and judging whether the size relation between the pixel value of the pixel and the pixel value of the adjacent pixel corresponds to an element in the feature matrix.
If not, S903 is performed, the pixel value of the pixel is increased or decreased according to the feature matrix.
And S904, if yes, keeping the pixel value unchanged.
After the feature matrix is acquired, each pixel in the region to be adjusted can be traversed, and whether the magnitude relation between the pixel value of each pixel and the pixel value of the adjacent pixel corresponds to an element in the feature matrix is judged. It should be noted here that, for the first column of pixels in the area to be adjusted, since there is no pixel before the column of pixels, the pixel value may be generally kept unchanged for the column of pixels. For each pixel in the second column, judging the magnitude relation before the pixel value of the pixel and the adjacent pixel to obtain a judging result which is larger or smaller; determining elements with the same positions in the feature matrix, determining the size relation represented by the elements, judging whether the elements are consistent with each other, and if so, keeping the pixel value of the pixel unchanged; if not, the pixel value of the pixel needs to be increased or decreased according to the element so that the pixel value corresponds to the element.
For example, when the pixel value of the pixel in the first row and the second column in the area to be adjusted is greater than the pixel value of the pixel in the first row and the first column, and the element in the first row and the second column in the feature matrix is 0, it indicates that the pixel values are inconsistent, and the pixel value of the pixel in the first row and the second column in the area to be adjusted needs to be reduced so as to be smaller than the pixel value of the pixel in the first row and the first column.
In order to further increase the difficulty of identifying the watermark video frame, a horizontal feature matrix and a vertical feature matrix may be generated according to the first proportion, the second proportion, and the size of the pixel value adjustment region in the target pixel value rule, respectively. Wherein the elements in the horizontal feature matrix represent: a magnitude relation between pixel values of each pixel and pixel values of adjacent pixels in the same row; the elements in the vertical feature matrix represent: the magnitude relationship between the pixel value of each pixel and the pixel value of an adjacent pixel in the same column.
Then traversing each pixel in the area to be adjusted, and judging whether the pixel value of each pixel corresponds to an element in the horizontal feature matrix or not according to the magnitude relation between the pixel value of each pixel and the pixel value of the adjacent pixel in the same row; if not, the pixel value of the pixel is increased or decreased according to the horizontal feature matrix.
Judging whether the size relation between the pixel value of the pixel and the pixel value of the adjacent pixel in the same column corresponds to an element in the vertical feature matrix; if not, increasing or decreasing the pixel value of the pixel according to the vertical feature matrix.
In addition, in the embodiment of the present invention, the pixel value to be adjusted may be a luminance value, and before the pixel value of each pixel is determined, the luminance value of each pixel may be obtained. Specifically, the method can be obtained in three ways:
first kind: since the video frame to be processed may be an image expressed in RGB color space in general, the luminance value of each pixel may be calculated by extracting the color parameter value of the red channel, the color parameter value of the green channel, and the color parameter value of the blue channel of each pixel and using a luminance value calculation formula.
Second kind: an image of the RGB color space representation may be converted into a gray scale image from which luminance values are then extracted.
Third, an image of an RGB color space representation may be converted to a YUV image, from which luminance values are then obtained.
In the embodiment of the invention, a feature matrix can be generated according to the first proportion, the second proportion and the size of a pixel value adjustment area included in a target pixel value rule, each pixel in the area to be adjusted is traversed, and whether the size relation between the pixel value of each pixel and the pixel value of an adjacent pixel corresponds to an element in the feature matrix is judged; if not, the pixel value of the pixel is increased or decreased according to the feature matrix, so that the pixel value in the video frame to be processed can be adjusted based on the target pixel value rule.
As an optional implementation manner of the embodiment of the present invention, the target pixel value rule further includes: pixels whose pixel values are increased compared with adjacent pixel values in the pixel value adjustment region are arranged in order of pixels whose pixel values are decreased compared with adjacent pixel values.
The flow step S901 of the embodiment shown in fig. 9, which includes the step of generating a feature matrix according to the first scale, the second scale, and the size of the pixel value adjustment area in the target pixel value rule, includes:
and generating a feature matrix according to the first proportion, the second proportion, the arrangement sequence in the target pixel value rule and the size of the pixel value adjustment area in the target pixel value rule.
When the first proportion of the pixels increased from the adjacent pixel value to the total pixels of the pixel value adjustment area and the second proportion of the pixels decreased from the adjacent pixel value to the total pixels of the pixel value adjustment area are determined in the pixel value adjustment area, there may be a plurality of different arrangement orders of the pixels increased from the adjacent pixel value and the pixels decreased from the adjacent pixel value, and therefore, in generating the feature matrix, the arrangement order of the pixels increased from the adjacent pixel value and the pixels decreased from the adjacent pixel value in the target pixel value rule may also be considered to generate one feature matrix uniquely corresponding thereto.
As an optional implementation manner of the embodiment of the present invention, as shown in fig. 10, before step S604 of the embodiment of fig. 6, for a watermarked video frame, pixel values in the video frame are adjusted based on a target pixel value rule, so that a pixel value adjustment area obtained after adjustment conforms to the target pixel value rule, a method for producing a watermarked video frame provided by the embodiment of the present invention may further include:
s1001, a plurality of pixel value rules and version information corresponding to each pixel value rule are acquired.
In order to prevent the pixel value rule from being broken maliciously, so that the video frame to be processed with the target watermark added is identified, typically, the server may update the pixel value rule at intervals of a period of time, or update the pixel value rule after finding that the pixel value rule is broken. In this way, a plurality of pixel value rules are maintained in the server. The client may obtain a plurality of pixel value rules and version information corresponding to each pixel value rule from the server. The version information may be a numerical value and may represent a sequential order in which the server maintains the rules of the respective pixel values.
S1002, selecting a pixel value rule with the latest version information from a plurality of pixel value rules, and determining the pixel value rule as a target pixel value rule.
Since the probability that the pixel value rule corresponding to the latest version information is broken is large, the pixel value rule with the latest version information can be selected from the plurality of pixel value rules according to the version information and used as the target pixel value rule.
In the embodiment of the invention, the identification difficulty of the encrypted watermark video frame can be further improved by acquiring a plurality of pixel value rules from the server and taking the pixel value rule with the latest version information as the target pixel value rule.
As an optional implementation manner of the embodiment of the present invention, an encrypted watermark may be added to a video frame to be processed, as shown in fig. 11, and in step S603 of the embodiment shown in fig. 6, the step of adding a target watermark to the video frame to be processed to obtain a watermarked video frame may include:
s1101, obtaining area pixel values of each pixel in a watermark area; and obtaining watermark pixel values of all pixels in the target watermark.
After determining the watermark region, region pixel values for each pixel in the watermark region may be obtained, which may include: color parameter values for the red channel, color parameter values for the green channel and color parameter values for the blue channel.
Watermark pixel values for each pixel may be obtained from the target watermark, which may likewise include: color parameter values for the red channel, color parameter values for the green channel and color parameter values for the blue channel.
S1102, calculating a first product between the regional pixel value and a first preset weight coefficient; and calculating a second product between the watermark pixel value and a second preset weight coefficient.
The first preset weight coefficient and the second preset weight coefficient can be preset according to experience or experiment, the sum of the two weight coefficients can be 1, and the setting of the weight coefficients can be based on the principle that the watching experience of a user is not affected and the video frame to be processed is not easy to find when being checked by naked eyes. For example, the first preset weight coefficient may be set to 0.7 and the second preset weight coefficient may be set to 0.3.
When calculating a first product between the pixel value of the region and a first preset weight coefficient, the color parameter values of the three channels are required to be multiplied by the first preset weight coefficient respectively; similarly, when calculating the second product between the watermark pixel value and the second preset weight coefficient, the color parameter values of the three channels need to be multiplied by the second preset weight coefficient respectively.
S1103, a sum of the first product and the second product is calculated as the target pixel value.
The sum of the first product and the second product may be taken as the target pixel value. Here, the size of the watermark region may be the same as the size of the target watermark, and thus, when calculating the target pixel value, the pixel value of the pixel having the same position as the target watermark is calculated by using the watermark region.
For example: the pixel values of the pixels in the first row and the first column in the watermark area are: r1, g1 and b1, the pixel values of the pixels in the first row and the first column in the target watermark are: r2, g2 and b2, wherein the first preset weight coefficient is a1, the second preset weight coefficient is a2, and then the target pixel values r3, g3 and b3 in the first row and the first column are respectively: r3=r1 a1+r2 a2; g3 =g1×a1+g2×a2; b3 =b1×a1+b2×a2.
S1104 updates the pixel value of the pixel in the watermark area to the target pixel value.
After obtaining the target pixel value of the pixels in each watermark region, the pixel value of each pixel may be updated to the target pixel value. In the embodiment of the invention, the pixel values of the pixels in the watermark area and the pixel values of the pixels in the target watermark are weighted, so that the target watermark is not easy to be found in the video frame to be processed added with the target watermark.
The embodiment of the present invention provides a specific embodiment of a watermark video frame identification apparatus, corresponding to the flow shown in fig. 1, referring to fig. 12, fig. 12 is a schematic structural diagram of a watermark video frame identification apparatus according to the embodiment of the present invention, where the watermark video frame identification apparatus may include:
the to-be-detected video acquisition module 1201 is configured to acquire a to-be-detected video.
The to-be-detected video frame detection module 1202 is configured to detect each to-be-detected video frame in the to-be-detected video, and determine whether the video frame includes a preset pixel value adjustment area; the pixel value adjustment area is: adjusting pixel values in the video frame based on a target pixel value rule, and conforming to the region of the target pixel value rule; the target pixel value rule includes: and the pixel value adjustment region is used for adjusting the change rule of the pixel value between the pixel values.
The video frame determining module 1203 is configured to determine a video frame to be detected including a preset pixel value adjustment area as a video frame to which a watermark is added.
The identification device of the watermark video frame provided by the embodiment of the invention obtains the video to be detected; detecting each video frame to be detected in the video to be detected, and determining whether the video frame contains a preset pixel value adjusting area, wherein the pixel value adjusting area is an area which accords with the target pixel value rule after the pixel value in the video frame added with the watermark is adjusted in advance. Therefore, when a video frame containing the pixel value adjustment area is identified from the video to be detected, the video frame is the video frame added with the watermark, i.e. the video frame to be detected containing the preset pixel value adjustment area can be determined as the video frame added with the watermark. Therefore, the embodiment of the invention can automatically identify the video frame containing the watermark from the video to be detected.
As an optional implementation manner of the embodiment of the present invention, the pixel value adjustment area is specifically: and aiming at the video frame added with the watermark, adjusting the pixel value in the video frame based on the target pixel value rule, and conforming to the region of the target pixel value rule.
As an optional implementation manner of the embodiment of the present invention, the above-mentioned to-be-detected video frame detection module 1202 may include:
the first gradient feature extraction submodule is used for extracting gradient features of each video frame to be detected; each element in the gradient feature represents: the pixel value of the pixel having the same position as the element in the video frame to be detected, and the pixel value of the adjacent pixel.
The first pixel value judging sub-module is used for judging whether each pixel value in the video frame to be detected accords with the change rule of the pixel value between each pixel value in the pixel value adjusting area in the target pixel value rule according to the gradient characteristics of the video frame to be detected.
The first video frame determining submodule is used for determining that a video frame to be detected contains a preset pixel value adjusting area if yes.
As an optional implementation manner of the embodiment of the present invention, the target pixel value rule further includes: the pixel value adjusts the size of the region.
The device for identifying the watermark video frame in the embodiment of the invention further comprises:
the undetermined area obtaining module is used for traversing each video frame to be detected based on the size of the pixel value adjustment area included in the target pixel value rule to obtain a plurality of undetermined areas with the size of the pixel value adjustment area in the video frame to be detected.
The video frame detection module 1202 includes:
the second gradient feature extraction submodule is used for extracting gradient features of the undetermined areas aiming at each undetermined area; each element in the gradient profile of the undetermined region represents: a magnitude relationship between a pixel value of a pixel in the undetermined region that has the same position as the element and a pixel value of an adjacent pixel.
And the second pixel value judging sub-module is used for judging whether each pixel value in the to-be-determined area accords with the change rule of the pixel value among the pixel values in the pixel value adjusting area in the target pixel value rule according to the gradient characteristics of the to-be-determined area.
The second video frame determining submodule is used for, if the to-be-determined area accords with the change rule of the pixel value among the pixel values in the pixel value adjusting area in the target pixel value rule, including a preset pixel value adjusting area in the video frame where the to-be-determined area is located.
As an optional implementation manner of the embodiment of the present invention, in the target pixel value rule, a change rule of a pixel value between each pixel value in the pixel value adjustment area includes: a pixel that increases compared to the adjacent pixel value occupies a first proportion of the total pixels of the pixel value adjustment area, and a pixel that decreases compared to the adjacent pixel value occupies a second proportion of the total pixels of the pixel value adjustment area.
The gradient characteristics of each undetermined area comprise: the pixel value of each pixel is increased or decreased by a corresponding identification compared to the adjacent pixel value.
The second pixel value judging sub-module includes:
and the proportion counting unit is used for counting a third proportion of pixels which are increased compared with the adjacent pixel values to the total pixels of the pixel value adjustment area and a fourth proportion of pixels which are reduced compared with the adjacent pixel values to the total pixels of the pixel value adjustment area based on the marks that the pixel values of the pixels are increased or reduced compared with the adjacent pixel values in the gradient characteristics.
The first proportion judging unit is used for judging whether the absolute value of the difference value between the counted third proportion and the first proportion is smaller than or equal to a first preset threshold value, if so, the undetermined area accords with the change rule of the pixel value among the pixel values in the pixel value adjusting area.
Or the second proportion judging unit is used for judging whether the absolute value of the difference value between the fourth proportion and the second proportion is smaller than or equal to a second preset threshold value, if so, the undetermined area accords with the change rule of the pixel value among the pixel values in the pixel value adjusting area.
As an optional implementation manner of the embodiment of the present invention, in the target pixel value rule, the method further includes: pixels whose pixel values are increased compared with adjacent pixel values in the pixel value adjustment region are arranged in order of pixels whose pixel values are decreased compared with adjacent pixel values.
The first proportion judging unit is specifically configured to: judging whether the absolute value of the difference between the third proportion and the first proportion is smaller than or equal to a first preset threshold value, if so, judging whether the arrangement sequence of the marks for increasing or decreasing the pixel value of each pixel compared with the adjacent pixel value accords with the arrangement sequence in the target pixel value rule, and if so, judging whether the undetermined area accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule.
The second proportion judging unit is specifically configured to: judging whether the absolute value of the difference between the fourth proportion and the second proportion is smaller than or equal to a first preset threshold value, if so, judging whether the arrangement sequence of the marks for increasing or decreasing the pixel value of each pixel compared with the adjacent pixel value accords with the arrangement sequence in the target pixel value rule, and if so, judging whether the undetermined area accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule.
As an alternative implementation manner of the embodiment of the present invention, for any pixel, the adjacent pixels of the pixel and the pixel are located in the same horizontal direction or the same vertical direction.
As an optional implementation manner of the embodiment of the present invention, the identifying device for a watermark video frame provided by the embodiment of the present invention further includes:
and the pixel value rule selecting module is used for selecting one pixel value rule from a plurality of pixel value rules obtained in advance if each undetermined region does not accord with the change rule of the pixel value among the pixel values in the target pixel value rule, determining the pixel value rule as the target pixel value rule, and returning to the step of judging whether each pixel value in each undetermined region accords with the change rule of the pixel value among the pixel values in the pixel value adjustment region in the target pixel value rule according to the gradient characteristics of each undetermined region.
As an optional implementation manner of the embodiment of the present invention, the identifying device for a watermark video frame provided by the embodiment of the present invention further includes:
and the video frame output module is used for outputting and displaying the video frame added with the watermark.
As an optional implementation manner of the embodiment of the present invention, the target pixel value rule further includes: the pixel value adjusts the relative positional relationship between the region and the watermark region.
The device for identifying the watermark video frame provided by the embodiment of the invention further comprises:
the watermark region determining module is used for determining the watermark region based on the relative position relation between the pixel value adjusting region and the watermark region and the pixel value adjusting region.
And the watermark area display module is used for highlighting the watermark area.
An embodiment of the present invention provides a specific embodiment of a watermark video frame production apparatus, corresponding to the flow shown in fig. 6, referring to fig. 13, fig. 13 is a schematic structural diagram of a watermark video frame production apparatus according to an embodiment of the present invention, where the watermark video frame production apparatus may include:
an operation request acquisition module 1301 is configured to acquire an operation request of a video to be processed.
The to-be-processed video frame selection module 1302 is configured to select a to-be-processed video frame from the to-be-processed video.
The target watermark adding module 1303 is configured to add a target watermark to a video frame to be processed, and obtain a watermarked video frame.
The pixel value adjustment module 1304 is configured to adjust, for a watermarked video frame, pixel values in the video frame based on a target pixel value rule, so that a pixel value adjustment area obtained after adjustment conforms to the target pixel value rule, where the target pixel value rule includes: and the pixel value adjustment region is used for adjusting the change rule of the pixel value between the pixel values.
The device for producing the watermark video frames provided by the embodiment of the invention acquires the operation request of the video to be processed; selecting a video frame to be processed from the video to be processed; adding the target watermark into a video frame to be processed to obtain a video frame added with the watermark; for a video frame added with the watermark, adjusting pixel values in the video frame based on a target pixel value rule so that a pixel value adjustment area obtained after adjustment accords with the target pixel value rule, wherein the target pixel value rule comprises the following steps: the size of the pixel value adjustment region and the variation law of the pixel value size between the individual pixel values in the pixel value adjustment region. The video frame added with the watermark is characterized in that the pixel value in the video frame is adjusted based on the target pixel value rule, so that the pixel value adjustment area obtained after adjustment accords with the target pixel value rule, and therefore the video frame added with the watermark also comprises the pixel value adjustment area.
As an optional implementation manner of the embodiment of the present invention, the target pixel value rule further includes: the pixel value adjusts the relative positional relationship between the region and the watermark region.
The device for producing the watermark video frame provided by the embodiment of the invention can further comprise:
the first watermark region determining module is used for determining a watermark region from the video frame to be processed, wherein the watermark region is a region for adding the target watermark.
The first region to be adjusted determining module is used for determining a region to be adjusted from the video frame to be processed according to the relative position relationship between the watermark region, the pixel value adjusting region and the watermark region and the size of the pixel value adjusting region in the target pixel value rule, wherein the region to be adjusted is a region for adjusting the pixel value.
Or alternatively, the process may be performed,
and the second to-be-adjusted area determining module is used for determining the to-be-adjusted area from the to-be-processed video frame based on the size of the pixel value adjustment area in the target pixel value rule.
And the second watermark region determining module is used for determining the watermark region according to the region to be adjusted and the relative position relationship between the pixel value adjusting region and the watermark region.
As an optional implementation manner of the embodiment of the present invention, the target pixel value rule further includes: in the pixel value adjustment region, a pixel increased in comparison with the adjacent pixel value occupies a first proportion of the total pixels of the pixel value adjustment region, and a pixel decreased in comparison with the adjacent pixel value occupies a second proportion of the total pixels of the pixel value adjustment region.
The pixel value adjustment module 1304 may include:
the characteristic matrix generation sub-module is used for generating a characteristic matrix according to the first proportion, the second proportion and the size of the pixel value adjustment area in the target pixel value rule; each element in the feature matrix represents: in the pixel value adjustment region, the pixel value of the pixel having the same position as the element has a magnitude relation with the pixel value of the adjacent pixel.
The pixel value size relation judging sub-module is used for traversing each pixel in the region to be regulated and judging whether the size relation between the pixel value of the pixel and the pixel value of the adjacent pixel corresponds to an element in the feature matrix or not; if not, the pixel value of the pixel is increased or decreased according to the feature matrix.
As an optional implementation manner of the embodiment of the present invention, the target pixel value rule further includes: pixels whose pixel values are increased compared with adjacent pixel values in the pixel value adjustment region are arranged in order of pixels whose pixel values are decreased compared with adjacent pixel values.
The feature matrix generation sub-module is specifically configured to:
and generating a feature matrix according to the first proportion, the second proportion, the arrangement sequence in the target pixel value rule and the size of the pixel value adjustment area in the target pixel value rule.
As an optional implementation manner of the embodiment of the present invention, the apparatus for producing a watermarked video frame provided by the embodiment of the present invention may further include:
the second pixel value rule obtaining module is used for obtaining a plurality of pixel value rules and version information corresponding to each pixel value rule.
And the second pixel value rule selecting module is used for selecting the pixel value rule with the latest version information from the plurality of pixel value rules and determining the pixel value rule as the target pixel value rule.
As an optional implementation manner of the embodiment of the present invention, the target watermark adding module 1303 may include:
a pixel value obtaining sub-module, configured to obtain a region pixel value of each pixel in the watermark region; and obtaining watermark pixel values of all pixels in the target watermark.
The product calculation sub-module is used for calculating a first product between the regional pixel value and a first preset weight coefficient; and calculating a second product between the watermark pixel value and a second preset weight coefficient.
And a product sum calculating submodule for calculating the sum of the first product and the second product as a target pixel value.
And the pixel value updating sub-module is used for updating the pixel value of the pixel in the watermark area to the target pixel value.
As an alternative implementation manner of the embodiment of the present invention, the operation request includes: play request, upload request, or post request.
The embodiment of the invention also provides an electronic device, as shown in fig. 14, which comprises a processor 1401, a communication interface 1402, a memory 1403 and a communication bus 1404, wherein the processor 1401, the communication interface 1402 and the memory 1403 communicate with each other through the communication bus 1404.
A memory 1403 for storing a computer program.
The processor 1401 is configured to execute the program stored in the memory 1403, and implement the following steps:
and acquiring a video to be detected.
Detecting each video frame to be detected in the video to be detected, and determining whether the video frame contains a preset pixel value adjustment area or not; the pixel value adjustment area is: adjusting pixel values in the video frame based on a target pixel value rule, and conforming to the region of the target pixel value rule; the target pixel value rule includes: and the pixel value adjustment region is used for adjusting the change rule of the pixel value between the pixel values.
And determining the video frame to be detected containing the preset pixel value adjustment area as the video frame added with the watermark.
The embodiment of the invention also provides an electronic device, as shown in fig. 15, which comprises a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502 and the memory 1503 complete communication with each other through the communication bus 1504.
Memory 1503 for storing computer programs.
The processor 1501, when executing the program stored in the memory 1503, performs the following steps:
obtaining an operation request of a video to be processed, wherein the operation request comprises: play request, upload request, or post request.
And selecting a video frame to be processed from the video to be processed.
And adding the target watermark into the video frame to be processed to obtain the video frame added with the watermark.
For a video frame added with the watermark, adjusting pixel values in the video frame based on a target pixel value rule so that a pixel value adjustment area obtained after adjustment accords with the target pixel value rule, wherein the target pixel value rule comprises the following steps: and the pixel value adjustment region is used for adjusting the change rule of the pixel value between the pixel values.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In a further embodiment of the present invention, a computer readable storage medium is provided, in which a computer program is stored, which when executed by a processor implements the steps of the method for identifying a watermark video frame as described in any of fig. 1-5.
In a further embodiment of the present invention, there is also provided a computer readable storage medium having stored therein a computer program which, when executed by a processor, implements the steps of the method of producing a watermarked video frame according to any of figures 6 to 11 described above.
In yet another embodiment of the present invention, a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of identifying a watermarked video frame according to any of the preceding embodiments, fig. 1-5, is also provided.
In a further embodiment of the present invention, there is also provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of producing a watermarked video frame according to any of figures 6 to 11 of the above embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments in part.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (23)

1. A method of identifying a watermarked video frame, the method comprising:
acquiring a video to be detected;
detecting each video frame to be detected in the video to be detected, and determining whether the video frame contains a preset pixel value adjustment area or not; the pixel value adjustment area is: adjusting pixel values in the video frame based on a target pixel value rule, and conforming to the region of the target pixel value rule; the target pixel value rule includes: a change rule of the pixel value between each pixel value in the pixel value adjustment region; in the target pixel value rule, a change rule of the pixel value between each pixel value in the pixel value adjustment area includes: a first proportion of pixels that are increased compared to adjacent pixel values to total pixels of the pixel value adjustment area, and a second proportion of pixels that are decreased compared to adjacent pixel values to total pixels of the pixel value adjustment area;
And determining the video frame to be detected containing the preset pixel value adjustment area as the video frame added with the watermark.
2. The method according to claim 1, wherein the pixel value adjustment area is specifically: and aiming at the video frame added with the watermark, adjusting the pixel value in the video frame based on the target pixel value rule, and conforming to the region of the target pixel value rule.
3. The method according to claim 1, wherein the step of detecting each video frame to be detected in the video to be detected and determining whether the video frame contains a preset pixel value adjustment area includes:
extracting gradient characteristics of each video frame to be detected;
each element in the gradient feature represents: the pixel value of the pixel with the same position as the element in the video frame to be detected and the pixel value of the adjacent pixel are in a size relation;
judging whether each pixel value in the video frame to be detected accords with the change rule of the pixel value between each pixel value in the pixel value adjusting area in the target pixel value rule according to the gradient characteristics of the video frame to be detected;
If yes, the video frame to be detected comprises a preset pixel value adjusting area.
4. The method of claim 1, wherein the target pixel value rule further comprises: the size of the pixel value adjustment region;
the step of detecting each video frame to be detected in the video to be detected and determining whether the video frame contains a preset pixel value adjustment area includes:
traversing each video frame to be detected based on the size of a pixel value adjustment area included in the target pixel value rule, and obtaining a plurality of undetermined areas with the area size being the size of the pixel value adjustment area in the video frame to be detected;
extracting gradient characteristics of each undetermined area aiming at each undetermined area; each element in the gradient characteristics of the undetermined region represents: a magnitude relation between a pixel value of a pixel having the same position as the element in the undetermined area and a pixel value of an adjacent pixel;
judging whether each pixel value in the undetermined area accords with the change rule of the pixel value between each pixel value in the pixel value adjusting area in the target pixel value rule according to the gradient characteristics of the undetermined area;
And if the undetermined area accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule, the video frame where the undetermined area is located contains a preset pixel value adjustment area.
5. The method of claim 4, wherein the gradient characteristics of the undetermined region include: the pixel value of each pixel is increased or decreased by a corresponding mark compared with the adjacent pixel value;
the step of judging whether each pixel value in the undetermined area accords with the change rule of the pixel value between each pixel value in the pixel value adjusting area according to the gradient characteristics of the undetermined area, comprising the following steps:
based on the marks that the pixel value of each pixel is increased or decreased compared with the adjacent pixel value in the gradient feature, counting a third proportion of the pixel increased compared with the adjacent pixel value to the total pixel of the pixel value adjustment area, and counting a fourth proportion of the pixel decreased compared with the adjacent pixel value to the total pixel of the pixel value adjustment area;
judging whether the absolute value of the difference value between the counted third proportion and the first proportion is smaller than or equal to a first preset threshold value, if so, the undetermined area accords with the change rule of the pixel value among all the pixel values in the pixel value adjusting area in the target pixel value rule;
Or judging whether the absolute value of the difference value between the fourth proportion and the second proportion is smaller than or equal to a second preset threshold value, if so, the undetermined area accords with the change rule of the pixel value among all the pixel values in the pixel value adjusting area in the target pixel value rule.
6. The method of claim 5, wherein the target pixel value rule further comprises: pixels whose pixel values are increased compared to adjacent pixel values in the pixel value adjustment region, and pixels whose pixel values are decreased compared to adjacent pixel values are arranged in this order;
judging whether the absolute value of the difference value between the counted third proportion and the first proportion is smaller than or equal to a first preset threshold value, if so, the undetermined area accords with the change rule of the pixel value among all the pixel values in the pixel value adjusting area, and the method comprises the following steps:
judging whether the absolute value of the difference between the third proportion and the first proportion is smaller than or equal to the first preset threshold value, if so, judging whether the arrangement sequence of marks for increasing or decreasing the pixel value of each pixel compared with the adjacent pixel value accords with the arrangement sequence in the target pixel value rule, and if so, judging that the undetermined area accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule;
Judging whether the absolute value of the difference value between the fourth proportion and the second proportion is smaller than or equal to a second preset threshold value, if so, the undetermined area accords with the change rule of the pixel value among all the pixel values in the pixel value adjusting area, and the method comprises the following steps:
judging whether the absolute value of the difference between the fourth proportion and the second proportion is smaller than or equal to the first preset threshold value, if so, judging whether the arrangement sequence of the marks for increasing or decreasing the pixel value of each pixel compared with the adjacent pixel value accords with the arrangement sequence in the target pixel value rule, and if so, judging that the undetermined area accords with the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule.
7. The method of any one of claims 1-6, wherein for any pixel, the adjacent pixels of the pixel are in the same horizontal direction or the same vertical direction as the pixel.
8. The method according to claim 4, wherein after the step of determining whether each pixel value in the pending area conforms to the change rule of the pixel value between each pixel value in the pixel value adjustment area in the target pixel value rule according to the gradient feature of the pending area, the method further comprises:
And if each undetermined area does not accord with the change rule of the pixel value among the pixel values in the pixel value adjustment area in the target pixel value rule, selecting one pixel value rule from a plurality of pixel value rules acquired in advance, determining the pixel value rule as the target pixel value rule, and returning to the step of judging whether each pixel value in each undetermined area accords with the change rule of the pixel value among the pixel value adjustment areas in the target pixel value rule according to the gradient characteristics of each undetermined area.
9. The method according to claim 1, wherein after the step of determining the video frame to be detected including the preset pixel value adjustment area as the watermarked video frame, the method further comprises:
outputting and displaying the video frame added with the watermark.
10. The method of claim 9, wherein the target pixel value rule further comprises: a relative positional relationship between the pixel value adjustment region and the watermark region;
after the step of determining the video frame to be detected including the preset pixel value adjustment area as the watermarked video frame, the method further includes:
Determining the watermark region based on the relative positional relationship between the pixel value adjustment region and the watermark region, and the pixel value adjustment region;
highlighting the watermark region.
11. A method of producing a watermarked video frame, the method comprising:
acquiring an operation request of a video to be processed;
selecting a video frame to be processed from the video to be processed;
adding a target watermark into the video frame to be processed to obtain a video frame added with the watermark;
and for the video frame added with the watermark, adjusting pixel values in the video frame based on a target pixel value rule so that an adjusted pixel value adjustment area accords with the target pixel value rule, wherein the target pixel value rule comprises the following steps: a change rule of the pixel value between each pixel value in the pixel value adjustment region; in the target pixel value rule, a change rule of the pixel value between each pixel value in the pixel value adjustment area includes: a first proportion of pixels that are increased compared to adjacent pixel values to the total pixels of the pixel value adjustment area and a second proportion of pixels that are decreased compared to adjacent pixel values to the total pixels of the pixel value adjustment area.
12. The method of claim 11, wherein the target pixel value rule further comprises: a relative positional relationship between the pixel value adjustment region and the watermark region;
before the step of adding the target watermark to the video frame to be processed, obtaining a watermarked video frame, the method further comprises:
determining a watermark area from the video frame to be processed, wherein the watermark area is an area for adding a target watermark;
determining a region to be adjusted from the video frame to be processed according to the relative position relationship between the pixel value adjustment region and the watermark region and the size of the pixel value adjustment region in the target pixel value rule, wherein the region to be adjusted is a region for adjusting the pixel value;
or alternatively, the process may be performed,
the size of the region is adjusted based on the pixel value in the target pixel value rule, and the region to be adjusted is determined from the video frame to be processed;
and determining a watermark region according to the region to be adjusted and the relative position relationship between the pixel value adjustment region and the watermark region.
13. The method of claim 12, wherein the target pixel value rule further comprises: in the pixel value adjustment region, a first proportion of pixels increased compared with adjacent pixel values to the total pixels of the pixel value adjustment region, and a second proportion of pixels decreased compared with adjacent pixel values to the total pixels of the pixel value adjustment region;
The step of adjusting the pixel value in the video frame based on the target pixel value rule for the watermarked video frame so that the pixel value adjustment area obtained after adjustment conforms to the target pixel value rule includes:
generating a feature matrix according to the first proportion, the second proportion and the size of the pixel value adjustment area in the target pixel value rule; each element in the feature matrix represents: in the pixel value adjustment area, the pixel value of the pixel having the same position as the element and the pixel value of the adjacent pixel have a magnitude relation;
traversing each pixel in the region to be adjusted, and judging whether the size relationship between the pixel value of the pixel and the pixel value of the adjacent pixel corresponds to the element in the feature matrix; if not, increasing or decreasing the pixel value of the pixel according to the feature matrix.
14. The method of claim 13, wherein the target pixel value rule further comprises: pixels whose pixel values are increased compared to adjacent pixel values in the pixel value adjustment region, and pixels whose pixel values are decreased compared to adjacent pixel values are arranged in this order;
the step of generating a feature matrix according to the first proportion, the second proportion, and the size of the pixel value adjustment area in the target pixel value rule includes:
And generating a feature matrix according to the first proportion, the second proportion, the arrangement sequence in the target pixel value rule and the size of the pixel value adjustment area in the target pixel value rule.
15. The method of claim 11, wherein prior to the step of adjusting pixel values in the video frame based on a target pixel value rule for the watermarked video frame such that the adjusted obtained pixel value adjustment area conforms to the target pixel value rule, the method further comprises:
acquiring a plurality of pixel value rules and version information corresponding to each pixel value rule;
and selecting the pixel value rule with the latest version information from the plurality of pixel value rules, and determining the pixel value rule as the target pixel value rule.
16. The method of claim 11, wherein the step of adding a target watermark to the video frame to be processed to obtain a watermarked video frame comprises:
obtaining regional pixel values of each pixel in the watermark region; obtaining watermark pixel values of all pixels in the target watermark;
calculating a first product between the regional pixel value and a first preset weight coefficient; and calculating a second product between the watermark pixel value and a second preset weight coefficient;
Calculating the sum of the first product and the second product as a target pixel value;
and updating the pixel value of the pixel in the watermark area to the target pixel value.
17. The method of claim 11, wherein the operation request comprises: play request, upload request, or post request.
18. An apparatus for identifying a watermarked video frame, the apparatus comprising:
the video to be detected acquisition module is used for acquiring the video to be detected;
the video frame detection module to be detected is used for detecting each video frame to be detected in the video to be detected and determining whether the video frame contains a preset pixel value adjustment area or not; the pixel value adjustment area is: adjusting pixel values in the video frame based on a target pixel value rule, and conforming to the region of the target pixel value rule; the target pixel value rule includes: a change rule of the pixel value between each pixel value in the pixel value adjustment region; in the target pixel value rule, a change rule of the pixel value between each pixel value in the pixel value adjustment area includes: a first proportion of pixels that are increased compared to adjacent pixel values to total pixels of the pixel value adjustment area, and a second proportion of pixels that are decreased compared to adjacent pixel values to total pixels of the pixel value adjustment area;
And the video frame determining module is used for determining the video frame to be detected containing the preset pixel value adjustment area as the video frame added with the watermark.
19. An apparatus for producing a watermarked video frame, the apparatus comprising:
the operation request acquisition module is used for acquiring an operation request of the video to be processed;
the to-be-processed video frame selection module is used for selecting to-be-processed video frames from the to-be-processed video;
the target watermark adding module is used for adding a target watermark into the video frame to be processed to obtain a video frame added with the watermark;
the pixel value adjusting module is configured to adjust, for the watermarked video frame, a pixel value in the video frame based on a target pixel value rule, so that a pixel value adjustment area obtained after adjustment conforms to the target pixel value rule, where the target pixel value rule includes: a change rule of the pixel value between each pixel value in the pixel value adjustment region; in the target pixel value rule, a change rule of the pixel value between each pixel value in the pixel value adjustment area includes: a first proportion of pixels that are increased compared to adjacent pixel values to the total pixels of the pixel value adjustment area and a second proportion of pixels that are decreased compared to adjacent pixel values to the total pixels of the pixel value adjustment area.
20. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method of any of claims 1-10 when executing a program stored on a memory.
21. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method of any of claims 11-17 when executing a program stored on a memory.
22. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-10.
23. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 11-17.
CN202110275124.0A 2021-03-15 2021-03-15 Watermark video frame identification method, watermark video frame production method, watermark video frame identification device and electronic equipment Active CN113015004B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110275124.0A CN113015004B (en) 2021-03-15 2021-03-15 Watermark video frame identification method, watermark video frame production method, watermark video frame identification device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110275124.0A CN113015004B (en) 2021-03-15 2021-03-15 Watermark video frame identification method, watermark video frame production method, watermark video frame identification device and electronic equipment

Publications (2)

Publication Number Publication Date
CN113015004A CN113015004A (en) 2021-06-22
CN113015004B true CN113015004B (en) 2023-04-28

Family

ID=76406986

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110275124.0A Active CN113015004B (en) 2021-03-15 2021-03-15 Watermark video frame identification method, watermark video frame production method, watermark video frame identification device and electronic equipment

Country Status (1)

Country Link
CN (1) CN113015004B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117314774B (en) * 2023-09-26 2024-04-09 广州市星飞达电子科技有限公司 Infrared image correction system based on detector temperature

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110084735A (en) * 2019-04-26 2019-08-02 新华三云计算技术有限公司 Watermark adding method, analytic method, device, electronic equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002354219A (en) * 2001-05-23 2002-12-06 Sony Corp Method and device for embedding electronic watermark and program
JP5557756B2 (en) * 2011-01-17 2014-07-23 日本放送協会 Digital watermark embedding device, digital watermark embedding program, digital watermark detection device, and digital watermark detection program
US10218994B2 (en) * 2015-05-01 2019-02-26 Verance Corporation Watermark recovery using audio and video watermarking
US10757434B2 (en) * 2017-10-18 2020-08-25 The Quantum Group, Inc. Cloaking and watermark of non-coded information

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110084735A (en) * 2019-04-26 2019-08-02 新华三云计算技术有限公司 Watermark adding method, analytic method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113015004A (en) 2021-06-22

Similar Documents

Publication Publication Date Title
CN112423083B (en) System and method for dynamically providing video overlay
US20160366463A1 (en) Information pushing method, terminal and server
JP6564464B2 (en) Video program segment detection
CN106412720B (en) Method and device for removing video watermark
CN110691259B (en) Video playing method, system, device, electronic equipment and storage medium
CN107590447A (en) A kind of caption recognition methods and device
WO2017211250A1 (en) Image overlay display method and system
JP5325267B2 (en) Object display device, object display method, and object display program
KR20160033751A (en) Watermark extractor enhancements based on payload ranking
CN108615030B (en) Title consistency detection method and device and electronic equipment
CN110012350B (en) Video processing method and device, video processing equipment and storage medium
CN104637068B (en) Frame of video and video pictures occlusion detection method and device
CN111027412B (en) Human body key point identification method and device and electronic equipment
US20160098863A1 (en) Combining a digital image with a virtual entity
WO2019000793A1 (en) Pixelating method and device for live broadcasting, electronic device, and storage medium
CN113015004B (en) Watermark video frame identification method, watermark video frame production method, watermark video frame identification device and electronic equipment
CN107622497A (en) Image cropping method, apparatus, computer-readable recording medium and computer equipment
CN110969100A (en) Human body key point identification method and device and electronic equipment
CN115314734A (en) Video watermark processing method and device, electronic equipment and storage medium
CN113076961B (en) Image feature library updating method, image detection method and device
CN111640150A (en) Video data source analysis system and method
Hu et al. Fast source camera identification using matching signs between query and reference fingerprints
Qi et al. An adaptive visible watermark embedding method based on region selection
Huang et al. Novel cover selection criterion for spatial steganography using linear pixel prediction error
CN115829896A (en) Image fusion method and device and electronic equipment

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