WO2021083110A1 - Carrier object processing and watermark embedding methods and apparatuses, and electronic device - Google Patents

Carrier object processing and watermark embedding methods and apparatuses, and electronic device Download PDF

Info

Publication number
WO2021083110A1
WO2021083110A1 PCT/CN2020/123884 CN2020123884W WO2021083110A1 WO 2021083110 A1 WO2021083110 A1 WO 2021083110A1 CN 2020123884 W CN2020123884 W CN 2020123884W WO 2021083110 A1 WO2021083110 A1 WO 2021083110A1
Authority
WO
WIPO (PCT)
Prior art keywords
watermark
carrier object
feature vector
original
processed
Prior art date
Application number
PCT/CN2020/123884
Other languages
French (fr)
Chinese (zh)
Inventor
崔文学
张琦
刘永亮
Original Assignee
阿里巴巴集团控股有限公司
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 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2021083110A1 publication Critical patent/WO2021083110A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • G06T1/0092Payload characteristic determination in a watermarking scheme, e.g. number of bits to be embedded
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing

Definitions

  • This application relates to the field of computer technology, in particular to a method, device, and electronic device for processing carrier objects, and a method, device, and electronic device for embedding a watermark.
  • the existing watermark editing technology is mainly to obtain a large number of carrier objects that contain the same or similar watermark, and then estimate the watermark position of the carrier object, and then edit the watermark according to the estimated watermark position.
  • using this technology can only process a batch of carrier objects, and cannot process a single carrier object alone, which brings troubles to the processing of a single carrier object.
  • the above-mentioned watermark editing technique can only be edited for a certain type of watermark, that is, only a single type of watermark can be edited.
  • the types of watermarks in the existing watermarked carrier objects are different. Therefore, the existing watermark editing methods cannot accurately edit the watermarks in the carrier objects with watermarks with diversified styles.
  • This application provides a carrier object processing method to solve the problem that the existing watermark editing methods cannot accurately edit the watermark due to the diversity of watermark styles; this application also provides a carrier object processing device and electronic equipment. This application also provides a watermark embedding method, device and electronic equipment.
  • This application provides a method for processing a carrier object, including:
  • the watermark template edit the watermark in the to-be-processed carrier object to obtain a target carrier object.
  • the extracting a watermark template from the to-be-processed carrier object includes:
  • a watermark template corresponding to the feature vector is obtained.
  • the obtaining the watermark template corresponding to the feature vector according to the feature vector of the carrier object to be processed includes:
  • the watermark template is a template used when adding watermark information to the original carrier object; wherein, the original carrier object is the carrier object before the watermark information is added to the carrier object to be processed.
  • it also includes:
  • the editing the watermark in the carrier object to be processed according to the watermark template to obtain a target carrier object includes: editing in the carrier object to be processed according to a predetermined color of the watermark and the watermark template The watermark obtains the target carrier object.
  • the setting the color of the watermark to a predetermined color in the carrier object to be processed according to the watermark template includes:
  • the carrier object to be processed and the watermark template are input into a network model for setting the watermark color to a predetermined color, so as to set the color of the watermark in the carrier object to be processed to a predetermined color.
  • the input of the carrier object to be processed and the watermark template into a network model for setting the watermark color to a predetermined color, so as to set the color of the watermark in the carrier object to be processed to a predetermined color include:
  • the color of the watermark in the carrier object to be processed is set to a predetermined color.
  • it also includes:
  • the editing the watermark in the to-be-processed carrier object according to the predetermined color of the watermark and the watermark template to obtain a target carrier object includes:
  • the carrier object to be processed, the watermark template, and the carrier object set to a predetermined color are input into the network model for editing the watermark to obtain the target carrier object.
  • the inputting the to-be-processed carrier object, the watermark template, and the carrier object set to a predetermined color into a network model for editing watermarks to obtain a target carrier object includes:
  • the watermark template, and the editing feature vector corresponding to the carrier object set to a predetermined color edit the watermark of the to-be-processed carrier object to obtain a target carrier object.
  • the setting the color of the watermark in the to-be-processed carrier object to a predetermined color refers to setting the pixel value of the watermark in the to-be-processed carrier object at the position in the to-be-processed carrier object Is the predetermined pixel value.
  • it further includes obtaining the network model used to extract the watermark template
  • the obtaining of the network model used to extract the watermark template includes:
  • the first-level watermark template, the second-level watermark template, and the third-level watermark template as watermark templates corresponding to the sample data;
  • the corresponding relationship between the sample data and the watermark template corresponding to the sample data is obtained, and the corresponding relationship is used as a network model for extracting the watermark template.
  • the obtaining the second-level feature vector according to the first-level feature vector includes:
  • the second-level feature vector is obtained according to the feature vector of the first shrinkage scale corresponding to the second-level feature vector.
  • the obtaining the feature vector of the first contraction scale corresponding to the second-level feature vector according to the feature vector of the first contraction scale corresponding to the first-level feature vector includes:
  • the feature vector of the second contraction scale corresponding to the second-level feature vector is obtained.
  • the obtaining a third-level feature vector according to the second-level feature vector includes:
  • the obtaining the feature vector of the first contraction scale corresponding to the third-level feature vector according to the feature vector of the first contraction scale corresponding to the second-level feature vector includes:
  • the feature vector of the second contraction scale corresponding to the three-level feature vector is obtained.
  • it also includes obtaining a network model for setting the watermark color to a predetermined color
  • the obtaining a network model for setting the watermark color to a predetermined color includes:
  • the first-level feature vector and the first-level watermark template set the color of the watermark in the sample data to a predetermined color, and obtain a first sample of the sample data set to the predetermined color;
  • the three-level feature vector and the three-level watermark template set the color of the watermark in the sample data to a predetermined color; obtain a third sample of the sample data set to the predetermined color;
  • the corresponding relationship between the sample data and the sample data of the predetermined color is obtained, and the corresponding relationship is used as a network model for setting the watermark color to the predetermined color.
  • the method further includes: correcting the network model for extracting the watermark template according to the sample data of the predetermined color;
  • the correcting the network model for extracting the watermark template according to the sample data of the predetermined color includes:
  • it also includes obtaining a network model for editing the watermark
  • the obtaining of the network model used for editing the watermark includes:
  • the editing feature vector edit the watermark corresponding to the sample data to obtain target sample data
  • the corresponding relationship between the sample data and the target sample data is obtained, and the corresponding relationship is used as a network model for editing the watermark.
  • the extracting a watermark template from the to-be-processed carrier object includes:
  • a set of watermark templates or all of the watermark templates in the at least one set of watermark templates corresponding to the carrier object to be processed are used as the watermark templates of the carrier to be processed.
  • this application provides a carrier object processing device, including:
  • the carrier object processing unit is used to obtain the carrier object to be processed
  • a watermark template extraction unit configured to extract a watermark template from the carrier object to be processed
  • the target carrier object obtaining unit is configured to edit the watermark in the to-be-processed carrier object according to the watermark template to obtain the target carrier object.
  • This application also provides a watermark embedding method, including:
  • the original watermark is embedded in a designated position of the original carrier object.
  • the obtaining the original watermark includes:
  • the obtaining the position information of the original watermark embedded on the original carrier object includes:
  • the position information at which the original watermark is embedded on the original carrier object is obtained.
  • the determining the embedding area of the original watermark on the original carrier object according to the size information of the original carrier object includes:
  • the embedding area of the original watermark on the original carrier object is determined.
  • the obtaining, in the embedding area, the position information at which the original watermark is embedded on the original carrier object according to the size information of the original watermark includes:
  • the position information at which the original watermark is embedded on the original carrier object is obtained.
  • the attribute information of the original watermark includes at least one of the color of the original watermark, the font of the original watermark, and the font size information of the original watermark.
  • this application also provides a watermark embedding device, including:
  • the original carrier object obtaining unit which is used to obtain the original carrier object
  • the original watermark obtaining unit is used to obtain the original watermark
  • a location information obtaining unit configured to obtain location information of the original watermark embedded on the original carrier object
  • the embedding unit is configured to embed the original watermark at a designated position of the original carrier object randomly according to the attribute information of the original watermark and the position information in the original carrier object.
  • This application provides an electronic device, including:
  • the memory is used to store the program of the carrier object processing method and execute the following steps:
  • the watermark template edit the watermark in the to-be-processed carrier object to obtain a target carrier object.
  • This application provides an electronic device, including:
  • the memory is used to store the program of the watermark embedding method and execute the following steps:
  • the original watermark is embedded in a designated position of the original carrier object.
  • This application provides a computer storage medium that stores a program of a carrier object processing method, and the program is run by a processor to perform the following steps:
  • the watermark template edit the watermark in the to-be-processed carrier object to obtain a target carrier object.
  • This application provides a computer storage medium that stores a program of the watermark embedding method, and the program is run by a processor to perform the following steps:
  • the original watermark is embedded in a designated position of the original carrier object.
  • This application discloses a method for processing a carrier object, including: obtaining a carrier object to be processed; extracting a watermark template from the carrier object to be processed; editing the watermark in the carrier object to be processed according to the watermark template, Get the target carrier object.
  • the carrier object processing method of the present application by extracting the watermark template corresponding to the carrier object to be processed, the specific position of the watermark can be accurately obtained; according to the watermark template, the watermark of the carrier object to be processed can be accurately edited.
  • the carrier object processing method of the present application solves the problem that the existing watermark editing method cannot accurately edit the watermark due to the diversity of watermark styles by obtaining the watermark template corresponding to the carrier object to be processed.
  • FIG. 1A is a schematic diagram of an application scenario embodiment of the carrier object processing method provided by this application.
  • FIG. 1B is a schematic diagram of another embodiment of the application scenario of the carrier object processing method provided by this application.
  • FIG. 2 is a flowchart of a method for processing a carrier object according to Embodiment 1 of the application.
  • FIG. 3 is a schematic diagram of a second application scenario embodiment of the carrier object processing method provided by this application.
  • Fig. 4 is a schematic diagram of the GridNet network structure provided in the first embodiment of the application.
  • FIG. 5 is a schematic diagram of a carrier object processing apparatus provided in Embodiment 2 of this application.
  • Fig. 6 is a flow chart of the watermark embedding method provided in the third embodiment of the application.
  • Fig. 7 is a schematic diagram of a watermark embedding device provided in the fourth embodiment of the application.
  • FIG. 8 is a schematic diagram of a carrier object processing electronic device provided in Embodiment 5 of this application.
  • This application provides a method and device for processing a carrier object, an electronic device, and a computer storage medium.
  • FIG. 1A it is a schematic diagram of an application scenario embodiment of the carrier object processing method provided by this application.
  • the server obtains the carrier object to be processed from the terminal.
  • the carrier object to be processed may be an image with a watermark or a video frame image.
  • Extract the watermark template based on the current image.
  • After obtaining the watermark template set the color of the watermark in the watermarked image to a predetermined color, and then edit the watermark in the watermarked image according to the predetermined color of the watermark and the watermark template, and edit the watermarked image Return to the terminal.
  • FIG. 1B is a schematic diagram of another embodiment of the application scenario of the carrier object processing method provided by this application.
  • the application scenario is only an embodiment of the application scenario, and the purpose of providing this application scenario embodiment is to facilitate the understanding of the carrier object processing method of the present application, and is not used to limit the carrier object processing method of the present application.
  • FIG. 2 it is a flowchart of an embodiment of a method for processing a carrier object according to Embodiment 1 of the present application.
  • the method includes the following steps.
  • Step S201 Obtain a carrier object to be processed.
  • the carrier object to be processed refers to a carrier object containing a watermark.
  • the carrier object may be at least one of an image or a text file.
  • the carrier object containing the watermark can be an image containing a watermark, a Word text document containing a watermark, or a PDF text document containing a watermark.
  • the method of processing a carrier object is mainly described by processing a watermarked image.
  • the carrier object to be processed may also be other carrier media containing watermarks other than images containing watermarks and text documents containing watermarks, and there is no limitation here.
  • Step S202 Extract a watermark template from the carrier object to be processed.
  • a watermark template needs to be extracted from the carrier object to be processed.
  • the watermark template is a template used when adding watermark information to the original carrier object; wherein, the original carrier object is the carrier object before the watermark information is added to the carrier object to be processed.
  • extracting the watermark template from the to-be-processed carrier object may be in the manner described below.
  • the network model used to extract the watermark template is mainly used for the detection of the watermark in the carrier object to be processed, and the main task of the watermark detection is to extract the watermark binary template information from the watermarked carrier object (ie image), that is, the watermark template.
  • this embodiment designs a network model for extracting the watermark template.
  • a multi-cascade network structure is adopted.
  • each stage will output a feature vector F i , where i represents the number of stages of the network, and then this feature vector will be used as the input feature vector of the next level (i+1) network.
  • the number of stages of the network is three.
  • Each level of network is used for feature extraction (first level network), feature enhancement (second level network), and feature refinement (third level network).
  • the watermark template corresponding to the feature vector is obtained according to the feature vector of the carrier object to be processed.
  • the obtaining the watermark template corresponding to the feature vector according to the feature vector of the carrier object to be processed may be performing a convolution operation on the feature vector to obtain the watermark template corresponding to the feature vector.
  • S i output a watermark template convolution operation (C i) on each stage output feature vector F i. Since in the present embodiment, the three stages of the network, the output of the watermark templates S i is also three.
  • each level of the network in the network model for extracting the watermark template in this embodiment is a GridNet structure, as shown in Figure 4 below, which is a schematic diagram of the GridNet network structure.
  • the convolution kernels of all convolution layers are 3x3
  • the number of convolution kernels in the middle layer is 32, that is, 32 feature maps are generated for each layer.
  • Down-sampling (down arrow in Figure 4) is implemented using convolution, with a step size of 2; up-sampling (up arrow in Figure 4) uses a deconvolution operation.
  • the horizontal arrows indicate that there are 3 convolutional layers, 3 activation layers, and 3 batch normalization layers; down-sampling arrows indicate 3 convolutional layers, 3 activation layers, and the last volume
  • the build-up step size is 2; the up-sampling arrows indicate 2 convolutional layers, 1 deconvolutional layer, and 3 activation layers.
  • the sample data for extracting the watermark template may be used first. Afterwards, the first-level feature vector of the sample data is obtained.
  • the second-level feature vector is obtained according to the first-level feature vector.
  • a convolution operation is performed on the second-level feature vector to obtain the second-level watermark template corresponding to the second-level feature vector.
  • a third-level feature vector is obtained according to the second-level feature vector.
  • a convolution operation is performed on the third-level feature vector to obtain the third-level watermark template corresponding to the third-level feature vector.
  • the first-level watermark template, the second-level watermark template, and the third-level watermark template are used as the watermark templates corresponding to the sample data.
  • the corresponding relationship between the sample data and the watermark template corresponding to the sample data is obtained, and the corresponding relationship is used as a network model for extracting the watermark template.
  • the GridNet structure adopted by each level of the network in the above-mentioned network model for extracting the watermark template may be specifically embodied in the manner of obtaining the second-level feature vector according to the first-level feature vector.
  • the manner of obtaining the second-level feature vector is as described below.
  • the feature vector of the first shrinkage scale corresponding to the first-level feature vector is obtained.
  • the feature vector of the first contraction scale corresponding to the first-level feature vector is obtained.
  • the second-level feature vector is obtained according to the feature vector of the first shrinkage scale corresponding to the second-level feature vector.
  • the feature vector of the first contraction scale corresponding to the first-level feature vector is obtained in the manner described below.
  • the feature vector of the second contraction scale corresponding to the first-level feature vector is obtained.
  • the feature vector of the second contraction scale corresponding to the first-level feature vector is obtained.
  • the feature vector of the second contraction scale corresponding to the second-level feature vector is obtained.
  • the feature vector of the first contraction scale corresponding to the second-level feature vector is obtained.
  • GridNet structure adopted by each level of the network in the above-mentioned network model for extracting the watermark template may be specifically embodied in the manner of obtaining the third-level feature vector according to the second-level feature vector.
  • the feature vector of the first shrinkage scale corresponding to the secondary feature vector is obtained.
  • the feature vector of the first contraction scale corresponding to the second-level feature vector is obtained.
  • the feature vector of the first contraction scale corresponding to the third-level feature vector is obtained.
  • a three-level feature vector is obtained according to the feature vector of the first shrinkage scale corresponding to the three-level feature vector.
  • the feature vector of the first contraction scale corresponding to the second-level feature vector is obtained in the manner described below.
  • the feature vector of the second contraction scale corresponding to the second-level feature vector is obtained.
  • the feature vector of the second contraction scale corresponding to the second-level feature vector is obtained.
  • the feature vector of the second contraction scale corresponding to the third-level feature vector is obtained.
  • the feature vector of the second shrinkage scale corresponding to the three-level feature vector is obtained.
  • the color of the watermark is set to a predetermined color in the carrier object to be processed.
  • the color of the watermark is set to a predetermined color in the carrier object to be processed.
  • setting the color of the watermark in the carrier object to be processed to a predetermined color refers to setting the pixel value of the watermark in the carrier object to be processed at the position in the carrier object to be processed to a predetermined Pixel values.
  • the pixel value of the position of the watermark in the to-be-processed carrier object in the to-be-processed carrier object is set to zero.
  • setting the color of the watermark in the carrier object to be processed to a predetermined color may be inputting the carrier object to be processed and the watermark template into a watermark for setting the watermark color.
  • the color of the watermark in the carrier object to be processed is set to a predetermined color.
  • the carrier object to be processed and the watermark template are input into a network model for setting the watermark color to a predetermined color, so as to set the color of the watermark in the carrier object to be processed to a predetermined color, according to The way described below.
  • the position information and shape information of the watermark in the carrier object to be processed are obtained.
  • the color of the watermark in the carrier object to be processed is set to a predetermined color.
  • the carrier object to be processed and the watermark template are input into the network model for setting the watermark color to a predetermined color, so as to set the color of the watermark in the carrier object to be processed to a predetermined color.
  • It is a network model that sets the watermark color to a predetermined color. Therefore, in this embodiment, it is also necessary to train to obtain a network model for setting the watermark color to a predetermined color.
  • the network model used to set the watermark color to a predetermined color and the network model used to extract the watermark template belong to mutually corresponding network models.
  • Obtaining the network model used to set the watermark color to a predetermined color is trained according to the sample data during training of the network model used to extract the watermark template and the watermark template generated during the training process.
  • the specific process of training the network model for setting the watermark color to a predetermined color is described as follows.
  • the color of the watermark is set to a predetermined color in the sample data, and the first sample of the sample data set to the predetermined color is obtained.
  • the color of the watermark is set to a predetermined color in the sample data; the second sample after the sample data is set to the predetermined color is obtained.
  • the color of the watermark is set to a predetermined color in the sample data; and a third sample of the sample data set to the predetermined color is obtained.
  • the first sample, the second sample, and the third sample are used as sample data in which the color of the watermark is set to a predetermined color in the sample data.
  • the corresponding relationship between the sample data and the sample data of the predetermined color is obtained, and the corresponding relationship is used as a network model for setting the watermark color to the predetermined color.
  • the main purpose of setting the watermark color to a predetermined color is to unify the colors in the watermarked image.
  • the watermark colors are diverse, and the diversified watermark colors will cause the watermark to be edited inaccurately during the watermark editing process. Therefore, the watermark color in the image containing the watermark is set to a predetermined color, and the pixel value of the watermark position is set to Zero, the pixel values in other positions remain unchanged.
  • the structure of the network model used to set the watermark color to a predetermined color is similar to the network model used to extract the watermark template.
  • the only difference is the output setting in the structure of the network model used to set the watermark color to a predetermined color
  • the result of the sample data of the predetermined color is three-channel data
  • the watermark template output by the network model used to extract the watermark template is two-dimensional single-channel data.
  • the structure of the network model used to set the watermark color to a predetermined color refer to the relevant description of the network model used to extract the watermark template for details, which will not be described in detail here.
  • the sample data for the predetermined color is compared to the watermark template. Correction of the network model; the specific method can be described as follows.
  • the above-mentioned correction process can be specifically as follows:
  • T i the feature vector generated by each level of the network
  • M i the generated sample data of the predetermined color
  • (F i -1) * ( - 1) simulates the watermark templates bitwise operation
  • the two network structures of the network model used to set the watermark color to a predetermined color and the network model used to extract the watermark template can be jointly trained, and have the following advantages:
  • the watermark template information of the model can provide guidance for the network model used to set the watermark color to a predetermined color.
  • the watermark color is set to The result of the predetermined color can be effectively fed back to the network model used to extract the watermark template, thereby guiding the generation of the watermark template to a certain extent.
  • Step S203 Edit the watermark in the carrier object to be processed according to the watermark template to obtain the target carrier object.
  • a watermark template is obtained, and a carrier object in which the color of the watermark in the carrier object to be processed is set to a predetermined color is obtained. Afterwards, the carrier object to be processed, the watermark template, and the carrier object set to a predetermined color are input into the network model for editing the watermark to obtain the target carrier object.
  • the input of the to-be-processed carrier object, the watermark template, and the carrier object set to a predetermined color into the network model for editing the watermark to obtain the target carrier object is as follows.
  • the watermark template, and the editing feature vector corresponding to the carrier object set to a predetermined color the watermark of the carrier object to be processed is edited to obtain the target carrier object.
  • obtaining the network model for editing the watermark may be: first, according to the sample data, the watermark template corresponding to the sample data, and the sample data of the predetermined color, the editing feature vector in the sample data is obtained. Afterwards, according to the editing feature vector, edit the watermark corresponding to the sample data to obtain the target sample data; finally obtain the corresponding relationship between the sample data and the target sample data, and use the corresponding relationship as the target sample data.
  • Network model of watermarking can refer to deleting the original watermark, or can also refer to adding the watermark after deleting the original watermark.
  • the target sample data refers to the original sample data in the network model for generating and editing the watermark or the sample data of the newly added watermark.
  • editing the watermark may also be other watermark editing methods other than detecting the watermark, deleting the original watermark, and adding the watermark, such as modifying the watermark. It still belongs to the protection scope of this application.
  • the main task of editing a watermark is to accurately restore the watermarked carrier object to the original carrier object without watermark, or add a watermark or modify the watermark after restoring to the original carrier object without watermark.
  • the specific position of the watermark in the carrier object must be accurately estimated.
  • the input is not a single watermarked image, and the results obtained in the network model used to extract the watermark template and the network model used to set the watermark color to a predetermined color are also input.
  • the output can be multiple generated watermark templates, and multiple watermark templates are input to the main part of the network model used to edit the watermark.
  • the function is to provide watermark location information and shape information for the watermark editing task; in the network model used to set the watermark color to a predetermined color, multiple images with the watermark set to the predetermined color are obtained, and these images are input for editing the watermark
  • the influence of the diversification of watermark colors can be eliminated; in addition, it can also have a certain guiding effect on the position and shape of the watermark.
  • multiple images are input, including multiple watermark templates, multiple watermarks are set as images with predetermined colors and a watermark-containing image to be processed.
  • Multiple watermark templates and images with multiple watermarks set to predetermined colors can provide more information for watermark editing to a certain extent, thereby improving the effect of watermark editing.
  • Network Model for editing the structure of the watermark with the above two the same sampling multi-cascade network structure, in particular, assuming the i-th stage of the network output is expressed as a feature vector V i, then: among them Represents the i-th level repair network, Is the parameter to be learned.
  • the training mode of this network is referred to the training mode of the network model used to extract the watermark template, which will not be repeated here.
  • the method of adding a new watermark to the carrier after deleting the original watermark after deleting the original watermark please refer to the relevant description part of the third embodiment, which will not be repeated here.
  • a total of three network models are included. Since the network model used to set the watermark color to a predetermined color and the network model used to extract the watermark template are jointly trained, the loss function involved in the network model learning (training) process is mainly divided into two parts.
  • the loss function of the network model used to set the watermark color to a predetermined color and the network model used to extract the watermark template can be expressed as:
  • ⁇ S represents the learnable parameter in the network model used to extract the watermark template
  • ⁇ T represents the network model used to set the watermark color to the predetermined color Learnable parameters.
  • represents a hyperparameter that weighs the two.
  • the loss function can be expressed as:
  • L is the number of multiple cascades in the network model used to extract the watermark template
  • C i represents a convolutional layer
  • the i-th level network of the network model used to extract the watermark template will output a feature vector F i
  • This feature vector will provide guidance for the network model used to set the watermark color to a predetermined color, and its loss function can be expressed as:
  • the loss function of the network model used to edit the watermark can be expressed as:
  • FIG. 3 shows a schematic diagram of a second application scenario embodiment of the carrier object processing method provided by the present application.
  • the user inputs the image with the watermark "2018” and the editing requirement “modify the watermark of the image 2018 to 2019” into the computing device 300, and the computing device 300 obtains the specific position of the watermark "2008” in the image by extracting the watermark template of the image.
  • set the watermark "2018” to a predetermined color according to the specific location of the watermark, and set the watermark to a specific color to overcome the inaccuracy of the watermark edited during the watermark editing process caused by the diversification of the watermark color, and finally set it to The watermark "2018” of a specific color is changed to the watermark "2019".
  • the above-mentioned image with the watermark “2018” can also be input alone or together with other batches of images.
  • This method can automatically identify the image with the watermark “2018” and automatically detect its watermark “2018” according to the actual time. , And automatically modify the watermark time "2018” in the image according to the current time.
  • multiple sets of watermark modification schemes can be automatically recommended based on the results of the detection and recognition of the watermark.
  • the watermark in the image with the watermark "2018” can be modified to "2019", or it can be modified to "2019" at the same time.
  • the above-mentioned image containing the watermark "2018” can be automatically modified according to the current time after it has been modified.
  • the watermark "2018” of the image can be changed to "2019” in 2019, and it can be automatically changed to "2020” in 2020.
  • the purpose of the foregoing application scenario embodiments is to facilitate the understanding of the carrier object processing method of the present application, and is not used to limit the carrier object processing method of the present application.
  • the carrier object processing method of this embodiment can accurately obtain the specific position of the watermark by extracting the watermark template corresponding to the carrier object to be processed; according to the watermark template, the watermark of the carrier object to be processed can be accurately edited.
  • the carrier object processing method of the present application solves the problem that the existing watermark editing method cannot accurately edit the watermark due to the diversity of watermark styles by obtaining the watermark template corresponding to the carrier object to be processed.
  • FIG. 5 it is a schematic diagram of a carrier object processing apparatus according to the second embodiment of the application. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.
  • the device embodiments described below are merely illustrative.
  • the carrier object processing unit 501 is configured to obtain a carrier object to be processed
  • a watermark template extraction unit 502 configured to extract a watermark template from the carrier object to be processed
  • the target carrier object obtaining unit 503 is configured to edit the watermark in the to-be-processed carrier object according to the watermark template to obtain a target carrier object.
  • the watermark template extraction unit is specifically used for:
  • a watermark template corresponding to the feature vector is obtained.
  • the watermark template extraction unit is specifically used for:
  • the watermark template is a template used when adding watermark information to the original carrier object; wherein, the original carrier object is the carrier object before the watermark information is added to the carrier object to be processed.
  • it also includes: a color setting unit;
  • the color setting unit is specifically configured to: set the color of the watermark to a predetermined color in the carrier object to be processed according to the watermark template;
  • the target carrier object obtaining unit is specifically used for:
  • the predetermined color of the watermark and the watermark template edit the watermark in the to-be-processed carrier object to obtain a target carrier object.
  • the color setting unit is specifically used for:
  • the carrier object to be processed and the watermark template are input into a network model for setting the watermark color to a predetermined color, so as to set the color of the watermark in the carrier object to be processed to a predetermined color.
  • the color setting unit is specifically used for:
  • the color of the watermark in the carrier object to be processed is set to a predetermined color.
  • it further includes: a second carrier object obtaining unit;
  • the second carrier object obtaining unit is specifically used for:
  • the target carrier object obtaining unit is specifically used for:
  • the carrier object to be processed, the watermark template, and the carrier object set to a predetermined color are input into a network model for editing the watermark to obtain a target carrier object.
  • the target carrier object obtaining unit is specifically used for:
  • the watermark template, and the editing feature vector corresponding to the carrier object set to a predetermined color edit the watermark of the to-be-processed carrier object to obtain the target carrier object.
  • the setting the color of the watermark in the to-be-processed carrier object to a predetermined color refers to setting the pixel value of the watermark in the to-be-processed carrier object at the position in the to-be-processed carrier object Is the predetermined pixel value.
  • it further includes a first network model obtaining unit
  • the first network model obtaining unit is configured to obtain the network model used to extract the watermark template
  • the first network model obtaining unit is specifically used for:
  • the first-level watermark template, the second-level watermark template, and the third-level watermark template as watermark templates corresponding to the sample data;
  • the corresponding relationship between the sample data and the watermark template corresponding to the sample data is obtained, and the corresponding relationship is used as a network model for extracting the watermark template.
  • the first network model obtaining unit is specifically configured to:
  • the second-level feature vector is obtained according to the feature vector of the first shrinkage scale corresponding to the second-level feature vector.
  • the first network model obtaining unit is specifically configured to:
  • the feature vector of the second contraction scale corresponding to the second-level feature vector is obtained.
  • the first network model obtaining unit is specifically configured to:
  • the first network model obtaining unit is specifically configured to:
  • the feature vector of the second contraction scale corresponding to the three-level feature vector is obtained.
  • it further includes a second network model obtaining unit;
  • the second network model obtaining unit is configured to obtain a network model for setting the watermark color to a predetermined color
  • the second network model obtaining unit is specifically used for:
  • the first-level feature vector and the first-level watermark template set the color of the watermark in the sample data to a predetermined color, and obtain a first sample of the sample data set to the predetermined color;
  • the three-level feature vector and the three-level watermark template set the color of the watermark in the sample data to a predetermined color; obtain a third sample of the sample data set to the predetermined color;
  • the corresponding relationship between the sample data and the sample data of the predetermined color is obtained, and the corresponding relationship is used as a network model for setting the watermark color to the predetermined color.
  • it also includes a correction unit
  • the correction unit is configured to correct the network model used for extracting the watermark template according to the sample data of the predetermined color
  • the correction unit is specifically used for:
  • it further includes a third network model obtaining unit;
  • the third network model obtaining unit is configured to obtain a network model for editing watermarks
  • the third network model obtaining unit is specifically used for:
  • the editing feature vector edit the watermark corresponding to the sample data to obtain target sample data
  • the corresponding relationship between the sample data and the target sample data is obtained, and the corresponding relationship is used as a network model for editing the watermark.
  • the watermark template extraction unit is specifically used for:
  • a set of watermark templates or all of the watermark templates in the at least one set of watermark templates corresponding to the carrier object to be processed are used as the watermark templates of the carrier to be processed.
  • FIG. 6 is a flowchart of an embodiment of the watermark embedding method in the third embodiment of this application.
  • the method includes the following steps. include:
  • Step S601 Obtain the original carrier object, and obtain the original watermark.
  • the watermark embedding method of this embodiment can be used to generate a watermark-containing carrier object to train the network model for extracting the watermark template of the first embodiment, the network model for setting the watermark color to a predetermined color, and the network for editing the watermark model.
  • the original watermark can be obtained in the manner described below.
  • a number symbols, B English symbols, and C special symbols can be selected in advance to randomly form a sequence containing A+B+C characters, and the character sequence is used as the original watermark.
  • Step S602 Obtain the position information at which the original watermark is embedded on the original carrier object.
  • step S601 After obtaining the original carrier object and obtaining the original watermark in step S601, the position information at which the original watermark is embedded on the original carrier object is obtained.
  • one of the ways to obtain it may be: firstly, obtain the size information of the original carrier object and the information of the original watermark. Size Information. Then, according to the size information of the original carrier object, the embedding area of the original watermark on the original carrier object is determined. Finally, in the embedding area, according to the size information of the original watermark, the position information at which the original watermark is embedded on the original carrier object is obtained.
  • the determination of the embedding area of the original watermark on the original carrier object according to the size information of the original carrier object may be in the manner described below. First, obtain the length and size information of the original carrier object according to the size information of the original carrier object. After that, determine the first reserved size information in the length direction on the original carrier object according to the length and size information; at the same time, obtain the width and size information of the original carrier object according to the size information of the original carrier object; And, determining the second reserved size information in the width direction on the original carrier object according to the width size information. Finally, according to the size information of the original carrier object, the first reserved size information and the second reserved size information, the embedding area of the original watermark on the original carrier object is determined.
  • the position information at which the original watermark is embedded on the original carrier object is obtained.
  • the size information of the original watermark Obtain the edge position information of the original watermark.
  • the position information of the original watermark embedded on the original carrier object is obtained.
  • Step S603 In the original carrier object, randomly according to the attribute information of the original watermark and the position information, embed the original watermark in the designated position of the original carrier object.
  • step S601 the original carrier object is obtained, and the original watermark is obtained; and in step S602, after obtaining the position information of the original watermark embedded on the original carrier object, in the original carrier object, randomly follow the attributes of the original watermark Information and the location information, the original watermark is embedded in the specified location of the original carrier object.
  • the attribute information of the original watermark includes at least one of the color of the original watermark, the font of the original watermark, and the font size information of the original watermark.
  • the watermark embedding method of this embodiment obtains the original carrier object and the original watermark. On this basis, the position information of the original watermark embedded in the original carrier object is obtained, so that in the original carrier object, randomly according to the attribute information of the original watermark and the position information, the original The watermark is embedded in the designated position of the original carrier object.
  • the watermark embedded in this method ensures that the watermark is not on the edge of the original carrier object, so as to ensure that the watermark can be accurately detected.
  • a watermark embedding method is provided.
  • this application also provides a watermark embedding device.
  • FIG. 7 it is a schematic diagram of a watermark embedding device according to the fourth embodiment of the application. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment. The device embodiments described below are merely illustrative.
  • the original carrier object obtaining unit 701 is configured to obtain the original carrier object
  • the original watermark obtaining unit 702 is configured to obtain the original watermark
  • a location information obtaining unit 703, configured to obtain location information of the original watermark embedded on the original carrier object
  • the embedding unit 704 is configured to embed the original watermark at a designated position of the original carrier object randomly according to the attribute information of the original watermark and the position information in the original carrier object.
  • the original watermark obtaining unit is specifically used for:
  • the location information obtaining unit is specifically configured to:
  • the position information at which the original watermark is embedded on the original carrier object is obtained.
  • the location information obtaining unit is specifically configured to:
  • the embedding area of the original watermark on the original carrier object is determined.
  • the location information obtaining unit is specifically configured to:
  • the position information at which the original watermark is embedded on the original carrier object is obtained.
  • the attribute information of the original watermark includes at least one of the color of the original watermark, the font of the original watermark, and the font size information of the original watermark.
  • the first embodiment of the present application provides a method for processing a carrier object
  • the fifth embodiment of the present application provides an electronic device corresponding to the method for processing the carrier object.
  • FIG. 8 shows a schematic diagram of the electronic device of the carrier object processing method provided in the fifth embodiment of the present application.
  • the memory 802 is used to store the program of the carrier object processing method and execute the following steps:
  • the watermark template edit the watermark in the to-be-processed carrier object to obtain a target carrier object.
  • the third embodiment of this application provides a watermark embedding method
  • the sixth embodiment of this application provides an electronic device corresponding to the watermark embedding method. Since the schematic diagram of the electronic device is the same as FIG. 8, please refer to FIG. 8 for the specific diagram.
  • This application provides an electronic device, including:
  • the memory is used to store the program of the watermark embedding method and execute the following steps:
  • the original watermark is embedded in a designated position of the original carrier object.
  • the first embodiment of the present application provides a method for processing a carrier object
  • the seventh embodiment of the present application provides a computer storage medium corresponding to the method for processing the carrier object.
  • a computer storage medium of this embodiment stores a program of a carrier object processing method, and the program is run by a processor to perform the following steps:
  • the watermark template edit the watermark in the to-be-processed carrier object to obtain a target carrier object.
  • the third embodiment of the present application provides a watermark embedding method
  • the eighth embodiment of the present application provides a computer storage medium corresponding to the watermark embedding method.
  • a computer storage medium of this embodiment stores a program of the watermark embedding method, and the program is run by a processor to perform the following steps:
  • the original watermark is embedded in a designated position of the original carrier object.
  • the computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-permanent memory in a computer readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices.
  • computer-readable media does not include non-transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
  • this application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

Carrier object processing and watermark embedding methods and apparatuses, and an electronic device. The carrier object processing method comprises: acquiring a carrier object to be processed (S201); extracting a watermark template from said carrier object (S202); editing a watermark in said carrier object according to the watermarking template, so as to obtain a target carrier object (S203). According to the described method, the specific position of the watermark can be accurately obtained by extracting the watermark template corresponding to a carrier object to be processed, and the watermark of said carrier object can be accurately edited according to the watermark template, solving the problem in the existing watermark editing method that the watermark cannot be accurately edited due to diversity of watermark patterns.

Description

载体对象处理和水印嵌入方法、装置及电子设备Carrier object processing and watermark embedding method, device and electronic equipment
本申请要求2019年10月31日递交的申请号为201911049751.1、发明名称为“载体对象处理和水印嵌入方法、装置及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on October 31, 2019 with the application number 201911049751.1 and the invention title "Carrier object processing and watermark embedding method, device and electronic equipment", the entire content of which is incorporated into this application by reference in.
技术领域Technical field
本申请涉及计算机技术领域,具体涉及一种载体对象处理方法、装置及电子设备,以及,一种水印嵌入方法、装置及电子设备。This application relates to the field of computer technology, in particular to a method, device, and electronic device for processing carrier objects, and a method, device, and electronic device for embedding a watermark.
背景技术Background technique
近年来,随着信息技术以及数字技术的快速发展,越来越多的数字媒体,包括声音、文字、图像、视频等得到广泛传播。而这些数字媒体具有易于存储、复制和传播的特点,并且易于进行各种形式的操作与修改,因而使得这些数字媒体在传播的过程中,容易被不法分子利用。因此,越来越多的企业与个人在这些数字媒体上添加水印以此保护知识产权。In recent years, with the rapid development of information technology and digital technology, more and more digital media, including sound, text, images, video, etc., have been widely disseminated. These digital media have the characteristics of easy storage, copying and dissemination, and are easy to carry out various forms of operation and modification, thus making these digital media easy to be used by criminals in the process of dissemination. Therefore, more and more companies and individuals are adding watermarks to these digital media to protect their intellectual property rights.
而在一些应用场景下,需要将数字媒体带有的水印编辑,这就涉及水印编辑技术。现有的水印编辑技术主要是获取大量的含有相同或者相似水印的载体对象,进而对载体对象的水印位置进行估计,然后根据估计的水印位置将水印编辑。然而,采用该技术只能处理批量载体对象,不能单独处理某一载体对象,这就为处理单一的载体对象带来困扰。另外,上述编辑水印技术的方法只能针对某一水印类型进行编辑,即只能编辑单一类型的水印。然而现有的带有水印的载体对象中的水印的类型各不相同,因此,现有的水印编辑方法不能精确编辑带有样式多样性的水印的载体对象中的水印。In some application scenarios, it is necessary to edit the watermark carried by the digital media, which involves watermark editing technology. The existing watermark editing technology is mainly to obtain a large number of carrier objects that contain the same or similar watermark, and then estimate the watermark position of the carrier object, and then edit the watermark according to the estimated watermark position. However, using this technology can only process a batch of carrier objects, and cannot process a single carrier object alone, which brings troubles to the processing of a single carrier object. In addition, the above-mentioned watermark editing technique can only be edited for a certain type of watermark, that is, only a single type of watermark can be edited. However, the types of watermarks in the existing watermarked carrier objects are different. Therefore, the existing watermark editing methods cannot accurately edit the watermarks in the carrier objects with watermarks with diversified styles.
发明内容Summary of the invention
本申请提供一种载体对象处理方法,以解决现有的水印编辑方法因水印样式多样性而不能精确编辑水印的问题;本申请还提供一种载体对象处理装置以及电子设备。本申请同时还提供一种水印嵌入方法、装置及电子设备。This application provides a carrier object processing method to solve the problem that the existing watermark editing methods cannot accurately edit the watermark due to the diversity of watermark styles; this application also provides a carrier object processing device and electronic equipment. This application also provides a watermark embedding method, device and electronic equipment.
本申请提供一种载体对象处理方法,包括:This application provides a method for processing a carrier object, including:
获取待处理载体对象;Obtain the to-be-processed carrier object;
从所述待处理载体对象中提取水印模板;Extracting a watermark template from the to-be-processed carrier object;
根据所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象。According to the watermark template, edit the watermark in the to-be-processed carrier object to obtain a target carrier object.
可选的,所述从所述待处理载体对象中提取水印模板,包括:Optionally, the extracting a watermark template from the to-be-processed carrier object includes:
将所述待处理载体对象输入到用于提取水印模板的网络模型中,获得所述待处理载体对象的特征向量;Input the to-be-processed carrier object into a network model for extracting a watermark template to obtain a feature vector of the to-be-processed carrier object;
根据所述待处理载体对象的特征向量,获得所述特征向量对应的水印模板。According to the feature vector of the carrier object to be processed, a watermark template corresponding to the feature vector is obtained.
可选的,所述根据所述待处理载体对象的特征向量,获得所述特征向量对应的水印模板,包括:Optionally, the obtaining the watermark template corresponding to the feature vector according to the feature vector of the carrier object to be processed includes:
对所述特征向量进行卷积操作,获得所述特征向量对应的水印模板。Performing a convolution operation on the feature vector to obtain a watermark template corresponding to the feature vector.
可选的,所述水印模板为在向原载体对象添加水印信息时采用的模板;其中,所述原载体对象为所述待处理载体对象添加水印信息之前的载体对象。Optionally, the watermark template is a template used when adding watermark information to the original carrier object; wherein, the original carrier object is the carrier object before the watermark information is added to the carrier object to be processed.
可选的,还包括:Optionally, it also includes:
根据所述水印模板,在所述待处理载体对象中将水印的颜色设置为预定颜色;Setting the color of the watermark in the carrier object to be processed to a predetermined color according to the watermark template;
所述根据所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象,包括:根据所述水印的预定颜色以及所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象。The editing the watermark in the carrier object to be processed according to the watermark template to obtain a target carrier object includes: editing in the carrier object to be processed according to a predetermined color of the watermark and the watermark template The watermark obtains the target carrier object.
可选的,所述根据所述水印模板,在所述待处理载体对象中将水印的颜色设置为预定颜色,包括:Optionally, the setting the color of the watermark to a predetermined color in the carrier object to be processed according to the watermark template includes:
将所述待处理载体对象以及所述水印模板输入到用于将水印颜色设置为预定颜色的网络模型中,以将所述待处理载体对象中水印的颜色设置为预定颜色。The carrier object to be processed and the watermark template are input into a network model for setting the watermark color to a predetermined color, so as to set the color of the watermark in the carrier object to be processed to a predetermined color.
可选的,所述将所述待处理载体对象以及所述水印模板输入到用于将水印颜色设置为预定颜色的网络模型中,以将所述待处理载体对象中水印的颜色设置为预定颜色,包括:Optionally, the input of the carrier object to be processed and the watermark template into a network model for setting the watermark color to a predetermined color, so as to set the color of the watermark in the carrier object to be processed to a predetermined color ,include:
根据所述水印模板,获得水印在所述待处理载体对象中的位置信息以及形状信息;Obtaining the position information and shape information of the watermark in the carrier object to be processed according to the watermark template;
根据所述水印在所述待处理载体对象中的位置信息以及形状信息,将所述水印在所述待处理载体对象中的颜色设置为预定颜色。According to the position information and shape information of the watermark in the carrier object to be processed, the color of the watermark in the carrier object to be processed is set to a predetermined color.
可选的,还包括:Optionally, it also includes:
获得所述待处理载体对象中水印的颜色设置为预定颜色后的载体对象;Obtaining the carrier object in which the color of the watermark in the carrier object to be processed is set to a predetermined color;
所述根据所述水印的预定颜色以及所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象,包括:The editing the watermark in the to-be-processed carrier object according to the predetermined color of the watermark and the watermark template to obtain a target carrier object includes:
将所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象输入 到用于编辑水印的网络模型中,以得到目标载体对象。The carrier object to be processed, the watermark template, and the carrier object set to a predetermined color are input into the network model for editing the watermark to obtain the target carrier object.
可选的,所述将所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象输入到用于编辑水印的网络模型中,以得到目标载体对象,包括:Optionally, the inputting the to-be-processed carrier object, the watermark template, and the carrier object set to a predetermined color into a network model for editing watermarks to obtain a target carrier object includes:
将所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象输入到所述用于编辑水印的网络模型中,获得所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象对应的编辑特征向量;Input the to-be-processed carrier object, the watermark template, and the carrier object set to a predetermined color into the network model for editing watermarks to obtain the to-be-processed carrier object, the watermark template, and the The edit feature vector corresponding to the carrier object set as a predetermined color;
根据所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象对应的编辑特征向量,编辑所述待处理载体对象的水印,得到目标载体对象。According to the to-be-processed carrier object, the watermark template, and the editing feature vector corresponding to the carrier object set to a predetermined color, edit the watermark of the to-be-processed carrier object to obtain a target carrier object.
可选的,所述在所述待处理载体对象中将水印的颜色设置为预定颜色是指,将所述待处理载体对象中的水印在所述待处理载体对象中的位置处的像素值设置为预定像素值。Optionally, the setting the color of the watermark in the to-be-processed carrier object to a predetermined color refers to setting the pixel value of the watermark in the to-be-processed carrier object at the position in the to-be-processed carrier object Is the predetermined pixel value.
可选的,还包括获得所述用于提取水印模板的网络模型;Optionally, it further includes obtaining the network model used to extract the watermark template;
所述获得用于提取水印模板的网络模型,包括:The obtaining of the network model used to extract the watermark template includes:
获得用于提取水印模板的样本数据;Obtain sample data for extracting the watermark template;
获得所述样本数据的一级特征向量;Obtaining the first-level feature vector of the sample data;
对所述一级特征向量进行卷积操作,获得所述一级特征向量对应的一级水印模板;Performing a convolution operation on the first-level feature vector to obtain a first-level watermark template corresponding to the first-level feature vector;
根据所述一级特征向量,获得二级特征向量;Obtaining a second-level feature vector according to the first-level feature vector;
对所述二级特征向量进行卷积操作,获得所述二级特征向量对应的二级水印模板;Performing a convolution operation on the secondary feature vector to obtain a secondary watermark template corresponding to the secondary feature vector;
根据所述二级特征向量,获得三级特征向量;Obtaining a third-level feature vector according to the second-level feature vector;
对所述三级特征向量进行卷积操作,获得所述三级特征向量对应的三级水印模板;Performing a convolution operation on the three-level feature vector to obtain a three-level watermark template corresponding to the three-level feature vector;
将所述一级水印模板,所述二级水印模板以及所述三级水印模板作为所述样本数据对应的水印模板;Using the first-level watermark template, the second-level watermark template, and the third-level watermark template as watermark templates corresponding to the sample data;
获得所述样本数据与所述样本数据对应的水印模板的对应关系,并将所述对应关系作为用于提取水印模板的网络模型。The corresponding relationship between the sample data and the watermark template corresponding to the sample data is obtained, and the corresponding relationship is used as a network model for extracting the watermark template.
可选的,所述根据所述一级特征向量,获得二级特征向量,包括:Optionally, the obtaining the second-level feature vector according to the first-level feature vector includes:
根据所述一级特征向量,获得所述一级特征向量对应的第一收缩尺度的特征向量;Obtaining, according to the first-level feature vector, the feature vector of the first shrinkage scale corresponding to the first-level feature vector;
根据所述一级特征向量对应的第一收缩尺度的特征向量,获得所述二级特征向量对应的第一收缩尺度的特征向量;Obtaining the feature vector of the first contraction scale corresponding to the second-level feature vector according to the feature vector of the first contraction scale corresponding to the first-level feature vector;
根据所述二级特征向量对应的第一收缩尺度的特征向量,获得二级特征向量。The second-level feature vector is obtained according to the feature vector of the first shrinkage scale corresponding to the second-level feature vector.
可选的,所述根据所述一级特征向量对应的第一收缩尺度的特征向量,获得所述二 级特征向量对应的第一收缩尺度的特征向量,包括:Optionally, the obtaining the feature vector of the first contraction scale corresponding to the second-level feature vector according to the feature vector of the first contraction scale corresponding to the first-level feature vector includes:
根据所述一级特征向量对应的第一收缩尺度的特征向量,获得所述一级特征向量对应的第二收缩尺度的特征向量;Obtaining the feature vector of the second contraction scale corresponding to the first-level feature vector according to the feature vector of the first contraction scale corresponding to the first-level feature vector;
根据所述一级特征向量对应的第二收缩尺度的特征向量,获得所述二级特征向量对应的第二收缩尺度的特征向量;Obtaining the feature vector of the second contraction scale corresponding to the second-level feature vector according to the feature vector of the second contraction scale corresponding to the first-level feature vector;
根据所述二级特征向量对应的第二收缩尺度的特征向量,获得所述二级特征向量对应的第一收缩尺度的特征向量。According to the feature vector of the second contraction scale corresponding to the second-level feature vector, the feature vector of the first contraction scale corresponding to the second-level feature vector is obtained.
可选的,所述根据所述二级特征向量,获得三级特征向量,包括:Optionally, the obtaining a third-level feature vector according to the second-level feature vector includes:
根据所述二级特征向量,获得所述二级特征向量对应的第一收缩尺度的特征向量;Obtaining, according to the second-level feature vector, a feature vector of the first shrinkage scale corresponding to the second-level feature vector;
根据所述二级特征向量对应的第一收缩尺度的特征向量,获得所述三级特征向量对应的第一收缩尺度的特征向量;Obtaining the feature vector of the first contraction scale corresponding to the third-level feature vector according to the feature vector of the first contraction scale corresponding to the second-level feature vector;
根据所述三级特征向量对应的第一收缩尺度的特征向量,获得三级特征向量。According to the feature vector of the first shrinkage scale corresponding to the three-level feature vector, a three-level feature vector is obtained.
可选的,所述根据所述二级特征向量对应的第一收缩尺度的特征向量,获得所述三级特征向量对应的第一收缩尺度的特征向量,包括:Optionally, the obtaining the feature vector of the first contraction scale corresponding to the third-level feature vector according to the feature vector of the first contraction scale corresponding to the second-level feature vector includes:
根据所述二级特征向量对应的第一收缩尺度的特征向量,获得所述二级特征向量对应的第二收缩尺度的特征向量;Obtaining the feature vector of the second contraction scale corresponding to the second-level feature vector according to the feature vector of the first contraction scale corresponding to the second-level feature vector;
根据所述二级特征向量对应的第二收缩尺度的特征向量,获得所述三级特征向量对应的第二收缩尺度的特征向量;Obtaining the feature vector of the second contraction scale corresponding to the third-level feature vector according to the feature vector of the second contraction scale corresponding to the second-level feature vector;
根据所述三级特征向量对应的第二收缩尺度的特征向量,获得所述三级特征向量对应的第一收缩尺度的特征向量。According to the feature vector of the second contraction scale corresponding to the three-level feature vector, the feature vector of the first contraction scale corresponding to the three-level feature vector is obtained.
可选的,还包括获得用于将水印颜色设置为预定颜色的网络模型;Optionally, it also includes obtaining a network model for setting the watermark color to a predetermined color;
所述获得用于将水印颜色设置为预定颜色的网络模型,包括:The obtaining a network model for setting the watermark color to a predetermined color includes:
根据所述一级特征向量以及所述一级水印模板,在所述样本数据中将水印的颜色设置为预定颜色,获得所述样本数据的设置为预定颜色后的第一样本;According to the first-level feature vector and the first-level watermark template, set the color of the watermark in the sample data to a predetermined color, and obtain a first sample of the sample data set to the predetermined color;
根据所述二级特征向量以及所述二级水印模板,在所述样本数据中将水印的颜色设置为预定颜色;获得所述样本数据的设置为预定颜色后的第二样本;Setting the color of the watermark in the sample data to a predetermined color according to the secondary feature vector and the secondary watermark template; obtaining a second sample of the sample data set to the predetermined color;
根据所述三级特征向量以及所述三级水印模板,在所述样本数据中将水印的颜色设置为预定颜色;获得所述样本数据的设置为预定颜色后的第三样本;According to the three-level feature vector and the three-level watermark template, set the color of the watermark in the sample data to a predetermined color; obtain a third sample of the sample data set to the predetermined color;
将所述第一样本,所述第二样本以及所述第三样本作为所述样本数据中将水印的颜色设置为预定颜色的样本数据;Using the first sample, the second sample, and the third sample as sample data in which the color of the watermark is set to a predetermined color in the sample data;
获得所述样本数据与所述预定颜色的样本数据的对应关系,并将所述对应关系作为用于将水印颜色设置为预定颜色的网络模型。The corresponding relationship between the sample data and the sample data of the predetermined color is obtained, and the corresponding relationship is used as a network model for setting the watermark color to the predetermined color.
可选的,还包括:根据所述预定颜色的样本数据对所述用于提取水印模板的网络模型校正;Optionally, the method further includes: correcting the network model for extracting the watermark template according to the sample data of the predetermined color;
所述根据所述预定颜色的样本数据对所述用于提取水印模板的网络模型校正,包括:The correcting the network model for extracting the watermark template according to the sample data of the predetermined color includes:
判断所述预定颜色的样本数据与期望预定颜色的样本数据是否在指定的阈值范围内;若是,直接将所述预定颜色的样本数据作为所述用于将水印颜色设置为预定颜色的网络模型的输出结果;Determine whether the sample data of the predetermined color and the sample data of the desired predetermined color are within the specified threshold; if so, directly use the sample data of the predetermined color as the network model for setting the watermark color to the predetermined color Output result;
若否,则根据所述预定颜色的样本数据以及所述用于提取水印模板的样本数据,重新获取所述待处理载体对象的校正特征向量;根据所述校正特征向量,获得所述校正特征向量对应的校正水印模板。If not, reacquire the correction feature vector of the carrier object to be processed according to the sample data of the predetermined color and the sample data used to extract the watermark template; obtain the correction feature vector according to the correction feature vector Corresponding corrected watermark template.
可选的,还包括获得用于编辑水印的网络模型;Optionally, it also includes obtaining a network model for editing the watermark;
所述获得用于编辑水印的网络模型,包括:The obtaining of the network model used for editing the watermark includes:
根据所述样本数据,所述样本数据对应的水印模板以及所述预定颜色的样本数据,获得所述样本数据中的编辑特征向量;Obtaining the edit feature vector in the sample data according to the sample data, the watermark template corresponding to the sample data, and the sample data of the predetermined color;
根据所述编辑特征向量,将所述样本数据对应的水印编辑,得到目标样本数据;According to the editing feature vector, edit the watermark corresponding to the sample data to obtain target sample data;
获得所述样本数据与所述目标样本数据的对应关系,并将所述对应关系作为用于编辑水印的网络模型。The corresponding relationship between the sample data and the target sample data is obtained, and the corresponding relationship is used as a network model for editing the watermark.
可选的,所述从所述待处理载体对象中提取水印模板,包括:Optionally, the extracting a watermark template from the to-be-processed carrier object includes:
根据所述待处理载体对象,自动获取对应所述待处理载体对象的至少一套水印模板;Automatically obtain at least one set of watermark templates corresponding to the to-be-processed carrier object according to the to-be-processed carrier object;
将所述对应所述待处理载体对象的至少一套水印模板中的一套水印模板或者全部水印模板作为所述待处理载体的水印模板。A set of watermark templates or all of the watermark templates in the at least one set of watermark templates corresponding to the carrier object to be processed are used as the watermark templates of the carrier to be processed.
对应地,本申请提供一种载体对象处理装置,包括:Correspondingly, this application provides a carrier object processing device, including:
载体对象处理单元,用于获取待处理载体对象;The carrier object processing unit is used to obtain the carrier object to be processed;
水印模板提取单元,用于从所述待处理载体对象中提取水印模板;A watermark template extraction unit, configured to extract a watermark template from the carrier object to be processed;
目标载体对象获得单元,用于根据所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象。The target carrier object obtaining unit is configured to edit the watermark in the to-be-processed carrier object according to the watermark template to obtain the target carrier object.
本申请还提供一种水印嵌入方法,包括:This application also provides a watermark embedding method, including:
获得原始载体对象,并获取原始水印;Obtain the original carrier object and obtain the original watermark;
获得在所述原始载体对象上嵌入所述原始水印的位置信息;Obtaining position information at which the original watermark is embedded on the original carrier object;
在所述原始载体对象中,随机按照所述原始水印的属性信息以及所述位置信息,将所述原始水印嵌入至所述原始载体对象的指定位置上。In the original carrier object, randomly according to the attribute information of the original watermark and the position information, the original watermark is embedded in a designated position of the original carrier object.
可选的,所述获取原始水印,包括:Optionally, the obtaining the original watermark includes:
将数字符号、英文符号以及特殊符号中的至少一种进行随机组合,形成字符序列;Randomly combine at least one of numeric symbols, English symbols, and special symbols to form a character sequence;
将所述字符序列作为所述原始水印。Use the character sequence as the original watermark.
可选的,所述获得在所述原始载体对象上嵌入所述原始水印的位置信息,包括:Optionally, the obtaining the position information of the original watermark embedded on the original carrier object includes:
获取所述原始载体对象的尺寸信息以及所述原始水印的尺寸信息;Acquiring the size information of the original carrier object and the size information of the original watermark;
根据所述原始载体对象的尺寸信息,确定所述原始水印在所述原始载体对象上的嵌入区域;Determine the embedding area of the original watermark on the original carrier object according to the size information of the original carrier object;
在所述嵌入区域内,根据所述原始水印的尺寸信息,获得在所述原始载体对象上嵌入所述原始水印的位置信息。In the embedding area, according to the size information of the original watermark, the position information at which the original watermark is embedded on the original carrier object is obtained.
可选的,所述根据所述原始载体对象的尺寸信息,确定所述原始水印在所述原始载体对象上的嵌入区域,包括:Optionally, the determining the embedding area of the original watermark on the original carrier object according to the size information of the original carrier object includes:
根据所述原始载体对象的尺寸信息,获得所述原始载体对象的长度尺寸信息;Obtaining the length and size information of the original carrier object according to the size information of the original carrier object;
根据所述长度尺寸信息,确定在所述原始载体对象上长度方向的第一预留尺寸信息;Determine the first reserved size information in the length direction on the original carrier object according to the length size information;
根据所述原始载体对象的尺寸信息,获得所述原始载体对象的宽度尺寸信息;Obtaining the width size information of the original carrier object according to the size information of the original carrier object;
根据所述宽度尺寸信息,确定在所述原始载体对象上宽度方向的第二预留尺寸信息;Determine the second reserved size information in the width direction on the original carrier object according to the width size information;
根据所述原始载体对象的尺寸信息,所述第一预留尺寸信息以及所述第二预留尺寸信息,确定所述原始水印在所述原始载体对象上的嵌入区域。According to the size information of the original carrier object, the first reserved size information and the second reserved size information, the embedding area of the original watermark on the original carrier object is determined.
可选的,所述在所述嵌入区域内,根据所述原始水印的尺寸信息,获得在所述原始载体对象上嵌入所述原始水印的位置信息,包括:Optionally, the obtaining, in the embedding area, the position information at which the original watermark is embedded on the original carrier object according to the size information of the original watermark, includes:
根据所述原始水印的尺寸信息,获得所述原始水印的边缘位置信息;Obtaining edge position information of the original watermark according to the size information of the original watermark;
根据所述原始水印的边缘位置信息以及所述嵌入区域的位置信息,获得在所述原始载体对象上嵌入所述原始水印的位置信息。According to the edge position information of the original watermark and the position information of the embedding area, the position information at which the original watermark is embedded on the original carrier object is obtained.
可选的,所述原始水印的属性信息包括:原始水印的颜色、原始水印的字体以及原始水印的字号信息中的至少一种。Optionally, the attribute information of the original watermark includes at least one of the color of the original watermark, the font of the original watermark, and the font size information of the original watermark.
对应地,本申请还提供一种水印嵌入装置,包括:Correspondingly, this application also provides a watermark embedding device, including:
原始载体对象获得单元,用于获得原始载体对象;The original carrier object obtaining unit, which is used to obtain the original carrier object;
原始水印获得单元,用于获取原始水印;The original watermark obtaining unit is used to obtain the original watermark;
位置信息获得单元,用于获得在所述原始载体对象上嵌入所述原始水印的位置信息;A location information obtaining unit, configured to obtain location information of the original watermark embedded on the original carrier object;
嵌入单元,用于在所述原始载体对象中,随机按照所述原始水印的属性信息以及所述位置信息,将所述原始水印嵌入至所述原始载体对象的指定位置上。The embedding unit is configured to embed the original watermark at a designated position of the original carrier object randomly according to the attribute information of the original watermark and the position information in the original carrier object.
本申请提供一种电子设备,包括:This application provides an electronic device, including:
处理器;processor;
存储器,用于存储载体对象处理方法的程序后,并执行以下步骤:The memory is used to store the program of the carrier object processing method and execute the following steps:
获取待处理载体对象;Obtain the to-be-processed carrier object;
从所述待处理载体对象中提取水印模板;Extracting a watermark template from the to-be-processed carrier object;
根据所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象。According to the watermark template, edit the watermark in the to-be-processed carrier object to obtain a target carrier object.
本申请提供一种电子设备,包括:This application provides an electronic device, including:
处理器;processor;
存储器,用于存储水印嵌入方法的程序后,并执行以下步骤:The memory is used to store the program of the watermark embedding method and execute the following steps:
获得原始载体对象,并获取原始水印;Obtain the original carrier object and obtain the original watermark;
获得在所述原始载体对象上嵌入所述原始水印的位置信息;Obtaining position information at which the original watermark is embedded on the original carrier object;
在所述原始载体对象中,随机按照所述原始水印的属性信息以及所述位置信息,将所述原始水印嵌入至所述原始载体对象的指定位置上。In the original carrier object, randomly according to the attribute information of the original watermark and the position information, the original watermark is embedded in a designated position of the original carrier object.
本申请提供一种计算机存储介质,所述计算机存储介质存储载体对象处理方法的程序,该程序被处理器运行,执行下述步骤:This application provides a computer storage medium that stores a program of a carrier object processing method, and the program is run by a processor to perform the following steps:
获取待处理载体对象;Obtain the to-be-processed carrier object;
从所述待处理载体对象中提取水印模板;Extracting a watermark template from the to-be-processed carrier object;
根据所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象。According to the watermark template, edit the watermark in the to-be-processed carrier object to obtain a target carrier object.
本申请提供一种计算机存储介质,所述计算机存储介质存储水印嵌入方法的程序,该程序被处理器运行,执行下述步骤:This application provides a computer storage medium that stores a program of the watermark embedding method, and the program is run by a processor to perform the following steps:
获得原始载体对象,并获取原始水印;Obtain the original carrier object and obtain the original watermark;
获得在所述原始载体对象上嵌入所述原始水印的位置信息;Obtaining position information at which the original watermark is embedded on the original carrier object;
在所述原始载体对象中,随机按照所述原始水印的属性信息以及所述位置信息,将所述原始水印嵌入至所述原始载体对象的指定位置上。In the original carrier object, randomly according to the attribute information of the original watermark and the position information, the original watermark is embedded in a designated position of the original carrier object.
与现有技术相比,本申请具有以下优点:Compared with the prior art, this application has the following advantages:
本申请公开了一种载体对象处理方法,包括:获取待处理载体对象;从所述待处理载体对象中提取水印模板;根据所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象。本申请的载体对象处理方法,通过提取待处理载体对象对应的水印 模板,能够精确获得水印的具体位置;根据水印模板从而能够准确地将待处理载体对象的水印编辑。本申请的载体对象处理方法通过获得待处理载体对象对应的水印模板,解决了现有的水印编辑方法因水印样式多样性而不能精确编辑水印的问题。This application discloses a method for processing a carrier object, including: obtaining a carrier object to be processed; extracting a watermark template from the carrier object to be processed; editing the watermark in the carrier object to be processed according to the watermark template, Get the target carrier object. In the carrier object processing method of the present application, by extracting the watermark template corresponding to the carrier object to be processed, the specific position of the watermark can be accurately obtained; according to the watermark template, the watermark of the carrier object to be processed can be accurately edited. The carrier object processing method of the present application solves the problem that the existing watermark editing method cannot accurately edit the watermark due to the diversity of watermark styles by obtaining the watermark template corresponding to the carrier object to be processed.
附图说明Description of the drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments described in this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings.
图1A为本申请提供的载体对象处理方法应用场景实施例的示意图。FIG. 1A is a schematic diagram of an application scenario embodiment of the carrier object processing method provided by this application.
图1B为本申请提供的载体对象处理方法应用场景另外实施例的示意图。FIG. 1B is a schematic diagram of another embodiment of the application scenario of the carrier object processing method provided by this application.
图2为本申请实施例一提供的载体对象处理方法流程图。FIG. 2 is a flowchart of a method for processing a carrier object according to Embodiment 1 of the application.
图3为本申请提供的载体对象处理方法第二应用场景实施例的示意图。FIG. 3 is a schematic diagram of a second application scenario embodiment of the carrier object processing method provided by this application.
图4为本申请实施例一提供的GridNet网络结构示意图。Fig. 4 is a schematic diagram of the GridNet network structure provided in the first embodiment of the application.
图5为本申请实施例二提供的载体对象处理装置示意图。FIG. 5 is a schematic diagram of a carrier object processing apparatus provided in Embodiment 2 of this application.
图6为本申请实施例三提供的水印嵌入方法流程图。Fig. 6 is a flow chart of the watermark embedding method provided in the third embodiment of the application.
图7为本申请实施例四提供的水印嵌入装置示意图。Fig. 7 is a schematic diagram of a watermark embedding device provided in the fourth embodiment of the application.
图8为本申请实施例五提供的载体对象处理电子设备示意图。FIG. 8 is a schematic diagram of a carrier object processing electronic device provided in Embodiment 5 of this application.
具体实施方式Detailed ways
在下面的描述中阐述了很多具体细节以便于充分理解本发明。但是本发明能够以很多不同于在此描述的其它方式来实施,本领域技术人员可以在不违背本发明内涵的情况下做类似推广,因此本发明不受下面公开的具体实施的限制。In the following description, many specific details are explained in order to fully understand the present invention. However, the present invention can be implemented in many other ways different from those described here, and those skilled in the art can make similar popularizations without violating the connotation of the present invention. Therefore, the present invention is not limited by the specific implementation disclosed below.
本申请提供一种载体对象处理方法与装置,电子设备,以及计算机存储介质。This application provides a method and device for processing a carrier object, an electronic device, and a computer storage medium.
本申请提供的一些实施例可以处理载体对象中的水印的场景。如图1A所示,其为本申请提供的载体对象处理方法应用场景实施例的示意图。首先,服务端从终端获得待处理的载体对象,待处理的载体对象可以是带有水印的图像,可以为视频帧图像。根据当前图像进行提取水印模板。在获得水印模板后,将带有水印的图像中的水印的颜色设置为预定颜色,然后,根据水印的预定颜色以及水印模板,在带有水印的图像中编辑水印,并将编辑水印后的图像返回至终端。所述编辑水印至少包括检测水印,删除水印, 增加水印以及修改水印中的至少一种。例如,图1B为本申请提供的载体对象处理方法应用场景另外实施例的示意图,在图1B中,首先将图像中的“B61&pmFhJlw2?HV”水印在去掉之后,得到不加水印的图像,然后在不含水印的图像上再新增新的水印“@blue#”。需要说明的是,应用场景仅仅是应用场景的一个实施例,提供此应用场景实施例的目的是便于理解本申请的载体对象处理方法,而并非用于限定本申请的载体对象处理方法。Some embodiments provided in this application can handle the scene of the watermark in the carrier object. As shown in FIG. 1A, it is a schematic diagram of an application scenario embodiment of the carrier object processing method provided by this application. First, the server obtains the carrier object to be processed from the terminal. The carrier object to be processed may be an image with a watermark or a video frame image. Extract the watermark template based on the current image. After obtaining the watermark template, set the color of the watermark in the watermarked image to a predetermined color, and then edit the watermark in the watermarked image according to the predetermined color of the watermark and the watermark template, and edit the watermarked image Return to the terminal. The editing of the watermark includes at least one of detecting the watermark, deleting the watermark, adding the watermark, and modifying the watermark. For example, FIG. 1B is a schematic diagram of another embodiment of the application scenario of the carrier object processing method provided by this application. In FIG. Add a new watermark "@blue#" to the images without watermark. It should be noted that the application scenario is only an embodiment of the application scenario, and the purpose of providing this application scenario embodiment is to facilitate the understanding of the carrier object processing method of the present application, and is not used to limit the carrier object processing method of the present application.
如图2所示,其为本申请实施例一的载体对象处理方法实施例的流程图。所述方法包括如下步骤。As shown in FIG. 2, it is a flowchart of an embodiment of a method for processing a carrier object according to Embodiment 1 of the present application. The method includes the following steps.
步骤S201:获取待处理载体对象。Step S201: Obtain a carrier object to be processed.
在本申请中,待处理载体对象是指含有水印的载体对象。其中,载体对象可以是图像或者文本文件的至少一种。例如含有水印的载体对象可以是含有水印的图像,也可以是含有水印的Word文本文档,或者是含有水印的PDF文本文档。在本实施例中,主要以处理带水印的图像来说明载体对象处理方法。当然,可以理解的是,待处理载体对象还可以是除含有水印的图像,含有水印的文本文档之外的其它含有水印的载体介质,此处不做限制。In this application, the carrier object to be processed refers to a carrier object containing a watermark. Wherein, the carrier object may be at least one of an image or a text file. For example, the carrier object containing the watermark can be an image containing a watermark, a Word text document containing a watermark, or a PDF text document containing a watermark. In this embodiment, the method of processing a carrier object is mainly described by processing a watermarked image. Of course, it is understandable that the carrier object to be processed may also be other carrier media containing watermarks other than images containing watermarks and text documents containing watermarks, and there is no limitation here.
步骤S202:从待处理载体对象中提取水印模板。Step S202: Extract a watermark template from the carrier object to be processed.
在步骤S201获取待处理载体对象后,为了检测待处理载体对象中的水印的精确位置,需要从待处理载体对象中提取水印模板。所述水印模板为在向原载体对象添加水印信息时采用的模板;其中,所述原载体对象为所述待处理载体对象添加水印信息之前的载体对象。After obtaining the carrier object to be processed in step S201, in order to detect the precise position of the watermark in the carrier object to be processed, a watermark template needs to be extracted from the carrier object to be processed. The watermark template is a template used when adding watermark information to the original carrier object; wherein, the original carrier object is the carrier object before the watermark information is added to the carrier object to be processed.
具体地,从所述待处理载体对象中提取水印模板,可以是按照如下描述的方式。Specifically, extracting the watermark template from the to-be-processed carrier object may be in the manner described below.
首先,将所述待处理载体对象输入到用于提取水印模板的网络模型中,获得所述待处理载体对象的特征向量。First, input the to-be-processed carrier object into the network model for extracting the watermark template, and obtain the feature vector of the to-be-processed carrier object.
用于提取水印模板的网络模型主要是用于待处理载体对象中水印的检测,而水印检测主要任务是从含水印的载体对象(即图像)中提取出水印二进制模板信息,即水印模板。为了更加精确地将水印模板提取出来,本实施例设计了用于提取水印模板的网络模型,在提出的用于提取水印模板的网络模型中,采用了多级联的网络结构。在提出的多级联的网络中,每一级都会输出一个特征向量F i,其中,i表示网络的级数,然后该特征向量将作为下一级(i+1)网络的输入特征向量。在本实施例中,网络的级数为三。每级的网络分别用于特征的提取(第一级网络)、特征的增强(第二级网络)以及特征的细 化(第三级网络)。 The network model used to extract the watermark template is mainly used for the detection of the watermark in the carrier object to be processed, and the main task of the watermark detection is to extract the watermark binary template information from the watermarked carrier object (ie image), that is, the watermark template. In order to extract the watermark template more accurately, this embodiment designs a network model for extracting the watermark template. In the proposed network model for extracting the watermark template, a multi-cascade network structure is adopted. In the proposed multi-cascade network, each stage will output a feature vector F i , where i represents the number of stages of the network, and then this feature vector will be used as the input feature vector of the next level (i+1) network. In this embodiment, the number of stages of the network is three. Each level of network is used for feature extraction (first level network), feature enhancement (second level network), and feature refinement (third level network).
在获得特征向量后,根据所述待处理载体对象的特征向量,获得所述特征向量对应的水印模板。After the feature vector is obtained, the watermark template corresponding to the feature vector is obtained according to the feature vector of the carrier object to be processed.
具体地,所述根据所述待处理载体对象的特征向量,获得所述特征向量对应的水印模板,可以是对所述特征向量进行卷积操作,获得所述特征向量对应的水印模板。在每级输出的特征向量F i上利用卷积操作(C i)输出一个水印模板S i。由于在本实施例中,网络的级数为三,因此输出的水印模板S i也为三个。 Specifically, the obtaining the watermark template corresponding to the feature vector according to the feature vector of the carrier object to be processed may be performing a convolution operation on the feature vector to obtain the watermark template corresponding to the feature vector. S i output a watermark template convolution operation (C i) on each stage output feature vector F i. Since in the present embodiment, the three stages of the network, the output of the watermark templates S i is also three.
为了更准确地获取待处理载体对象中提取水印模板,本实施例中的用于提取水印模板的网络模型每一级网络均为GridNet结构,如下图4所示,其为GridNet网络结构示意图。在本实施例中的三个网络模型中,每个网络模型都采用了3级联网络,即:L=3,三级联网络分别依次完成特征提取、特征增强和特征细化,每一个网络结构都采用了GridNet结构。具体地,在GridNet中,所有的卷积层的卷积核都是3x3,中间层卷积核的个数是32,也就是每一层生成了32个特征图。下采样(图4中的向下箭头)利用卷积实现,步长设为2;上采样(图4中的向上箭头)利用反卷积操作。在图4中的结构中,横向箭头表示有3个卷积层,3个激活层,3个批归一化层;下采样箭头表示3个卷积层,3个激活层,其中最后一个卷积层步长为2;上采样箭头表示2个卷积层,1个反卷积层,3个激活层。In order to more accurately obtain the watermark template extracted from the carrier object to be processed, each level of the network in the network model for extracting the watermark template in this embodiment is a GridNet structure, as shown in Figure 4 below, which is a schematic diagram of the GridNet network structure. In the three network models in this embodiment, each network model uses a 3-cascade network, that is: L=3, the three-cascade network completes feature extraction, feature enhancement, and feature refinement in sequence, and each network The structure adopts the GridNet structure. Specifically, in GridNet, the convolution kernels of all convolution layers are 3x3, and the number of convolution kernels in the middle layer is 32, that is, 32 feature maps are generated for each layer. Down-sampling (down arrow in Figure 4) is implemented using convolution, with a step size of 2; up-sampling (up arrow in Figure 4) uses a deconvolution operation. In the structure in Figure 4, the horizontal arrows indicate that there are 3 convolutional layers, 3 activation layers, and 3 batch normalization layers; down-sampling arrows indicate 3 convolutional layers, 3 activation layers, and the last volume The build-up step size is 2; the up-sampling arrows indicate 2 convolutional layers, 1 deconvolutional layer, and 3 activation layers.
GridNet网络结构主要是利用图像的多尺度信息,而采用图像的多尺度信息可以在一定程度上增强获取待处理载体对象中提取水印模板的准确度,同时可以在一定程度上增强网络的学习能力。如果将第i级GridNet表示为
Figure PCTCN2020123884-appb-000001
其中
Figure PCTCN2020123884-appb-000002
表示
Figure PCTCN2020123884-appb-000003
中可学习的参数,则整个用于提取水印模板的网络模型可以表示为:
Figure PCTCN2020123884-appb-000004
S i=C i(F i)。
The GridNet network structure mainly uses the multi-scale information of the image, and the multi-scale information of the image can enhance the accuracy of extracting the watermark template from the carrier object to be processed to a certain extent, and can also enhance the learning ability of the network to a certain extent. If the i-th GridNet is expressed as
Figure PCTCN2020123884-appb-000001
among them
Figure PCTCN2020123884-appb-000002
Means
Figure PCTCN2020123884-appb-000003
For the learnable parameters in, the entire network model used to extract the watermark template can be expressed as:
Figure PCTCN2020123884-appb-000004
S i =C i (F i ).
在使用用于提取水印模板的网络模型对待处理载体对象进行提取模板之前,需要获得所述用于提取水印模板的网络模型。Before using the network model for extracting the watermark template to extract the template for the carrier object to be processed, it is necessary to obtain the network model for extracting the watermark template.
作为获得用于提取水印模板的网络模型的其中一种方式,可以是先采用用于提取水印模板的样本数据。之后,获得所述样本数据的一级特征向量。As one of the ways to obtain the network model for extracting the watermark template, the sample data for extracting the watermark template may be used first. Afterwards, the first-level feature vector of the sample data is obtained.
在获得所述样本数据的一级特征向量后,对所述一级特征向量进行卷积操作,获得所述一级特征向量对应的一级水印模板。After obtaining the first-level feature vector of the sample data, perform a convolution operation on the first-level feature vector to obtain a first-level watermark template corresponding to the first-level feature vector.
同时,在获得所述样本数据的一级特征向量后,根据所述一级特征向量,获得二级特征向量。采用与获得所述一级特征向量对应的一级水印模板类似的方式,对所述二级 特征向量进行卷积操作,获得所述二级特征向量对应的二级水印模板。At the same time, after the first-level feature vector of the sample data is obtained, the second-level feature vector is obtained according to the first-level feature vector. In a manner similar to obtaining the first-level watermark template corresponding to the first-level feature vector, a convolution operation is performed on the second-level feature vector to obtain the second-level watermark template corresponding to the second-level feature vector.
类似地,在获得所述样本数据的二级特征向量后,根据所述二级特征向量,获得三级特征向量。采用与获得所述二级特征向量对应的二级水印模板类似的方式,对所述三级特征向量进行卷积操作,获得所述三级特征向量对应的三级水印模板。Similarly, after obtaining the second-level feature vector of the sample data, a third-level feature vector is obtained according to the second-level feature vector. In a manner similar to obtaining the second-level watermark template corresponding to the second-level feature vector, a convolution operation is performed on the third-level feature vector to obtain the third-level watermark template corresponding to the third-level feature vector.
在分别获得一级水印模板,二级水印模板以及三级水印模板后,将一级水印模板,二级水印模板以及三级水印模板作为所述样本数据对应的水印模板。After obtaining the first-level watermark template, the second-level watermark template, and the third-level watermark template, the first-level watermark template, the second-level watermark template, and the third-level watermark template are used as the watermark templates corresponding to the sample data.
最后,获得所述样本数据与所述样本数据对应的水印模板的对应关系,并将所述对应关系作为用于提取水印模板的网络模型。Finally, the corresponding relationship between the sample data and the watermark template corresponding to the sample data is obtained, and the corresponding relationship is used as a network model for extracting the watermark template.
上述用于提取水印模板的网络模型每一级网络采用的GridNet结构,具体可以是体现在根据所述一级特征向量,获得二级特征向量的方式上。具体地,根据所述一级特征向量,获得二级特征向量的方式按照如下描述的方式。The GridNet structure adopted by each level of the network in the above-mentioned network model for extracting the watermark template may be specifically embodied in the manner of obtaining the second-level feature vector according to the first-level feature vector. Specifically, according to the first-level feature vector, the manner of obtaining the second-level feature vector is as described below.
首先,根据所述一级特征向量,获得所述一级特征向量对应的第一收缩尺度的特征向量。之后,根据所述一级特征向量对应的第一收缩尺度的特征向量,获得所述二级特征向量对应的第一收缩尺度的特征向量。最终,根据所述二级特征向量对应的第一收缩尺度的特征向量,获得二级特征向量。First, according to the first-level feature vector, the feature vector of the first shrinkage scale corresponding to the first-level feature vector is obtained. Then, according to the feature vector of the first contraction scale corresponding to the first-level feature vector, the feature vector of the first contraction scale corresponding to the second-level feature vector is obtained. Finally, the second-level feature vector is obtained according to the feature vector of the first shrinkage scale corresponding to the second-level feature vector.
更具体地,所述根据所述一级特征向量对应的第一收缩尺度的特征向量,获得所述二级特征向量对应的第一收缩尺度的特征向量,按照如下描述的方式。More specifically, according to the feature vector of the first contraction scale corresponding to the first-level feature vector, the feature vector of the first contraction scale corresponding to the second-level feature vector is obtained in the manner described below.
首先,根据所述一级特征向量对应的第一收缩尺度的特征向量,获得所述一级特征向量对应的第二收缩尺度的特征向量。之后,根据所述一级特征向量对应的第二收缩尺度的特征向量,获得所述二级特征向量对应的第二收缩尺度的特征向量。最后,根据所述二级特征向量对应的第二收缩尺度的特征向量,获得所述二级特征向量对应的第一收缩尺度的特征向量。First, according to the feature vector of the first contraction scale corresponding to the first-level feature vector, the feature vector of the second contraction scale corresponding to the first-level feature vector is obtained. Then, according to the feature vector of the second contraction scale corresponding to the first-level feature vector, the feature vector of the second contraction scale corresponding to the second-level feature vector is obtained. Finally, according to the feature vector of the second contraction scale corresponding to the second-level feature vector, the feature vector of the first contraction scale corresponding to the second-level feature vector is obtained.
同样地,上述用于提取水印模板的网络模型每一级网络采用的GridNet结构,具体可以是体现在根据所述二级特征向量,获得三级特征向量的方式上。Similarly, the GridNet structure adopted by each level of the network in the above-mentioned network model for extracting the watermark template may be specifically embodied in the manner of obtaining the third-level feature vector according to the second-level feature vector.
首先,根据所述二级特征向量,获得所述二级特征向量对应的第一收缩尺度的特征向量。之后,根据所述二级特征向量对应的第一收缩尺度的特征向量,获得所述三级特征向量对应的第一收缩尺度的特征向量。最终,根据所述三级特征向量对应的第一收缩尺度的特征向量,获得三级特征向量。First, according to the secondary feature vector, the feature vector of the first shrinkage scale corresponding to the secondary feature vector is obtained. Then, according to the feature vector of the first contraction scale corresponding to the second-level feature vector, the feature vector of the first contraction scale corresponding to the third-level feature vector is obtained. Finally, a three-level feature vector is obtained according to the feature vector of the first shrinkage scale corresponding to the three-level feature vector.
更具体地,所述根据所述二级特征向量对应的第一收缩尺度的特征向量,获得所述三级特征向量对应的第一收缩尺度的特征向量,按照如下描述的方式。More specifically, according to the feature vector of the first contraction scale corresponding to the second-level feature vector, the feature vector of the first contraction scale corresponding to the third-level feature vector is obtained in the manner described below.
首先,根据所述二级特征向量对应的第一收缩尺度的特征向量,获得所述二级特征向量对应的第二收缩尺度的特征向量。之后,根据所述二级特征向量对应的第二收缩尺度的特征向量,获得所述三级特征向量对应的第二收缩尺度的特征向量。最后,根据所述三级特征向量对应的第二收缩尺度的特征向量,获得所述三级特征向量对应的第一收缩尺度的特征向量。First, according to the feature vector of the first contraction scale corresponding to the second-level feature vector, the feature vector of the second contraction scale corresponding to the second-level feature vector is obtained. Then, according to the feature vector of the second contraction scale corresponding to the second-level feature vector, the feature vector of the second contraction scale corresponding to the third-level feature vector is obtained. Finally, according to the feature vector of the second shrinkage scale corresponding to the three-level feature vector, the feature vector of the first shrinkage scale corresponding to the three-level feature vector is obtained.
同时在获得水印模板之后,为了克服现有的水印颜色多样性的问题,根据水印模板,在待处理载体对象中将水印的颜色设置为预定颜色。At the same time, after obtaining the watermark template, in order to overcome the problem of the existing watermark color diversity, according to the watermark template, the color of the watermark is set to a predetermined color in the carrier object to be processed.
在步骤S202获取水印模板后,根据水印模板,在待处理载体对象中将水印的颜色设置为预定颜色。其中,所述在所述待处理载体对象中将水印的颜色设置为预定颜色是指,将所述待处理载体对象中的水印在所述待处理载体对象中的位置处的像素值设置为预定像素值。在本实施例中,将所述待处理载体对象中的水印在所述待处理载体对象中的位置处的像素值设置为零。After obtaining the watermark template in step S202, according to the watermark template, the color of the watermark is set to a predetermined color in the carrier object to be processed. Wherein, setting the color of the watermark in the carrier object to be processed to a predetermined color refers to setting the pixel value of the watermark in the carrier object to be processed at the position in the carrier object to be processed to a predetermined Pixel values. In this embodiment, the pixel value of the position of the watermark in the to-be-processed carrier object in the to-be-processed carrier object is set to zero.
具体地,所述根据所述水印模板,在所述待处理载体对象中将水印的颜色设置为预定颜色,可以是将所述待处理载体对象以及所述水印模板输入到用于将水印颜色设置为预定颜色的网络模型中,以将所述待处理载体对象中水印的颜色设置为预定颜色。Specifically, according to the watermark template, setting the color of the watermark in the carrier object to be processed to a predetermined color may be inputting the carrier object to be processed and the watermark template into a watermark for setting the watermark color. In a network model of a predetermined color, the color of the watermark in the carrier object to be processed is set to a predetermined color.
更具体地,将所述待处理载体对象以及所述水印模板输入到用于将水印颜色设置为预定颜色的网络模型中,以将所述待处理载体对象中水印的颜色设置为预定颜色,按照如下描述的方式。首先,根据所述水印模板,获得水印在所述待处理载体对象中的位置信息以及形状信息。然后,根据所述水印在所述待处理载体对象中的位置信息以及形状信息,将所述水印在所述待处理载体对象中的颜色设置为预定颜色。More specifically, the carrier object to be processed and the watermark template are input into a network model for setting the watermark color to a predetermined color, so as to set the color of the watermark in the carrier object to be processed to a predetermined color, according to The way described below. First, according to the watermark template, the position information and shape information of the watermark in the carrier object to be processed are obtained. Then, according to the position information and shape information of the watermark in the carrier object to be processed, the color of the watermark in the carrier object to be processed is set to a predetermined color.
在上述将所述待处理载体对象以及所述水印模板输入到用于将水印颜色设置为预定颜色的网络模型中,以将所述待处理载体对象中水印的颜色设置为预定颜色,需要采用用于将水印颜色设置为预定颜色的网络模型。因此,在本实施例中,还需要训练获得用于将水印颜色设置为预定颜色的网络模型。其中,用于将水印颜色设置为预定颜色的网络模型与用于提取水印模板的网络模型属于相互对应的网络模型。In the foregoing, the carrier object to be processed and the watermark template are input into the network model for setting the watermark color to a predetermined color, so as to set the color of the watermark in the carrier object to be processed to a predetermined color. It is a network model that sets the watermark color to a predetermined color. Therefore, in this embodiment, it is also necessary to train to obtain a network model for setting the watermark color to a predetermined color. Among them, the network model used to set the watermark color to a predetermined color and the network model used to extract the watermark template belong to mutually corresponding network models.
获得用于将水印颜色设置为预定颜色的网络模型,是根据上述的用于提取水印模板的网络模型训练时的样本数据以及训练过程产生的水印模板进行训练的。训练用于将水印颜色设置为预定颜色的网络模型的具体过程描述如下。Obtaining the network model used to set the watermark color to a predetermined color is trained according to the sample data during training of the network model used to extract the watermark template and the watermark template generated during the training process. The specific process of training the network model for setting the watermark color to a predetermined color is described as follows.
首先,根据所述一级特征向量以及所述一级水印模板,在所述样本数据中将水印的颜色设置为预定颜色,获得所述样本数据的设置为预定颜色后的第一样本。同时,根据 所述二级特征向量以及所述二级水印模板,在所述样本数据中将水印的颜色设置为预定颜色;获得所述样本数据的设置为预定颜色后的第二样本。以及,根据所述三级特征向量以及所述三级水印模板,在所述样本数据中将水印的颜色设置为预定颜色;获得所述样本数据的设置为预定颜色后的第三样本。First, according to the first-level feature vector and the first-level watermark template, the color of the watermark is set to a predetermined color in the sample data, and the first sample of the sample data set to the predetermined color is obtained. At the same time, according to the secondary feature vector and the secondary watermark template, the color of the watermark is set to a predetermined color in the sample data; the second sample after the sample data is set to the predetermined color is obtained. And, according to the three-level feature vector and the three-level watermark template, the color of the watermark is set to a predetermined color in the sample data; and a third sample of the sample data set to the predetermined color is obtained.
之后,将所述第一样本,所述第二样本以及所述第三样本作为所述样本数据中将水印的颜色设置为预定颜色的样本数据。After that, the first sample, the second sample, and the third sample are used as sample data in which the color of the watermark is set to a predetermined color in the sample data.
最后,获得所述样本数据与所述预定颜色的样本数据的对应关系,并将所述对应关系作为用于将水印颜色设置为预定颜色的网络模型。Finally, the corresponding relationship between the sample data and the sample data of the predetermined color is obtained, and the corresponding relationship is used as a network model for setting the watermark color to the predetermined color.
将水印颜色设置为预定颜色主要目的在于将含水印的图像中的颜色统一化。在实际中,水印颜色多种多样,而水印颜色多样化会导致水印编辑过程中编辑的水印不准确,因此将含有水印的图像中的水印颜色设置为预定颜色,将水印位置的像素值置为零,其他位置的像素值不变。用于将水印颜色设置为预定颜色的网络模型的结构和用于提取水印模板的网络模型类似,唯一的不同点是在用于将水印颜色设置为预定颜色的网络模型的结构中,输出的设置为预定颜色的样本数据的结果是三通道数据,而用于提取水印模板的网络模型输出的水印模板是二维单通道的数据。关于用于将水印颜色设置为预定颜色的网络模型的结构,具体参见用于提取水印模板的网络模型的相关描述,此处不再详细赘述。The main purpose of setting the watermark color to a predetermined color is to unify the colors in the watermarked image. In practice, the watermark colors are diverse, and the diversified watermark colors will cause the watermark to be edited inaccurately during the watermark editing process. Therefore, the watermark color in the image containing the watermark is set to a predetermined color, and the pixel value of the watermark position is set to Zero, the pixel values in other positions remain unchanged. The structure of the network model used to set the watermark color to a predetermined color is similar to the network model used to extract the watermark template. The only difference is the output setting in the structure of the network model used to set the watermark color to a predetermined color The result of the sample data of the predetermined color is three-channel data, and the watermark template output by the network model used to extract the watermark template is two-dimensional single-channel data. Regarding the structure of the network model used to set the watermark color to a predetermined color, refer to the relevant description of the network model used to extract the watermark template for details, which will not be described in detail here.
将水印的位置的像素置为零,可以通过利用以下公式实现:y=S^*X,其中X是带水印的图像,S^是按水印模板的水印位置取反之后的结果,这样由于S^中的水印位置全部是零,而其他位置全部为一,所以得到的结果正好是设置为预定颜色的之后的结果。Setting the pixels of the watermark position to zero can be achieved by using the following formula: y=S^*X, where X is the watermarked image, and S^ is the result of inverting the watermark position of the watermark template, so because S The watermark positions in ^ are all zeros, and the other positions are all ones, so the result obtained is just the result after setting the predetermined color.
在本实施例中,为了训练更为精确的用于将水印颜色设置为预定颜色的网络模型和用于提取水印模板的网络模型,根据所述预定颜色的样本数据对所述用于提取水印模板的网络模型校正;具体可以按照如下描述方式。In this embodiment, in order to train a more accurate network model for setting the watermark color to a predetermined color and a network model for extracting the watermark template, the sample data for the predetermined color is compared to the watermark template. Correction of the network model; the specific method can be described as follows.
判断所述预定颜色的样本数据与期望预定颜色的样本数据是否在指定的阈值范围内;若是,直接将所述预定颜色的样本数据作为所述用于将水印颜色设置为预定颜色的网络模型的输出结果。Determine whether the sample data of the predetermined color and the sample data of the desired predetermined color are within the specified threshold; if so, directly use the sample data of the predetermined color as the network model for setting the watermark color to the predetermined color Output the result.
若否,则根据所述预定颜色的样本数据以及所述用于提取水印模板的样本数据,重新获取所述待处理载体对象的校正特征向量;根据所述校正特征向量,获得所述校正特征向量对应的校正水印模板。If not, reacquire the correction feature vector of the carrier object to be processed according to the sample data of the predetermined color and the sample data used to extract the watermark template; obtain the correction feature vector according to the correction feature vector Corresponding corrected watermark template.
上述校正过程具体可以是按照如下方式:在用于提取水印模板的网络模型中,每一 级网络生成的特征向量表示为T i,生成的预定颜色的样本数据表示为M i,在校正网络框架中,
Figure PCTCN2020123884-appb-000005
其中,
Figure PCTCN2020123884-appb-000006
表示第i级联网络,(F i-1)*(-1)模拟的是水印模板的按位取反操作,每一级的预定颜色的样本数据结果则可以表示为:M i=C i(T i),其中C i表示一个卷积层。
The above-mentioned correction process can be specifically as follows: In the network model used to extract the watermark template, the feature vector generated by each level of the network is denoted as T i , and the generated sample data of the predetermined color is denoted as M i . in,
Figure PCTCN2020123884-appb-000005
among them,
Figure PCTCN2020123884-appb-000006
Indicates the i-th cascade network, (F i -1) * ( - 1) simulates the watermark templates bitwise operation, the result of a predetermined color sample data of each stage can be expressed as: M i = C i (T i ), where C i represents a convolutional layer.
通过以上的校正,使得用于将水印颜色设置为预定颜色的网络模型和用于提取水印模板的网络模型两个网络结构可以联合训练,并具有如下的优势:首先,用于提取水印模板的网络模型的水印模板信息可以为用于将水印颜色设置为预定颜色的网络模型提供指导,水印模板学习的越精确,将水印颜色设置为预定颜色的结果就会越精确;其次,将水印颜色设置为预定颜色的结果可以有效地反馈给用于提取水印模板的网络模型,从而在一定程度上指导水印模板的生成。Through the above correction, the two network structures of the network model used to set the watermark color to a predetermined color and the network model used to extract the watermark template can be jointly trained, and have the following advantages: First, the network used to extract the watermark template The watermark template information of the model can provide guidance for the network model used to set the watermark color to a predetermined color. The more accurate the watermark template learning, the more accurate the result of setting the watermark color to the predetermined color; secondly, the watermark color is set to The result of the predetermined color can be effectively fed back to the network model used to extract the watermark template, thereby guiding the generation of the watermark template to a certain extent.
步骤S203:根据水印模板,在待处理载体对象中编辑水印,得到目标载体对象。Step S203: Edit the watermark in the carrier object to be processed according to the watermark template to obtain the target carrier object.
在步骤S202后,获得水印模板,并获得所述待处理载体对象中水印的颜色设置为预定颜色后的载体对象。之后,将所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象输入到用于编辑水印的网络模型中,以得到目标载体对象。After step S202, a watermark template is obtained, and a carrier object in which the color of the watermark in the carrier object to be processed is set to a predetermined color is obtained. Afterwards, the carrier object to be processed, the watermark template, and the carrier object set to a predetermined color are input into the network model for editing the watermark to obtain the target carrier object.
具体地,所述将所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象输入到用于编辑水印的网络模型中,以得到目标载体对象,按照如下方式。Specifically, the input of the to-be-processed carrier object, the watermark template, and the carrier object set to a predetermined color into the network model for editing the watermark to obtain the target carrier object is as follows.
首先,将所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象输入到所述用于编辑水印的网络模型中,获得所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象对应的编辑特征向量。First, input the carrier object to be processed, the watermark template, and the carrier object set to a predetermined color into the network model for editing watermarks to obtain the carrier object to be processed, and the watermark template And the editing feature vector corresponding to the carrier object set to the predetermined color.
之后,根据所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象对应的编辑特征向量,编辑所述待处理载体对象的水印,得到目标载体对象。Then, according to the carrier object to be processed, the watermark template, and the editing feature vector corresponding to the carrier object set to a predetermined color, the watermark of the carrier object to be processed is edited to obtain the target carrier object.
在编辑所述待处理载体对象的水印,得到目标载体对象之前,需要获得用于编辑水印的网络模型。其中,获得用于编辑水印的网络模型可以是:首先,根据所述样本数据,所述样本数据对应的水印模板以及所述预定颜色的样本数据,获得所述样本数据中的编辑特征向量。之后,根据所述编辑特征向量,将所述样本数据对应的水印编辑,得到目标样本数据;最后获得所述样本数据与所述目标样本数据的对应关系,并将所述对应关系作为用于目标水印的网络模型。在本实施例中,需要说明的是,编辑水印可以是指删除原水印,或者在也可以是指删除原水印后再新增水印。对应地,目标样本数据是指在 生成编辑水印网络模型中的原样本数据或者新增水印的样本数据。当然,在本申请的其他实施方式中,编辑水印还可以是除检测水印、删除原水印与新增水印的其他编辑水印的方式,例如修改水印。其仍属于本申请的保护范围。Before editing the watermark of the carrier object to be processed to obtain the target carrier object, a network model for editing the watermark needs to be obtained. Wherein, obtaining the network model for editing the watermark may be: first, according to the sample data, the watermark template corresponding to the sample data, and the sample data of the predetermined color, the editing feature vector in the sample data is obtained. Afterwards, according to the editing feature vector, edit the watermark corresponding to the sample data to obtain the target sample data; finally obtain the corresponding relationship between the sample data and the target sample data, and use the corresponding relationship as the target sample data. Network model of watermarking. In this embodiment, it should be noted that editing the watermark can refer to deleting the original watermark, or can also refer to adding the watermark after deleting the original watermark. Correspondingly, the target sample data refers to the original sample data in the network model for generating and editing the watermark or the sample data of the newly added watermark. Of course, in other embodiments of the present application, editing the watermark may also be other watermark editing methods other than detecting the watermark, deleting the original watermark, and adding the watermark, such as modifying the watermark. It still belongs to the protection scope of this application.
编辑水印的主要任务是将带水印的载体对象精确地还原为不带水印的原始载体对象,或者在还原为不带水印的原始载体对象后新增水印或者修改水印。为了更好地编辑水印,水印在载体对象中的具体位置必须要被准确估计。以编辑带有水印的图像为例,由于在带水印的图像中水印的颜色是不确定的,这就为水印的编辑带来了很大的挑战。在用于编辑水印的网络模型的结构中,输入的不是单一的带水印图像,将图像输入用于提取水印模板的网络模型和用于将水印颜色设置为预定颜色的网络模型中得到的结果也会输入到用于编辑水印的网络模型中。对于一张图像,由于用于提取水印模板的网络模型为多级联的网络结构的设计,因此输出可以得到多个生成的水印模板,多个水印模板输入到用于编辑水印的网络模型的主要作用是为水印编辑任务提供水印的位置信息以及形状信息;在用于将水印颜色设置为预定颜色的网络模型中,获得了多个水印设置为预定颜色的图像,这些图像输入到用于编辑水印的网络模型中主要可以消除水印颜色多样化的影响;另外也可以在水印位置和形状上有一定的指导作用。所以,在用于编辑水印的网络模型中,输入多张图像,包括多个水印模板,多个水印设置为预定颜色的图像和一张待处理的含有水印的图像。多个水印模以及多个水印设置为预定颜色的图像,可以在一定程度上为水印编辑提供更多的信息,从而提高水印编辑效果。用于编辑水印的网络模型同上述两个结构,同样采样多级联的网络结构,具体地,假设第i级网络输出的特征向量表示为V i,则:
Figure PCTCN2020123884-appb-000007
其中
Figure PCTCN2020123884-appb-000008
表示第i级修复网络,
Figure PCTCN2020123884-appb-000009
为待学习的参数。
The main task of editing a watermark is to accurately restore the watermarked carrier object to the original carrier object without watermark, or add a watermark or modify the watermark after restoring to the original carrier object without watermark. In order to edit the watermark better, the specific position of the watermark in the carrier object must be accurately estimated. Take editing an image with a watermark as an example. Since the color of the watermark in an image with a watermark is uncertain, this brings great challenges to the editing of the watermark. In the structure of the network model used to edit the watermark, the input is not a single watermarked image, and the results obtained in the network model used to extract the watermark template and the network model used to set the watermark color to a predetermined color are also input. Will be entered into the network model used to edit the watermark. For an image, because the network model used to extract the watermark template is a multi-cascade network structure design, the output can be multiple generated watermark templates, and multiple watermark templates are input to the main part of the network model used to edit the watermark. The function is to provide watermark location information and shape information for the watermark editing task; in the network model used to set the watermark color to a predetermined color, multiple images with the watermark set to the predetermined color are obtained, and these images are input for editing the watermark In the network model, the influence of the diversification of watermark colors can be eliminated; in addition, it can also have a certain guiding effect on the position and shape of the watermark. Therefore, in the network model for editing watermarks, multiple images are input, including multiple watermark templates, multiple watermarks are set as images with predetermined colors and a watermark-containing image to be processed. Multiple watermark templates and images with multiple watermarks set to predetermined colors can provide more information for watermark editing to a certain extent, thereby improving the effect of watermark editing. Network Model for editing the structure of the watermark with the above two, the same sampling multi-cascade network structure, in particular, assuming the i-th stage of the network output is expressed as a feature vector V i, then:
Figure PCTCN2020123884-appb-000007
among them
Figure PCTCN2020123884-appb-000008
Represents the i-th level repair network,
Figure PCTCN2020123884-appb-000009
Is the parameter to be learned.
另外,由于用于编辑水印的网络模型的结构和用于提取水印模板的网络模型类似,此网络的训练模式参见用于提取水印模板的网络模型的训练模式,此处不再赘述。关于删除原水印后,再在删除原水印后的载体上添加新水印的方法部分,请参见实施例三的相关描述部分,此处不再赘述。In addition, since the structure of the network model used to edit the watermark is similar to the network model used to extract the watermark template, the training mode of this network is referred to the training mode of the network model used to extract the watermark template, which will not be repeated here. For the method of adding a new watermark to the carrier after deleting the original watermark after deleting the original watermark, please refer to the relevant description part of the third embodiment, which will not be repeated here.
在本实施例中,一共包括三个网络模型。由于用于将水印颜色设置为预定颜色的网络模型和用于提取水印模板的网络模型是联合训练的,所以,网络模型学习(训练)过程涉及的损失函数主要分两部分。用于将水印颜色设置为预定颜色的网络模型和用于提取水印模板的网络模型的损失函数可以表示为:In this embodiment, a total of three network models are included. Since the network model used to set the watermark color to a predetermined color and the network model used to extract the watermark template are jointly trained, the loss function involved in the network model learning (training) process is mainly divided into two parts. The loss function of the network model used to set the watermark color to a predetermined color and the network model used to extract the watermark template can be expressed as:
Figure PCTCN2020123884-appb-000010
Figure PCTCN2020123884-appb-000010
其中,
Figure PCTCN2020123884-appb-000011
表示用于提取水印模板的网络模型的损失函数,
Figure PCTCN2020123884-appb-000012
表示用于将水印颜色设置为预定颜色的网络模型的损失函数,θ S表示用于提取水印模板的网络模型中可学习的参数,θ T表示用于将水印颜色设置为预定颜色的网络模型中可学习的参数。λ表示权衡两者的超参数。
among them,
Figure PCTCN2020123884-appb-000011
Represents the loss function of the network model used to extract the watermark template,
Figure PCTCN2020123884-appb-000012
Represents the loss function of the network model used to set the watermark color to a predetermined color, θ S represents the learnable parameter in the network model used to extract the watermark template, and θ T represents the network model used to set the watermark color to the predetermined color Learnable parameters. λ represents a hyperparameter that weighs the two.
具体地,在用于提取水印模板的网络模型中,给定带水印的图像x,期望不同的多级联子网络可以输出水印模板S,其损失函数可以表示为:Specifically, in the network model used to extract the watermark template, given a watermarked image x, it is expected that different multi-cascade sub-networks can output the watermark template S, and the loss function can be expressed as:
Figure PCTCN2020123884-appb-000013
Figure PCTCN2020123884-appb-000013
其中,L是用于提取水印模板的网络模型中多级联的个数,C i表示一个卷积层,在用于提取水印模板的网络模型的第i级网络会输出一个特征向量F i,该特征向量会为用于将水印颜色设置为预定颜色的网络模型提供指导,其损失函数可以表示为: Among them, L is the number of multiple cascades in the network model used to extract the watermark template, C i represents a convolutional layer, and the i-th level network of the network model used to extract the watermark template will output a feature vector F i , This feature vector will provide guidance for the network model used to set the watermark color to a predetermined color, and its loss function can be expressed as:
Figure PCTCN2020123884-appb-000014
Figure PCTCN2020123884-appb-000014
其中,T是真实的将水印颜色设置为预定颜色之后的结果,I(F i)=(F i-1)*(-1),表示模拟按位取反的操作。 Among them, T is the real result after the watermark color is set to the predetermined color, I(F i )=(F i -1)*(-1), which means the operation of simulating bitwise inversion.
在用于编辑水印的网络模型中,其网络结构也采用了多级联网络结构,假设不带水印的真实的图像表示为y,用于编辑水印的网络模型的损失函数可以表示为:In the network model used to edit the watermark, its network structure also adopts a multi-cascade network structure. Assuming that the real image without watermark is represented as y, the loss function of the network model used to edit the watermark can be expressed as:
Figure PCTCN2020123884-appb-000015
Figure PCTCN2020123884-appb-000015
其中,
Figure PCTCN2020123884-appb-000016
表示一个集合,包括带水印的图像,以及从用于提取水印模板的网络模型获得的多个水印模板和用于将水印颜色设置为预定颜色的网络模型中获得的多个水印设置为预定颜色的图像。
among them,
Figure PCTCN2020123884-appb-000016
Represents a set, including watermarked images, and multiple watermark templates obtained from the network model used to extract the watermark template and multiple watermarks obtained from the network model used to set the watermark color to a predetermined color. image.
请参见图3,其示出了本申请提供的载体对象处理方法第二应用场景实施例的示意图。用户将带有水印“2018”的图像以及编辑需求“将图像的水印2018修改为2019” 输入至计算设备300,计算设备300通过提取图像的水印模板获得水印“2008”在图像中的具体位置,之后,根据水印的具体位置将水印“2018”设置为预定颜色,将水印设置为特定颜色能够克服因水印颜色多样化而导致的水印编辑过程中编辑的水印不准确,最终在图像中将设置为特定颜色的水印“2018”修改为水印“2019”。当然,上述带有水印“2018”的图像也可以单独输入或者与其他批量的图像一同输入,该方法可以自动识别到有水印“2018”的图像,并根据实际的时间自动检测其水印“2018”,并按照当下的时间自动修改图像中的水印时间“2018”。在具体检测与修改水印的过程中,可以根据检测识别水印的结果自动推荐多套修改水印的方案,在修改水印时,可以按照推荐的多套修改水印的方案选择一种进行修改,也可以是修改成多种。例如上述带有水印“2018”的图像中的水印可以修改为“2019”,也可以同时修改为“二零一九”。当然,也可以上仅将图像中的水印识别出并保存识别的水印结果,以供后续进行修改。上述含有水印“2018”的图像在修改过之后,可以根据当下时间自动修改。例如,可以在2019年时将图像的水印“2018”修改为“2019”,在2020年可以自动修改为“2020”。当然上述的应用场景实施例的目的是便于理解本申请的载体对象处理方法,而并非用于限定本申请的载体对象处理方法。Please refer to FIG. 3, which shows a schematic diagram of a second application scenario embodiment of the carrier object processing method provided by the present application. The user inputs the image with the watermark "2018" and the editing requirement "modify the watermark of the image 2018 to 2019" into the computing device 300, and the computing device 300 obtains the specific position of the watermark "2008" in the image by extracting the watermark template of the image. After that, set the watermark "2018" to a predetermined color according to the specific location of the watermark, and set the watermark to a specific color to overcome the inaccuracy of the watermark edited during the watermark editing process caused by the diversification of the watermark color, and finally set it to The watermark "2018" of a specific color is changed to the watermark "2019". Of course, the above-mentioned image with the watermark "2018" can also be input alone or together with other batches of images. This method can automatically identify the image with the watermark "2018" and automatically detect its watermark "2018" according to the actual time. , And automatically modify the watermark time "2018" in the image according to the current time. In the process of specific watermark detection and modification, multiple sets of watermark modification schemes can be automatically recommended based on the results of the detection and recognition of the watermark. When modifying the watermark, you can choose one of the recommended multiple sets of modification watermark schemes for modification, or it can be Modified into multiple. For example, the watermark in the image with the watermark "2018" can be modified to "2019", or it can be modified to "2019" at the same time. Of course, it is also possible to recognize only the watermark in the image and save the recognized watermark result for subsequent modification. The above-mentioned image containing the watermark "2018" can be automatically modified according to the current time after it has been modified. For example, the watermark "2018" of the image can be changed to "2019" in 2019, and it can be automatically changed to "2020" in 2020. Of course, the purpose of the foregoing application scenario embodiments is to facilitate the understanding of the carrier object processing method of the present application, and is not used to limit the carrier object processing method of the present application.
本实施例的载体对象处理方法,通过提取待处理载体对象对应的水印模板,能够精确获得水印的具体位置;根据水印模板从而能够准确地将待处理载体对象的水印编辑。本申请的载体对象处理方法通过获得待处理载体对象对应的水印模板,解决了现有的水印编辑方法因水印样式多样性而不能精确编辑水印的问题。The carrier object processing method of this embodiment can accurately obtain the specific position of the watermark by extracting the watermark template corresponding to the carrier object to be processed; according to the watermark template, the watermark of the carrier object to be processed can be accurately edited. The carrier object processing method of the present application solves the problem that the existing watermark editing method cannot accurately edit the watermark due to the diversity of watermark styles by obtaining the watermark template corresponding to the carrier object to be processed.
在上述的实施例一中,提供了一种载体对象处理方法,与之相对应的,本申请还提供一种载体对象处理装置。如图5所示,其为本申请实施例二的一种载体对象处理装置的示意图。由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。下述描述的装置实施例仅仅是示意性的。In the first embodiment described above, a carrier object processing method is provided, and correspondingly, the present application also provides a carrier object processing device. As shown in FIG. 5, it is a schematic diagram of a carrier object processing apparatus according to the second embodiment of the application. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment. The device embodiments described below are merely illustrative.
本实施例的一种载体对象处理装置,包括:A carrier object processing device of this embodiment includes:
载体对象处理单元501,用于获取待处理载体对象;The carrier object processing unit 501 is configured to obtain a carrier object to be processed;
水印模板提取单元502,用于从所述待处理载体对象中提取水印模板;A watermark template extraction unit 502, configured to extract a watermark template from the carrier object to be processed;
目标载体对象获得单元503,用于根据所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象。The target carrier object obtaining unit 503 is configured to edit the watermark in the to-be-processed carrier object according to the watermark template to obtain a target carrier object.
可选的,所述水印模板提取单元,具体用于:Optionally, the watermark template extraction unit is specifically used for:
将所述待处理载体对象输入到用于提取水印模板的网络模型中,获得所述待处理载 体对象的特征向量;Inputting the to-be-processed carrier object into a network model for extracting a watermark template to obtain a feature vector of the to-be-processed carrier object;
根据所述待处理载体对象的特征向量,获得所述特征向量对应的水印模板。According to the feature vector of the carrier object to be processed, a watermark template corresponding to the feature vector is obtained.
可选的,所述水印模板提取单元,具体用于:Optionally, the watermark template extraction unit is specifically used for:
对所述特征向量进行卷积操作,获得所述特征向量对应的水印模板。Performing a convolution operation on the feature vector to obtain a watermark template corresponding to the feature vector.
可选的,所述水印模板为在向原载体对象添加水印信息时采用的模板;其中,所述原载体对象为所述待处理载体对象添加水印信息之前的载体对象。Optionally, the watermark template is a template used when adding watermark information to the original carrier object; wherein, the original carrier object is the carrier object before the watermark information is added to the carrier object to be processed.
可选的,还包括:颜色设置单元;Optionally, it also includes: a color setting unit;
所述颜色设置单元,具体用于:根据所述水印模板,在所述待处理载体对象中将水印的颜色设置为预定颜色;The color setting unit is specifically configured to: set the color of the watermark to a predetermined color in the carrier object to be processed according to the watermark template;
所述目标载体对象获得单元,具体用于:The target carrier object obtaining unit is specifically used for:
根据所述水印的预定颜色以及所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象。According to the predetermined color of the watermark and the watermark template, edit the watermark in the to-be-processed carrier object to obtain a target carrier object.
可选的,所述颜色设置单元,具体用于:Optionally, the color setting unit is specifically used for:
将所述待处理载体对象以及所述水印模板输入到用于将水印颜色设置为预定颜色的网络模型中,以将所述待处理载体对象中水印的颜色设置为预定颜色。The carrier object to be processed and the watermark template are input into a network model for setting the watermark color to a predetermined color, so as to set the color of the watermark in the carrier object to be processed to a predetermined color.
可选的,所述颜色设置单元,具体用于:Optionally, the color setting unit is specifically used for:
根据所述水印模板,获得水印在所述待处理载体对象中的位置信息以及形状信息;Obtaining the position information and shape information of the watermark in the carrier object to be processed according to the watermark template;
根据所述水印在所述待处理载体对象中的位置信息以及形状信息,将所述水印在所述待处理载体对象中的颜色设置为预定颜色。According to the position information and shape information of the watermark in the carrier object to be processed, the color of the watermark in the carrier object to be processed is set to a predetermined color.
可选的,还包括:第二载体对象获得单元;Optionally, it further includes: a second carrier object obtaining unit;
所述第二载体对象获得单元,具体用于:The second carrier object obtaining unit is specifically used for:
获得所述待处理载体对象中水印的颜色设置为预定颜色后的载体对象;Obtaining the carrier object in which the color of the watermark in the carrier object to be processed is set to a predetermined color;
所述目标载体对象获得单元,具体用于:The target carrier object obtaining unit is specifically used for:
将所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象输入到用于编辑水印的网络模型中,以得到目标载体对象。The carrier object to be processed, the watermark template, and the carrier object set to a predetermined color are input into a network model for editing the watermark to obtain a target carrier object.
可选的,所述目标载体对象获得单元,具体用于:Optionally, the target carrier object obtaining unit is specifically used for:
将所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象输入到所述用于编辑水印的网络模型中,获得所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象对应的编辑特征向量;Input the to-be-processed carrier object, the watermark template, and the carrier object set to a predetermined color into the network model for editing watermarks to obtain the to-be-processed carrier object, the watermark template, and the The edit feature vector corresponding to the carrier object set as a predetermined color;
根据所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象对 应的编辑特征向量,编辑所述待处理载体对象的水印,得到目标载体对象。According to the to-be-processed carrier object, the watermark template, and the editing feature vector corresponding to the carrier object set to a predetermined color, edit the watermark of the to-be-processed carrier object to obtain the target carrier object.
可选的,所述在所述待处理载体对象中将水印的颜色设置为预定颜色是指,将所述待处理载体对象中的水印在所述待处理载体对象中的位置处的像素值设置为预定像素值。Optionally, the setting the color of the watermark in the to-be-processed carrier object to a predetermined color refers to setting the pixel value of the watermark in the to-be-processed carrier object at the position in the to-be-processed carrier object Is the predetermined pixel value.
可选的,还包括第一网络模型获得单元;Optionally, it further includes a first network model obtaining unit;
所述第一网络模型获得单元,用于获得所述用于提取水印模板的网络模型;The first network model obtaining unit is configured to obtain the network model used to extract the watermark template;
所述第一网络模型获得单元,具体用于:The first network model obtaining unit is specifically used for:
获得用于提取水印模板的样本数据;Obtain sample data for extracting the watermark template;
获得所述样本数据的一级特征向量;Obtaining the first-level feature vector of the sample data;
对所述一级特征向量进行卷积操作,获得所述一级特征向量对应的一级水印模板;Performing a convolution operation on the first-level feature vector to obtain a first-level watermark template corresponding to the first-level feature vector;
根据所述一级特征向量,获得二级特征向量;Obtaining a second-level feature vector according to the first-level feature vector;
对所述二级特征向量进行卷积操作,获得所述二级特征向量对应的二级水印模板;Performing a convolution operation on the secondary feature vector to obtain a secondary watermark template corresponding to the secondary feature vector;
根据所述二级特征向量,获得三级特征向量;Obtaining a third-level feature vector according to the second-level feature vector;
对所述三级特征向量进行卷积操作,获得所述三级特征向量对应的三级水印模板;Performing a convolution operation on the three-level feature vector to obtain a three-level watermark template corresponding to the three-level feature vector;
将所述一级水印模板,所述二级水印模板以及所述三级水印模板作为所述样本数据对应的水印模板;Using the first-level watermark template, the second-level watermark template, and the third-level watermark template as watermark templates corresponding to the sample data;
获得所述样本数据与所述样本数据对应的水印模板的对应关系,并将所述对应关系作为用于提取水印模板的网络模型。The corresponding relationship between the sample data and the watermark template corresponding to the sample data is obtained, and the corresponding relationship is used as a network model for extracting the watermark template.
可选的,所述第一网络模型获得单元,具体用于:Optionally, the first network model obtaining unit is specifically configured to:
根据所述一级特征向量,获得所述一级特征向量对应的第一收缩尺度的特征向量;Obtaining, according to the first-level feature vector, the feature vector of the first shrinkage scale corresponding to the first-level feature vector;
根据所述一级特征向量对应的第一收缩尺度的特征向量,获得所述二级特征向量对应的第一收缩尺度的特征向量;Obtaining the feature vector of the first contraction scale corresponding to the second-level feature vector according to the feature vector of the first contraction scale corresponding to the first-level feature vector;
根据所述二级特征向量对应的第一收缩尺度的特征向量,获得二级特征向量。The second-level feature vector is obtained according to the feature vector of the first shrinkage scale corresponding to the second-level feature vector.
可选的,所述第一网络模型获得单元,具体用于:Optionally, the first network model obtaining unit is specifically configured to:
根据所述一级特征向量对应的第一收缩尺度的特征向量,获得所述一级特征向量对应的第二收缩尺度的特征向量;Obtaining the feature vector of the second contraction scale corresponding to the first-level feature vector according to the feature vector of the first contraction scale corresponding to the first-level feature vector;
根据所述一级特征向量对应的第二收缩尺度的特征向量,获得所述二级特征向量对应的第二收缩尺度的特征向量;Obtaining the feature vector of the second contraction scale corresponding to the second-level feature vector according to the feature vector of the second contraction scale corresponding to the first-level feature vector;
根据所述二级特征向量对应的第二收缩尺度的特征向量,获得所述二级特征向量对应的第一收缩尺度的特征向量。According to the feature vector of the second contraction scale corresponding to the second-level feature vector, the feature vector of the first contraction scale corresponding to the second-level feature vector is obtained.
可选的,所述第一网络模型获得单元,具体用于:Optionally, the first network model obtaining unit is specifically configured to:
根据所述二级特征向量,获得所述二级特征向量对应的第一收缩尺度的特征向量;Obtaining, according to the second-level feature vector, a feature vector of the first shrinkage scale corresponding to the second-level feature vector;
根据所述二级特征向量对应的第一收缩尺度的特征向量,获得所述三级特征向量对应的第一收缩尺度的特征向量;Obtaining the feature vector of the first contraction scale corresponding to the third-level feature vector according to the feature vector of the first contraction scale corresponding to the second-level feature vector;
根据所述三级特征向量对应的第一收缩尺度的特征向量,获得三级特征向量。According to the feature vector of the first shrinkage scale corresponding to the three-level feature vector, a three-level feature vector is obtained.
可选的,所述第一网络模型获得单元,具体用于:Optionally, the first network model obtaining unit is specifically configured to:
根据所述二级特征向量对应的第一收缩尺度的特征向量,获得所述二级特征向量对应的第二收缩尺度的特征向量;Obtaining the feature vector of the second contraction scale corresponding to the second-level feature vector according to the feature vector of the first contraction scale corresponding to the second-level feature vector;
根据所述二级特征向量对应的第二收缩尺度的特征向量,获得所述三级特征向量对应的第二收缩尺度的特征向量;Obtaining the feature vector of the second contraction scale corresponding to the third-level feature vector according to the feature vector of the second contraction scale corresponding to the second-level feature vector;
根据所述三级特征向量对应的第二收缩尺度的特征向量,获得所述三级特征向量对应的第一收缩尺度的特征向量。According to the feature vector of the second contraction scale corresponding to the three-level feature vector, the feature vector of the first contraction scale corresponding to the three-level feature vector is obtained.
可选的,还包括第二网络模型获得单元;Optionally, it further includes a second network model obtaining unit;
所述第二网络模型获得单元,用于获得用于将水印颜色设置为预定颜色的网络模型;The second network model obtaining unit is configured to obtain a network model for setting the watermark color to a predetermined color;
所述第二网络模型获得单元,具体用于:The second network model obtaining unit is specifically used for:
根据所述一级特征向量以及所述一级水印模板,在所述样本数据中将水印的颜色设置为预定颜色,获得所述样本数据的设置为预定颜色后的第一样本;According to the first-level feature vector and the first-level watermark template, set the color of the watermark in the sample data to a predetermined color, and obtain a first sample of the sample data set to the predetermined color;
根据所述二级特征向量以及所述二级水印模板,在所述样本数据中将水印的颜色设置为预定颜色;获得所述样本数据的设置为预定颜色后的第二样本;Setting the color of the watermark in the sample data to a predetermined color according to the secondary feature vector and the secondary watermark template; obtaining a second sample of the sample data set to the predetermined color;
根据所述三级特征向量以及所述三级水印模板,在所述样本数据中将水印的颜色设置为预定颜色;获得所述样本数据的设置为预定颜色后的第三样本;According to the three-level feature vector and the three-level watermark template, set the color of the watermark in the sample data to a predetermined color; obtain a third sample of the sample data set to the predetermined color;
将所述第一样本,所述第二样本以及所述第三样本作为所述样本数据中将水印的颜色设置为预定颜色的样本数据;Using the first sample, the second sample, and the third sample as sample data in which the color of the watermark is set to a predetermined color in the sample data;
获得所述样本数据与所述预定颜色的样本数据的对应关系,并将所述对应关系作为用于将水印颜色设置为预定颜色的网络模型。The corresponding relationship between the sample data and the sample data of the predetermined color is obtained, and the corresponding relationship is used as a network model for setting the watermark color to the predetermined color.
可选的,还包括校正单元;Optionally, it also includes a correction unit;
所述校正单元,用于根据所述预定颜色的样本数据对所述用于提取水印模板的网络模型校正;The correction unit is configured to correct the network model used for extracting the watermark template according to the sample data of the predetermined color;
所述校正单元,具体用于:The correction unit is specifically used for:
判断所述预定颜色的样本数据与期望预定颜色的样本数据是否在指定的阈值范围 内;若是,直接将所述预定颜色的样本数据作为所述用于将水印颜色设置为预定颜色的网络模型的输出结果;Determine whether the sample data of the predetermined color and the sample data of the desired predetermined color are within the specified threshold; if so, directly use the sample data of the predetermined color as the network model for setting the watermark color to the predetermined color Output result;
若否,则根据所述预定颜色的样本数据以及所述用于提取水印模板的样本数据,重新获取所述待处理载体对象的校正特征向量;根据所述校正特征向量,获得所述校正特征向量对应的校正水印模板。If not, reacquire the correction feature vector of the carrier object to be processed according to the sample data of the predetermined color and the sample data used to extract the watermark template; obtain the correction feature vector according to the correction feature vector Corresponding corrected watermark template.
可选的,还包括第三网络模型获得单元;Optionally, it further includes a third network model obtaining unit;
所述第三网络模型获得单元,用于获得用于编辑水印的网络模型;The third network model obtaining unit is configured to obtain a network model for editing watermarks;
所述第三网络模型获得单元,具体用于:The third network model obtaining unit is specifically used for:
根据所述样本数据,所述样本数据对应的水印模板以及所述预定颜色的样本数据,获得所述样本数据中的编辑特征向量;Obtaining the edit feature vector in the sample data according to the sample data, the watermark template corresponding to the sample data, and the sample data of the predetermined color;
根据所述编辑特征向量,将所述样本数据对应的水印编辑,得到目标样本数据;According to the editing feature vector, edit the watermark corresponding to the sample data to obtain target sample data;
获得所述样本数据与所述目标样本数据的对应关系,并将所述对应关系作为用于编辑水印的网络模型。The corresponding relationship between the sample data and the target sample data is obtained, and the corresponding relationship is used as a network model for editing the watermark.
可选的,所述水印模板提取单元,具体用于:Optionally, the watermark template extraction unit is specifically used for:
根据所述待处理载体对象,自动获取对应所述待处理载体对象的至少一套水印模板;Automatically obtain at least one set of watermark templates corresponding to the to-be-processed carrier object according to the to-be-processed carrier object;
将所述对应所述待处理载体对象的至少一套水印模板中的一套水印模板或者全部水印模板作为所述待处理载体的水印模板。A set of watermark templates or all of the watermark templates in the at least one set of watermark templates corresponding to the carrier object to be processed are used as the watermark templates of the carrier to be processed.
本申请还提供一种水印嵌入方法,如图6所示,其为本申请实施例三的水印嵌入方法实施例的流程图。所述方法包括如下步骤。包括:This application also provides a watermark embedding method, as shown in FIG. 6, which is a flowchart of an embodiment of the watermark embedding method in the third embodiment of this application. The method includes the following steps. include:
步骤S601:获得原始载体对象,并获取原始水印。Step S601: Obtain the original carrier object, and obtain the original watermark.
本实施例的水印嵌入方法可用于生成含有水印的载体对象,以训练实施例一的用于提取水印模板的网络模型,用于将水印颜色设置为预定颜色的网络模型以及用于编辑水印的网络模型。The watermark embedding method of this embodiment can be used to generate a watermark-containing carrier object to train the network model for extracting the watermark template of the first embodiment, the network model for setting the watermark color to a predetermined color, and the network for editing the watermark model.
具体地,获取原始水印,可以按照如下描述的方式。Specifically, the original watermark can be obtained in the manner described below.
首先,将数字符号、英文符号以及特殊符号中的至少一种进行随机组合,形成字符序列。之后,将所述字符序列作为所述原始水印。First, randomly combine at least one of numeric symbols, English symbols, and special symbols to form a character sequence. After that, the character sequence is used as the original watermark.
例如,可以将预先选取A个数字符号,B个英文符号,C个特殊符号,随机组成含有A+B+C个字符的序列,将所述字符序列作为所述原始水印。For example, A number symbols, B English symbols, and C special symbols can be selected in advance to randomly form a sequence containing A+B+C characters, and the character sequence is used as the original watermark.
步骤S602:获得在所述原始载体对象上嵌入所述原始水印的位置信息。Step S602: Obtain the position information at which the original watermark is embedded on the original carrier object.
在步骤S601获取原始载体对象以及获取原始水印之后,获得在所述原始载体对象上 嵌入所述原始水印的位置信息。After obtaining the original carrier object and obtaining the original watermark in step S601, the position information at which the original watermark is embedded on the original carrier object is obtained.
所述获得在所述原始载体对象上嵌入所述原始水印的位置信息的方式有多种,其中一种获取的方式可以是:首先,获取所述原始载体对象的尺寸信息以及所述原始水印的尺寸信息。之后,根据所述原始载体对象的尺寸信息,确定所述原始水印在所述原始载体对象上的嵌入区域。最终,在所述嵌入区域内,根据所述原始水印的尺寸信息,获得在所述原始载体对象上嵌入所述原始水印的位置信息。There are many ways to obtain the position information of the original watermark embedded on the original carrier object, and one of the ways to obtain it may be: firstly, obtain the size information of the original carrier object and the information of the original watermark. Size Information. Then, according to the size information of the original carrier object, the embedding area of the original watermark on the original carrier object is determined. Finally, in the embedding area, according to the size information of the original watermark, the position information at which the original watermark is embedded on the original carrier object is obtained.
进一步地,所述根据所述原始载体对象的尺寸信息,确定所述原始水印在所述原始载体对象上的嵌入区域,可以按照如下描述的方式。首先,根据所述原始载体对象的尺寸信息,获得所述原始载体对象的长度尺寸信息。之后,根据所述长度尺寸信息,确定在所述原始载体对象上长度方向的第一预留尺寸信息;同时,根据所述原始载体对象的尺寸信息,获得所述原始载体对象的宽度尺寸信息;以及,根据所述宽度尺寸信息,确定在所述原始载体对象上宽度方向的第二预留尺寸信息。最终,根据所述原始载体对象的尺寸信息,所述第一预留尺寸信息以及所述第二预留尺寸信息,确定所述原始水印在所述原始载体对象上的嵌入区域。Further, the determination of the embedding area of the original watermark on the original carrier object according to the size information of the original carrier object may be in the manner described below. First, obtain the length and size information of the original carrier object according to the size information of the original carrier object. After that, determine the first reserved size information in the length direction on the original carrier object according to the length and size information; at the same time, obtain the width and size information of the original carrier object according to the size information of the original carrier object; And, determining the second reserved size information in the width direction on the original carrier object according to the width size information. Finally, according to the size information of the original carrier object, the first reserved size information and the second reserved size information, the embedding area of the original watermark on the original carrier object is determined.
更具体地,所述在所述嵌入区域内,根据所述原始水印的尺寸信息,获得在所述原始载体对象上嵌入所述原始水印的位置信息,首先,根据所述原始水印的尺寸信息,获得所述原始水印的边缘位置信息。之后,根据所述原始水印的边缘位置信息以及所述嵌入区域的位置信息,获得在所述原始载体对象上嵌入所述原始水印的位置信息。More specifically, in the embedding area, according to the size information of the original watermark, the position information at which the original watermark is embedded on the original carrier object is obtained. First, according to the size information of the original watermark, Obtain the edge position information of the original watermark. Then, according to the edge position information of the original watermark and the position information of the embedding area, the position information of the original watermark embedded on the original carrier object is obtained.
步骤S603:在所述原始载体对象中,随机按照所述原始水印的属性信息以及所述位置信息,将所述原始水印嵌入至所述原始载体对象的指定位置上。Step S603: In the original carrier object, randomly according to the attribute information of the original watermark and the position information, embed the original watermark in the designated position of the original carrier object.
在步骤S601获得原始载体对象,并获取原始水印;以及步骤S602获得在所述原始载体对象上嵌入所述原始水印的位置信息后,在所述原始载体对象中,随机按照所述原始水印的属性信息以及所述位置信息,将所述原始水印嵌入至所述原始载体对象的指定位置上。In step S601, the original carrier object is obtained, and the original watermark is obtained; and in step S602, after obtaining the position information of the original watermark embedded on the original carrier object, in the original carrier object, randomly follow the attributes of the original watermark Information and the location information, the original watermark is embedded in the specified location of the original carrier object.
其中,所述原始水印的属性信息包括:原始水印的颜色、原始水印的字体以及原始水印的字号信息中的至少一种。Wherein, the attribute information of the original watermark includes at least one of the color of the original watermark, the font of the original watermark, and the font size information of the original watermark.
采用上述获得原始载体对象上嵌入所述原始水印的位置信息,为使得水印不至于在原始载体对象的边缘上,可以采用随机位置的生成规则:X=random(W/10,W-W/10),Y=random(H/10,H-H/10)生成原始水 印的位置信息,其中,X、Y分别为水印在原始载体对象上的坐标位置,W、H为原始载体对象的尺寸的宽度与高度。Using the above to obtain the position information of the original watermark embedded on the original carrier object, in order to prevent the watermark from being on the edge of the original carrier object, a random position generation rule can be adopted: X=random(W/10, WW/10), Y=random(H/10, HH/10) generates the position information of the original watermark, where X and Y are the coordinate positions of the watermark on the original carrier object, and W and H are the width and height of the original carrier object.
本实施例的水印嵌入方法,通过获得原始载体对象以及原始水印。在此基础上,获得在所述原始载体对象上嵌入所述原始水印的位置信息,从而在所述原始载体对象中,随机按照所述原始水印的属性信息以及所述位置信息,将所述原始水印嵌入至所述原始载体对象的指定位置上。采用此方法嵌入的水印保证水印不处于原始载体对象的边缘上,以保证水印能够准确被检测。The watermark embedding method of this embodiment obtains the original carrier object and the original watermark. On this basis, the position information of the original watermark embedded in the original carrier object is obtained, so that in the original carrier object, randomly according to the attribute information of the original watermark and the position information, the original The watermark is embedded in the designated position of the original carrier object. The watermark embedded in this method ensures that the watermark is not on the edge of the original carrier object, so as to ensure that the watermark can be accurately detected.
在上述的实施例三中,提供了一种水印嵌入方法,与之相对应的,本申请还提供一种水印嵌入装置。如图7所示,其为本申请实施例四的一种水印嵌入装置的示意图。由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。下述描述的装置实施例仅仅是示意性的。In the above-mentioned third embodiment, a watermark embedding method is provided. Correspondingly, this application also provides a watermark embedding device. As shown in FIG. 7, it is a schematic diagram of a watermark embedding device according to the fourth embodiment of the application. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment. The device embodiments described below are merely illustrative.
本实施例的一种水印嵌入装置,包括:A watermark embedding device of this embodiment includes:
原始载体对象获得单元701,用于获得原始载体对象;The original carrier object obtaining unit 701 is configured to obtain the original carrier object;
原始水印获得单元702,用于获取原始水印;The original watermark obtaining unit 702 is configured to obtain the original watermark;
位置信息获得单元703,用于获得在所述原始载体对象上嵌入所述原始水印的位置信息;A location information obtaining unit 703, configured to obtain location information of the original watermark embedded on the original carrier object;
嵌入单元704,用于在所述原始载体对象中,随机按照所述原始水印的属性信息以及所述位置信息,将所述原始水印嵌入至所述原始载体对象的指定位置上。The embedding unit 704 is configured to embed the original watermark at a designated position of the original carrier object randomly according to the attribute information of the original watermark and the position information in the original carrier object.
可选的,所述原始水印获得单元,具体用于:Optionally, the original watermark obtaining unit is specifically used for:
将数字符号、英文符号以及特殊符号中的至少一种进行随机组合,形成字符序列;Randomly combine at least one of numeric symbols, English symbols, and special symbols to form a character sequence;
将所述字符序列作为所述原始水印。Use the character sequence as the original watermark.
可选的,所述位置信息获得单元,具体用于:Optionally, the location information obtaining unit is specifically configured to:
获取所述原始载体对象的尺寸信息以及所述原始水印的尺寸信息;Acquiring the size information of the original carrier object and the size information of the original watermark;
根据所述原始载体对象的尺寸信息,确定所述原始水印在所述原始载体对象上的嵌入区域;Determine the embedding area of the original watermark on the original carrier object according to the size information of the original carrier object;
在所述嵌入区域内,根据所述原始水印的尺寸信息,获得在所述原始载体对象上嵌入所述原始水印的位置信息。In the embedding area, according to the size information of the original watermark, the position information at which the original watermark is embedded on the original carrier object is obtained.
可选的,所述位置信息获得单元,具体用于:Optionally, the location information obtaining unit is specifically configured to:
根据所述原始载体对象的尺寸信息,获得所述原始载体对象的长度尺寸信息;Obtaining the length and size information of the original carrier object according to the size information of the original carrier object;
根据所述长度尺寸信息,确定在所述原始载体对象上长度方向的第一预留尺寸信息;Determine the first reserved size information in the length direction on the original carrier object according to the length size information;
根据所述原始载体对象的尺寸信息,获得所述原始载体对象的宽度尺寸信息;Obtaining the width size information of the original carrier object according to the size information of the original carrier object;
根据所述宽度尺寸信息,确定在所述原始载体对象上宽度方向的第二预留尺寸信息;Determine the second reserved size information in the width direction on the original carrier object according to the width size information;
根据所述原始载体对象的尺寸信息,所述第一预留尺寸信息以及所述第二预留尺寸信息,确定所述原始水印在所述原始载体对象上的嵌入区域。According to the size information of the original carrier object, the first reserved size information and the second reserved size information, the embedding area of the original watermark on the original carrier object is determined.
可选的,所述位置信息获得单元,具体用于:Optionally, the location information obtaining unit is specifically configured to:
根据所述原始水印的尺寸信息,获得所述原始水印的边缘位置信息;Obtaining edge position information of the original watermark according to the size information of the original watermark;
根据所述原始水印的边缘位置信息以及所述嵌入区域的位置信息,获得在所述原始载体对象上嵌入所述原始水印的位置信息。According to the edge position information of the original watermark and the position information of the embedding area, the position information at which the original watermark is embedded on the original carrier object is obtained.
可选的,所述原始水印的属性信息包括:原始水印的颜色、原始水印的字体以及原始水印的字号信息中的至少一种。Optionally, the attribute information of the original watermark includes at least one of the color of the original watermark, the font of the original watermark, and the font size information of the original watermark.
本申请实施例一给出了一种载体对象处理方法,本申请实施例五给出了与该载体对象处理方法对应的电子设备。The first embodiment of the present application provides a method for processing a carrier object, and the fifth embodiment of the present application provides an electronic device corresponding to the method for processing the carrier object.
如图8所示,其示出了本申请实施例五提供的载体对象处理方法电子设备示意图。As shown in FIG. 8, it shows a schematic diagram of the electronic device of the carrier object processing method provided in the fifth embodiment of the present application.
本实施例的一种电子设备,包括:An electronic device of this embodiment includes:
处理器801; Processor 801;
存储器802,用于存储载体对象处理方法的程序后,并执行以下步骤:The memory 802 is used to store the program of the carrier object processing method and execute the following steps:
获取待处理载体对象;Obtain the to-be-processed carrier object;
从所述待处理载体对象中提取水印模板;Extracting a watermark template from the to-be-processed carrier object;
根据所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象。According to the watermark template, edit the watermark in the to-be-processed carrier object to obtain a target carrier object.
本申请实施例三给出了一种水印嵌入方法,本申请实施例六给出了与该水印嵌入方法对应的电子设备。由于电子设备示意图与图8相同,具体图示请参见图8。The third embodiment of this application provides a watermark embedding method, and the sixth embodiment of this application provides an electronic device corresponding to the watermark embedding method. Since the schematic diagram of the electronic device is the same as FIG. 8, please refer to FIG. 8 for the specific diagram.
本申请提供一种电子设备,包括:This application provides an electronic device, including:
处理器;processor;
存储器,用于存储水印嵌入方法的程序后,并执行以下步骤:The memory is used to store the program of the watermark embedding method and execute the following steps:
获得原始载体对象,并获取原始水印;Obtain the original carrier object and obtain the original watermark;
获得在所述原始载体对象上嵌入所述原始水印的位置信息;Obtaining position information at which the original watermark is embedded on the original carrier object;
在所述原始载体对象中,随机按照所述原始水印的属性信息以及所述位置信息,将所述原始水印嵌入至所述原始载体对象的指定位置上。In the original carrier object, randomly according to the attribute information of the original watermark and the position information, the original watermark is embedded in a designated position of the original carrier object.
本申请实施例一给出了一种载体对象处理方法,本申请实施例七给出了与该载体对象处理方法对应的计算机存储介质。The first embodiment of the present application provides a method for processing a carrier object, and the seventh embodiment of the present application provides a computer storage medium corresponding to the method for processing the carrier object.
本实施例的一种计算机存储介质,所述计算机存储介质存储载体对象处理方法的程序,该程序被处理器运行,执行下述步骤:A computer storage medium of this embodiment, the computer storage medium stores a program of a carrier object processing method, and the program is run by a processor to perform the following steps:
获取待处理载体对象;Obtain the to-be-processed carrier object;
从所述待处理载体对象中提取水印模板;Extracting a watermark template from the to-be-processed carrier object;
根据所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象。According to the watermark template, edit the watermark in the to-be-processed carrier object to obtain a target carrier object.
本申请实施例三给出了一种水印嵌入方法,本申请实施例八给出了与该水印嵌入方法对应的计算机存储介质。The third embodiment of the present application provides a watermark embedding method, and the eighth embodiment of the present application provides a computer storage medium corresponding to the watermark embedding method.
本实施例的一种计算机存储介质,所述计算机存储介质存储水印嵌入方法的程序,该程序被处理器运行,执行下述步骤:A computer storage medium of this embodiment, the computer storage medium stores a program of the watermark embedding method, and the program is run by a processor to perform the following steps:
获得原始载体对象,并获取原始水印;Obtain the original carrier object and obtain the original watermark;
获得在所述原始载体对象上嵌入所述原始水印的位置信息;Obtaining position information at which the original watermark is embedded on the original carrier object;
在所述原始载体对象中,随机按照所述原始水印的属性信息以及所述位置信息,将所述原始水印嵌入至所述原始载体对象的指定位置上。In the original carrier object, randomly according to the attribute information of the original watermark and the position information, the original watermark is embedded in a designated position of the original carrier object.
本申请虽然以较佳实施例公开如上,但其并不是用来限定本申请,任何本领域技术人员在不脱离本申请的精神和范围内,都可以做出可能的变动和修改,因此本申请的保护范围应当以本申请权利要求所界定的范围为准。Although this application is disclosed as above in preferred embodiments, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, this application The scope of protection shall be subject to the scope defined by the claims of this application.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, the computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent memory in a computer readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include non-transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

Claims (31)

  1. 一种载体对象处理方法,其特征在于,包括:A method for processing a carrier object, characterized in that it comprises:
    获取待处理载体对象;Obtain the to-be-processed carrier object;
    从所述待处理载体对象中提取水印模板;Extracting a watermark template from the to-be-processed carrier object;
    根据所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象。According to the watermark template, edit the watermark in the to-be-processed carrier object to obtain a target carrier object.
  2. 根据权利要求1所述的方法,其特征在于,所述从所述待处理载体对象中提取水印模板,包括:The method according to claim 1, wherein the extracting a watermark template from the carrier object to be processed comprises:
    将所述待处理载体对象输入到用于提取水印模板的网络模型中,获得所述待处理载体对象的特征向量;Input the to-be-processed carrier object into a network model for extracting a watermark template to obtain a feature vector of the to-be-processed carrier object;
    根据所述待处理载体对象的特征向量,获得所述特征向量对应的水印模板。According to the feature vector of the carrier object to be processed, a watermark template corresponding to the feature vector is obtained.
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述待处理载体对象的特征向量,获得所述特征向量对应的水印模板,包括:The method according to claim 2, wherein the obtaining the watermark template corresponding to the feature vector according to the feature vector of the carrier object to be processed comprises:
    对所述特征向量进行卷积操作,获得所述特征向量对应的水印模板。Performing a convolution operation on the feature vector to obtain a watermark template corresponding to the feature vector.
  4. 根据权利要求1所述的方法,其特征在于,所述水印模板为在向原载体对象添加水印信息时采用的模板;其中,所述原载体对象为所述待处理载体对象添加水印信息之前的载体对象。The method according to claim 1, wherein the watermark template is a template used when adding watermark information to the original carrier object; wherein the original carrier object is the carrier before the watermark information is added to the carrier object to be processed Object.
  5. 根据权利要求1所述的方法,其特征在于,还包括:The method according to claim 1, further comprising:
    根据所述水印模板,在所述待处理载体对象中将水印的颜色设置为预定颜色;Setting the color of the watermark in the carrier object to be processed to a predetermined color according to the watermark template;
    所述根据所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象,包括:根据所述水印的预定颜色以及所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象。The editing the watermark in the carrier object to be processed according to the watermark template to obtain a target carrier object includes: editing in the carrier object to be processed according to a predetermined color of the watermark and the watermark template The watermark obtains the target carrier object.
  6. 根据权利要求5所述的方法,其特征在于,所述根据所述水印模板,在所述待处理载体对象中将水印的颜色设置为预定颜色,包括:The method according to claim 5, wherein the setting the color of the watermark in the carrier object to be processed to a predetermined color according to the watermark template comprises:
    将所述待处理载体对象以及所述水印模板输入到用于将水印颜色设置为预定颜色的网络模型中,以将所述待处理载体对象中水印的颜色设置为预定颜色。The carrier object to be processed and the watermark template are input into a network model for setting the watermark color to a predetermined color, so as to set the color of the watermark in the carrier object to be processed to a predetermined color.
  7. 根据权利要求6所述的方法,其特征在于,所述将所述待处理载体对象以及所述水印模板输入到用于将水印颜色设置为预定颜色的网络模型中,以将所述待处理载体对象中水印的颜色设置为预定颜色,包括:The method according to claim 6, wherein the input of the carrier object to be processed and the watermark template into a network model for setting the watermark color to a predetermined color, so as to transfer the carrier object to be processed The color of the watermark in the object is set to a predetermined color, including:
    根据所述水印模板,获得水印在所述待处理载体对象中的位置信息以及形状信息;Obtaining the position information and shape information of the watermark in the carrier object to be processed according to the watermark template;
    根据所述水印在所述待处理载体对象中的位置信息以及形状信息,将所述水印在所 述待处理载体对象中的颜色设置为预定颜色。According to the position information and shape information of the watermark in the carrier object to be processed, the color of the watermark in the carrier object to be processed is set to a predetermined color.
  8. 根据权利要求5所述的方法,其特征在于,还包括:The method according to claim 5, further comprising:
    获得所述待处理载体对象中水印的颜色设置为预定颜色后的载体对象;Obtaining the carrier object in which the color of the watermark in the carrier object to be processed is set to a predetermined color;
    所述根据所述水印的预定颜色以及所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象,包括:The editing the watermark in the to-be-processed carrier object according to the predetermined color of the watermark and the watermark template to obtain a target carrier object includes:
    将所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象输入到用于编辑水印的网络模型中,以得到目标载体对象。The carrier object to be processed, the watermark template, and the carrier object set to a predetermined color are input into a network model for editing the watermark to obtain a target carrier object.
  9. 根据权利要求8所述的方法,其特征在于,所述将所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象输入到用于编辑水印的网络模型中,以得到目标载体对象,包括:The method according to claim 8, wherein said inputting said carrier object to be processed, said watermark template and said carrier object set to a predetermined color into a network model for editing watermark, Get the target carrier object, including:
    将所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象输入到所述用于编辑水印的网络模型中,获得所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象对应的编辑特征向量;Input the to-be-processed carrier object, the watermark template, and the carrier object set to a predetermined color into the network model for editing watermarks to obtain the to-be-processed carrier object, the watermark template, and the The edit feature vector corresponding to the carrier object set as a predetermined color;
    根据所述待处理载体对象,所述水印模板以及所述设置为预定颜色后的载体对象对应的编辑特征向量,编辑所述待处理载体对象的水印,得到目标载体对象。According to the to-be-processed carrier object, the watermark template, and the editing feature vector corresponding to the carrier object set to a predetermined color, edit the watermark of the to-be-processed carrier object to obtain a target carrier object.
  10. 根据权利要求5所述的方法,其特征在于,所述在所述待处理载体对象中将水印的颜色设置为预定颜色是指,将所述待处理载体对象中的水印在所述待处理载体对象中的位置处的像素值设置为预定像素值。The method according to claim 5, wherein the setting the color of the watermark in the carrier object to be processed to a predetermined color refers to setting the watermark in the carrier object to be processed on the carrier object to be processed. The pixel value at the position in the object is set to a predetermined pixel value.
  11. 根据权利要求2所述的方法,其特征在于,还包括获得所述用于提取水印模板的网络模型;The method according to claim 2, further comprising obtaining the network model used to extract the watermark template;
    所述获得用于提取水印模板的网络模型,包括:The obtaining of the network model used to extract the watermark template includes:
    获得用于提取水印模板的样本数据;Obtain sample data for extracting the watermark template;
    获得所述样本数据的一级特征向量;Obtaining the first-level feature vector of the sample data;
    对所述一级特征向量进行卷积操作,获得所述一级特征向量对应的一级水印模板;Performing a convolution operation on the first-level feature vector to obtain a first-level watermark template corresponding to the first-level feature vector;
    根据所述一级特征向量,获得二级特征向量;Obtaining a second-level feature vector according to the first-level feature vector;
    对所述二级特征向量进行卷积操作,获得所述二级特征向量对应的二级水印模板;Performing a convolution operation on the secondary feature vector to obtain a secondary watermark template corresponding to the secondary feature vector;
    根据所述二级特征向量,获得三级特征向量;Obtaining a third-level feature vector according to the second-level feature vector;
    对所述三级特征向量进行卷积操作,获得所述三级特征向量对应的三级水印模板;Performing a convolution operation on the three-level feature vector to obtain a three-level watermark template corresponding to the three-level feature vector;
    将所述一级水印模板,所述二级水印模板以及所述三级水印模板作为所述样本数据对应的水印模板;Using the first-level watermark template, the second-level watermark template, and the third-level watermark template as watermark templates corresponding to the sample data;
    获得所述样本数据与所述样本数据对应的水印模板的对应关系,并将所述对应关系作为用于提取水印模板的网络模型。The corresponding relationship between the sample data and the watermark template corresponding to the sample data is obtained, and the corresponding relationship is used as a network model for extracting the watermark template.
  12. 根据权利要求11所述的方法,其特征在于,所述根据所述一级特征向量,获得二级特征向量,包括:The method according to claim 11, wherein the obtaining a second-level feature vector according to the first-level feature vector comprises:
    根据所述一级特征向量,获得所述一级特征向量对应的第一收缩尺度的特征向量;Obtaining, according to the first-level feature vector, the feature vector of the first shrinkage scale corresponding to the first-level feature vector;
    根据所述一级特征向量对应的第一收缩尺度的特征向量,获得所述二级特征向量对应的第一收缩尺度的特征向量;Obtaining the feature vector of the first contraction scale corresponding to the second-level feature vector according to the feature vector of the first contraction scale corresponding to the first-level feature vector;
    根据所述二级特征向量对应的第一收缩尺度的特征向量,获得二级特征向量。The second-level feature vector is obtained according to the feature vector of the first shrinkage scale corresponding to the second-level feature vector.
  13. 根据权利要求12所述的方法,其特征在于,所述根据所述一级特征向量对应的第一收缩尺度的特征向量,获得所述二级特征向量对应的第一收缩尺度的特征向量,包括:The method according to claim 12, wherein the obtaining the feature vector of the first contraction scale corresponding to the second-level feature vector according to the feature vector of the first contraction scale corresponding to the first-level feature vector comprises :
    根据所述一级特征向量对应的第一收缩尺度的特征向量,获得所述一级特征向量对应的第二收缩尺度的特征向量;Obtaining the feature vector of the second contraction scale corresponding to the first-level feature vector according to the feature vector of the first contraction scale corresponding to the first-level feature vector;
    根据所述一级特征向量对应的第二收缩尺度的特征向量,获得所述二级特征向量对应的第二收缩尺度的特征向量;Obtaining the feature vector of the second contraction scale corresponding to the second-level feature vector according to the feature vector of the second contraction scale corresponding to the first-level feature vector;
    根据所述二级特征向量对应的第二收缩尺度的特征向量,获得所述二级特征向量对应的第一收缩尺度的特征向量。According to the feature vector of the second contraction scale corresponding to the second-level feature vector, the feature vector of the first contraction scale corresponding to the second-level feature vector is obtained.
  14. 根据权利要求11所述的方法,其特征在于,所述根据所述二级特征向量,获得三级特征向量,包括:The method according to claim 11, wherein the obtaining a third-level feature vector according to the second-level feature vector comprises:
    根据所述二级特征向量,获得所述二级特征向量对应的第一收缩尺度的特征向量;Obtaining, according to the second-level feature vector, a feature vector of the first shrinkage scale corresponding to the second-level feature vector;
    根据所述二级特征向量对应的第一收缩尺度的特征向量,获得所述三级特征向量对应的第一收缩尺度的特征向量;Obtaining the feature vector of the first contraction scale corresponding to the third-level feature vector according to the feature vector of the first contraction scale corresponding to the second-level feature vector;
    根据所述三级特征向量对应的第一收缩尺度的特征向量,获得三级特征向量。According to the feature vector of the first shrinkage scale corresponding to the three-level feature vector, a three-level feature vector is obtained.
  15. 根据权利要求14所述的方法,其特征在于,所述根据所述二级特征向量对应的第一收缩尺度的特征向量,获得所述三级特征向量对应的第一收缩尺度的特征向量,包括:The method according to claim 14, wherein the obtaining the feature vector of the first contraction scale corresponding to the third-level feature vector according to the feature vector of the first contraction scale corresponding to the second-level feature vector comprises :
    根据所述二级特征向量对应的第一收缩尺度的特征向量,获得所述二级特征向量对应的第二收缩尺度的特征向量;Obtaining the feature vector of the second contraction scale corresponding to the second-level feature vector according to the feature vector of the first contraction scale corresponding to the second-level feature vector;
    根据所述二级特征向量对应的第二收缩尺度的特征向量,获得所述三级特征向量对应的第二收缩尺度的特征向量;Obtaining the feature vector of the second contraction scale corresponding to the third-level feature vector according to the feature vector of the second contraction scale corresponding to the second-level feature vector;
    根据所述三级特征向量对应的第二收缩尺度的特征向量,获得所述三级特征向量对应的第一收缩尺度的特征向量。According to the feature vector of the second contraction scale corresponding to the three-level feature vector, the feature vector of the first contraction scale corresponding to the three-level feature vector is obtained.
  16. 根据权利要求11所述的方法,其特征在于,还包括获得用于将水印颜色设置为预定颜色的网络模型;The method according to claim 11, further comprising obtaining a network model for setting the watermark color to a predetermined color;
    所述获得用于将水印颜色设置为预定颜色的网络模型,包括:The obtaining a network model for setting the watermark color to a predetermined color includes:
    根据所述一级特征向量以及所述一级水印模板,在所述样本数据中将水印的颜色设置为预定颜色,获得所述样本数据的设置为预定颜色后的第一样本;According to the first-level feature vector and the first-level watermark template, set the color of the watermark in the sample data to a predetermined color, and obtain a first sample of the sample data set to the predetermined color;
    根据所述二级特征向量以及所述二级水印模板,在所述样本数据中将水印的颜色设置为预定颜色;获得所述样本数据的设置为预定颜色后的第二样本;Setting the color of the watermark in the sample data to a predetermined color according to the secondary feature vector and the secondary watermark template; obtaining a second sample of the sample data set to the predetermined color;
    根据所述三级特征向量以及所述三级水印模板,在所述样本数据中将水印的颜色设置为预定颜色;获得所述样本数据的设置为预定颜色后的第三样本;According to the three-level feature vector and the three-level watermark template, set the color of the watermark in the sample data to a predetermined color; obtain a third sample of the sample data set to the predetermined color;
    将所述第一样本,所述第二样本以及所述第三样本作为所述样本数据中将水印的颜色设置为预定颜色的样本数据;Using the first sample, the second sample, and the third sample as sample data in which the color of the watermark is set to a predetermined color in the sample data;
    获得所述样本数据与所述预定颜色的样本数据的对应关系,并将所述对应关系作为用于将水印颜色设置为预定颜色的网络模型。The corresponding relationship between the sample data and the sample data of the predetermined color is obtained, and the corresponding relationship is used as a network model for setting the watermark color to the predetermined color.
  17. 根据权利要求16所述的方法,其特征在于,还包括:根据所述预定颜色的样本数据对所述用于提取水印模板的网络模型校正;The method according to claim 16, further comprising: correcting the network model for extracting the watermark template according to the sample data of the predetermined color;
    所述根据所述预定颜色的样本数据对所述用于提取水印模板的网络模型校正,包括:The correcting the network model for extracting the watermark template according to the sample data of the predetermined color includes:
    判断所述预定颜色的样本数据与期望预定颜色的样本数据是否在指定的阈值范围内;若是,直接将所述预定颜色的样本数据作为所述用于将水印颜色设置为预定颜色的网络模型的输出结果;Determine whether the sample data of the predetermined color and the sample data of the desired predetermined color are within the specified threshold; if so, directly use the sample data of the predetermined color as the network model for setting the watermark color to the predetermined color Output result;
    若否,则根据所述预定颜色的样本数据以及所述用于提取水印模板的样本数据,重新获取所述待处理载体对象的校正特征向量;根据所述校正特征向量,获得所述校正特征向量对应的校正水印模板。If not, reacquire the correction feature vector of the carrier object to be processed according to the sample data of the predetermined color and the sample data used to extract the watermark template; obtain the correction feature vector according to the correction feature vector Corresponding corrected watermark template.
  18. 根据权利要求16所述的方法,其特征在于,还包括获得用于编辑水印的网络模型;The method according to claim 16, further comprising obtaining a network model for editing the watermark;
    所述获得用于编辑水印的网络模型,包括:The obtaining of the network model used for editing the watermark includes:
    根据所述样本数据,所述样本数据对应的水印模板以及所述预定颜色的样本数据,获得所述样本数据中的编辑特征向量;Obtaining the edit feature vector in the sample data according to the sample data, the watermark template corresponding to the sample data, and the sample data of the predetermined color;
    根据所述编辑特征向量,将所述样本数据对应的水印编辑,得到目标样本数据;According to the editing feature vector, edit the watermark corresponding to the sample data to obtain target sample data;
    获得所述样本数据与所述目标样本数据的对应关系,并将所述对应关系作为用于编辑水印的网络模型。The corresponding relationship between the sample data and the target sample data is obtained, and the corresponding relationship is used as a network model for editing the watermark.
  19. 根据权利要求1所述的方法,其特征在于,所述从所述待处理载体对象中提取水印模板,包括:The method according to claim 1, wherein the extracting a watermark template from the carrier object to be processed comprises:
    根据所述待处理载体对象,自动获取对应所述待处理载体对象的至少一套水印模板;Automatically obtain at least one set of watermark templates corresponding to the to-be-processed carrier object according to the to-be-processed carrier object;
    将所述对应所述待处理载体对象的至少一套水印模板中的一套水印模板或者全部水印模板作为所述待处理载体的水印模板。A set of watermark templates or all of the watermark templates in the at least one set of watermark templates corresponding to the carrier object to be processed are used as the watermark templates of the carrier to be processed.
  20. 一种载体对象处理装置,其特征在于,包括:A carrier object processing device, characterized in that it comprises:
    载体对象处理单元,用于获取待处理载体对象;The carrier object processing unit is used to obtain the carrier object to be processed;
    水印模板提取单元,用于从所述待处理载体对象中提取水印模板;A watermark template extraction unit, configured to extract a watermark template from the carrier object to be processed;
    目标载体对象获得单元,用于根据所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象。The target carrier object obtaining unit is configured to edit the watermark in the to-be-processed carrier object according to the watermark template to obtain the target carrier object.
  21. 一种水印嵌入方法,其特征在于,包括:A watermark embedding method is characterized in that it includes:
    获得原始载体对象,并获取原始水印;Obtain the original carrier object and obtain the original watermark;
    获得在所述原始载体对象上嵌入所述原始水印的位置信息;Obtaining position information at which the original watermark is embedded on the original carrier object;
    在所述原始载体对象中,随机按照所述原始水印的属性信息以及所述位置信息,将所述原始水印嵌入至所述原始载体对象的指定位置上。In the original carrier object, randomly according to the attribute information of the original watermark and the position information, the original watermark is embedded in a designated position of the original carrier object.
  22. 根据权利要求21所述的方法,其特征在于,所述获取原始水印,包括:The method according to claim 21, wherein said obtaining the original watermark comprises:
    将数字符号、英文符号以及特殊符号中的至少一种进行随机组合,形成字符序列;Randomly combine at least one of numeric symbols, English symbols, and special symbols to form a character sequence;
    将所述字符序列作为所述原始水印。Use the character sequence as the original watermark.
  23. 根据权利要求21所述的方法,其特征在于,所述获得在所述原始载体对象上嵌入所述原始水印的位置信息,包括:The method according to claim 21, wherein said obtaining the position information of the original watermark embedded on the original carrier object comprises:
    获取所述原始载体对象的尺寸信息以及所述原始水印的尺寸信息;Acquiring the size information of the original carrier object and the size information of the original watermark;
    根据所述原始载体对象的尺寸信息,确定所述原始水印在所述原始载体对象上的嵌入区域;Determine the embedding area of the original watermark on the original carrier object according to the size information of the original carrier object;
    在所述嵌入区域内,根据所述原始水印的尺寸信息,获得在所述原始载体对象上嵌入所述原始水印的位置信息。In the embedding area, according to the size information of the original watermark, the position information at which the original watermark is embedded on the original carrier object is obtained.
  24. 根据权利要求23所述的方法,其特征在于,所述根据所述原始载体对象的尺寸 信息,确定所述原始水印在所述原始载体对象上的嵌入区域,包括:The method according to claim 23, wherein the determining the embedding area of the original watermark on the original carrier object according to the size information of the original carrier object comprises:
    根据所述原始载体对象的尺寸信息,获得所述原始载体对象的长度尺寸信息;Obtaining the length and size information of the original carrier object according to the size information of the original carrier object;
    根据所述长度尺寸信息,确定在所述原始载体对象上长度方向的第一预留尺寸信息;Determine the first reserved size information in the length direction on the original carrier object according to the length size information;
    根据所述原始载体对象的尺寸信息,获得所述原始载体对象的宽度尺寸信息;Obtaining the width size information of the original carrier object according to the size information of the original carrier object;
    根据所述宽度尺寸信息,确定在所述原始载体对象上宽度方向的第二预留尺寸信息;Determine the second reserved size information in the width direction on the original carrier object according to the width size information;
    根据所述原始载体对象的尺寸信息,所述第一预留尺寸信息以及所述第二预留尺寸信息,确定所述原始水印在所述原始载体对象上的嵌入区域。According to the size information of the original carrier object, the first reserved size information and the second reserved size information, the embedding area of the original watermark on the original carrier object is determined.
  25. 根据权利要求24所述的方法,其特征在于,所述在所述嵌入区域内,根据所述原始水印的尺寸信息,获得在所述原始载体对象上嵌入所述原始水印的位置信息,包括:The method according to claim 24, wherein the obtaining, in the embedding area, according to the size information of the original watermark, the position information at which the original watermark is embedded on the original carrier object comprises:
    根据所述原始水印的尺寸信息,获得所述原始水印的边缘位置信息;Obtaining edge position information of the original watermark according to the size information of the original watermark;
    根据所述原始水印的边缘位置信息以及所述嵌入区域的位置信息,获得在所述原始载体对象上嵌入所述原始水印的位置信息。According to the edge position information of the original watermark and the position information of the embedding area, the position information at which the original watermark is embedded on the original carrier object is obtained.
  26. 根据权利要求22所述的方法,其特征在于,所述原始水印的属性信息包括:原始水印的颜色、原始水印的字体以及原始水印的字号信息中的至少一种。The method according to claim 22, wherein the attribute information of the original watermark includes at least one of the color of the original watermark, the font of the original watermark, and the font size information of the original watermark.
  27. 一种水印嵌入装置,其特征在于,包括:A watermark embedding device is characterized in that it comprises:
    原始载体对象获得单元,用于获得原始载体对象;The original carrier object obtaining unit, which is used to obtain the original carrier object;
    原始水印获得单元,用于获取原始水印;The original watermark obtaining unit is used to obtain the original watermark;
    位置信息获得单元,用于获得在所述原始载体对象上嵌入所述原始水印的位置信息;A location information obtaining unit, configured to obtain location information of the original watermark embedded on the original carrier object;
    嵌入单元,用于在所述原始载体对象中,随机按照所述原始水印的属性信息以及所述位置信息,将所述原始水印嵌入至所述原始载体对象的指定位置上。The embedding unit is configured to embed the original watermark at a designated position of the original carrier object randomly according to the attribute information of the original watermark and the position information in the original carrier object.
  28. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    处理器;processor;
    存储器,用于存储载体对象处理方法的程序后,并执行以下步骤:The memory is used to store the program of the carrier object processing method and execute the following steps:
    获取待处理载体对象;Obtain the to-be-processed carrier object;
    从所述待处理载体对象中提取水印模板;Extracting a watermark template from the to-be-processed carrier object;
    根据所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象。According to the watermark template, edit the watermark in the to-be-processed carrier object to obtain a target carrier object.
  29. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    处理器;processor;
    存储器,用于存储水印嵌入方法的程序后,并执行以下步骤:The memory is used to store the program of the watermark embedding method and execute the following steps:
    获得原始载体对象,并获取原始水印;Obtain the original carrier object and obtain the original watermark;
    获得在所述原始载体对象上嵌入所述原始水印的位置信息;Obtaining position information at which the original watermark is embedded on the original carrier object;
    在所述原始载体对象中,随机按照所述原始水印的属性信息以及所述位置信息,将所述原始水印嵌入至所述原始载体对象的指定位置上。In the original carrier object, randomly according to the attribute information of the original watermark and the position information, the original watermark is embedded in a designated position of the original carrier object.
  30. 一种计算机存储介质,其特征在于,所述计算机存储介质存储载体对象处理方法的程序,该程序被处理器运行,执行下述步骤:A computer storage medium, characterized in that the computer storage medium stores a program of a carrier object processing method, and the program is run by a processor to perform the following steps:
    获取待处理载体对象;Obtain the to-be-processed carrier object;
    从所述待处理载体对象中提取水印模板;Extracting a watermark template from the to-be-processed carrier object;
    根据所述水印模板,在所述待处理载体对象中编辑所述水印,得到目标载体对象。According to the watermark template, edit the watermark in the to-be-processed carrier object to obtain a target carrier object.
  31. 一种计算机存储介质,其特征在于,所述计算机存储介质存储水印嵌入方法的程序,该程序被处理器运行,执行下述步骤:A computer storage medium, characterized in that the computer storage medium stores a program of a watermark embedding method, and the program is run by a processor to perform the following steps:
    获得原始载体对象,并获取原始水印;Obtain the original carrier object and obtain the original watermark;
    获得在所述原始载体对象上嵌入所述原始水印的位置信息;Obtaining position information at which the original watermark is embedded on the original carrier object;
    在所述原始载体对象中,随机按照所述原始水印的属性信息以及所述位置信息,将所述原始水印嵌入至所述原始载体对象的指定位置上。In the original carrier object, randomly according to the attribute information of the original watermark and the position information, the original watermark is embedded in a designated position of the original carrier object.
PCT/CN2020/123884 2019-10-31 2020-10-27 Carrier object processing and watermark embedding methods and apparatuses, and electronic device WO2021083110A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911049751.1 2019-10-31
CN201911049751.1A CN112750065B (en) 2019-10-31 2019-10-31 Carrier object processing and watermark embedding method, device and electronic equipment

Publications (1)

Publication Number Publication Date
WO2021083110A1 true WO2021083110A1 (en) 2021-05-06

Family

ID=75641424

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/123884 WO2021083110A1 (en) 2019-10-31 2020-10-27 Carrier object processing and watermark embedding methods and apparatuses, and electronic device

Country Status (2)

Country Link
CN (1) CN112750065B (en)
WO (1) WO2021083110A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114445256A (en) * 2022-01-27 2022-05-06 腾讯科技(深圳)有限公司 Training method, device, equipment and storage medium for digital watermark

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101901470A (en) * 2010-02-10 2010-12-01 桂林电子科技大学 Image-tampering detection and recovery method based on energy-domain semi-fragile watermarking
CN102903072A (en) * 2011-07-29 2013-01-30 天柏宽带网络科技(北京)有限公司 Blind digital watermark detection method and system
CN106454182A (en) * 2016-10-26 2017-02-22 维沃移动通信有限公司 Video generation method and mobile terminal
US20180122034A1 (en) * 2016-10-31 2018-05-03 Zhuhai Seine Technology Co., Ltd. Watermark adjustment method and device
CN110211015A (en) * 2018-02-28 2019-09-06 佛山科学技术学院 A kind of water mark method based on feature object protection
CN110322385A (en) * 2018-03-28 2019-10-11 浙江大学 Watermark insertion and extracting method, device and electronic equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8224019B2 (en) * 2007-05-22 2012-07-17 Xerox Corporation Embedding information in document blank space
CN102968758B (en) * 2012-12-14 2016-08-03 福建伊时代信息科技股份有限公司 The processing method of digital watermarking and system
CN108665403B (en) * 2017-03-29 2022-06-24 腾讯科技(深圳)有限公司 Digital watermark embedding method, digital watermark extracting method, digital watermark embedding device, digital watermark extracting device and digital watermark system
CN107240061B (en) * 2017-06-09 2021-01-12 河南师范大学 Watermark embedding and extracting method and device based on dynamic BP neural network
CN108055493B (en) * 2017-12-13 2020-06-30 苏州科达科技股份有限公司 Method and device for embedding watermark in video image
CN110378829B (en) * 2018-04-13 2021-12-24 浙江大学 Method, device and equipment for providing information and extracting watermark
CN109118420B (en) * 2018-08-21 2022-11-25 杭州朗和科技有限公司 Watermark identification model establishing and identifying method, device, medium and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101901470A (en) * 2010-02-10 2010-12-01 桂林电子科技大学 Image-tampering detection and recovery method based on energy-domain semi-fragile watermarking
CN102903072A (en) * 2011-07-29 2013-01-30 天柏宽带网络科技(北京)有限公司 Blind digital watermark detection method and system
CN106454182A (en) * 2016-10-26 2017-02-22 维沃移动通信有限公司 Video generation method and mobile terminal
US20180122034A1 (en) * 2016-10-31 2018-05-03 Zhuhai Seine Technology Co., Ltd. Watermark adjustment method and device
CN110211015A (en) * 2018-02-28 2019-09-06 佛山科学技术学院 A kind of water mark method based on feature object protection
CN110322385A (en) * 2018-03-28 2019-10-11 浙江大学 Watermark insertion and extracting method, device and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114445256A (en) * 2022-01-27 2022-05-06 腾讯科技(深圳)有限公司 Training method, device, equipment and storage medium for digital watermark

Also Published As

Publication number Publication date
CN112750065A (en) 2021-05-04
CN112750065B (en) 2022-12-09

Similar Documents

Publication Publication Date Title
US10803554B2 (en) Image processing method and device
TWI766855B (en) A character recognition method and device
CN109753971B (en) Correction method and device for distorted text lines, character recognition method and device
WO2018036293A1 (en) Image segmentation method, apparatus, and fully convolutional network system
WO2020199478A1 (en) Method for training image generation model, image generation method, device and apparatus, and storage medium
Duan et al. Coverless Steganography for Digital Images Based on a Generative Model.
GB2581374A (en) 3D Face reconstruction system and method
CN107784288B (en) Iterative positioning type face detection method based on deep neural network
CN108229287B (en) Image recognition method and device, electronic equipment and computer storage medium
Li et al. Unsupervised domain adaptation for monocular 3d object detection via self-training
CN111144215B (en) Image processing method, device, electronic equipment and storage medium
CN109919209A (en) A kind of domain-adaptive deep learning method and readable storage medium storing program for executing
US9292761B2 (en) Image processing device, image processing method, and program
CN109522807B (en) Satellite image recognition system and method based on self-generated features and electronic equipment
US9865061B2 (en) Constructing a 3D structure
CN112101386B (en) Text detection method, device, computer equipment and storage medium
CN111027412B (en) Human body key point identification method and device and electronic equipment
CN112396047B (en) Training sample generation method and device, computer equipment and storage medium
CN115861400B (en) Target object detection method, training device and electronic equipment
CN112037109A (en) Improved image watermarking method and system based on saliency target detection
Hu et al. Adaptive steganalysis based on selection region and combined convolutional neural networks
Chen et al. Image splicing localization using residual image and residual-based fully convolutional network
WO2021083110A1 (en) Carrier object processing and watermark embedding methods and apparatuses, and electronic device
US20220156873A1 (en) Image synthesis device and method for embedding watermark
JP7124957B2 (en) Image processing system, estimation device, processing method and program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20881801

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20881801

Country of ref document: EP

Kind code of ref document: A1