CN113766243A - Image data processing method and device, electronic equipment and storage medium - Google Patents

Image data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113766243A
CN113766243A CN202011302911.1A CN202011302911A CN113766243A CN 113766243 A CN113766243 A CN 113766243A CN 202011302911 A CN202011302911 A CN 202011302911A CN 113766243 A CN113766243 A CN 113766243A
Authority
CN
China
Prior art keywords
data
pixel data
parity
preset
current
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
CN202011302911.1A
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202011302911.1A priority Critical patent/CN113766243A/en
Publication of CN113766243A publication Critical patent/CN113766243A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • H04N19/467Embedding additional information in the video signal during the compression process characterised by the embedded information being invisible, e.g. watermarking

Abstract

The embodiment of the invention discloses a method and a device for processing image data, electronic equipment and a storage medium. The method comprises the following steps: acquiring binary data corresponding to watermark information to be embedded, and selecting a preset number of pixel data in a current image; wherein the preset number is consistent with the bit number of the binary data; and for each pixel data, determining a first parity of a bit corresponding to the current pixel data in the binary data and a second parity of the current pixel data, and rewriting the current pixel data according to a preset rewriting mode when the first parity and the second parity meet a preset condition to obtain a current image embedded with the watermark information. By the technical scheme of the embodiment of the invention, the influence on the image quality is reduced, and the safety of the image watermark information is improved.

Description

Image data processing method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of image processing, in particular to a method and a device for processing image data, electronic equipment and a storage medium.
Background
At present, when adding watermark information invisible to human eyes into an existing image, a method is usually adopted to embed the watermark information into the least significant bits of RGB values of partial pixels in the image, and the method adds the watermark information by changing the data of the least significant bits, so that the influence on the quality of the image is small.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
the scheme for adding the watermark information into the image belongs to plaintext encryption, and once the image is intercepted, the added watermark information can be directly obtained according to the least significant bit of the RGB value of the pixel in the image, so that the safety is low.
Disclosure of Invention
The embodiment of the invention provides a method and a device for processing image data, electronic equipment and a storage medium, which are used for improving the security of adding watermark information into an image.
In a first aspect, an embodiment of the present invention provides a method for processing image data, where the method includes:
acquiring binary data corresponding to watermark information to be embedded, and selecting a preset number of pixel data in a current image; wherein the preset number is consistent with the bit number of the binary data;
and for each pixel data, determining a first parity of a bit corresponding to the current pixel data in the binary data and a second parity of the current pixel data, and rewriting the current pixel data according to a preset rewriting mode when the first parity and the second parity meet a preset condition to obtain a current image embedded with the watermark information.
In a second aspect, an embodiment of the present invention further provides an apparatus for processing image data, where the apparatus includes:
the pixel data acquisition module is used for acquiring binary data corresponding to the watermark information to be embedded and selecting a preset number of pixel data in the current image; wherein the preset number is consistent with the bit number of the binary data;
and the pixel data rewriting module is used for determining a first parity of a bit corresponding to the current pixel data in the binary data and a second parity of the current pixel data for each pixel data, and rewriting the current pixel data according to a preset rewriting mode when the first parity and the second parity meet a preset condition to obtain the current image embedded with the watermark information.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method of processing image data as provided by any of the embodiments of the invention.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the processing method of the image data provided in any embodiment of the present invention.
The embodiment of the invention obtains the binary data corresponding to the watermark information to be embedded, selects the preset number of pixel data in the current image, determines the first parity of the bit corresponding to the current pixel data in the binary data and the second parity of the current pixel data for each pixel data, and rewrites the current pixel data according to a preset rewriting mode when the first parity and the second parity meet the preset condition to obtain the current image embedded with the watermark information.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description will be given below of the drawings required for the embodiments or the technical solutions in the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for processing image data according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for processing image data according to a second embodiment of the present invention;
fig. 3 is a schematic diagram of processing of image data according to a second embodiment of the present invention;
fig. 4 is a schematic diagram of processing of image data according to a second embodiment of the present invention;
fig. 5 is a schematic diagram of processing of image data according to a second embodiment of the present invention;
fig. 6 is a schematic diagram of processing of image data according to a second embodiment of the present invention;
FIG. 7 is a schematic structural diagram of an apparatus for processing image data according to a third embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a method for processing image data according to an embodiment of the present invention, which is applicable to a case where invisible watermark information is embedded in an image. The method may be performed by a device for processing image data, which may be implemented by means of software and/or hardware. The method specifically comprises the following steps:
s110, obtaining binary data corresponding to watermark information to be embedded, and selecting a preset number of pixel data in a current image; wherein the preset number is consistent with the bit number of the binary data.
In order to improve the security of the image, watermark information which is invisible to flesh eyes needs to be added into the current image. The watermark information may be letters, numbers, special characters, etc. In the embodiment of the present invention, in order to embed watermark information in an image, binary data corresponding to the watermark information to be embedded and pixel data corresponding to the image need to be acquired.
Optionally, when the Information to be embedded with the watermark is a letter J, binary data corresponding to the letter J may be obtained according to a binary data encoding rule stored in ASCII (American Standard Code for Information exchange Code, table American Standard Code for Information exchange); or, when the watermark information to be embedded is the number 74, binary data corresponding to the number 74 may also be obtained according to a conversion rule between decimal data and binary data. Of course, the above method for obtaining binary data is only an optional embodiment, and the embodiment does not limit the manner for obtaining the binary data corresponding to the watermark information to be embedded. Optionally, the current image characterizes the content of the image by pixel data. Specifically, the pixel data includes, but is not limited to, RGB data, luminance data, transparency data, and gradation data.
Specifically, a preset number of pixel data in the image is obtained. The preset number is consistent with the bit number of the binary data to be embedded with the watermark information. Specifically, the amount of information contained in one binary digit is one bit number. Specifically, when the information to be embedded with the watermark is a letter J, the binary data corresponding to the letter J is determined to be 01001010 according to the ASCII code table, and it can be known that the number of bits of the binary data of the letter J is 8, that is, the number of bits of the letter J is 8, so that 8 pieces of pixel data need to be acquired from the current image. Optionally, the preset number of pixel data may be continuous or discontinuous in the current image, which is not limited in this embodiment.
And S120, for each pixel data, determining a first parity of a bit corresponding to the current pixel data in the binary data and a second parity of the current pixel data, and rewriting the current pixel data according to a preset rewriting mode when the first parity and the second parity meet a preset condition to obtain a current image embedded with the watermark information.
In the embodiment of the invention, each bit of binary data corresponding to the watermark information to be embedded is determined, and each bit is used as first data. The parity of any bit in the first data is judged according to the data parity judgment rule and is recorded as a first parity. Optionally, a preset number of pixel data are selected from the current image according to the bit number of the binary data, and each selected pixel data is recorded as the second data. The parity of the pixel data corresponding to the bit in the first data is determined according to the parity determination rule of the data, and is referred to as a second parity. Optionally, when the first parity of any bit in the first data and the second parity of the corresponding pixel data satisfy a preset condition, the corresponding pixel data in the selected second data is rewritten according to a preset rewriting mode, so as to obtain the current image embedded with the watermark information.
Specifically, the preset condition is that when the first parity of any bit in the first data is different from the second parity of the corresponding pixel data in the second data, the current pixel data is rewritten according to a preset rewriting mode. Specifically, the preset rewrite rule includes a first rewrite mode and a second rewrite mode. Optionally, the first writing manner is to increase the current pixel data by a preset value when the bit in the first data corresponding to the first parity is an odd number and the pixel data corresponding to the second parity is an even number. Optionally, the preset value includes, but is not limited to, odd numbers such as 1, 3, 5, etc., and the size of the preset value is not limited in this embodiment. Optionally, the second rewriting manner is to reduce the current pixel data by a preset value when the bit in the first data corresponding to the first parity is an even number and the pixel data corresponding to the second parity is an odd number. Optionally, the pixel data before rewriting is replaced with the currently rewritten pixel data, and the formed current image is the image in which the watermark information has been embedded.
The embodiment of the invention obtains binary data corresponding to watermark information to be embedded, and selects a preset number of pixel data in a current image; for each pixel data, determining a first parity of a bit corresponding to the current pixel data in the binary data and a second parity of the current pixel data, and rewriting the current pixel data according to a preset rewriting mode when the first parity and the second parity meet a preset condition to obtain a current image embedded with the watermark information.
Example two
Fig. 2 is a flowchart of an image data processing method according to a second embodiment of the present invention, where in this embodiment, on the basis of the above embodiments, "a preset number of color channel data are selected from RGB data of a pixel in a current image," and the selected color channel data are respectively used as one pixel data. "further optimization is performed, wherein explanations of the same or corresponding terms as in the above embodiments are omitted. Referring to fig. 2, the method for processing image data provided by the present embodiment includes:
s210, obtaining binary data corresponding to the watermark information to be embedded.
S220, selecting a preset number of color channel data from RGB data of pixels in the current image, and taking the selected color channel data as pixel data respectively; wherein the preset number is consistent with the bit number of the binary data.
In the embodiment of the present invention, optionally, a preset number of color channel data in the RGB data of the current image may be selected as the selected pixel data. Specifically, the color channel data includes at least one of R channel data, G channel data, and B channel data. Wherein one color channel data is one pixel data.
Optionally, the selecting method for selecting a preset number of color channel data from RGB data of pixels in the current image includes: a preset number of consecutive or non-consecutive color channel data is selected from the pixel data (e.g., RGB data) in the current image. Illustratively, as shown in fig. 3, a preset number of continuous or discontinuous color channel data are randomly selected according to the bit number of binary data corresponding to the watermark information to be embedded. For example: when the information to be embedded with the watermark is a letter J, the binary data corresponding to the information to be embedded with the watermark is 01001010, and the bit number is 8 bits. Optionally, 12 color channel data of RGB data of 4 pixels are selected from the current image. Specifically, the color channel data includes: 196. 210, 181, 84, 132, 221, 213, 94, 220, 87, 142, and 123. Optionally, when discontinuous color channel data is selected, the discontinuous color channel data may be used as interference item data of currently selected pixel data, so as to further improve the security of the image in which the watermark information is embedded. Specifically, the selected color channel data includes: 196. 210, 181, 132, 221, 213, 220, and 87, in which one color channel data is one pixel data. Optionally, 84 and 94 are color channel data at the break, that is, as interference item data, which is rewritten together with the pixel data, and the interference item data may be color channel data at any break, and the embodiment does not limit the selection of the interference item data.
Optionally, the selecting method for selecting a preset number of color channel data from RGB data of pixels in the current image as the selected pixel data further includes: the method comprises the steps of obtaining RGB data of continuous or discontinuous pixels with preset quantity from a current image, and selecting preset color channel data in the RGB data. Specifically, as shown in fig. 4, continuous or discontinuous color channel data is randomly selected according to the bit number of binary data corresponding to the watermark information to be embedded. Similarly, taking the watermark information to be embedded as the letter J, the binary data corresponding to the watermark information to be embedded is 01001010, and the bit number is 8. Optionally, 10 consecutive pixels are selected from the current image, and in order to reduce the influence on the image quality, B channel data in the current pixel is selected, optionally, R channel data or G channel data in the current pixel may also be selected, and the embodiment does not limit the selection of the color channel data. Specifically, the selected B-channel data specifically includes: 158. 166, 194, 219, 181, 241, 235, 214, 234, and 221. Wherein the currently selected pixel data includes: 158. 166, 194, 181, 241, 235, 234 and 221, 219 and 214 are B-channel data of pixels at the break, i.e., as interference item data, and are rewritten together with the selected pixel data.
And S230, for each selected pixel data, determining a first parity of a bit corresponding to the current pixel data in the binary data and a second parity of the current pixel data, and rewriting the current pixel data according to a preset rewriting mode when the first parity and the second parity are different.
In the embodiment of the invention, the first parity of the bit corresponding to the current pixel data in the binary data corresponding to the watermark information to be embedded in the embodiment and the second parity of the selected current pixel data are determined according to the parity judgment rule of the data. And rewriting the current pixel data according to a preset rewriting rule. Specifically, when the bit in the first data corresponding to the first parity is an odd number and the pixel data of the corresponding bit in the second data corresponding to the second parity is an even number, increasing the current pixel data by a preset value; and when the bit in the first data corresponding to the first parity is even and the pixel data of the corresponding bit in the second data corresponding to the second parity is odd, reducing the pixel data of the current pixel by a preset value. Optionally, the preset value includes, but is not limited to, odd numbers such as 1, 3, 5, etc., and the example takes the preset value equal to 1 as an example. Optionally, the rewriting rule of the interference item data is to randomly rewrite the interference item data, specifically, an arbitrary value may be randomly increased or randomly decreased to the interference item data, and the rewriting manner of the interference item is not limited in this embodiment. Exemplarily, taking watermark information as a letter J and taking color channel data of a preset number in a current image pixel as pixel data by obtaining, as an example, binary data corresponding to the letter J is 01001010, where the selected color channel data includes: 196. 210, 181, 84, 132, 221, 213, 94, 220, 87, 142, and 123. Acquiring a first bit in binary data corresponding to watermark information, wherein the bit data is 0, judging that the first parity of the bit is an even number according to a data parity judgment rule, acquiring pixel data corresponding to the bit, wherein the pixel data is 196, and the pixel data can be judged to be an even number, so that the current pixel data is not rewritten and still is 196; acquiring a second bit in binary data corresponding to the watermark information, wherein the bit data is 1, judging that the first parity of the bit is an odd number, acquiring pixel data corresponding to the bit, wherein the pixel data is 210, and judging that the pixel data is an even number, so that a preset value of 1 is added to the current pixel data according to a first rewriting mode, and the rewritten pixel data is 210; acquiring a third bit in binary data corresponding to the watermark information, wherein the bit data is 0, judging that the first parity of the bit is even, acquiring pixel data corresponding to the bit, wherein the pixel data is 181, and judging that the pixel data is odd, so that the preset value 1 is reduced for the current pixel data according to a second rewriting mode, and the rewritten pixel data is 180; acquiring color channel data 84 at the discontinuity as an interference item, randomly increasing a numerical value of 0, and acquiring rewritten interference item data 84; rewriting all selected pixel data and interference item data according to the rewriting rule in sequence, and acquiring the rewritten data specifically includes: 196. 211, 180, 84, 132, 221, 212, 95, 221 and 86. Wherein the interference term data 84 and 95 are removed, and the obtaining of the rewritten pixel data includes: 196. 211, 180, 132, 221, 212, 221 and 86. And replacing the pixel data before rewriting with the currently rewritten pixel data to form a current image, namely the image embedded with the watermark information.
Exemplarily, taking the watermark information as a letter J and taking color channel data of a preset number obtained by acquiring a preset number of pixels in a current image as pixel data, where binary data corresponding to the letter J is 01001010, and the selected B channel data includes: 158. 166, 194, 219, 181, 241, 235, 214, 234, and 221. Acquiring a first bit in binary data corresponding to watermark information, wherein the bit data is 0, judging that the first parity of the bit is an even number according to a data parity judgment rule, acquiring pixel data corresponding to the bit, wherein the pixel data is 158, and can be judged to be the even number, so that the current pixel data is not rewritten and still is 158; acquiring a second bit in binary data corresponding to the watermark information, wherein the bit data is 1, judging that the first parity of the bit is an odd number, acquiring pixel data corresponding to the bit, wherein the pixel data is 166, and judging that the pixel data is an even number, so that a preset value of 3 is added to the current pixel data according to a first rewriting mode, and the rewritten pixel data is 169; acquiring a third bit in binary data corresponding to the watermark information, wherein the bit data is 0, judging that the first parity of the bit is an even number, acquiring pixel data corresponding to the bit, wherein the pixel data is 194, and judging that the pixel data is an even number, so that the current pixel data is not rewritten and still is 194; acquiring color channel data 219 at the interruption part as an interference item, randomly increasing a numerical value of 3, and acquiring rewritten interference item data as 222; rewriting all selected pixel data and interference item data according to the rewriting rule in sequence, and acquiring the rewritten data specifically includes: 158. 169, 194, 222, 178, 241, 232, 210, 237, and 218. Wherein, removing the disturbance term data 222 and 210, and acquiring the rewritten pixel data comprises: 158. 169, 194, 178, 241, 232, 237 and 218. And replacing the pixel data before rewriting with the currently rewritten pixel data to form a current image, namely the image embedded with the watermark information.
In some embodiments of the present invention, binary data corresponding to watermark information in an image may also be obtained by obtaining a preset number of pixel data in the image in which the watermark information is embedded. Specifically, a current image embedded with watermark information is obtained, and a preset number of pixel data are selected from the pixel data of the current image. Optionally, a preset number of continuous or discontinuous color channel data may be selected from RGB data of pixels in the current image as selected pixel data, and binary data corresponding to the watermark information is determined according to a remainder of division between each selected data and 2, for example, as shown in fig. 5, the preset number of pixel data in the pixels of the current image embedded with the watermark information is obtained, and specifically includes: 196. 211, 180, 84, 132, 221, 212, 95, 221 and 86. Dividing each pixel data by 2 in sequence to obtain a remainder, wherein the obtained remainder is as follows: 01001010, and the rest is binary data of watermark information. Optionally, RGB data of a preset number of continuous or discontinuous pixels in the current image may be obtained, one preset color channel data in each RGB data is selected, and the obtained color channel data is used as the selected pixel data. And determining binary data corresponding to the watermark information according to the remainder of division of the selected data by 2. For example, as shown in fig. 6, acquiring a preset number of pixel data in a preset number of pixels in a current image in which watermark information is embedded specifically includes: 158. 169, 194, 178, 241, 232, 237 and 218. Dividing each pixel data by 2 in sequence to obtain a remainder, wherein the obtained remainder is as follows: 01001010, and the rest is binary data of watermark information.
The embodiment of the invention obtains binary data corresponding to watermark information to be embedded, and selects a preset number of pixel data in a current image; and for each pixel data, determining the first parity of a bit corresponding to the current pixel data in the binary data and the second parity of the current pixel data, and rewriting the current pixel data according to a preset rewriting mode when the first parity and the second parity meet a preset condition to obtain a current image embedded with the watermark information, and adding the rewriting of the interference item data in the process of writing the pixel data, thereby further improving the safety of the image watermark information. And the color channel data of the least significant bit is acquired for overwriting to further reduce the influence on the image quality.
The following is an embodiment of an apparatus for processing image data according to an embodiment of the present invention, which belongs to the same inventive concept as the method for processing image data according to the above embodiments, and reference may be made to the above embodiment of the method for processing image data for details which are not described in detail in the embodiment of the apparatus for processing image data.
EXAMPLE III
Fig. 7 is a schematic structural diagram of a processing apparatus for image data according to a third embodiment of the present invention, where this embodiment is applicable to a case where a user embeds invisible watermark information into an image, and a specific structure of the processing apparatus for image data is as follows:
a pixel data obtaining module 410, configured to obtain binary data corresponding to watermark information to be embedded, and select a preset number of pixel data in a current image; wherein the preset number is consistent with the bit number of the binary data.
The pixel data rewriting module 420 is configured to determine, for each piece of pixel data, a first parity of a bit corresponding to the current pixel data in the binary data and a second parity of the current pixel data, and rewrite the current pixel data according to a preset rewriting manner when the first parity and the second parity satisfy a preset condition, so as to obtain a current image embedded with the watermark information.
Optionally, the pixel data obtaining module 410 includes:
and the color channel data selection unit is used for selecting a preset number of color channel data from the RGB data of the pixels in the current image, and taking the selected color channel data as pixel data respectively.
Optionally, the color channel data selecting unit includes:
the first color channel data selection subunit is configured to acquire RGB data of a preset number of continuous or discontinuous pixels in a current image, and select one preset color channel data from the RGB data.
And the first color channel data rewriting subunit is used for randomly rewriting a preset color channel data in the RGB data of the pixels which are not selected at the break if the RGB data of the discontinuous pixels are acquired.
Optionally, the color channel data selecting unit further includes:
and the second color channel data selection subunit is used for selecting a preset number of continuous or discontinuous color channel data from the RGB data of the pixels in the current image.
And the second color channel data rewriting subunit is used for randomly rewriting the unselected color channel data at the break part if the obtained discontinuous color channel data is obtained.
Optionally, the pixel data rewriting module 420 includes:
and a pixel data rewriting unit configured to rewrite the current pixel data in a preset rewriting manner when the first parity is different from the second parity.
A rewriting condition determining unit configured to add a preset value to current pixel data if the first parity is an odd number and the second parity is an even number; if the first parity is even and the second parity is odd, subtracting a preset value from the current pixel data.
Optionally, the apparatus further comprises: an image acquisition module for embedding watermark information;
the image acquisition module for embedding the watermark information comprises:
and the current image acquisition unit is used for acquiring the current image embedded with the watermark information.
And the pixel data selecting unit is used for selecting a preset number of pixel data from the current image embedded with the watermark information.
And the binary data determining unit is used for determining the remainder of division of each pixel data selected from the current image embedded with the watermark information and 2, and determining the binary data corresponding to the watermark information according to each remainder.
The image data processing device provided by the embodiment of the invention can execute the method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
The embodiment of the invention obtains binary data corresponding to watermark information to be embedded, and selects a preset number of pixel data in a current image; for each pixel data, determining a first parity of a bit corresponding to the current pixel data in the binary data and a second parity of the current pixel data, and rewriting the current pixel data according to a preset rewriting mode when the first parity and the second parity meet a preset condition to obtain a current image embedded with the watermark information.
It should be noted that, in the embodiment of the image data processing apparatus, the units and modules included in the image data processing apparatus are only divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be realized; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
Example four
Fig. 8 is a schematic structural diagram of an electronic device in the fourth embodiment of the present invention. FIG. 8 illustrates a block diagram of an exemplary electronic device 312 suitable for use in implementing embodiments of the present invention. The electronic device 312 shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 8, electronic device 312 is in the form of a general purpose computing device. The components of the electronic device 312 may include, but are not limited to: one or more processors or processing units 316, a system memory 328, and a bus 318 that couples the various system components including the system memory 328 and the processing unit 316.
Bus 318 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 312 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 312 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 328 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)330 and/or cache memory 332. The electronic device 312 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 334 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 8, and commonly referred to as a "hard drive"). Although not shown in FIG. 8, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 318 by one or more data media interfaces. Memory 328 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 340 having a set (at least one) of program modules 342 may be stored, for example, in memory 328, such program modules 342 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 342 generally perform the functions and/or methodologies of the described embodiments of the invention.
The electronic device 312 may also communicate with one or more external devices 314 (e.g., keyboard, pointing device, display 324, etc.), with one or more devices that enable a user to interact with the electronic device 312, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 312 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 322. Also, the electronic device 312 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 320. As shown, a network adapter 320 communicates with the other modules of the electronic device 312 via the bus 318. It should be appreciated that although not shown in FIG. 8, other hardware and/or software modules may be used in conjunction with electronic device 312, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 316 executes various functional applications and data processing by executing programs stored in the system memory 328, for example, implementing a processing method of image data provided by an embodiment of the present invention, the method including:
acquiring binary data corresponding to watermark information to be embedded, and selecting a preset number of pixel data in a current image; wherein the preset number is consistent with the bit number of the binary data;
and for each pixel data, determining a first parity of a bit corresponding to the current pixel data in the binary data and a second parity of the current pixel data, and rewriting the current pixel data according to a preset rewriting mode when the first parity and the second parity meet a preset condition to obtain a current image embedded with the watermark information.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for processing image data, where the method includes:
acquiring binary data corresponding to watermark information to be embedded, and selecting a preset number of pixel data in a current image; wherein the preset number is consistent with the bit number of the binary data;
and for each pixel data, determining a first parity of a bit corresponding to the current pixel data in the binary data and a second parity of the current pixel data, and rewriting the current pixel data according to a preset rewriting mode when the first parity and the second parity meet a preset condition to obtain a current image embedded with the watermark information. Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or electronic device. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (12)

1. A method of processing image data, comprising:
acquiring binary data corresponding to watermark information to be embedded, and selecting a preset number of pixel data in a current image; wherein the preset number is consistent with the bit number of the binary data;
and for each pixel data, determining a first parity of a bit corresponding to the current pixel data in the binary data and a second parity of the current pixel data, and rewriting the current pixel data according to a preset rewriting mode when the first parity and the second parity meet a preset condition to obtain a current image embedded with the watermark information.
2. The method according to claim 1, wherein rewriting the current pixel data in a preset rewriting manner when the first parity and the second parity satisfy a preset condition includes:
and when the first parity is different from the second parity, rewriting the current pixel data according to a preset rewriting mode.
3. The method of claim 2, wherein overwriting the current pixel data in a predetermined overwriting manner comprises:
if the first parity is odd and the second parity is even, adding a preset value to the current pixel data;
if the first parity is even and the second parity is odd, subtracting a preset value from the current pixel data.
4. The method of claim 1, wherein selecting a predetermined number of pixel data in the current image comprises:
selecting a preset number of color channel data from RGB data of pixels in a current image, and taking the selected color channel data as pixel data respectively.
5. The method of claim 4, wherein selecting a preset number of color channel data from the RGB data of the pixels in the current image comprises:
the method comprises the steps of obtaining RGB data of continuous or discontinuous pixels with preset quantity in a current image, and selecting preset color channel data in the RGB data.
6. The method of claim 5, further comprising:
and if the RGB data of the discontinuous pixels are acquired, randomly rewriting a preset color channel data in the RGB data of the non-selected pixels at the discontinuous positions.
7. The method of claim 4, wherein selecting a preset number of color channel data from the RGB data of the pixels in the current image comprises:
a preset number of continuous or discontinuous color channel data is selected from RGB data of pixels in a current image.
8. The method of claim 7, further comprising:
and if the discontinuous color channel data is acquired, randomly rewriting the unselected color channel data at the discontinuity.
9. The method according to any one of claims 1-8, further comprising:
acquiring a current image of the embedded watermark information;
selecting a preset number of pixel data from the current image embedded with the watermark information;
and determining remainder of division of each pixel data selected from the current image embedded with the watermark information and 2, and determining binary data corresponding to the watermark information according to each remainder.
10. An apparatus for processing image data, comprising:
the pixel data acquisition module is used for acquiring binary data corresponding to the watermark information to be embedded and selecting a preset number of pixel data in the current image; wherein the preset number is consistent with the bit number of the binary data;
and the pixel data rewriting module is used for determining a first parity of a bit corresponding to the current pixel data in the binary data and a second parity of the current pixel data for each pixel data, and rewriting the current pixel data according to a preset rewriting mode when the first parity and the second parity meet a preset condition to obtain the current image embedded with the watermark information.
11. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of processing image data as claimed in any one of claims 1-9.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of processing image data according to any one of claims 1 to 9.
CN202011302911.1A 2020-11-19 2020-11-19 Image data processing method and device, electronic equipment and storage medium Pending CN113766243A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011302911.1A CN113766243A (en) 2020-11-19 2020-11-19 Image data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011302911.1A CN113766243A (en) 2020-11-19 2020-11-19 Image data processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113766243A true CN113766243A (en) 2021-12-07

Family

ID=78786156

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011302911.1A Pending CN113766243A (en) 2020-11-19 2020-11-19 Image data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113766243A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023102936A1 (en) * 2021-12-10 2023-06-15 深圳传音控股股份有限公司 Image information processing method, intelligent terminal, and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030097568A1 (en) * 2000-11-02 2003-05-22 Jong-Uk Choi Watermaking system and method for protecting a digital image from forgery or alteration
JP2013066054A (en) * 2011-09-16 2013-04-11 Ricoh Co Ltd Image processing apparatus, method and program
CN108242041A (en) * 2016-12-26 2018-07-03 天津职业技术师范大学 A kind of non-blind watermark implementing method of random order based on chaos

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030097568A1 (en) * 2000-11-02 2003-05-22 Jong-Uk Choi Watermaking system and method for protecting a digital image from forgery or alteration
JP2013066054A (en) * 2011-09-16 2013-04-11 Ricoh Co Ltd Image processing apparatus, method and program
CN108242041A (en) * 2016-12-26 2018-07-03 天津职业技术师范大学 A kind of non-blind watermark implementing method of random order based on chaos

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
薛辉等: "基于像素点灰度值奇偶性的数字图像水印方案", 《计算机应用研究》, pages 347 - 348 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023102936A1 (en) * 2021-12-10 2023-06-15 深圳传音控股股份有限公司 Image information processing method, intelligent terminal, and storage medium

Similar Documents

Publication Publication Date Title
US10303902B2 (en) Hardware assist for privilege access violation checks
CN111090628B (en) Data processing method and device, storage medium and electronic equipment
CN107515759B (en) Screen capture method and device, electronic equipment and readable storage medium
US10649905B2 (en) Method and apparatus for storing data
US10042576B2 (en) Method and apparatus for compressing addresses
CN106383880B (en) GIF file playing method and system
CN107315729B (en) Data processing method, medium, device and computing equipment for chart
EP3270371B1 (en) Method and apparatus for managing graphics layers within a graphics display component
CN111597003B (en) Picture rendering method and device, computer equipment and medium
US7496727B1 (en) Secure memory access system and method
US20090138687A1 (en) Memory device having data processing function
CN112035857A (en) Data protection method, device, equipment and medium
CN113766243A (en) Image data processing method and device, electronic equipment and storage medium
CN112968828A (en) Chat message display method, device, equipment and storage medium
CN112000336A (en) Interface rendering method, electronic device and computer-readable storage medium
CN112214784A (en) Resource processing method, device, electronic equipment and medium
CN108259958B (en) Remote control key response method, device, equipment and storage medium
JPH0553909A (en) Cache memory control system for image data processing
CN111062053B (en) Method, device, equipment and medium for processing biological characteristic data
US9794580B2 (en) Cache management device, and motion picture system and method using the same
CN112839227B (en) Image coding method, device, equipment and medium
US11017495B2 (en) Systems, processes, and computer program products for acceleration of bit-per-pixel fill transfers in a graphics rendering system
CN114356475A (en) Display processing method, device, equipment and storage medium
CN108876703B (en) Data storage method
CN113010454A (en) Data reading and writing method, device, terminal and storage medium

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