CN113691885A - Video watermark removing method and device, computer equipment and storage medium - Google Patents

Video watermark removing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113691885A
CN113691885A CN202111055812.2A CN202111055812A CN113691885A CN 113691885 A CN113691885 A CN 113691885A CN 202111055812 A CN202111055812 A CN 202111055812A CN 113691885 A CN113691885 A CN 113691885A
Authority
CN
China
Prior art keywords
watermark
picture
video
pictures
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111055812.2A
Other languages
Chinese (zh)
Other versions
CN113691885B (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.)
Shenzhen Wondershare Software Co Ltd
Original Assignee
Shenzhen Wondershare Software 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 Shenzhen Wondershare Software Co Ltd filed Critical Shenzhen Wondershare Software Co Ltd
Priority to CN202111055812.2A priority Critical patent/CN113691885B/en
Publication of CN113691885A publication Critical patent/CN113691885A/en
Application granted granted Critical
Publication of CN113691885B publication Critical patent/CN113691885B/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/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
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the invention discloses a method and a device for removing a video watermark, computer equipment and a storage medium, and relates to the technical field of video processing. Wherein the method comprises: acquiring a video from which a watermark is to be removed; extracting a plurality of pictures from the video and forming a first picture set by all the extracted pictures; processing the pictures in the first picture set according to a preset method to obtain a watermark picture; calculating an optimal transparency value based on a competition group optimization algorithm according to the watermark picture; and removing the watermark picture in the video through a video watermark removing formula according to the optimal transparency value. According to the method, the high-precision watermark picture is obtained through processing according to the first picture set, and the optimal transparency value calculated quickly based on the competition group optimization algorithm is combined, so that the smooth transition between the watermark removal area and the surrounding area is realized, the video watermark removal efficiency is accelerated, and the comfort level of a user for watching a video can be improved.

Description

Video watermark removing method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of video processing technologies, and in particular, to a method and an apparatus for removing a video watermark, a computer device, and a storage medium.
Background
With the arrival of short video vents, people have higher and higher requirements for editing videos, and everyone can become an editor of the own media. However, watermarking on video presents an unpleasant experience for the self-media editor.
At present, the method for removing watermarks of pictures is gradually mature. However, these methods have a common problem in that it takes tens of seconds or even tens of seconds to process one picture. As is well known, video is composed of a single picture, and obviously these time consuming methods do not meet the requirements of removal of the video watermark. The existing video watermark removing methods mainly include two methods: 1. and adding mosaic or ground glass special effect treatment to the watermark area to make the watermark area fuzzy. 2. And carrying out occlusion by other pictures or characters. Although the two methods are fast, the removal of the watermark is not thorough, and the smoothness of the picture cannot be ensured so as not to meet the requirements of users.
Disclosure of Invention
The embodiment of the invention provides a method and a device for removing a video watermark, computer equipment and a storage medium, and aims to solve the problems that the conventional method for removing the video watermark is long in time consumption, incomplete in watermark removal and incapable of ensuring smooth transition of a picture.
In a first aspect, an embodiment of the present invention provides a method for removing a video watermark, where the method for removing a video watermark includes: acquiring a video from which a watermark is to be removed; extracting a plurality of pictures from the video and forming a first picture set by all the extracted pictures; processing the pictures in the first picture set according to a preset method to obtain a watermark picture; and removing the watermark picture in the video through a video watermark removing formula according to the optimal transparency value.
In a second aspect, an embodiment of the present invention further provides an apparatus for removing a video watermark, where the apparatus includes:
the acquisition unit is used for acquiring a video from which the watermark is to be removed;
a first extraction unit, configured to extract multiple frames of pictures from the video and form all the extracted pictures into a first picture set;
the processing unit is used for processing the pictures in the first picture set according to a preset method to obtain a watermark picture;
the first calculation unit is used for calculating the optimal transparency value of the watermark picture based on a competition group optimization algorithm;
and the removing unit is used for removing the watermark picture in the video through a video watermark removing formula according to the optimal transparency value.
In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes a memory and a processor, where the memory stores a computer program, and the processor implements the method when executing the computer program.
In a fourth aspect, the present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program realizes the above method when being executed by a processor.
The embodiment of the invention provides a method and a device for removing a video watermark, computer equipment and a storage medium, wherein the method comprises the following steps: acquiring a video from which a watermark is to be removed; extracting a plurality of pictures from the video and forming a first picture set by all the extracted pictures; processing the pictures in the first picture set according to a preset method to obtain a watermark picture; calculating an optimal transparency value based on a competition group optimization algorithm according to the watermark picture; and removing the watermark picture in the video through a video watermark removing formula according to the optimal transparency value. According to the method, the high-precision watermark picture is obtained through processing according to the first picture set, and the optimal transparency value calculated quickly based on the competition group optimization algorithm is combined, so that the smooth transition between the watermark removal area and the surrounding area is realized, the video watermark removal efficiency is accelerated, and the comfort level of a user for watching a video can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for removing a video watermark according to an embodiment of the present invention;
fig. 2 is a sub-flowchart of a video watermark removing method according to an embodiment of the present invention;
fig. 3 is a sub-flowchart of a video watermark removing method according to an embodiment of the present invention;
fig. 4 is a sub-flowchart of a video watermark removing method according to an embodiment of the present invention;
fig. 5 is a sub-flowchart of a video watermark removing method according to an embodiment of the present invention;
fig. 6 is a schematic block diagram of a video watermark removing apparatus according to an embodiment of the present invention;
fig. 7 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It is to be understood that the terms "includes" and "including" when used in this specification and the appended claims are also to be construed to indicate that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
The method for removing the video watermark can be applied to user terminals, such as intelligent devices of mobile phones, tablet computers, notebook computers, desktop computers and the like. The corresponding functions are realized by the application software installed on the user terminal, which is described below by taking a mobile phone terminal as an example.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for removing a video watermark according to an embodiment of the present invention. As shown in FIG. 1, the method includes the following steps S1-S5.
And S1, acquiring the video to be subjected to watermark removal.
In specific implementation, a video to be subjected to watermark removal needs to be acquired, for example, a user selects or uploads a video with a watermark as a video to be subjected to watermark removal through a mobile phone terminal, and then the mobile phone terminal takes the video acquired with the watermark removal as a processing object of a subsequent processing flow. Specifically, in the present embodiment, the position of the watermark in the video from which the watermark is to be removed and the pixel value are fixed.
S2, extracting multiple frames of pictures from the video and forming a first picture set from all the extracted pictures.
In a specific implementation, a plurality of pictures are extracted from the video and all the extracted pictures form a first picture set. A frame is a single picture of the smallest unit in a video, corresponding to each shot on a motion picture film. The frames appear as a grid or a marker on the timeline of the video software. In an embodiment, the watermark picture to be removed is obtained through operation according to the first picture set.
In one embodiment, as shown in fig. 2, the step S2 includes: steps S201-S202.
S201, playing the video to preview the pictures in the video.
In specific implementation, the video is played to preview the pictures in the video. In one embodiment, the video to be de-watermarked is previewed by playing so that multiple frames of pictures are extracted.
S202, extracting multiple frames of pictures of the video according to a preset video frame interval and forming a first picture set by all the extracted pictures.
In specific implementation, multiple frames of pictures of the video are extracted according to a preset video frame interval, and all the extracted pictures form a first picture set. In an embodiment, the preset video frame interval is 10 frames, that is, one frame of picture is extracted every ten frames as a target picture, specifically, a user may set the size of the preset interval according to the length of the video to be watermarked and the specific picture condition, where the preset interval is not specifically limited. In one embodiment, the picture set is represented as UiWhere i is the number of pictures in the set, typically i is 20 or 30, and the preview of the video can be stopped by forming the first picture set.
And S3, processing the pictures in the first picture set according to a preset method to obtain a watermark picture.
In specific implementation, the pictures in the first picture set are processed according to a preset method to obtain a watermark picture. In an embodiment, the extracted pixel difference between different frame pictures is utilized to preprocess the pictures to obtain the watermark pictures.
In one embodiment, as shown in fig. 3, the step S3 includes: steps S301 to S302.
S301, two frames of pictures are extracted from the first picture set to serve as target pictures, a second picture set with the two target pictures removed is obtained, and difference operation is conducted on the two target pictures to obtain a watermark-free picture.
In specific implementation, two frames of pictures are extracted from the first picture set to be used as target pictures, a second picture set with the two target pictures removed is obtained, and difference operation is performed on the two target pictures to obtain a watermark-free picture. In one embodiment, the position of the watermark picture in the two target pictures is fixedAnd the pixel values of the watermark pictures are the same, the pixel values of the target pictures except the watermark regions are changed, and the two target pictures are subjected to difference operation to subtract the watermark pictures with the same pixel values to obtain the watermark-free pictures. In one embodiment, from set UiExtracting target picture U randomlymAnd UnThe two are subtracted to obtain a watermark-free picture Wo=Um-UnWherein m is not equal to n, recording and removing the target picture UmAnd UnThe second picture set is Us
S302, performing preset operation on the pictures in the second picture set and the watermark-free pictures to obtain watermark pictures.
In specific implementation, the pictures in the second picture set and the watermark-free pictures are subjected to preset operation to obtain watermark pictures. In one embodiment, as shown in fig. 4, the step S302 includes: steps S3021 to S3022.
And S3021, sequentially extracting each frame of picture in the second picture set, and performing preset operation on each frame of picture and the watermark-free picture to obtain a watermark region pixel value set.
In specific implementation, each picture in the second picture set is sequentially extracted, and each frame of the picture and the watermark-free picture are subjected to preset operation to obtain a watermark region pixel value set. In one embodiment, the picture includes a watermark picture, and the pixel value of the watermark area in the non-watermark picture is 0, and the pixel value of the non-watermark area is not 0. And carrying out preset operation on the two to obtain the pixel value of the watermark area. Specifically, the preset operation is to assign a pixel value corresponding to a region where a pixel value in the image is zero in the image without the watermark to a pixel value in the watermark region, that is, to extract the pixel value in the watermark region in the image. In one embodiment, the set of pixel values is PsWherein s-i-2. Two target pictures of the non-watermark picture are removed from the second picture set, so that the number of elements in the pixel value set of the watermark region is equal to i-2, and the pixel value of the watermark region with smaller error can be obtained through the step of averaging.
And S3022, calculating the average value of the pixel values of the watermark region in the pixel value set of the watermark region, and extracting the average value of the pixel values of the watermark region to a blank frame to obtain the watermark picture.
In specific implementation, the average value of the pixel values of the watermark region in the pixel value set of the watermark region is obtained, and the average value of the pixels of the watermark region is extracted to a blank frame to obtain a watermark picture. In one embodiment, the set of pixel values is averaged to Ps=(P1+P2+P3+...+Ps) And/s, because the position with the pixel value of 0 may also appear in the non-watermark region in the non-watermark picture, the error of the watermark picture is effectively reduced by solving the mean value of the pixel values of the watermark region in the pixel value set of the watermark region, and a more accurate watermark picture is obtained so as to improve the smoothness of watermark removal.
And S4, calculating an optimal transparency value based on a competition group optimization algorithm according to the watermark picture.
In specific implementation, an optimal transparency value is calculated according to the watermark picture based on a competition group optimization algorithm. The transparency value alpha is the transparency of the watermark picture, when alpha is 0, the watermark can not be seen completely, when alpha is 1, the watermark can completely cover the original video frame, and the area alpha without the watermark in the watermarked video frame is 0. Therefore, the transparency value alpha of the watermark picture in the picture of the watermarked video is a numerical value between 0 and 1. The removal of the video watermark can be realized by solving the transparency value alpha and then according to the obtained watermark picture. In one embodiment, the watermark picture and the random transparency value are used as a particle population of a competition group optimization algorithm, a winner and a loser are distinguished through the merit and disadvantage evaluation, the loser is subjected to optimization learning and then subjected to the next round of merit and disadvantage evaluation, and the process is repeated until the optimal transparency value is obtained.
In one embodiment, as shown in fig. 5, the step S4 includes: steps S401 to S404.
S401, establishing an initial particle population according to the watermark picture.
In specific implementation, an initial particle population is established according to the watermark picture, and the particles have a transparency value alphaiProduct of the picture with the watermark W, i.e. alphaiW, wherein the value range of the transparency valueIs [0, 1]]. In one embodiment, αiA random number from 0 to 1.
S402, traversing the particle population and randomly grouping every two particles in the population.
In a specific implementation, the particles in the population are randomly grouped two by traversing the particle population. In one embodiment, the particles in the particle population are grouped into two groups to prepare for the next evaluation of the superiority and inferiority.
In the process of randomly grouping two by two, if an odd number of particles occur, the finally excessive particles may be ignored, and only the particles in the group may be evaluated for superiority and inferiority.
And S403, evaluating the superiority and inferiority of the current round of the two particles in each group to obtain a winner and a loser of each group in the current round.
In specific implementation, the goodness and the badness of the current round are evaluated for two particles in each group, and the winner and the loser of each group in the current round are obtained. In one embodiment, the pixel gradient value between the watermark picture and the non-watermark picture corresponding to each particle is calculated; and calculating pixel gradient values of all pixel points in the watermark picture and pixel points of the non-watermark region picture, and then solving an average value as the pixel gradient value between the watermark picture and the non-watermark picture.
And comparing the pixel gradient values of the two particles in each group, taking the particle corresponding to the smaller pixel gradient value as a winner, and taking the particle corresponding to the larger pixel gradient value as a loser, so as to obtain the winner and the loser of each group in the current round. The smaller the pixel gradient value is, the smaller the pixel change between the watermark picture and the non-watermark picture is, the smaller the pixel gradient value is, the particles with the small pixel gradient value are taken as the winner, and the value of alpha is optimized so that the better smoothness can be obtained for removing the watermark.
S404, performing optimization learning on the loser, entering the next round of goodness and badness evaluation until the winner meets a preset threshold or the current cycle number reaches a preset cycle number, and outputting a transparency value corresponding to the winner in the last cycle as an optimal transparency value.
In specific implementation, the loser is subjected to optimization learning and then enters the next round of goodness and badness evaluation until the winner meets a preset threshold or the current cycle number reaches a preset cycle number, and the transparency value corresponding to the winner in the last cycle is output as the optimal transparency value. Specifically, the particles in the original population are randomly grouped pairwise, and then the two particles in each group are evaluated for superiority and inferiority, so that a winner and a loser in each group are obtained. After the evaluation of the superiority and inferiority of the current round is finished, operation is not needed to be carried out on the winner in each group, and optimized learning is needed to be carried out on the losers in each group so as to enable the losers to be closer to the winner.
It should be noted that the preset threshold is a pixel gradient value, and when the pixel gradient value of a winner is smaller than the preset threshold, the cycle is stopped, and the transparency value is output as the optimal transparency value. A large number of experiments prove that the competitive cluster optimization algorithm can output the optimal transparency value in a short time.
In one embodiment, the performing optimized learning on the loser includes:
the loser is optimally learned according to the following formula:
Figure BDA0003254585970000081
wherein l represents the loser, w represents the winner, n represents the current number of rounds of circulation, Vl(n +1) represents the variation value of the n +1 th round after the loser learns from the winner, Xw(n) denotes the n-th winner, Xl(n) represents the nth loser,
Figure BDA0003254585970000082
denotes the average value, X, of all particlesl(n +1) represents the n +1 th loser, c is a control parameter, r1、r2Are all random numbers, r1、r2Has a value range of [0, 1]]。
In this embodiment, the losers in each group are optimally learned according to the above formula, so that the losers are closer to the winner after the optimal learning. Wherein the control parameter may be set to 2.
In this embodiment, in each round of the goodness and badness evaluation process, whether the corresponding winner meets the matching requirement, that is, whether the matching requirement meets the preset threshold value, can be determined according to the evaluation result.
Of course, it should be further described that if there are winners in a plurality of groups meeting the preset threshold in one round of goodness and badness evaluation process, a minimum value may be selected from the transparency values of the winners in the plurality of groups as an optimal transparency value, and an average value of the transparency values of the winners may also be obtained as the optimal transparency value.
If the winners in each group do not meet the preset threshold in the current round of merit and disadvantage evaluation process, the next round of merit and disadvantage evaluation is needed, and whether the winners meeting the preset threshold exist is determined continuously according to the preset threshold in the next round of merit and disadvantage evaluation process. It should be noted that before the next round of goodness and badness evaluation, optimized learning needs to be performed on the losers in each group in the current round, and pairwise random grouping needs to be performed on the losers and winners after optimized learning.
It should be noted that, in order to avoid that the matching cannot be achieved after multiple rounds of goodness evaluation, an optimized cycle number, that is, a preset cycle number, may be set in this embodiment. That is, when the number of rounds of the goodness evaluation reaches the preset number of rounds, the goodness evaluation is stopped, and at this time, the transparency value corresponding to the winner closest to the preset threshold in the last round of the rounds is output as the optimal transparency value.
And S5, removing the watermark picture in the video through a video watermark removing formula according to the optimal transparency value.
In specific implementation, the watermark picture in the video is removed through a video watermark removing formula according to the optimal transparency value. In this embodiment, the formula for removing the video watermark is I ═ (y- α × W)/(1- α), where I represents an unwatermarked image, y represents a watermarked image, W represents a watermark picture, and α represents an optimal transparency value. The representation watermark picture W obtained through operation and the optimal transparency value calculated based on the competition group optimization algorithm are substituted into the video watermark removing formula, so that the watermark picture in the video can be removed, the time for removing the video watermark is shortened, and the smoothness of watermark removal is improved.
The embodiment of the invention provides a method for removing a video watermark, which comprises the following steps: acquiring a video from which a watermark is to be removed; extracting a plurality of pictures from the video and forming a first picture set by all the extracted pictures; processing the pictures in the first picture set according to a preset method to obtain a watermark picture; calculating the optimal transparency value of the watermark picture based on a competition group optimization algorithm; and removing the watermark picture in the video through a video watermark removing formula according to the optimal transparency value. According to the method, a high-precision watermark picture is obtained through processing according to a first picture set; by combining the optimal transparency value calculated rapidly based on the competition group optimization algorithm, the smooth transition between the watermark removal area and the surrounding area is realized, the video watermark removal efficiency is accelerated, and the comfort level of a user for watching videos can be improved.
Fig. 6 is a schematic block diagram of a video watermark removing apparatus according to an embodiment of the present invention. As shown in fig. 6, the present invention further provides a video watermark removing apparatus 100 corresponding to the above video watermark removing method. The video watermark removal apparatus 100 includes a unit for executing the video watermark removal method, and may be configured in a desktop computer, a tablet computer, a laptop computer, or the like. Specifically, referring to fig. 6, the apparatus 100 for removing a video watermark includes an obtaining unit 101, a first extracting unit 102, a processing unit 103, a first calculating unit 104, and a removing unit 105.
The acquiring unit 101 is configured to acquire a video from which a watermark is to be removed; the first extracting unit 102 is configured to extract multiple frames of pictures from the video and form all the extracted pictures into a first picture set; the processing unit 103 is configured to process the pictures in the first picture set according to a preset method to obtain a watermark picture; the first calculating unit 104 is configured to calculate an optimal transparency value of the watermark picture based on a competition group optimization algorithm; the removing unit 105 is configured to remove a watermark picture in the video according to the optimal transparency value through a video watermark removing formula.
In one embodiment, the first computing unit 104 includes:
the establishing unit is used for establishing an initial particle population according to the watermark picture, wherein the particles are the product of a transparency value and the watermark picture, and the value range of the transparency value is [0, 1 ];
the traversing unit is used for traversing the particle population and randomly grouping the particles in the population pairwise;
the evaluation unit is used for evaluating the advantages and the disadvantages of the current round of the two particles in each group to obtain a winner and a loser of each group in the current round;
and the output unit is used for performing optimization learning on the loser and then entering the next round of goodness and badness evaluation until the winner meets a preset threshold or the current cycle number reaches a preset cycle number, and outputting a transparency value corresponding to the winner in the last cycle as an optimal transparency value.
In one embodiment, the evaluation unit includes:
the second calculation unit is used for calculating the pixel gradient value between the watermark picture and the non-watermark picture corresponding to each particle;
and the comparison unit is used for comparing the pixel gradient values of the two particles in each group, taking the particle corresponding to the smaller pixel gradient value as a winner, and taking the particle corresponding to the larger pixel gradient value as a loser, so as to obtain the winner and the loser of each group in the current round.
In one embodiment, the output unit includes:
the learning unit is used for carrying out optimization learning on the loser according to the following formula:
Figure BDA0003254585970000101
wherein l represents the loser, w represents the winner, n represents the current number of rounds of circulation, Vl(n +1) represents the variation value of the n +1 th round after the loser learns from the winner, Xw(n) denotes the n-th winner, Xl(n) represents the nth loser,
Figure BDA0003254585970000111
denotes the average value, X, of all particlesl(n +1) represents the n +1 th loser, c is a control parameter, r1、r2Are all random numbers, r1、r2Has a value range of [0, 1]]。
In an embodiment, the first extracting unit 102 includes;
the preview unit is used for playing the video to preview pictures in the video;
and the second extraction unit is used for extracting a plurality of frames of pictures of the video at preset video frame intervals and forming all the extracted pictures into a first picture set.
In an embodiment, the processing unit 103 includes:
the difference operation unit is used for extracting two frames of pictures from the first picture set to be used as target pictures, obtaining a second picture set with the two target pictures removed, and performing difference operation on the two target pictures to obtain a watermark-free picture;
and the first preset operation unit is used for carrying out preset operation on the pictures in the second picture set and the watermark-free pictures to obtain the watermark pictures.
In an embodiment, the predetermined operation unit includes:
the second preset operation unit is used for sequentially extracting each frame of picture in the second picture set and carrying out preset operation on each frame of picture and the watermark-free picture to obtain a watermark region pixel value set;
and the averaging unit is used for averaging the pixel values of the watermark region in the pixel value set of the watermark region and extracting the average value of the pixels of the watermark region to the blank frame to obtain the watermark picture.
It should be noted that, as can be clearly understood by those skilled in the art, the foregoing video watermark removing apparatus and the specific implementation process of each unit may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided herein.
The above-mentioned video watermark removal apparatus may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 7.
Referring to fig. 7, the computer device 300 includes a processor 302, a memory, which may include a non-volatile storage medium 303 and an internal memory 304, and a network interface 305 connected by a system bus 301.
The nonvolatile storage medium 303 may store an operating system 3031 and a computer program 3032. The computer program 3032, when executed, causes the processor 302 to perform a method of video watermark removal.
The processor 302 is used to provide computing and control capabilities to support the operation of the overall computer device 300.
The internal memory 304 provides an environment for the execution of a computer program 3032 in the non-volatile storage medium 303, which computer program 3032, when executed by the processor 302, causes the processor 302 to perform a method for removing a video watermark.
The network interface 305 is used for network communication with other devices. Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing device 300 to which the disclosed aspects apply, as a particular computing device 300 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 302 is configured to run a computer program 3032 stored in the memory to implement the following steps:
acquiring a video from which a watermark is to be removed;
extracting a plurality of pictures from the video and forming a first picture set by all the extracted pictures;
processing the pictures in the first picture set according to a preset method to obtain a watermark picture;
calculating the optimal transparency value of the watermark picture based on a competition group optimization algorithm;
and removing the watermark picture in the video through a video watermark removing formula according to the optimal transparency value.
In an embodiment, the calculating the optimal transparency value of the watermark picture based on the competition group optimization algorithm includes:
establishing an initial particle population according to the watermark picture, wherein the particles are the product of a transparency value and the watermark picture, and the value range of the transparency value is [0, 1 ];
traversing the particle population to randomly group the particles in the population in pairs;
evaluating the superiority and inferiority of the current round of the two particles in each group to obtain a winner and a loser of each group in the current round;
and performing optimization learning on the loser, entering the next round of goodness and badness evaluation until the winner meets a preset threshold or the current cycle number reaches a preset cycle number, and outputting a transparency value corresponding to the winner in the last cycle as an optimal transparency value.
In an embodiment, the performing the goodness evaluation of the current round on the two particles in each group to obtain the winner and the loser of each group in the current round includes:
calculating a pixel gradient value between the watermark picture and the non-watermark picture corresponding to each particle;
and comparing the pixel gradient values of the two particles in each group, taking the particle corresponding to the smaller pixel gradient value as a winner, and taking the particle corresponding to the larger pixel gradient value as a loser, so as to obtain the winner and the loser of each group in the current round.
In one embodiment, the performing optimized learning on the loser includes:
the loser is optimally learned according to the following formula:
Figure BDA0003254585970000131
wherein l represents the loser, w represents the winner, n represents the current number of rounds of circulation, Vl(n +1) represents the variation value of the n +1 th round after the loser learns from the winner, Xw(n) denotes the n-th winner, Xl(n) represents the nth loser,
Figure BDA0003254585970000132
denotes the average value, X, of all particlesl(n +1) represents the n +1 th loser, c is a control parameter, r1、r2Are all random numbers, r1、r2Has a value range of [0, 1]]。
In one embodiment, the extracting multiple frames of pictures from the video and forming all the extracted pictures into a first set of pictures includes;
playing the video to preview pictures in the video;
and extracting multi-frame pictures of the video according to a preset video frame interval and forming a first picture set by all the extracted pictures.
In an embodiment, the processing the pictures in the first picture set according to a preset method to obtain a watermark picture includes:
extracting two frames of pictures from the first picture set as target pictures to obtain a second picture set without the two target pictures, and performing difference operation on the two target pictures to obtain a watermark-free picture;
and carrying out preset operation on the pictures in the second picture set and the watermark-free pictures to obtain watermark pictures.
In an embodiment, the performing a preset operation on the pictures in the second picture set and the watermark-free picture to obtain a watermark picture includes:
sequentially extracting each frame of picture in the second picture set, and performing preset operation on each frame of picture and the non-watermark picture to obtain a watermark region pixel value set;
and solving the mean value of the pixel values of the watermark region in the pixel value set of the watermark region, and extracting the mean value of the pixels of the watermark region to a blank frame to obtain the watermark picture.
It should be understood that, in the embodiment of the present Application, the Processor 302 may be a Central Processing Unit (CPU), and the Processor 302 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. The computer program, when executed by a processor, causes the processor to perform any of the above-described embodiments of the video watermark removal method of the present invention.
The storage medium is an entity and non-transitory storage medium, and may be various entity storage media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, while the invention has been described with respect to the above-described embodiments, it will be understood that the invention is not limited thereto but may be embodied with various modifications and changes.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for removing a video watermark, comprising:
acquiring a video from which a watermark is to be removed;
extracting a plurality of pictures from the video and taking all the extracted pictures as a first picture set;
processing the pictures in the first picture set according to a preset method to obtain a watermark picture;
calculating the optimal transparency value of the watermark picture based on a competition group optimization algorithm;
and removing the watermark picture in the video through a video watermark removing formula according to the optimal transparency value.
2. The method for removing a video watermark according to claim 1, wherein the calculating an optimal transparency value of the watermark picture based on a competition group optimization algorithm includes:
establishing an initial particle population according to the watermark picture, wherein the particles are the product of a transparency value and the watermark picture, and the value range of the transparency value is [0, 1 ];
traversing the particle population to randomly group the particles in the population in pairs;
evaluating the superiority and inferiority of the current round of the two particles in each group to obtain a winner and a loser of each group in the current round;
and performing optimization learning on the loser, entering the next round of goodness and badness evaluation until the winner meets a preset threshold or the current cycle number reaches a preset cycle number, and outputting a transparency value corresponding to the winner in the last cycle as an optimal transparency value.
3. The method of claim 2, wherein the performing a goodness evaluation on the current round for two particles in each packet to obtain a winner and a loser of each packet in the current round comprises:
calculating a pixel gradient value between the watermark picture and the non-watermark picture corresponding to each particle;
and comparing the pixel gradient values of the two particles in each group, taking the particle corresponding to the smaller pixel gradient value as a winner, and taking the particle corresponding to the larger pixel gradient value as a loser, so as to obtain the winner and the loser of each group in the current round.
4. The method of claim 3, wherein the learning optimization for the loser comprises:
the loser is optimally learned according to the following formula:
Figure FDA0003254585960000021
wherein l represents the loser, w represents the winner, n represents the current number of rounds of circulation, Vl(n +1) represents the variation value of the n +1 th round after the loser learns from the winner, Xw(n) denotes the n-th winner, Xl(n) represents the nth loser,
Figure FDA0003254585960000022
denotes the average value, X, of all particlesl(n +1) represents the n +1 th loser, c is a control parameter, r1、r2Are all random numbers, r1、r2Has a value range of [0, 1]]。
5. The method for removing a video watermark according to claim 1, wherein the extracting a plurality of pictures from the video and forming all the extracted pictures into a first picture set comprises;
playing the video to preview pictures in the video;
and extracting multi-frame pictures of the video according to a preset video frame interval and forming a first picture set by all the extracted pictures.
6. The method for removing a video watermark according to claim 5, wherein the processing the pictures in the first picture set according to a preset method to obtain the watermark picture comprises:
extracting two frames of pictures from the first picture set as target pictures to obtain a second picture set without the two target pictures, and performing difference operation on the two target pictures to obtain a watermark-free picture;
and carrying out preset operation on the pictures in the second picture set and the watermark-free pictures to obtain watermark pictures.
7. The method for removing video watermark according to claim 6, wherein the performing a preset operation on the pictures in the second picture set and the watermark-free pictures to obtain watermark pictures comprises:
sequentially extracting each frame of picture in the second picture set, and performing preset operation on each frame of picture and the non-watermark picture to obtain a watermark region pixel value set;
and solving the mean value of the pixel values of the watermark region in the pixel value set of the watermark region, and extracting the mean value of the pixels of the watermark region to a blank frame to obtain the watermark picture.
8. An apparatus for removing a video watermark, comprising:
the acquisition unit is used for acquiring a video from which the watermark is to be removed;
a first extraction unit, configured to extract multiple frames of pictures from the video and form all the extracted pictures into a first picture set;
the processing unit is used for processing the pictures in the first picture set according to a preset method to obtain a watermark picture;
the first calculation unit is used for calculating the optimal transparency value of the watermark picture based on a competition group optimization algorithm;
and the removing unit is used for removing the watermark picture in the video through a video watermark removing formula according to the optimal transparency value.
9. A computer arrangement, characterized in that the computer arrangement comprises a memory having stored thereon a computer program and a processor implementing the method according to any of claims 1-7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method according to any one of claims 1-7.
CN202111055812.2A 2021-09-09 2021-09-09 Video watermark removal method and device, computer equipment and storage medium Active CN113691885B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111055812.2A CN113691885B (en) 2021-09-09 2021-09-09 Video watermark removal method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111055812.2A CN113691885B (en) 2021-09-09 2021-09-09 Video watermark removal method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113691885A true CN113691885A (en) 2021-11-23
CN113691885B CN113691885B (en) 2024-01-30

Family

ID=78585811

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111055812.2A Active CN113691885B (en) 2021-09-09 2021-09-09 Video watermark removal method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113691885B (en)

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006116270A2 (en) * 2005-04-26 2006-11-02 Verance Corporation Security enhancements of digital watermarks for multi-media content
KR20110101577A (en) * 2010-03-09 2011-09-16 한국과학기술원 The video watermarking system for inaccessible contents using overlay channel and the method thereof
CN103295180A (en) * 2013-05-02 2013-09-11 陕西师范大学 Digital watermarking method with robustness and transparency in optimum balance
CN103793874A (en) * 2014-02-14 2014-05-14 中北大学 Novel digital watermarking method capable of maintaining fidelity and robustness
JP2016072706A (en) * 2014-09-26 2016-05-09 大日本印刷株式会社 Strength setting method for watermark embedding and computer program
CN106780286A (en) * 2017-01-23 2017-05-31 天津大学 A kind of particle group optimizing water mark method extracted based on blind watermatking
CN107240059A (en) * 2017-04-07 2017-10-10 广东精点数据科技股份有限公司 The modeling method of image digital watermark embedment strength regressive prediction model
CN108055493A (en) * 2017-12-13 2018-05-18 苏州科达科技股份有限公司 The method and device of embedded watermark in video image
US20180270388A1 (en) * 2017-03-14 2018-09-20 Google Inc. Semi-Transparent Embedded Watermarks
CN109636710A (en) * 2018-10-16 2019-04-16 平安好房(上海)电子商务有限公司 Automatically remove method, equipment, storage medium and the device of watermark
CN111696046A (en) * 2019-03-13 2020-09-22 北京奇虎科技有限公司 Watermark removing method and device based on generating type countermeasure network
CN111932431A (en) * 2020-07-07 2020-11-13 华中科技大学 Visible watermark removing method based on watermark decomposition model and electronic equipment
CN111968024A (en) * 2020-07-24 2020-11-20 南昌大学 Self-adaptive image watermarking method
CN111984943A (en) * 2020-07-29 2020-11-24 南京信息工程大学 DWT-SVD digital watermarking method based on artificial bee colony algorithm
CN112217958A (en) * 2020-09-15 2021-01-12 陕西科技大学 Method for preprocessing digital watermark carrier image irrelevant to device color space
CN112653894A (en) * 2020-12-15 2021-04-13 深圳万兴软件有限公司 Interframe predictive coding searching method and device, computer equipment and storage medium
CN113065631A (en) * 2021-03-24 2021-07-02 安徽铜冠铜箔集团股份有限公司 Parameter optimization method based on improved competition group algorithm

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006116270A2 (en) * 2005-04-26 2006-11-02 Verance Corporation Security enhancements of digital watermarks for multi-media content
KR20110101577A (en) * 2010-03-09 2011-09-16 한국과학기술원 The video watermarking system for inaccessible contents using overlay channel and the method thereof
CN103295180A (en) * 2013-05-02 2013-09-11 陕西师范大学 Digital watermarking method with robustness and transparency in optimum balance
CN103793874A (en) * 2014-02-14 2014-05-14 中北大学 Novel digital watermarking method capable of maintaining fidelity and robustness
JP2016072706A (en) * 2014-09-26 2016-05-09 大日本印刷株式会社 Strength setting method for watermark embedding and computer program
CN106780286A (en) * 2017-01-23 2017-05-31 天津大学 A kind of particle group optimizing water mark method extracted based on blind watermatking
US20180270388A1 (en) * 2017-03-14 2018-09-20 Google Inc. Semi-Transparent Embedded Watermarks
CN107240059A (en) * 2017-04-07 2017-10-10 广东精点数据科技股份有限公司 The modeling method of image digital watermark embedment strength regressive prediction model
CN108055493A (en) * 2017-12-13 2018-05-18 苏州科达科技股份有限公司 The method and device of embedded watermark in video image
CN109636710A (en) * 2018-10-16 2019-04-16 平安好房(上海)电子商务有限公司 Automatically remove method, equipment, storage medium and the device of watermark
CN111696046A (en) * 2019-03-13 2020-09-22 北京奇虎科技有限公司 Watermark removing method and device based on generating type countermeasure network
CN111932431A (en) * 2020-07-07 2020-11-13 华中科技大学 Visible watermark removing method based on watermark decomposition model and electronic equipment
CN111968024A (en) * 2020-07-24 2020-11-20 南昌大学 Self-adaptive image watermarking method
CN111984943A (en) * 2020-07-29 2020-11-24 南京信息工程大学 DWT-SVD digital watermarking method based on artificial bee colony algorithm
CN112217958A (en) * 2020-09-15 2021-01-12 陕西科技大学 Method for preprocessing digital watermark carrier image irrelevant to device color space
CN112653894A (en) * 2020-12-15 2021-04-13 深圳万兴软件有限公司 Interframe predictive coding searching method and device, computer equipment and storage medium
CN113065631A (en) * 2021-03-24 2021-07-02 安徽铜冠铜箔集团股份有限公司 Parameter optimization method based on improved competition group algorithm

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
MUHAMMAD ISHTIAQ等: "Adaptive Watermark Strength Selection using Particle Swarm Optimization", ICIC EXPRESS LETTERS, vol. 4, no. 5 *
MUSTAPHA HEMIS等: "Optimized Audio Watermarking Scheme with Swarm Intelligence", 2015 FIRST INTERNATIONAL CONFERENCE ON NEW TECHNOLOGIES OF INFORMATION AND COMMUNICATION *
RAN CHENG等: "A Competitive Swarm Optimizer for Large Scale Optimization", IEEE TRANSACTIONS ON CYBERNETICS, vol. 45, no. 2, pages 191 - 202 *
吴万旭;牛钰莹;刘甜甜;赵全超;: "基于差分进化的小波域彩色图像盲水印算法", 通信技术, no. 04 *
曾苑: "基于粒子群优化和小波变换的视频水印算法研究", 中国优秀硕士学位论文全文数据库, no. 3, pages 29 - 34 *

Also Published As

Publication number Publication date
CN113691885B (en) 2024-01-30

Similar Documents

Publication Publication Date Title
CN108337551B (en) Screen recording method, storage medium and terminal equipment
CN108961303B (en) Image processing method and device, electronic equipment and computer readable medium
JP6553692B2 (en) Moving image background removal method and moving image background removal system
US10438322B2 (en) Image resolution enhancement
CN106303157B (en) Video noise reduction processing method and video noise reduction processing device
US20180342045A1 (en) Image resolution enhancement using machine learning
CN108830892B (en) Face image processing method and device, electronic equipment and computer readable storage medium
CN106558053B (en) Object segmentation methods and Object Segmentation device
CN111127309B (en) Portrait style migration model training method, portrait style migration method and device
US8983188B1 (en) Edge-aware smoothing in images
CN113055615B (en) Conference all-in-one machine, screen segmentation display method and storage device
CN115439615B (en) Distributed integrated management system based on three-dimensional BIM
CN109934789A (en) Image de-noising method, device and electronic equipment
CN110555863A (en) moving object detection method and device and computer readable storage medium
CN112115295A (en) Video image detection method and device and electronic equipment
CN109919190B (en) Straight line segment matching method, device, storage medium and terminal
TWI711004B (en) Picture processing method and device
CN110856014B (en) Moving image generation method, moving image generation device, electronic device, and storage medium
CN113691885A (en) Video watermark removing method and device, computer equipment and storage medium
CN113298723A (en) Video processing method and device, electronic equipment and computer storage medium
CN108876691B (en) Self-adaptive reversible watermarking method and system
WO2017036386A1 (en) Video denoising method and device, terminal and storage medium
CN111754411B (en) Image noise reduction method, image noise reduction device and terminal equipment
CN115170581A (en) Portrait segmentation model generation method, portrait segmentation model and portrait segmentation method
CN112967301A (en) Self-timer image matting method and device

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