CN113496450A - Data processing method, device and equipment - Google Patents

Data processing method, device and equipment Download PDF

Info

Publication number
CN113496450A
CN113496450A CN202010203028.0A CN202010203028A CN113496450A CN 113496450 A CN113496450 A CN 113496450A CN 202010203028 A CN202010203028 A CN 202010203028A CN 113496450 A CN113496450 A CN 113496450A
Authority
CN
China
Prior art keywords
image
information
embedded
target
correction template
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010203028.0A
Other languages
Chinese (zh)
Inventor
刘永亮
牛惠冉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN202010203028.0A priority Critical patent/CN113496450A/en
Publication of CN113496450A publication Critical patent/CN113496450A/en
Pending legal-status Critical Current

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/005Robust watermarking, e.g. average attack or collusion attack resistant
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2201/00General purpose image data processing
    • G06T2201/005Image watermarking
    • G06T2201/0065Extraction of an embedded watermark; Reliable detection

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

The application discloses a data processing method, which comprises the following steps: acquiring a carrier image and acquiring information to be embedded; acquiring an original correction template corresponding to the carrier image, wherein the original correction template is used for correcting a target image when the information to be embedded in the target image is extracted, and the target image is an image embedded with the original correction template and the information to be embedded; and embedding the original correction template and the information to be embedded into the carrier image to obtain the target image. By adopting the method, the block resynchronization problem possibly encountered in the embedding process is solved, so that the embedded information in the target image can be conveniently and quickly extracted.

Description

Data processing method, device and equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method and apparatus, an electronic device, and a storage device.
Background
With the development of digital media technology and internet technology, people pay more and more attention to digital copyright protection of resources such as images and videos. At present, people usually use digital watermarking technology to realize protection of digital copyright, and digital watermarking technology mainly refers to implicit embedding of watermark information in resources such as images, videos and the like to provide copyright protection.
At present, the watermark embedding methods based on block embedding are various, and most of the watermark embedding methods based on block embedding can generally better maintain the quality of watermark images when the watermark images are obtained. However, when extracting watermark information from an image obtained by using a watermark embedding method of block embedding, it is difficult to obtain block information that is consistent with that obtained during embedding processing, and watermark information in the image cannot be accurately extracted, i.e., a block resynchronization problem; especially, when an image embedded with watermark information is transmitted in a network, the image is usually attacked by various modes such as rotation and cutting, which further increases the block resynchronization problem encountered when extracting the watermark information from the image, and further cannot conveniently and quickly extract the watermark information from the image.
In addition, when other embedded information besides watermark information is embedded into an image, the problem of block resynchronization may occur, and the embedded information in the image cannot be conveniently and quickly extracted.
Disclosure of Invention
The application provides a data processing method, which aims to solve the problem that the prior art cannot conveniently and quickly extract embedded information in an image due to block resynchronization when the embedded information is extracted from the image.
The application provides a data processing method, which comprises the following steps: acquiring a carrier image and acquiring information to be embedded; acquiring an original correction template corresponding to the carrier image, wherein the original correction template is used for correcting a target image when the information to be embedded in the target image is extracted, and the target image is an image embedded with the original correction template and the information to be embedded; and embedding the original correction template and the information to be embedded into the carrier image to obtain the target image.
Optionally, the acquiring an original correction template corresponding to the carrier image includes: acquiring a target template vector, wherein the sum of all elements of the target template vector is zero; acquiring an initial mask matrix with a preset size, wherein the preset size is not larger than the size of the carrier image; and acquiring the original correction template according to the target template vector and the initial mask matrix.
Optionally, the obtaining the target template vector includes: acquiring a binary sequence with the length not less than a preset length threshold; replacing the value 0 in the binary sequence with a value-1; and if the sum of all elements in the binary sequence is not zero, adjusting at least one element in the binary sequence to obtain an adjusted binary sequence, and constructing the target template vector by using the adjusted binary sequence, wherein the sum of all elements in the adjusted binary sequence is zero.
Optionally, the obtaining the original correction template according to the target template vector and the initial mask matrix includes obtaining the original correction template by using a preset first formula.
Optionally, the embedding the original correction template and the information to be embedded into the carrier image to obtain the target image includes: embedding the original correction template into a first channel of the carrier image; embedding the information to be embedded into a second channel of the carrier image to obtain the target image; the first channel is a channel with pixel visual sensitivity meeting a preset pixel visual sensitivity condition, and the second channel is a channel other than the first channel.
Optionally, the embedding the original correction template into the first channel of the carrier image includes: obtaining a first image corresponding to the carrier image according to pixel information in a first channel of the carrier image; scaling the first image to a preset size to obtain a first scaled image, wherein the preset size is not larger than the size of the carrier image; embedding the original correction template into the first scaled image to obtain a first to-be-embedded scaled image; zooming the first image to be embedded from the preset size to the size which is the same as the size of the carrier image to obtain a first image to be embedded; replacing pixel information in a first channel of the carrier image with pixel information in the first image to be embedded.
Optionally, the embedding the original rectification template into the first scaled image to obtain a first to-be-embedded scaled image includes: performing fast Fourier transform processing on the first scaled image to acquire a frequency spectrum matrix corresponding to the first scaled image; embedding the original correction template into the frequency domain of the frequency spectrum matrix to obtain the frequency spectrum matrix embedded into the original correction template; and performing fast Fourier inverse transformation processing on the frequency spectrum matrix embedded into the original correction template to obtain the first to-be-embedded scaled image.
Optionally, the embedding the original rectification template into the frequency domain of the spectrum matrix to obtain the spectrum matrix embedded into the original rectification template includes: obtaining magnitude spectrum information of the frequency spectrum matrix; and multiplying the original correction template by a preset embedding intensity factor, and then performing matrix addition operation on the original correction template and the amplitude spectrum information to obtain modified amplitude spectrum information.
Optionally, the performing inverse fast fourier transform processing on the frequency spectrum matrix embedded in the original correction template to obtain the first to-be-embedded scaled image includes: acquiring phase frequency information of the frequency spectrum matrix; and performing fast Fourier inverse transformation processing on the modified amplitude spectrum information and the modified phase frequency information to obtain the first image to be embedded and zoomed.
Optionally, the method further includes: acquiring an original pixel matrix for representing pixel information in a first channel of the carrier image; scaling the first scaled image from the preset size to a size same as that of the carrier image, and acquiring a scaled pixel matrix for representing pixel information in the scaled image; and performing matrix subtraction operation on the original pixel matrix and the scaling pixel matrix to obtain a first scaling residual error.
Optionally, the replacing the pixel information in the first channel of the carrier image with the pixel information in the first image to be embedded, and embedding the original rectification template in the first channel of the carrier image, includes: acquiring a pixel matrix for representing pixel information in the first image to be embedded; performing matrix addition operation on the pixel matrix and the first scaling residual error to obtain a first residual error compensation pixel matrix; replacing pixel information in a first channel of the carrier image with the first residual compensated pixel matrix.
Optionally, the embedding the information to be embedded into the second channel of the carrier image includes: obtaining a second image corresponding to the carrier image according to the pixel information in the second channel of the carrier image; scaling the second image to a preset size to obtain a second scaled image, wherein the preset size is not larger than the size of the carrier image; embedding the information to be embedded into the second zoomed image to obtain a second zoomed image to be embedded; zooming the second image to be embedded to the size which is the same as the size of the carrier image from the preset size to obtain a second image to be embedded; replacing pixel information in a second channel of the carrier image with pixel information in the second image to be embedded.
Optionally, the embedding the information to be embedded into the second zoomed image to obtain a second zoomed image to be embedded includes: performing initial identification information splicing processing on the information to be embedded to obtain spliced information to be embedded; and embedding the spliced information to be embedded into the second zoomed image to obtain a second zoomed image to be embedded.
Optionally, the performing initial identification information splicing processing on the information to be embedded to obtain spliced information to be embedded includes: acquiring embedding start information indicating embedding start position information; and acquiring spliced information to be embedded before splicing the embedded initial information to the information to be embedded.
Optionally, before the splicing the embedding start information to the information to be embedded, acquiring the spliced information to be embedded, including: acquiring the binary sequence of the embedded initial information and acquiring the binary sequence of the information to be embedded; and splicing the binary sequence of the embedded initial information to the binary sequence of the information to be embedded to obtain the spliced information to be embedded.
Optionally, the embedding the spliced information to be embedded into the second zoomed image to obtain a second zoomed image to be embedded includes: and embedding the spliced information to be embedded into the second zoomed image by a block embedding method to obtain the second zoomed image to be embedded.
Optionally, the method further includes: acquiring an original pixel matrix for representing pixel information in a second channel of the carrier image; scaling the second scaled image from the preset size to a size same as that of the carrier image, and acquiring a scaled pixel matrix for representing pixel information in the scaled image; and performing matrix subtraction operation on the original pixel matrix and the scaling pixel matrix to obtain a second scaling residual error.
Optionally, the replacing the pixel information in the second channel of the carrier image with the pixel information in the second image to be embedded, and embedding the information to be embedded in the second channel of the carrier image, includes: acquiring a pixel matrix for representing pixel information in the second image to be embedded; performing matrix addition operation on the pixel matrix and the second scaling residual error to obtain a second residual error compensation pixel matrix; replacing pixel information in a second channel of the carrier image with the second residual compensated pixel matrix.
Optionally, the first channel is a B channel in an RGB color channel of the carrier image, and the second channel is a G channel in the RGB color channel of the carrier image.
The present application also provides another data processing method, including: acquiring an image to be detected; acquiring a target matching correction template embedded in the image to be detected, wherein the target matching correction template is used for correcting the image to be detected when target embedding information in the image to be detected is extracted, and the target matching correction template and an original correction template used when the target embedding information is embedded in the image to be detected meet a preset matching condition; correcting the image to be detected by using the target matching correction template to obtain a corrected image to be detected; and acquiring the target embedded information from the corrected image to be detected.
Optionally, the obtaining of the target matching correction template embedded in the image to be detected includes: and acquiring the target matching correction template from a first channel of the image to be detected, wherein the first channel is a channel in which the visual sensitivity of the contained pixels meets a preset visual sensitivity condition.
Optionally, the obtaining the target matching correction template from the first channel of the image to be detected includes: obtaining a first image corresponding to the image to be detected according to pixel information in a first channel of the image to be detected; scaling the first image to a preset size to obtain a first scaled image, wherein the preset size is not larger than the size of the image to be detected; and acquiring the target matching correction template from the first zooming image.
Optionally, the obtaining the target matching correction template from the first zoomed image includes: performing fast Fourier transform processing on the first scaled image to acquire a frequency spectrum matrix corresponding to the first scaled image; and acquiring the target matching correction template according to the frequency spectrum matrix.
Optionally, the obtaining the target matching correction template according to the spectrum matrix includes: acquiring a correction template to be determined and a spectrum vector to be determined corresponding to the correction template to be determined according to the spectrum matrix; and determining the target matching correction template from the to-be-determined correction template and the to-be-determined frequency spectrum vector.
Optionally, the method includes: according to the spectrum matrix, acquiring the correction template to be determined and the spectrum vector to be determined corresponding to the correction template to be determined by using the following steps: acquiring an initial spectrum vector; and obtaining the to-be-determined correction template from the spectrum matrix by using a preset second formula, and updating the initial spectrum vector according to the obtained to-be-determined correction template to obtain the to-be-determined spectrum vector corresponding to the to-be-determined correction template.
Optionally, the method further includes: and adjusting the radius value of the correction template in the preset second formula and the offset angle value of the image to be detected in the preset second formula, executing the step set again, and acquiring the correction template to be determined and the frequency spectrum vector to be determined corresponding to different radius values and different offset angle values.
Optionally, the determining the target matching correction template from the to-be-determined correction template and the to-be-determined spectrum vector includes: acquiring a target template vector, wherein the target template vector is used for acquiring the vector of the original correction template when the original correction template is embedded into the image to be detected; and determining the target matching correction template from the correction template to be determined and the frequency spectrum vector to be determined according to the target template vector.
Optionally, the determining the target matching correction template from the to-be-determined correction template and the to-be-determined spectrum vector according to the target template vector includes: obtaining a first to-be-determined frequency spectrum vector from the to-be-determined frequency spectrum vector; calculating the covariance of the target template vector and the first to-be-determined frequency spectrum vector to obtain covariance information; and judging whether the to-be-determined correction template corresponding to the first to-be-determined frequency spectrum vector and the original correction template meet the preset matching condition or not according to the covariance information so as to determine the target matching correction template.
Optionally, the method includes: and acquiring a maximum value in the covariance information, and taking a to-be-determined correction template corresponding to the first to-be-determined frequency spectrum vector corresponding to the maximum value as the target correction template.
Optionally, the using the target matching correction template to correct the image to be detected includes: acquiring a value of a bias angle of the image to be detected under rotational attack according to the target matching correction template, and performing rotational correction on the image to be detected; and acquiring the original size of the image to be detected according to the target matching correction template, and cutting and correcting the image to be detected.
Optionally, the obtaining, according to the target matching correction template, a value of an offset angle of the image to be detected under rotational attack, and performing rotational correction on the image to be detected includes: taking the value of the offset angle of the image to be detected corresponding to the target matching correction template as the value of the offset angle of the image to be detected under the rotary attack; and according to the value of the offset angle of the image to be detected under the rotation attack, carrying out reverse rotation on the image to be detected so as to carry out rotation correction on the image to be detected.
Optionally, the obtaining, according to the target matching correction template, an original size of the image to be detected, and performing cutting correction on the image to be detected includes: and acquiring the original size of the image to be detected according to the radius value of the target matching correction template and the radius value of the original correction template, and cutting and correcting the image to be detected.
Optionally, the obtaining the original size of the image to be detected according to the radius value of the target matching correction template and the radius value of the original correction template includes: and dividing the radius value of the original correction template by the radius value of the target matching correction template, and multiplying the divided value by the row number value of the preset size to obtain the original size of the image to be detected.
Optionally, the obtaining the target embedding information from the corrected image to be detected includes: and acquiring the target embedded information from the corrected image to be detected by using a block extraction method.
Optionally, if the target embedding information does not include embedding start information, where the embedding start information is used to indicate an embedding start position of the target embedding information, the method further includes: and removing one column or one row from the left side or the upper side of the corrected image to be detected, and acquiring the target embedded information from the corrected image to be detected by using a block extraction method again.
The present application also provides a data processing apparatus, comprising: the information acquisition unit is used for acquiring a carrier image and acquiring information to be embedded; a template obtaining unit, configured to obtain an original correction template corresponding to the carrier image, where the original correction template is used to correct a target image when extracting the information to be embedded, where the target image is an image in which the original correction template and the information to be embedded are embedded; and the information embedding unit is used for embedding the original correction template and the information to be embedded into the carrier image to obtain the target image.
The present application further provides an electronic device, comprising:
a processor;
a memory for storing a program of a data processing method, the apparatus performing the following steps after being powered on and running the program of the data processing method by the processor:
acquiring a carrier image and acquiring information to be embedded; acquiring an original correction template corresponding to the carrier image, wherein the original correction template is used for correcting a target image when the information to be embedded in the target image is extracted, and the target image is an image embedded with the original correction template and the information to be embedded; and embedding the original correction template and the information to be embedded into the carrier image to obtain the target image.
The present application also provides a storage device storing a program of a data processing method, the program being executed by a processor to perform the steps of:
acquiring a carrier image and acquiring information to be embedded; acquiring an original correction template corresponding to the carrier image, wherein the original correction template is used for correcting a target image when the information to be embedded in the target image is extracted, and the target image is an image embedded with the original correction template and the information to be embedded; and embedding the original correction template and the information to be embedded into the carrier image to obtain the target image.
The present application also provides another data processing apparatus, comprising: the image acquisition unit is used for acquiring an image to be detected; the template acquisition unit is used for acquiring a target matching correction template embedded in the image to be detected, wherein the target matching correction template is used for correcting the image to be detected when target embedding information in the image to be detected is extracted, and the target matching correction template and an original correction template used when the target embedding information is embedded in the image to be detected meet a preset matching condition; the image restoration unit is used for correcting the image to be detected by using the target matching correction template to obtain a corrected image to be detected; and the information extraction unit is used for acquiring target embedded information from the corrected image to be detected.
The present application also provides another electronic device, comprising:
a processor;
a memory for storing a program of a data processing method, the apparatus performing the following steps after being powered on and running the program of the data processing method by the processor:
acquiring an image to be detected; acquiring a target matching correction template embedded in the image to be detected, wherein the target matching correction template is used for correcting the image to be detected when target embedding information in the image to be detected is extracted, and the target matching correction template and an original correction template used when the target embedding information is embedded in the image to be detected meet a preset matching condition; correcting the image to be detected by using the target matching correction template to obtain a corrected image to be detected; and acquiring target embedded information from the corrected image to be detected.
The present application also provides another storage device storing a program of a data processing method, the program being executed by a processor to perform the steps of:
acquiring an image to be detected; acquiring a target matching correction template embedded in the image to be detected, wherein the target matching correction template is used for correcting the image to be detected when target embedding information in the image to be detected is extracted, and the target matching correction template and an original correction template used when the target embedding information is embedded in the image to be detected meet a preset matching condition; correcting the image to be detected by using the target matching correction template to obtain a corrected image to be detected; and acquiring target embedded information from the corrected image to be detected.
Compared with the prior art, the method has the following advantages:
the application provides a data processing method, which comprises the following steps: acquiring a carrier image and acquiring information to be embedded; acquiring an original correction template corresponding to the carrier image, wherein the original correction template is used for correcting a target image when the information to be embedded in the target image is extracted, and the target image is an image embedded with the original correction template and the information to be embedded; and embedding the original correction template and the information to be embedded into the carrier image to obtain the target image. When the information to be embedded is embedded into the carrier image, the method acquires the original correction template which corresponds to the carrier image and is used for correcting the target image when the information to be embedded is extracted from the target image, and embeds the original correction template and the information to be embedded into the carrier image to obtain the target image, so that when the embedded information to be embedded is extracted from the target image, the target image can be corrected through the original correction template to solve the problem of block resynchronization which is possibly encountered, and the information embedded into the target image can be conveniently and quickly extracted.
The present application further provides a data processing method, including: acquiring an image to be detected; acquiring a target matching correction template embedded in the image to be detected, wherein the target matching correction template is used for correcting the image to be detected when target embedding information in the image to be detected is extracted, and the target matching correction template and an original correction template used when the target embedding information is embedded in the image to be detected meet a preset matching condition; correcting the image to be detected by using the target matching correction template to obtain a corrected image to be detected; and acquiring target embedding information embedded into the image to be detected from the corrected image to be detected. According to the method, after the image to be detected is obtained, the target matching correction template meeting the preset matching condition with the original correction template used when the target embedding information is embedded into the image to be detected is extracted from the image to be detected, and the image to be detected is corrected according to the target matching correction template, so that the problem of block resynchronization possibly encountered is solved, and the target embedding information in the image to be detected can be conveniently and quickly extracted.
Drawings
Fig. 1A is a schematic diagram of an application scenario of a data processing method provided in the present application.
Fig. 1B is a schematic diagram of an application scenario of another data processing method provided in the present application.
Fig. 2 is a flowchart of a data processing method according to a first embodiment of the present application.
Fig. 3 is a flowchart of another data processing method according to a second embodiment of the present application.
Fig. 4 is a schematic diagram of a data processing apparatus according to a third embodiment of the present application.
Fig. 5 is a schematic diagram of an electronic device according to a fourth embodiment of the present application.
Fig. 6 is a schematic diagram of another data processing apparatus according to a sixth embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
In order to show the present application more clearly, the application scenarios of the two data processing methods in the present application are briefly introduced first.
The two data processing methods in the present application may be applied to a scenario in which a client interacts with a server, as shown in fig. 1A and fig. 1B, which are respectively a schematic diagram of an application scenario of one data processing method provided in the present application and a schematic diagram of an application scenario of another data processing method provided in the present application. When information to be embedded is required to be embedded into a carrier image, a client firstly establishes connection with a server, the client sends the carrier image and the information to be embedded to the server after connection, and the server receives the carrier image and the information to be embedded and then obtains an original correction template corresponding to the carrier image, wherein the original correction template is used for correcting a target image when the information to be embedded which is embedded into the target image is extracted; after the server side obtains an original correction template corresponding to the carrier image, embedding the original correction template and the information to be embedded into the carrier image, so as to obtain a target image embedded with the original correction template and the information to be embedded, and then providing the target image for the client side by the server side; the client then receives the target image with the embedded original correction template and information to be embedded. When embedded target embedded information needs to be extracted from an image to be detected, wherein the image to be detected is an image corresponding to the target image, the image to be detected may be attacked in various manners such as rotation and cutting when the image to be detected is propagated in a network, in order to solve the problem of possible distribution resynchronization when the target embedded information is extracted from the image to be detected, after the client obtains the image to be detected, the client first establishes connection with the server, after the connection, the client sends the obtained image to be detected to the server, and after the server receives the image to be detected, the server obtains a target matching correction template from the image to be detected, wherein the target matching correction template is used for correcting the image to be detected when the target embedded information in the image to be detected is extracted, and the target matching correction template and an original correction template used when the target embedded information is embedded into the image to be detected meet preset matching conditions (ii) a Then, the server side corrects the image to be detected by using the target matching correction template to obtain the corrected image to be detected; and then, acquiring target embedded information from the corrected image to be detected, and providing the target embedded information to the client.
It should be noted that the client may be a mobile terminal device, such as a mobile phone, a tablet computer, or a commonly used computer device; the server is generally a server, and the server may be a locally deployed physical server or a cloud server.
In addition, in specific implementation, the method provided in the first embodiment of the present application may also be applied to a client, a server, or an interaction between a server and a server.
For example, after obtaining a carrier image and information to be embedded, a client directly obtains an original correction template corresponding to the carrier image, and embeds the original correction template and the information to be embedded into the carrier image to obtain a target image; when a client needs to acquire target embedded information from an image to be detected, a target matching correction template is directly acquired from the image to be detected, the image to be detected is corrected according to the target matching correction template, and then the target embedded information is extracted from the corrected image to be detected. The above application scenario is only one specific embodiment of the two data processing methods described in the present application, and is provided for facilitating understanding of the two data processing methods provided in the present application, and is not intended to limit the two data processing methods provided in the present application.
A first embodiment of the present application provides a data processing method, which is described below with reference to fig. 2.
As shown in fig. 2, in step S201, a carrier image is acquired, and information to be embedded is acquired.
The carrier image is a carrier for carrying information to be embedded, and may be an image, or a certain video frame in a video resource, where the image may be a dynamic image or a static image, for example, the image may be a dynamic image in a gif (graphics Interchange format) format, or may also be a static image in a jpeg (joint Photographic Experts group) format. In addition, the video resource may be an entity video file, for example, the video resource is a video file stored in a remote server for local downloading and playing; the streaming media can also be in a streaming media (streaming media) form, for example, a video stream which is provided by a video resource for an online video-on-demand platform or an online live platform and can be directly streamed; in addition, the video resource may be a video resource in the form of AR, VR, or the like, or a stereoscopic video resource, and of course, as the technology is continuously advanced, the video resource may also be a resource in other formats and other forms related to the video, and is not limited specifically here.
The information to be embedded refers to extra information added in the carrier image. The information to be embedded may be a digital watermark, or may be other kinds of hidden information, for example, information such as company LOGO, contract document scan, and the like.
As shown in fig. 2, in step S202, an original correction template corresponding to the carrier image is obtained, where the original correction template is used to correct a target image when extracting the information to be embedded in the target image, and the target image is an image in which the original correction template and the information to be embedded are embedded.
The original correction template is used for correcting the target image when the embedded information to be embedded is extracted from the target image obtained by the method of the first embodiment of the present application, and the original correction template is specifically a matrix corresponding to the carrier image, and effective values in the matrix form a dot matrix in the carrier image, wherein the size of the matrix is a preset size, and the preset size corresponds to the size of the carrier image and is not larger than the size of the carrier image. In the first embodiment of the present application, unless otherwise specified, the predetermined size is specifically 1024 × 1024, and the unit is the basic cell width in the matrix, that is, 1024 basic cell widths × 1024 basic cell widths; it should be noted that, since the original correction template is specifically a matrix, in the first embodiment of the present application, unless otherwise specified, the unit of the preset size related to the template and the unit of the radius related to the template in the subsequent processing are specifically the basic cell width in the corresponding matrix, for example, the distance between the element (1, 1) and the element (1, 3) in the matrix is 2, that is, 2 basic cell widths, and the distance between the element (1, 1) and the element (2, 2) is 1.414, that is, 1.414 basic cell widths. Of course, in specific implementations, the preset size may be set to other sizes, and the following describes how to obtain the original correction template in detail.
The acquiring of the original correction template corresponding to the carrier image includes: acquiring a target template vector, wherein the sum of all elements of the target template vector is zero; acquiring an initial mask matrix with a preset size, wherein the preset size is not larger than the size of the carrier image; and acquiring the original correction template according to the target template vector and the initial mask matrix.
The obtaining of the target template vector includes: acquiring a binary sequence with the length not less than a preset length threshold; replacing the value 0 in the binary sequence with a value-1; and if the sum of all elements in the binary sequence is not zero, adjusting at least one element in the binary sequence to obtain an adjusted binary sequence, and constructing the target template vector by using the adjusted binary sequence, wherein the sum of all elements in the adjusted binary sequence is zero.
The target template vector is used to generate an original correction template, which is a binary vector, and in the first embodiment of the present application, the target template vector is composed of two values, 1 and-1, and the sum of all elements of the target template vector is zero. It should be noted that, for convenience in use, the target template vector may be all images, that is, all the carrier images share one vector; of course, in view of security, that is, in order to improve the concealment of the finally obtained target image, each carrier image may also correspond to one target template vector, for example, user identity information may be added to the target template vector, such as generating the target template vector according to user account information. In particular implementation, after obtaining the target template vector, in order to be able to conveniently extract the target template vector from the target image embedded with information, or extracting embedded information from the image to be detected corresponding to the target image which is subject to an attack such as rotation or cropping, the correspondence between the target template vector and the target image may be established, and stored, and during the extraction process, obtaining the target template vector according to the corresponding relation, obtaining a matching vector similar to the target template vector from the target image or the image to be detected according to the target template vector, further determining a target correction template matched with the original correction template in the target image or the image to be detected according to the matching vector, and correcting the target image or the image to be detected according to the target correction template, and further acquiring embedded information from the corrected target image or the image to be detected.
The initial mask matrix is a matrix formed by values having different initial values from those in the target template vector, and the size of the initial mask matrix may be the predetermined size, such as 1024 × 1024.
In the first embodiment of the present application, the preset length threshold is 10 for example, a binary sequence [ 0111000100 ] with a length of 10 is obtained, and then the value 0 in the binary sequence is replaced with the value-1, namely [ -1111-1-1-11-1-1 ], since the sum of all elements of the binary sequence is not zero, the value of at least one bit in the binary sequence can be adjusted, e.g., the last bit is adjusted to 1, so that the sum of all elements of the binary sequence is zero, i.e. the obtained adjusted binary sequence is [ -1111-1-1-11-11 ], and then the target template vector is constructed with the binary sequence, i.e. the target template vector is [ -1111-1-1-11-11 ]. It should be noted that, in specific implementation, the preset length threshold may also be set to other values, which are not described herein again.
After obtaining the target template vector and the initial mask matrix, obtaining the original correction template by using a preset first formula, wherein the preset first formula is as follows:
Figure BDA0002420014900000121
and M [ x ]i,yi]=V[i];
Setting an initial mask matrix as M, setting the target template vector as V, setting the preset size as M '. times.n', setting the length of the target template vector as L, setting the radius of the original correction template as r, and setting xiFor row values, y, of point values in the original correction mask in the initial mask matrixiFor column values of point values in the original correction template in the initial mask matrix, i ∈ [0,1,2.. L-1 ]]M '> 0, n' > 0, L > 0, r is not less than a preset minimum radius threshold and not more than a preset maximum radius threshold.
It should be noted that, in the first embodiment of the present application, the radius of the original correction template ranges from 160 to 190 basic cell widths, that is, the preset minimum radius threshold is 160 basic cell widths, and the preset maximum radius threshold is 190 basic cell widths, so that the setting is such that, in the first embodiment of the present application, specifically, the original correction template is embedded into the frequency domain of the carrier image, that is, into the frequency domain of the spectral matrix obtained by performing fast fourier transform on the carrier image, and when the radius is small, the embedding position of the correction template in the carrier image is close to the spectral center of the spectral matrix, which is equivalent to adding low-frequency noise to the carrier image, at this time, the compression resistance of the finally obtained target image is high but is easily recognized by human eyes; when the radius is larger, the embedding position of the original correction template in the carrier image is far away from the center of the frequency spectrum matrix, which is equivalent to adding high-frequency noise to the carrier image, which is not easily recognized by human eyes, but the finally obtained target image has low compression resistance and is easily damaged by an image compression algorithm, so that when the original correction template is embedded, the original correction template needs to be embedded in the intermediate frequency region of the frequency spectrum matrix. It should be noted that, with the continuous development of the technology, in the specific implementation, the value of the radius of the original correction template may also be set to be other value ranges according to the actual needs, and details are not described here.
As shown in fig. 2, in step S203, the original correction template and the information to be embedded are embedded into the carrier image, and the target image is obtained.
After the original correction template is acquired in step S202, the original correction template and the information to be embedded are embedded in the carrier image, and the target image can be acquired.
Since the data size of the original correction template is much larger than the data size of the information to be embedded, in order to improve the quality of the obtained target image when the original correction template is embedded in the carrier image, a first embodiment of the present application provides a method for embedding the correction template and the information to be embedded in the carrier image to improve the quality of the obtained target image, where the method specifically includes: embedding the original correction template into a first channel of the carrier image; embedding the information to be embedded into a second channel of the carrier image to obtain the target image; the first channel is a channel with pixel visual sensitivity meeting a preset pixel visual sensitivity condition, and the second channel is a channel other than the first channel.
That is, in order to improve the quality of the obtained target image, in the first embodiment of the present application, the original correction template is embedded into the channel of the carrier image, where the pixel visual sensitivity of the carrier image meets the preset pixel visual sensitivity condition, so as to avoid the problem of poor quality of the target image caused by the embedding of the original correction template; meanwhile, in order to avoid the influence of the original correction template on the information to be embedded, in the first embodiment of the present application, the information to be embedded is embedded into a channel other than the first channel of the carrier image, so that two types of information are independently embedded into different channels of the carrier image, and the interference caused by two different types of information during information extraction is avoided.
In the first embodiment of the present application, the first channel is a B channel in the RGB color channels of the carrier image, and the second channel is a G channel in the RGB color channels of the carrier image, and since the description of the RGB color channels of the image is related to the prior art, details thereof are not repeated herein.
Said embedding said original corrective template into a first pass of said carrier image, comprising: obtaining a first image corresponding to the carrier image according to pixel information in a first channel of the carrier image; scaling the first image to a preset size to obtain a first scaled image, wherein the preset size is not larger than the size of the carrier image; embedding the original correction template into the first scaled image to obtain a first to-be-embedded scaled image; zooming the first image to be embedded from the preset size to the size which is the same as the size of the carrier image to obtain a first image to be embedded; replacing pixel information in a first channel of the carrier image with pixel information in the first image to be embedded.
It should be noted that the reason why the original rectification template is embedded into the first scaled image is to reduce the block resynchronization problem that may be encountered when extracting the embedded information in the target image after the target image is subjected to the selection and cropping attacks to the greatest extent possible.
The embedding the original rectification template into the first scaled image to obtain a first to-be-embedded scaled image includes: performing fast Fourier transform processing on the first scaled image to acquire a frequency spectrum matrix corresponding to the first scaled image; embedding the original correction template into the frequency domain of the frequency spectrum matrix to obtain the frequency spectrum matrix embedded into the original correction template; and performing fast Fourier inverse transformation processing on the frequency spectrum matrix embedded into the original correction template to obtain the first to-be-embedded scaled image.
Namely, the original correcting template is embedded into the frequency domain of the frequency spectrum matrix by utilizing the characteristic that the frequency spectrum matrix obtained by Fourier transform processing has translation and no deformation, rather than in the spatial domain of the spectral matrix, so that a central point for locating embedded information in the image can be obtained in the target image quickly from the original correction template, wherein, the spectrum matrix obtained by Fourier transform has the characteristic of no translation deformation, which means that the central position of the amplitude frequency of the spectrum matrix is relatively stable, it is usually only relevant whether a signal of a certain frequency is contained in the image, but not where in the image the signal is, and therefore, the embedding center of an original correction template embedded in the frequency spectrum matrix obtained through Fourier transform processing and the position of a point value are stable, and the original correction template can be easily detected to be used for correcting a target image.
The embedding the original correction template into the frequency domain of the spectrum matrix to obtain the spectrum matrix embedded into the original correction template includes: obtaining magnitude spectrum information of the frequency spectrum matrix; and multiplying the original correction template by a preset embedding intensity factor, and then performing matrix addition operation on the original correction template and the amplitude spectrum information to obtain modified amplitude spectrum information.
The performing inverse fast fourier transform processing on the frequency spectrum matrix embedded into the original correction template to obtain the first to-be-embedded scaled image includes: acquiring phase frequency information of the frequency spectrum matrix; and performing fast Fourier inverse transformation processing on the modified amplitude spectrum information and the modified phase frequency information to obtain the first image to be embedded and zoomed.
In addition, in order to improve the quality of the finally obtained target image, after the first scaled image is obtained, a residual value of an image formed by the first scaled image and the pixel information in the first channel of the carrier image may be calculated, so that when the first to-be-embedded image is used to replace the pixel information in the first channel of the carrier image, the first to-be-embedded image is used to perform image compensation on the first to-be-embedded image, and the first to-be-embedded image subjected to image compensation is used to replace the pixel information in the first channel of the carrier image, which specifically includes: acquiring an original pixel matrix for representing pixel information in a first channel of the carrier image; scaling the first scaled image from the preset size to a size same as that of the carrier image, and acquiring a scaled pixel matrix for representing pixel information in the scaled image; and performing matrix subtraction operation on the original pixel matrix and the scaling pixel matrix to obtain a first scaling residual error.
Furthermore, embedding the original rectification template into the first channel of the carrier image, in replacing the pixel information in the first channel of the carrier image with the pixel information in the first image to be embedded, comprises: acquiring a pixel matrix for representing pixel information in the first image to be embedded; performing matrix addition operation on the pixel matrix and the first scaling residual error to obtain a first residual error compensation pixel matrix; replacing pixel information in a first channel of the carrier image with the first residual compensated pixel matrix.
It should be noted that, as detailed description is given in the prior art, details of how to perform fast fourier transform processing on an image to obtain a spectrum matrix corresponding to the image, and how to perform inverse fast fourier transform processing on the spectrum matrix to obtain an image corresponding to the spectrum matrix are not repeated here.
The embedding strength factor is preset to indicate the modification degree of the embedded information, such as the original correction template or the information to be embedded, to the carrier image.
After embedding the original correction template into the carrier image, the information to be embedded may be embedded into the carrier image, e.g. into the second channel of the carrier image, using a block embedding method.
The embedding the information to be embedded into the second channel of the carrier image comprises: obtaining a second image corresponding to the carrier image according to the pixel information in the second channel of the carrier image; scaling the second image to a preset size to obtain a second scaled image, wherein the preset size is not larger than the size of the carrier image; embedding the information to be embedded into the second zoomed image to obtain a second zoomed image to be embedded; zooming the second image to be embedded to the size which is the same as the size of the carrier image from the preset size to obtain a second image to be embedded; replacing pixel information in a second channel of the carrier image with pixel information in the second image to be embedded.
The embedding the information to be embedded into the second zoomed image to obtain a second zoomed image to be embedded comprises: performing initial identification information splicing processing on the information to be embedded to obtain spliced information to be embedded; and embedding the spliced information to be embedded into the second zoomed image to obtain a second zoomed image to be embedded.
The initial identification information splicing processing is carried out on the information to be embedded, and the spliced information to be embedded is obtained, and the method comprises the following steps: acquiring embedding start information indicating embedding start position information; and acquiring spliced information to be embedded before splicing the embedded initial information to the information to be embedded.
The acquiring the spliced information to be embedded before splicing the embedded initial information to the information to be embedded includes: acquiring the binary sequence of the embedded initial information and acquiring the binary sequence of the information to be embedded; and splicing the binary sequence of the embedded initial information to the binary sequence of the information to be embedded to obtain the spliced information to be embedded.
The embedding the spliced information to be embedded into the second zoomed image to obtain a second zoomed image to be embedded comprises: and embedding the spliced information to be embedded into the second zoomed image by a block embedding method to obtain the second zoomed image to be embedded.
In the first embodiment of the present application, the spliced information to be embedded is embedded into the second scaled image by using a Discrete Cosine Transform (DCT) energy difference method, so as to obtain the second scaled image to be embedded.
For example, extracting pixel information in a G channel of an RGB color channel of the carrier image, obtaining a second image corresponding to the carrier image, and then scaling the second image to 1024 × 1024 size, obtaining a second scaled image; acquiring embedding start information, wherein if the embedding start information is a custom sequence '1111111111', splicing the custom sequence to the front of a binary sequence of information to be embedded, and if the information to be embedded is '0101101110', splicing the information to be embedded into the binary sequence to be '11111111110101101110'; then, dividing the second zooming image into 8 × 8 small blocks, performing DCT (discrete cosine transformation) transformation on each small block, and selecting the DCT coefficient of the block positioned in the intermediate frequency region in each block as the energy value of the small block; then, dividing every two small blocks into a group, comparing the energy values corresponding to the two small blocks, representing 1 by the small block with large energy, and representing 0 by the small block with small energy, so as to embed the spliced information to be embedded into a second zoomed image and obtain a second zoomed image to be embedded; then, performing IDCT transformation on each 8 × 8 small block of the second scaled image to be embedded, scaling the second scaled image to be embedded from 1024 × 1024 size to the size same as that of the carrier image, and obtaining a second image to be embedded; the pixel information in the second channel of the carrier image is then replaced with the pixel information in the second image to be embedded, i.e. the information to be embedded can be embedded in the G channel of the carrier image.
It should be noted that, in specific implementation, other block embedding methods may also be used to embed the information to be embedded into the carrier image, for example, a block histogram embedding method, a method of performing block embedding after performing N-order wavelet transform on the carrier image, a method of performing SVD decomposition on the carrier image after performing N-order wavelet transform or performing block embedding after performing DCT transform on the carrier image, and a method of performing DCT transform embedding on the carrier image blocks, which are not described herein again.
In addition, in order to further improve the quality of the finally obtained target image, when the information to be embedded is embedded in the second scaled image, after the second scaled image is obtained, a residual value of an image formed by the second scaled image and the pixel information in the second channel of the carrier image may also be calculated, so that when the second image to be embedded is used to replace the pixel information in the second channel of the carrier image, the image compensation is performed on the second image to be embedded by using the residual value, and the image compensated second image to be embedded is used to replace the pixel information in the second channel of the carrier image, which specifically includes: acquiring an original pixel matrix for representing pixel information in a second channel of the carrier image; scaling the second scaled image from the preset size to a size same as that of the carrier image, and acquiring a scaled pixel matrix for representing pixel information in the scaled image; and performing matrix subtraction operation on the original pixel matrix and the scaling pixel matrix to obtain a second scaling residual error.
The replacing pixel information in a second channel of the carrier image with pixel information in the second image to be embedded, the embedding the information to be embedded in the second channel of the carrier image, comprising: acquiring a pixel matrix for representing pixel information in the second image to be embedded; performing matrix addition operation on the pixel matrix and the second scaling residual error to obtain a second residual error compensation pixel matrix; replacing pixel information in a second channel of the carrier image with the second residual compensated pixel matrix.
In summary, the method provided in the first embodiment of the present application includes: acquiring a carrier image and acquiring information to be embedded; acquiring an original correction template corresponding to the carrier image, wherein the original correction template is used for correcting a target image when the information to be embedded in the target image is extracted, and the target image is an image embedded with the original correction template and the information to be embedded; and embedding the original correction template and the information to be embedded into the carrier image to obtain the target image. When the information to be embedded is embedded into the carrier image, the method acquires the original correction template which corresponds to the carrier image and is used for correcting the target image when the information to be embedded is extracted from the target image, and embeds the original correction template and the information to be embedded into the carrier image to obtain the target image, so that when the embedded information to be embedded is extracted from the target image, the target image can be corrected through the original correction template to solve the problem of block resynchronization which is possibly encountered, and the information embedded into the target image can be conveniently and quickly extracted.
The first embodiment of the present application describes a process for embedding information to be embedded into a carrier image, and a second embodiment of the present application, corresponding to the first embodiment of the present application, is a process for extracting embedded information from an image to be detected.
A second embodiment of the present application provides a data processing method, which is described below with reference to fig. 3.
As shown in fig. 3, in step S301, an image to be detected is acquired.
As shown in fig. 3, in step S302, a target matching correction template embedded in the image to be detected is obtained, where the target matching correction template is used to correct the image to be detected when extracting target embedding information in the image to be detected, and the target matching correction template and an original correction template used when embedding the target embedding information in the image to be detected satisfy a preset matching condition.
As shown in fig. 3, in step S303, the target matching correction template is used to correct the image to be detected, and a corrected image to be detected is obtained.
As shown in fig. 3, in step S304, the target embedding information is acquired from the corrected image to be detected.
The acquisition of the target matching correction template embedded in the image to be detected comprises the following steps: and acquiring the target matching correction template from a first channel of the image to be detected, wherein the first channel is a channel with pixel visual sensitivity meeting a preset pixel visual sensitivity condition.
The following in the first passageway of waiting to detect the image, acquire the target matches and corrects the template, include: obtaining a first image corresponding to the image to be detected according to pixel information in a first channel of the image to be detected; scaling the first image to a preset size to obtain a first scaled image, wherein the preset size is not larger than the size of the image to be detected; and acquiring the target matching correction template from the first zooming image.
The obtaining the target matching correction template from the first scaled image includes: performing fast Fourier transform processing on the first scaled image to acquire a frequency spectrum matrix corresponding to the first scaled image; and acquiring the target matching correction template according to the frequency spectrum matrix.
The obtaining the target matching correction template according to the frequency spectrum matrix includes: acquiring a correction template to be determined and a spectrum vector to be determined corresponding to the correction template to be determined according to the spectrum matrix; and determining the target matching correction template from the to-be-determined correction template and the to-be-determined frequency spectrum vector.
Wherein, this application second embodiment still includes: according to the spectrum matrix, acquiring the correction template to be determined and the spectrum vector to be determined corresponding to the correction template to be determined by using the following steps: acquiring an initial spectrum vector; obtaining the to-be-determined correction template from the spectrum matrix by using a preset second formula, and updating the initial spectrum vector according to the obtained to-be-determined correction template to obtain a to-be-determined spectrum vector corresponding to the to-be-determined correction template, where the preset second formula specifically is:
Figure BDA0002420014900000191
W[i]=S[xi,yi];
setting the spectrum matrix as S, the initial spectrum vector as W, the to-be-determined spectrum vector as W ', the preset size as m '. times.n ', the length of the initial spectrum vector as L, and the radius of the to-be-determined correction template as r and xiNumber of rows, y, in the spectrum matrix for point values in the correction template to be determinediFor the column number of the point values in the correction template to be determined in the frequency spectrum matrix, theta is used for representing the offset angle of the image to be detected, i belongs to [0,1,2.. L-1 ]]M ' > 0, n ' > 0, L > 0, r is not less than a preset minimum extraction radius threshold value and not more than a preset maximum extraction radius threshold value, and r ' sThe initial value is the preset minimum extraction radius threshold value, theta is not smaller than the preset minimum offset angle threshold value and not larger than the preset maximum offset angle threshold value, and the initial value of theta is the preset minimum offset angle threshold value.
In addition, the second embodiment of the present application may further include: and adjusting the radius value of the correction template in the preset second formula and the offset angle value of the image to be detected in the preset second formula, and executing the step set again to obtain the correction template to be determined and the frequency spectrum vector to be determined corresponding to different radius values and different offset angle values, wherein the minimum extraction radius threshold is 130 basic cell widths, and the preset maximum extraction radius threshold is 160 basic cell widths. It should be noted that the description about the unit of radius is described in detail in the first embodiment of the present application, and is not repeated herein.
The determining the target matching correction template from the correction template to be determined and the spectrum vector to be determined includes: acquiring a target template vector, wherein the target template vector is used for acquiring the vector of the original correction template when the original correction template is embedded into the image to be detected; and determining the target matching correction template from the correction template to be determined and the frequency spectrum vector to be determined according to the target template vector.
The determining the target matching correction template from the correction template to be determined and the spectrum vector to be determined according to the target template vector comprises: obtaining a first to-be-determined frequency spectrum vector from the to-be-determined frequency spectrum vector; calculating the covariance of the target template vector and the first to-be-determined frequency spectrum vector to obtain covariance information; and judging whether the to-be-determined correction template corresponding to the first to-be-determined frequency spectrum vector and the original correction template meet the preset matching condition or not according to the covariance information so as to determine the target matching correction template.
The determining, according to the covariance information, whether the to-be-determined correction template corresponding to the first to-be-determined spectrum vector and the original correction template satisfy the preset matching condition to determine the target matching correction template includes: and acquiring a maximum value in the covariance information, and taking a to-be-determined correction template corresponding to the first to-be-determined frequency spectrum vector corresponding to the maximum value as the target matching correction template. The preset matching conditions are as follows: and the to-be-determined correction template corresponding to the to-be-determined spectrum vector with the maximum covariance between the to-be-determined spectrum vector and the target template vector is obtained from the to-be-detected image.
The use the target matching correction template is used for correcting the image to be detected, and the method comprises the following steps: acquiring a value of a bias angle of the image to be detected under rotational attack according to the target matching correction template, and performing rotational correction on the image to be detected; and acquiring the original size of the image to be detected according to the target matching correction template, and cutting and correcting the image to be detected.
The step of obtaining the value of the offset angle of the image to be detected under the rotary attack according to the target matching correction template, and performing rotary correction on the image to be detected comprises the following steps: taking the value of the offset angle of the image to be detected corresponding to the target matching correction template as the value of the offset angle of the image to be detected under the rotary attack; and according to the value of the offset angle of the image to be detected under the rotation attack, carrying out reverse rotation on the image to be detected so as to carry out rotation correction on the image to be detected.
The step of obtaining the original size of the image to be detected according to the target matching correction template, and cutting and correcting the image to be detected comprises the following steps: and acquiring the original size of the image to be detected according to the radius value of the target matching correction template and the radius value of the original correction template, and cutting and correcting the image to be detected.
The acquiring the original size of the image to be detected according to the radius value of the target matching correction template and the radius value of the original correction template comprises: and dividing the radius value of the original correction template by the radius value of the target matching correction template, and multiplying the divided value by the row number value of the preset size to obtain the original size of the image to be detected.
The follow in the image that awaits measuring after the rectification, acquire target embedding information includes: and acquiring the target embedded information from the corrected image to be detected by using a block extraction method. In addition, if the target embedding information does not include embedding start information, where the embedding start information is used to indicate an embedding start position of the target embedding information, the method further includes: and removing one column or one row from the left side or the upper side of the corrected image to be detected, and acquiring the target embedded information from the corrected image to be detected by using a block extraction method again.
A third embodiment of the present application provides a data processing apparatus corresponding to the data processing method provided in the first embodiment of the present application.
As shown in fig. 4, the data processing apparatus includes:
an information obtaining unit 401, configured to obtain a carrier image and obtain information to be embedded.
A template obtaining unit 402, configured to obtain an original correction template corresponding to the carrier image, where the original correction template is used to correct a target image when extracting the information to be embedded in the target image, and the target image is an image in which the original correction template and the information to be embedded are embedded.
An information embedding unit 403, configured to embed the original correction template and the information to be embedded into the carrier image, and obtain the target image.
Optionally, the template obtaining unit is specifically configured to: acquiring a target template vector, wherein the sum of all elements of the target template vector is zero; acquiring an initial mask matrix with a preset size, wherein the preset size is not larger than the size of the carrier image; and acquiring the original correction template according to the target template vector and the initial mask matrix.
Optionally, the obtaining the target template vector includes: acquiring a binary sequence with the length not less than a preset length threshold; replacing the value 0 in the binary sequence with a value-1; and if the sum of all elements in the binary sequence is not zero, adjusting at least one element in the binary sequence to obtain an adjusted binary sequence, and constructing the target template vector by using the adjusted binary sequence, wherein the sum of all elements in the adjusted binary sequence is zero.
Optionally, the obtaining the original correction template according to the target template vector and the initial mask matrix includes obtaining the original correction template by using a preset first formula.
Optionally, the information embedding unit is specifically configured to: embedding the original correction template into a first channel of the carrier image; embedding the information to be embedded into a second channel of the carrier image to obtain the target image; the first channel is a channel with pixel visual sensitivity meeting a preset pixel visual sensitivity condition, and the second channel is a channel other than the first channel.
Optionally, the embedding the original correction template into the first channel of the carrier image includes: obtaining a first image corresponding to the carrier image according to pixel information in a first channel of the carrier image; scaling the first image to a preset size to obtain a first scaled image, wherein the preset size is not larger than the size of the carrier image; embedding the original correction template into the first scaled image to obtain a first to-be-embedded scaled image; zooming the first image to be embedded from the preset size to the size which is the same as the size of the carrier image to obtain a first image to be embedded; replacing pixel information in a first channel of the carrier image with pixel information in the first image to be embedded.
Optionally, the embedding the original rectification template into the first scaled image to obtain a first to-be-embedded scaled image includes: performing fast Fourier transform processing on the first scaled image to acquire a frequency spectrum matrix corresponding to the first scaled image; embedding the original correction template into the frequency domain of the frequency spectrum matrix to obtain the frequency spectrum matrix embedded into the original correction template; and performing fast Fourier inverse transformation processing on the frequency spectrum matrix embedded into the original correction template to obtain the first to-be-embedded scaled image.
Optionally, the embedding the original rectification template into the frequency domain of the spectrum matrix to obtain the spectrum matrix embedded into the original rectification template includes: obtaining magnitude spectrum information of the frequency spectrum matrix; and multiplying the original correction template by a preset embedding intensity factor, and then performing matrix addition operation on the original correction template and the amplitude spectrum information to obtain modified amplitude spectrum information.
Optionally, the performing inverse fast fourier transform processing on the frequency spectrum matrix embedded in the original correction template to obtain the first to-be-embedded scaled image includes: acquiring phase frequency information of the frequency spectrum matrix; and performing fast Fourier inverse transformation processing on the modified amplitude spectrum information and the modified phase frequency information to obtain the first image to be embedded and zoomed.
Optionally, the method further includes: acquiring an original pixel matrix for representing pixel information in a first channel of the carrier image; scaling the first scaled image from the preset size to a size same as that of the carrier image, and acquiring a scaled pixel matrix for representing pixel information in the scaled image; and performing matrix subtraction operation on the original pixel matrix and the scaling pixel matrix to obtain a first scaling residual error.
Optionally, the replacing the pixel information in the first channel of the carrier image with the pixel information in the first image to be embedded, and embedding the original rectification template in the first channel of the carrier image, includes: acquiring a pixel matrix for representing pixel information in the first image to be embedded; performing matrix addition operation on the pixel matrix and the first scaling residual error to obtain a first residual error compensation pixel matrix; replacing pixel information in a first channel of the carrier image with the first residual compensated pixel matrix.
Optionally, the embedding the information to be embedded into the second channel of the carrier image includes: obtaining a second image corresponding to the carrier image according to the pixel information in the second channel of the carrier image; scaling the second image to a preset size to obtain a second scaled image, wherein the preset size is not larger than the size of the carrier image; embedding the information to be embedded into the second zoomed image to obtain a second zoomed image to be embedded; zooming the second image to be embedded to the size which is the same as the size of the carrier image from the preset size to obtain a second image to be embedded; replacing pixel information in a second channel of the carrier image with pixel information in the second image to be embedded.
Optionally, the embedding the information to be embedded into the second zoomed image to obtain a second zoomed image to be embedded includes: performing initial identification information splicing processing on the information to be embedded to obtain spliced information to be embedded; and embedding the spliced information to be embedded into the second zoomed image to obtain a second zoomed image to be embedded.
Optionally, the performing initial identification information splicing processing on the information to be embedded to obtain spliced information to be embedded includes: acquiring embedding start information indicating embedding start position information; and acquiring spliced information to be embedded before splicing the embedded initial information to the information to be embedded.
Optionally, before the splicing the embedding start information to the information to be embedded, acquiring the spliced information to be embedded, including: acquiring the binary sequence of the embedded initial information and acquiring the binary sequence of the information to be embedded; and splicing the binary sequence of the embedded initial information to the binary sequence of the information to be embedded to obtain the spliced information to be embedded.
Optionally, the embedding the spliced information to be embedded into the second zoomed image to obtain a second zoomed image to be embedded includes: and embedding the spliced information to be embedded into the second zoomed image by a block embedding method to obtain the second zoomed image to be embedded.
Optionally, the method further includes: acquiring an original pixel matrix for representing pixel information in a second channel of the carrier image; scaling the second scaled image from the preset size to a size same as that of the carrier image, and acquiring a scaled pixel matrix for representing pixel information in the scaled image; and performing matrix subtraction operation on the original pixel matrix and the scaling pixel matrix to obtain a second scaling residual error.
Optionally, the replacing the pixel information in the second channel of the carrier image with the pixel information in the second image to be embedded, and embedding the information to be embedded in the second channel of the carrier image, includes: acquiring a pixel matrix for representing pixel information in the second image to be embedded; performing matrix addition operation on the pixel matrix and the second scaling residual error to obtain a second residual error compensation pixel matrix; replacing pixel information in a second channel of the carrier image with the second residual compensated pixel matrix.
Optionally, the first channel is a B channel in an RGB color channel of the carrier image, and the second channel is a G channel in the RGB color channel of the carrier image.
It should be noted that, for the detailed description of the apparatus provided in the third embodiment of the present application, reference may be made to the related description of the first embodiment of the present application, and details are not described here again.
A fourth embodiment of the present application provides an electronic device corresponding to the data processing method provided in the first embodiment of the present application.
As shown in fig. 5, the electronic device includes:
a processor 501;
memory 502 for a program of a data processing method, which device, when powered on and running said program of a data processing method by said processor, performs the following steps:
acquiring a carrier image and acquiring information to be embedded;
acquiring an original correction template corresponding to the carrier image, wherein the original correction template is used for correcting a target image when the information to be embedded in the target image is extracted, and the target image is an image embedded with the original correction template and the information to be embedded;
and embedding the original correction template and the information to be embedded into the carrier image to obtain the target image.
It should be noted that, for the detailed description of the electronic device provided in the fourth embodiment of the present application, reference may be made to the related description of the first embodiment of the present application, and details are not repeated here.
In correspondence with a data processing method provided in the first embodiment of the present application, a fifth embodiment of the present application provides a storage device storing a program of the data processing method, the program being executed by a processor to perform the steps of:
acquiring a carrier image and acquiring information to be embedded;
acquiring an original correction template corresponding to the carrier image, wherein the original correction template is used for correcting a target image when the information to be embedded in the target image is extracted, and the target image is an image embedded with the original correction template and the information to be embedded;
and embedding the original correction template and the information to be embedded into the carrier image to obtain the target image.
It should be noted that, for the detailed description of the storage device provided in the fifth embodiment of the present application, reference may be made to the related description of the first embodiment of the present application, and details are not described here again.
A sixth embodiment of the present application provides a data processing apparatus corresponding to the data processing method provided in the second embodiment of the present application.
As shown in fig. 6, the apparatus includes:
an image obtaining unit 601, configured to obtain an image to be detected.
A template obtaining unit 602, configured to obtain a target matching correction template embedded in the image to be detected, where the target matching correction template is used to correct the image to be detected when extracting target embedding information in the image to be detected, and the target matching correction template and an original correction template used when embedding the target embedding information in the image to be detected satisfy a preset matching condition.
And the image repairing unit 603 is configured to correct the image to be detected by using the target matching correction template, and obtain the corrected image to be detected.
An information extracting unit 604, configured to obtain the target embedding information from the corrected image to be detected.
Optionally, the template obtaining unit is specifically configured to: and acquiring the target matching correction template from a first channel of the image to be detected, wherein the first channel is a channel with pixel visual sensitivity meeting a preset pixel visual sensitivity condition.
Optionally, the obtaining the target matching correction template from the first channel of the image to be detected includes: obtaining a first image corresponding to the image to be detected according to pixel information in a first channel of the image to be detected; scaling the first image to a preset size to obtain a first scaled image, wherein the preset size is not larger than the size of the image to be detected; and acquiring the target matching correction template from the first zooming image.
Optionally, the obtaining the target matching correction template from the first zoomed image includes: performing fast Fourier transform processing on the first scaled image to acquire a frequency spectrum matrix corresponding to the first scaled image; and acquiring the target matching correction template according to the frequency spectrum matrix.
Optionally, the obtaining the target matching correction template according to the spectrum matrix includes: acquiring a correction template to be determined and a spectrum vector to be determined corresponding to the correction template to be determined according to the spectrum matrix; and determining the target matching correction template from the to-be-determined correction template and the to-be-determined frequency spectrum vector.
Optionally, the method includes: according to the spectrum matrix, acquiring the correction template to be determined and the spectrum vector to be determined corresponding to the correction template to be determined by using the following steps: acquiring an initial spectrum vector; and obtaining the to-be-determined correction template from the spectrum matrix by using a preset second formula, and updating the initial spectrum vector according to the obtained to-be-determined correction template to obtain the to-be-determined spectrum vector corresponding to the to-be-determined correction template.
Optionally, the method further includes: and adjusting the radius value of the correction template in the preset second formula and the offset angle value of the image to be detected in the preset second formula, executing the step set again, and acquiring the correction template to be determined and the frequency spectrum vector to be determined corresponding to different radius values and different offset angle values.
Optionally, the determining the target matching correction template from the to-be-determined correction template and the to-be-determined spectrum vector includes: acquiring a target template vector, wherein the target template vector is used for acquiring the vector of the original correction template when the original correction template is embedded into the image to be detected; and determining the target matching correction template from the correction template to be determined and the frequency spectrum vector to be determined according to the target template vector.
Optionally, the determining the target matching correction template from the to-be-determined correction template and the to-be-determined spectrum vector according to the target template vector includes: obtaining a first to-be-determined frequency spectrum vector from the to-be-determined frequency spectrum vector; calculating the covariance of the target template vector and the first to-be-determined frequency spectrum vector to obtain covariance information; and judging whether the to-be-determined correction template corresponding to the first to-be-determined frequency spectrum vector and the original correction template meet the preset matching condition or not according to the covariance information so as to determine the target matching correction template.
Optionally, the method includes: and acquiring a maximum value in the covariance information, and taking a to-be-determined correction template corresponding to the first to-be-determined frequency spectrum vector corresponding to the maximum value as the target matching correction template. Optionally, the image repairing unit is specifically configured to: acquiring a value of a bias angle of the image to be detected under rotational attack according to the target matching correction template, and performing rotational correction on the image to be detected; and acquiring the original size of the image to be detected according to the target matching correction template, and cutting and correcting the image to be detected.
Optionally, the obtaining, according to the target matching correction template, a value of an offset angle of the image to be detected under rotational attack, and performing rotational correction on the image to be detected includes: taking the value of the offset angle of the image to be detected corresponding to the target matching correction template as the value of the offset angle of the image to be detected under the rotary attack; and according to the value of the offset angle of the image to be detected under the rotation attack, carrying out reverse rotation on the image to be detected so as to carry out rotation correction on the image to be detected.
Optionally, the obtaining, according to the target matching correction template, an original size of the image to be detected, and performing cutting correction on the image to be detected includes: and acquiring the original size of the image to be detected according to the radius value of the target matching correction template and the radius value of the original correction template, and cutting and correcting the image to be detected.
Optionally, the obtaining the original size of the image to be detected according to the radius value of the target matching correction template and the radius value of the original correction template includes: and dividing the radius value of the original correction template by the radius value of the target matching correction template, and multiplying the divided value by the row number value of the preset size to obtain the original size of the image to be detected.
Optionally, the information extracting unit is specifically configured to: and acquiring the target embedded information from the corrected image to be detected by using a block extraction method.
Optionally, if the target embedding information does not include embedding start information, where the embedding start information is used to indicate an embedding start position of the target embedding information, the method further includes: and removing one column or one row from the left side or the upper side of the corrected image to be detected, and acquiring the target embedded information from the corrected image to be detected by using a block extraction method again.
It should be noted that, for the detailed description of the apparatus provided in the sixth embodiment of the present application, reference may be made to the related description of the second embodiment of the present application, and details are not described here again.
A seventh embodiment of the present application provides an electronic device corresponding to the data processing method provided in the second embodiment of the present application.
The electronic device includes:
a processor;
a memory for storing a program of a data processing method, the apparatus performing the following steps after being powered on and running the program of the data processing method by the processor:
acquiring an image to be detected;
acquiring a target matching correction template embedded in the image to be detected, wherein the target matching correction template is used for correcting the image to be detected when target embedding information in the image to be detected is extracted, and the target matching correction template and an original correction template used when the target embedding information is embedded in the image to be detected meet a preset matching condition;
correcting the image to be detected by using the target matching correction template to obtain a corrected image to be detected;
and acquiring the target embedded information from the corrected image to be detected.
It should be noted that, for the detailed description of the electronic device provided in the seventh embodiment of the present application, reference may be made to the related description of the second embodiment of the present application, and details are not described here again.
In accordance with a data processing method provided in the second embodiment of the present application, an eighth embodiment of the present application provides a storage device storing a program of the data processing method, the program being executed by a processor to perform the steps of:
acquiring an image to be detected;
acquiring a target matching correction template embedded in the image to be detected, wherein the target matching correction template is used for correcting the image to be detected when target embedding information in the image to be detected is extracted, and the target matching correction template and an original correction template used when the target embedding information is embedded in the image to be detected meet a preset matching condition;
correcting the image to be detected by using the target matching correction template to obtain a corrected image to be detected;
and acquiring the target embedded information from the corrected image to be detected.
It should be noted that, for the detailed description of the storage device provided in the eighth embodiment of the present application, reference may be made to the related description of the second embodiment of the present application, and details are not described here again.
Although the present application has been described with reference to the preferred embodiments, it is not intended to limit the present application, and those skilled in the art can make variations and modifications without departing from the spirit and scope of the present application, therefore, the scope of the present application should be determined by the claims that follow.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile 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 a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

Claims (41)

1. A data processing method, comprising:
acquiring a carrier image and acquiring information to be embedded;
acquiring an original correction template corresponding to the carrier image, wherein the original correction template is used for correcting a target image when the information to be embedded in the target image is extracted, and the target image is an image embedded with the correction template and the information to be embedded;
and embedding the original correction template and the information to be embedded into the carrier image to obtain the target image.
2. The method of claim 1, wherein said obtaining an original correction template corresponding to the carrier image comprises:
acquiring a target template vector, wherein the sum of all elements of the target template vector is zero;
acquiring an initial mask matrix with a preset size, wherein the preset size is not larger than the size of the carrier image;
and acquiring the original correction template according to the target template vector and the initial mask matrix.
3. The method of claim 2, wherein the obtaining the target template vector comprises:
acquiring a binary sequence with the length not less than a preset length threshold;
replacing the value 0 in the binary sequence with a value-1;
and if the sum of all elements in the binary sequence is not zero, adjusting at least one element in the binary sequence to obtain an adjusted binary sequence, and constructing the target template vector by using the adjusted binary sequence, wherein the sum of all elements in the adjusted binary sequence is zero.
4. The method of claim 2, wherein obtaining the original correction template based on the target template vector and the initial mask matrix comprises obtaining the original correction template using a preset first formula.
5. The method according to claim 1, wherein said embedding the original correction template and the information to be embedded into the carrier image, obtaining the target image, comprises:
embedding the original correction template into a first channel of the carrier image;
embedding the information to be embedded into a second channel of the carrier image to obtain the target image;
the first channel is a channel with pixel visual sensitivity meeting a preset pixel visual sensitivity condition, and the second channel is a channel other than the first channel.
6. The method of claim 5, wherein said embedding the original correction template into the first pass of the carrier image comprises:
obtaining a first image corresponding to the carrier image according to pixel information in a first channel of the carrier image;
scaling the first image to a preset size to obtain a first scaled image, wherein the preset size is not larger than the size of the carrier image;
embedding the original correction template into the first scaled image to obtain a first to-be-embedded scaled image;
zooming the first image to be embedded from the preset size to the size which is the same as the size of the carrier image to obtain a first image to be embedded;
replacing pixel information in a first channel of the carrier image with pixel information in the first image to be embedded.
7. The method according to claim 6, wherein said embedding said original corrective template into said first scaled image, obtaining a first to-be-embedded scaled image, comprises:
performing fast Fourier transform processing on the first scaled image to acquire a frequency spectrum matrix corresponding to the first scaled image;
embedding the original correction template into the frequency domain of the frequency spectrum matrix to obtain the frequency spectrum matrix embedded into the original correction template;
and performing fast Fourier inverse transformation processing on the frequency spectrum matrix embedded into the original correction template to obtain the first to-be-embedded scaled image.
8. The method according to claim 7, wherein said embedding the original corrective template into the frequency domain of the spectral matrix, obtaining the spectral matrix embedded into the original corrective template, comprises:
obtaining magnitude spectrum information of the frequency spectrum matrix;
and multiplying the original correction template by a preset embedding intensity factor, and then performing matrix addition operation on the original correction template and the amplitude spectrum information to obtain modified amplitude spectrum information.
9. The method according to claim 8, wherein said performing an inverse fast fourier transform on the spectrum matrix embedded in the original correction template to obtain the first scaled image to be embedded comprises:
acquiring phase frequency information of the frequency spectrum matrix;
and performing fast Fourier inverse transformation processing on the modified amplitude spectrum information and the modified phase frequency information to obtain the first image to be embedded and zoomed.
10. The method of claim 6, further comprising:
acquiring an original pixel matrix for representing pixel information in a first channel of the carrier image;
scaling the first scaled image from the preset size to a size same as that of the carrier image, and acquiring a scaled pixel matrix for representing pixel information in the scaled image;
and performing matrix subtraction operation on the original pixel matrix and the scaling pixel matrix to obtain a first scaling residual error.
11. The method of claim 10, wherein the replacing pixel information in the first channel of the carrier image with pixel information in the first image to be embedded, the embedding the original rectification template in the first channel of the carrier image comprises:
acquiring a pixel matrix for representing pixel information in the first image to be embedded;
performing matrix addition operation on the pixel matrix and the first scaling residual error to obtain a first residual error compensation pixel matrix;
replacing pixel information in a first channel of the carrier image with the first residual compensated pixel matrix.
12. The method according to claim 5, wherein said embedding the information to be embedded in a second channel of the carrier image comprises:
obtaining a second image corresponding to the carrier image according to the pixel information in the second channel of the carrier image;
scaling the second image to a preset size to obtain a second scaled image, wherein the preset size is not larger than the size of the carrier image;
embedding the information to be embedded into the second zoomed image to obtain a second zoomed image to be embedded;
zooming the second image to be embedded to the size which is the same as the size of the carrier image from the preset size to obtain a second image to be embedded;
replacing pixel information in a second channel of the carrier image with pixel information in the second image to be embedded.
13. The method according to claim 12, wherein said embedding the information to be embedded into the second scaled image, obtaining a second scaled image to be embedded, comprises:
performing initial identification information splicing processing on the information to be embedded to obtain spliced information to be embedded;
and embedding the spliced information to be embedded into the second zoomed image to obtain a second zoomed image to be embedded.
14. The method according to claim 13, wherein the performing of the initial identification information splicing processing on the information to be embedded to obtain the spliced information to be embedded includes:
acquiring embedding start information indicating embedding start position information;
and acquiring spliced information to be embedded before splicing the embedded initial information to the information to be embedded.
15. The method according to claim 14, wherein obtaining the spliced information to be embedded before splicing the embedding start information to the information to be embedded comprises:
acquiring the binary sequence of the embedded initial information and acquiring the binary sequence of the information to be embedded;
and splicing the binary sequence of the embedded initial information to the binary sequence of the information to be embedded to obtain the spliced information to be embedded.
16. The method according to claim 13, wherein the embedding the stitched information to be embedded into the second scaled image to obtain a second scaled image to be embedded comprises:
and embedding the spliced information to be embedded into the second zoomed image by a block embedding method to obtain the second zoomed image to be embedded.
17. The method of claim 12, further comprising:
acquiring an original pixel matrix for representing pixel information in a second channel of the carrier image;
scaling the second scaled image from the preset size to a size same as that of the carrier image, and acquiring a scaled pixel matrix for representing pixel information in the scaled image;
and performing matrix subtraction operation on the original pixel matrix and the scaling pixel matrix to obtain a second scaling residual error.
18. The method of claim 17, wherein the replacing pixel information in the second channel of the carrier image with pixel information in the second image to be embedded, the embedding the information to be embedded in the second channel of the carrier image, comprises:
acquiring a pixel matrix for representing pixel information in the second image to be embedded;
performing matrix addition operation on the pixel matrix and the second scaling residual error to obtain a second residual error compensation pixel matrix;
replacing pixel information in a second channel of the carrier image with the second residual compensated pixel matrix.
19. A method as claimed in claim 5, wherein the first channel is a B channel of the RGB color channels of the carrier image and the second channel is a G channel of the RGB color channels of the carrier image.
20. A data processing method, comprising:
acquiring an image to be detected;
acquiring a target matching correction template embedded in the image to be detected, wherein the target matching correction template is used for correcting the image to be detected when target embedding information in the image to be detected is extracted, and the target matching correction template and an original correction template used when the target embedding information is embedded in the image to be detected meet a preset matching condition;
correcting the image to be detected by using the target matching correction template to obtain a corrected image to be detected;
and acquiring the target embedded information from the corrected image to be detected.
21. The method according to claim 20, wherein the obtaining of the target matching correction template embedded in the image to be detected comprises:
and acquiring the target matching correction template from a first channel of the image to be detected, wherein the first channel is a channel with pixel visual sensitivity meeting a preset pixel visual sensitivity condition.
22. The method as claimed in claim 21, wherein said obtaining said target matching correction template from said first channel of said image to be detected comprises:
obtaining a first image corresponding to the image to be detected according to pixel information in a first channel of the image to be detected;
scaling the first image to a preset size to obtain a first scaled image, wherein the preset size is not larger than the size of the image to be detected;
and acquiring the target matching correction template from the first zooming image.
23. The method of claim 22, wherein said obtaining the target matching correction template from the first scaled image comprises:
performing fast Fourier transform processing on the first scaled image to acquire a frequency spectrum matrix corresponding to the first scaled image;
and acquiring the target matching correction template according to the frequency spectrum matrix.
24. The method according to claim 23, wherein the obtaining the target matching correction template according to the spectrum matrix comprises:
acquiring a correction template to be determined and a spectrum vector to be determined corresponding to the correction template to be determined according to the spectrum matrix;
and determining the target matching correction template from the to-be-determined correction template and the to-be-determined frequency spectrum vector.
25. The method of claim 24, comprising: according to the spectrum matrix, acquiring the correction template to be determined and the spectrum vector to be determined corresponding to the correction template to be determined by using the following steps:
acquiring an initial spectrum vector;
and obtaining the to-be-determined correction template from the spectrum matrix by using a preset second formula, and updating the initial spectrum vector according to the obtained to-be-determined correction template to obtain the to-be-determined spectrum vector corresponding to the to-be-determined correction template.
26. The method of claim 25, further comprising:
and adjusting the radius value of the correction template in the preset second formula and the offset angle value of the image to be detected in the preset second formula, executing the step set again, and acquiring the correction template to be determined and the frequency spectrum vector to be determined corresponding to different radius values and different offset angle values.
27. The method according to claim 26, wherein the determining the target matching correction template from the correction template to be determined and the spectral vector to be determined comprises:
acquiring a target template vector, wherein the target template vector is used for acquiring the vector of the original correction template when the original correction template is embedded into the image to be detected;
and determining the target matching correction template from the correction template to be determined and the frequency spectrum vector to be determined according to the target template vector.
28. The method according to claim 27, wherein the determining the target matching correction template from the correction template to be determined and the spectrum vector to be determined according to the target template vector comprises:
obtaining a first to-be-determined frequency spectrum vector from the to-be-determined frequency spectrum vector;
calculating the covariance of the target template vector and the first to-be-determined frequency spectrum vector to obtain covariance information;
and judging whether the to-be-determined correction template corresponding to the first to-be-determined frequency spectrum vector and the original correction template meet the preset matching condition or not according to the covariance information so as to determine the target matching correction template.
29. The method of claim 28, comprising: and acquiring a maximum value in the covariance information, and taking a to-be-determined correction template corresponding to the first to-be-determined frequency spectrum vector corresponding to the maximum value as the target matching correction template.
30. The method as claimed in claim 29, wherein said rectifying said image to be detected using said target matching rectifying template comprises:
acquiring a value of a bias angle of the image to be detected under rotational attack according to the target matching correction template, and performing rotational correction on the image to be detected;
and acquiring the original size of the image to be detected according to the target matching correction template, and cutting and correcting the image to be detected.
31. The method according to claim 30, wherein the obtaining a value of an offset angle of the image to be detected under a rotation attack according to the target matching correction template to perform rotation correction on the image to be detected comprises:
taking the value of the offset angle of the image to be detected corresponding to the target matching correction template as the value of the offset angle of the image to be detected under the rotary attack;
and according to the value of the offset angle of the image to be detected under the rotation attack, carrying out reverse rotation on the image to be detected so as to carry out rotation correction on the image to be detected.
32. The method as claimed in claim 30, wherein said obtaining the original size of the image to be detected according to the target matching correction template, and performing cropping correction on the image to be detected comprises:
and acquiring the original size of the image to be detected according to the radius value of the target matching correction template and the radius value of the original correction template, and cutting and correcting the image to be detected.
33. The method according to claim 32, wherein the obtaining the original size of the image to be detected according to the radius value of the target matching correction template and the radius value of the original correction template comprises:
and dividing the radius value of the original correction template by the radius value of the target matching correction template, and multiplying the divided value by the row number value of the preset size to obtain the original size of the image to be detected.
34. The method according to claim 20, wherein said obtaining the target embedding information from the rectified image to be detected comprises:
and acquiring the target embedded information from the corrected image to be detected by using a block extraction method.
35. The method of claim 34, wherein if the target embedding information does not include embedding start information, wherein the embedding start information is used to indicate an embedding start position of the target embedding information, the method further comprises:
and removing one column or one row from the left side or the upper side of the corrected image to be detected, and acquiring the target embedded information from the corrected image to be detected by using a block extraction method again.
36. A data processing apparatus, comprising:
the information acquisition unit is used for acquiring a carrier image and acquiring information to be embedded;
a template obtaining unit, configured to obtain an original correction template corresponding to the carrier image, where the original correction template is used to correct a target image when extracting the information to be embedded, where the target image is an image in which the original correction template and the information to be embedded are embedded;
and the information embedding unit is used for embedding the original correction template and the information to be embedded into the carrier image to obtain the target image.
37. An electronic device, comprising:
a processor;
a memory for storing a program of a data processing method, the apparatus performing the following steps after being powered on and running the program of the data processing method by the processor:
acquiring a carrier image and acquiring information to be embedded;
acquiring an original correction template corresponding to the carrier image, wherein the original correction template is used for correcting a target image when the information to be embedded in the target image is extracted, and the target image is an image embedded with the original correction template and the information to be embedded;
and embedding the original correction template and the information to be embedded into the carrier image to obtain the target image.
38. A storage device characterized by storing a program of a data processing method, the program being executed by a processor to execute the steps of:
acquiring a carrier image and acquiring information to be embedded;
acquiring an original correction template corresponding to the carrier image, wherein the original correction template is used for correcting a target image when the information to be embedded in the target image is extracted, and the target image is an image embedded with the original correction template and the information to be embedded;
and embedding the original correction template and the information to be embedded into the carrier image to obtain the target image.
39. A data processing apparatus, comprising:
the image acquisition unit is used for acquiring an image to be detected;
the template acquisition unit is used for acquiring a target matching correction template embedded in the image to be detected, wherein the target matching correction template is used for correcting the image to be detected when target embedding information in the image to be detected is extracted, and the target matching correction template and an original correction template used when the target embedding information is embedded in the image to be detected meet a preset matching condition;
the image restoration unit is used for correcting the image to be detected by using the target matching correction template to obtain a corrected image to be detected;
and the information extraction unit is used for acquiring target embedded information from the corrected image to be detected.
40. An electronic device, comprising:
a processor;
a memory for storing a program of a data processing method, the apparatus performing the following steps after being powered on and running the program of the data processing method by the processor:
acquiring an image to be detected;
acquiring a target matching correction template embedded in the image to be detected, wherein the target matching correction template is used for correcting the image to be detected when target embedding information in the image to be detected is extracted, and the target matching correction template and an original correction template used when the target embedding information is embedded in the image to be detected meet a preset matching condition;
correcting the image to be detected by using the target matching correction template to obtain a corrected image to be detected;
and acquiring target embedded information from the corrected image to be detected.
41. A storage device characterized by storing a program of a data processing method, the program being executed by a processor to execute the steps of:
acquiring an image to be detected;
acquiring a target matching correction template embedded in the image to be detected, wherein the target matching correction template is used for correcting the image to be detected when target embedding information in the image to be detected is extracted, and the target matching correction template and an original correction template used when the target embedding information is embedded in the image to be detected meet a preset matching condition;
correcting the image to be detected by using the target matching correction template to obtain a corrected image to be detected;
and acquiring the target embedded information from the corrected image to be detected.
CN202010203028.0A 2020-03-20 2020-03-20 Data processing method, device and equipment Pending CN113496450A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010203028.0A CN113496450A (en) 2020-03-20 2020-03-20 Data processing method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010203028.0A CN113496450A (en) 2020-03-20 2020-03-20 Data processing method, device and equipment

Publications (1)

Publication Number Publication Date
CN113496450A true CN113496450A (en) 2021-10-12

Family

ID=77993787

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010203028.0A Pending CN113496450A (en) 2020-03-20 2020-03-20 Data processing method, device and equipment

Country Status (1)

Country Link
CN (1) CN113496450A (en)

Similar Documents

Publication Publication Date Title
Rawat et al. A new robust watermarking scheme for color images
Ma et al. Local geometric distortions resilient watermarking scheme based on symmetry
JP2002247344A (en) Method and apparatus for processing image
US11070700B2 (en) Method of extracting watermark data in an image with reference to a noise-based image located in the image based on a comparison process performed in the frequency domain
Sun et al. A geometrically robust multi-bit video watermarking algorithm based on 2-D DFT
US9159112B2 (en) Digital watermarking using saturation patterns
Ling et al. Robust video watermarking based on affine invariant regions in the compressed domain
Kwok et al. Alternative anti-forensics method for contrast enhancement
Roy et al. Watermarking through image geometry change tracking
Munib et al. Robust image watermarking technique using triangular regions and Zernike moments for quantization based embedding
JP5534411B2 (en) Image processing device
CN111932432A (en) Blind watermark implanting method, blind watermark detecting method, blind watermark implanting device, blind watermark detecting equipment and storage medium
Juarez-Sandoval et al. Digital image ownership authentication via camouflaged unseen-visible watermarking
Saikia et al. Image authentication under geometric attacks via concentric square partition based image hashing
Kay et al. Robust content based image watermarking
Nikolaidis Local distortion resistant image watermarking relying on salient feature extraction
CN113763224A (en) Image processing method and device
CN112541853A (en) Data processing method, device and equipment
US8885871B2 (en) Method and system for performing transcoding resistant watermarking
CN113496450A (en) Data processing method, device and equipment
Pramila et al. Watermark robustness in the print-cam process
Wan et al. Improved spread transform dither modulation based on robust perceptual just noticeable distortion model
Zeng et al. Replacing DWT with DTCWT in blind image rotation angle estimation
Keskinarkaus et al. Wavelet domain print-scan and JPEG resilient data hiding method
CN112966230A (en) Information steganography and extraction method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination