[go: up one dir, main page]

CN111966973A - Copyright protection method and system based on picture pixel value steganography - Google Patents

Copyright protection method and system based on picture pixel value steganography Download PDF

Info

Publication number
CN111966973A
CN111966973A CN202010693792.0A CN202010693792A CN111966973A CN 111966973 A CN111966973 A CN 111966973A CN 202010693792 A CN202010693792 A CN 202010693792A CN 111966973 A CN111966973 A CN 111966973A
Authority
CN
China
Prior art keywords
picture
characters
pixel points
binary string
rgb
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.)
Withdrawn
Application number
CN202010693792.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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010693792.0A priority Critical patent/CN111966973A/en
Publication of CN111966973A publication Critical patent/CN111966973A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/16Program or content traceability, e.g. by watermarking

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

本发明提供了一种基于图片像素值隐写的版权保护方法及系统,本发明通过对图片像素点的奇偶性进行和二进制串进行比对,依据约定的规则对像素点进行微调,达到在不影响图片质量本身和体积大小的前提下,将特定内容的版权溯源信息写入文件,并通过反向取证的方式实现了对图片的版权保护,达到既不影响图片本身质量和展示效果,又能隐藏特定信息在图片中的效果,方便对图片进行溯源,有助于版权保护,确保不被他人剽窃。

Figure 202010693792

The invention provides a copyright protection method and system based on steganography of picture pixel values. The invention compares the parity of picture pixel points with the binary string, and fine-tunes the pixel points according to the agreed rules, so as to achieve no Under the premise of affecting the quality and size of the picture itself, the copyright traceability information of specific content is written into the file, and the copyright protection of the picture is realized through reverse forensics, so as to not affect the quality and display effect of the picture itself, but also Hide the effect of specific information in the picture, facilitate the traceability of the picture, help copyright protection, and ensure that it is not plagiarized by others.

Figure 202010693792

Description

一种基于图片像素值隐写的版权保护方法及系统A copyright protection method and system based on image pixel value steganography

技术领域technical field

本发明涉及版权保护技术领域,特别是一种基于图片像素值隐写的版权保护方法及系统。The invention relates to the technical field of copyright protection, in particular to a copyright protection method and system based on image pixel value steganography.

背景技术Background technique

在Web开发时,发布的产品以及用户上传资源中,包含有大量图片资源,其中一些图片是包含有版权的,或者含有内网敏感信息,通过对这些图片进行特定编码的写入,实现对这些资源的溯源和保护。During web development, the released products and user-uploaded resources contain a large number of image resources, some of which are copyrighted or contain sensitive information on the intranet. Traceability and protection of resources.

目前互联网有价值的信息获取成本越来越高,很多网站营运者耗费了大量的人力和资金收集到的信息,被一些爬虫轻易采集以自用或获利。比如淘宝网店的模特照片,经营者花费不菲成本请来模特拍摄的照片被其他网店轻易剽窃用于自己的网店。对于SNS用户社交网站,其用户和用户产生的内容是网站最大的财富,也是网站的竞争力一部分。一些社交旅游网站由该站用户上传的大量精美照片,被竞争对手用爬虫抓取用于丰富自身内容。At present, the cost of obtaining valuable information on the Internet is getting higher and higher. Many website operators spend a lot of manpower and funds to collect the information, which is easily collected by some crawlers for their own use or profit. For example, the model photos of Taobao's online store, the photos taken by the model at a high cost are easily stolen by other online stores and used in their own online stores. For SNS user social networking sites, its users and user-generated content are the site's greatest wealth and a part of the site's competitiveness. A large number of beautiful photos uploaded by users of some social travel websites are scraped by competitors to enrich their own content with crawlers.

如何确保这些内容不被他人轻易剽窃,是本领域急需解决的重要问题,相机拍摄的照片中含有Exif(Exchangeable image file format,记录数码照片的属性信息和拍摄数据)信息,但这些信息主要是设备信息、拍摄时间等,存储的信息量较小,能被轻易抹除和修改,不具有溯源的价值。How to ensure that these contents are not easily plagiarized by others is an important problem that needs to be solved urgently in the field. The photos taken by the camera contain Exif (Exchangeable image file format, which records the attribute information and shooting data of digital photos) information, but these information are mainly equipment Information, shooting time, etc., the amount of stored information is small, can be easily erased and modified, and does not have the value of traceability.

发明内容SUMMARY OF THE INVENTION

本发明的目的是提供一种基于图片像素值隐写的版权保护方法及系统,旨在解决现有技术中图片的Exif信息可被轻易抹除和修改,不能提供版权保护的问题,实现对图片进行溯源,有助于版权保护,确保不被他人剽窃。The purpose of the present invention is to provide a kind of copyright protection method and system based on picture pixel value steganography, aiming to solve the problem that the Exif information of the picture can be easily erased and modified in the prior art, and the copyright protection cannot be provided, so as to realize the protection of the picture. Tracing the source can help copyright protection and ensure that it is not plagiarized by others.

为达到上述技术目的,本发明提供了一种基于图片像素值隐写的版权保护方法,所述方法包括以下操作:In order to achieve the above-mentioned technical purpose, the present invention provides a copyright protection method based on image pixel value steganography, and the method includes the following operations:

对图片进行像素点采样,确定可写入图片的字符数量;Sampling the pixels of the picture to determine the number of characters that can be written into the picture;

当所需编码的版权信息文本的字符数量小于所述可写入图片的字符数量时,将所需编码的版权信息文本转换成二进制串;When the number of characters of the copyright information text to be encoded is less than the number of characters of the writable picture, convert the copyright information text to be encoded into a binary string;

将二进制串的比特位与顺序排列的像素点的RGB三值一一对应,并通过二进制串逐位对像素点进行微调,按照1为奇数、0为偶数的规则,将像素点的RGB值奇偶性与对应二进制串位不同的RGB值进行加1或减1,调整为与对应二进制串位的数值奇偶性一一对应,并将所需编码的总长度按逆序写入图片最后N个像素点;One-to-one correspondence between the bits of the binary string and the RGB values of the sequentially arranged pixels, and fine-tune the pixels bit by bit through the binary string. According to the rule that 1 is odd and 0 is even, the RGB value of the pixel is odd and even. Add 1 or subtract 1 to the RGB values whose properties are different from the corresponding binary string bits, adjust them to correspond one-to-one with the numerical parity of the corresponding binary string bits, and write the total length of the required encoding into the last N pixels of the picture in reverse order. ;

在版权保护取证时,对图片最后N个像素点提取编码长度A,根据长度值A,获取图片前A个像素点对应的RGB三值,按照1为奇数、0为偶数的规则,将RGB值的奇偶性转换为包含1、0的二进制串,并对二进制串反向解码出版权信息文本。When collecting evidence for copyright protection, extract the coding length A from the last N pixels of the picture, and obtain the RGB three values corresponding to the first A pixels of the picture according to the length value A. According to the rule that 1 is an odd number and 0 is an even number, the RGB value is The parity of is converted into a binary string containing 1, 0, and the binary string is decoded in reverse for the publishing rights information text.

优选地,所述版权信息为文件所有者、文件创建时间、唯一序列号中的任意一种或组合。Preferably, the copyright information is any one or a combination of file owner, file creation time, and unique serial number.

优选地,所述图片在写入版权信息时需将格式转换为统一格式。Preferably, the format of the picture needs to be converted into a unified format when the copyright information is written.

优选地,所述可写入图片的字符数量为:Preferably, the number of characters that can be written into the picture is:

当字符为中文时,字符数量为像素点数量/24;当字符为英文或数字时,字符数量为像素点数量/16。When the characters are Chinese, the number of characters is the number of pixels/24; when the characters are English or numbers, the number of characters is the number of pixels/16.

本发明实施例还提供了一种基于图片像素值隐写的版权保护系统,所述系统包括:The embodiment of the present invention also provides a copyright protection system based on image pixel value steganography, the system includes:

图片像素点采样模块,用于对图片进行像素点采样,确定可写入图片的字符数量;The picture pixel sampling module is used to sample the pixels of the picture to determine the number of characters that can be written into the picture;

版权信息文本转换模块,用于当所需编码的版权信息文本的字符数量小于所述可写入图片的字符数量时,将所需编码的版权信息文本转换成二进制串;A copyright information text conversion module, used for converting the required encoded copyright information text into a binary string when the number of characters of the required encoded copyright information text is less than the number of characters that can be written into the picture;

像素点RGB值微调模块,用于将二进制串的比特位与顺序排列的像素点的RGB三值一一对应,并通过二进制串逐位对像素点进行微调,按照1为奇数、0为偶数的规则,将像素点的RGB值奇偶性与对应二进制串位不同的RGB值进行加1或减1,调整为与对应二进制串位的数值奇偶性一一对应,并将所需编码的总长度按逆序写入图片最后N个像素点;The pixel point RGB value fine-tuning module is used to correspond the bits of the binary string to the RGB three values of the sequentially arranged pixel points, and fine-tune the pixel points bit by bit through the binary string, according to 1 for odd and 0 for even. As a rule, add 1 or subtract 1 to the RGB value parity of the pixel point and the RGB value with different corresponding binary string bits, adjust it to correspond one-to-one with the numerical parity of the corresponding binary string bits, and set the total length of the required encoding according to Write the last N pixels of the picture in reverse order;

版权信息提取模块,用于在版权保护取证时,对图片最后N个像素点提取编码长度A,根据长度值A,获取图片前A个像素点对应的RGB三值,按照1为奇数、0为偶数的规则,将RGB值的奇偶性转换为包含1、0的二进制串,并对二进制串反向解码出版权信息文本。The copyright information extraction module is used to extract the coding length A for the last N pixels of the picture when collecting evidence of copyright protection, and obtain the RGB three values corresponding to the first A pixels of the picture according to the length value A, according to which 1 is an odd number and 0 is an odd number. The even number rule converts the parity of the RGB value into a binary string containing 1 and 0, and reversely decodes the binary string to publish the copyright information text.

优选地,所述版权信息为文件所有者、文件创建时间、唯一序列号中的任意一种或组合。Preferably, the copyright information is any one or a combination of file owner, file creation time, and unique serial number.

优选地,所述图片在写入版权信息时需将格式转换为统一格式。Preferably, the format of the picture needs to be converted into a unified format when the copyright information is written.

优选地,所述可写入图片的字符数量为:Preferably, the number of characters that can be written into the picture is:

当字符为中文时,字符数量为像素点数量/24;当字符为英文或数字时,字符数量为像素点数量/16。When the characters are Chinese, the number of characters is the number of pixels/24; when the characters are English or numbers, the number of characters is the number of pixels/16.

本发明还提供了一种基于图片像素值隐写的版权保护设备,包括:The present invention also provides a copyright protection device based on picture pixel value steganography, including:

存储器,用于存储计算机程序;memory for storing computer programs;

处理器,用于执行所述计算机程序,以实现所述的基于图片像素值隐写的版权保护方法。The processor is configured to execute the computer program to implement the copyright protection method based on steganography of picture pixel values.

本发明还提供了一种可读存储介质,用于保存计算机程序,其中,所述计算机程序被处理器执行时实现所述的基于图片像素值隐写的版权保护方法。The present invention also provides a readable storage medium for storing a computer program, wherein when the computer program is executed by a processor, the copyright protection method based on picture pixel value steganography is implemented.

发明内容中提供的效果仅仅是实施例的效果,而不是发明所有的全部效果,上述技术方案中的一个技术方案具有如下优点或有益效果:The effects provided in the summary of the invention are only the effects of the embodiments, rather than all the effects of the invention. One of the above technical solutions has the following advantages or beneficial effects:

与现有技术相比,本发明通过对图片像素点的奇偶性进行和二进制串进行比对,依据约定的规则对像素点进行微调,达到在不影响图片质量本身和体积大小的前提下,将特定内容的版权溯源信息写入文件,并通过反向取证的方式实现了对图片的版权保护,达到既不影响图片本身质量和展示效果,又能隐藏特定信息在图片中的效果,方便对图片进行溯源,有助于版权保护,确保不被他人剽窃。Compared with the prior art, the present invention compares the parity of the pixel points of the picture with the binary string, and fine-tunes the pixels according to the agreed rules, so as to achieve the premise of not affecting the quality of the picture itself and the size of the volume. The copyright traceability information of specific content is written into the file, and the copyright protection of the picture is realized through reverse forensics, so as not to affect the quality and display effect of the picture itself, but also to hide the effect of specific information in the picture, which is convenient for the picture. Tracing the source can help copyright protection and ensure that it is not plagiarized by others.

附图说明Description of drawings

图1为本发明实施例中所提供的一种基于图片像素值隐写的版权保护方法流程图;1 is a flowchart of a copyright protection method based on picture pixel value steganography provided in an embodiment of the present invention;

图2为本发明实施例中所提供的编码过程示例;2 is an example of an encoding process provided in an embodiment of the present invention;

图3为本发明实施例中所提供的一种基于图片像素值隐写的版权保护系统框图。FIG. 3 is a block diagram of a copyright protection system based on image pixel value steganography provided in an embodiment of the present invention.

具体实施方式Detailed ways

为了能清楚说明本方案的技术特点,下面通过具体实施方式,并结合其附图,对本发明进行详细阐述。下文的公开提供了许多不同的实施例或例子用来实现本发明的不同结构。为了简化本发明的公开,下文中对特定例子的部件和设置进行描述。此外,本发明可以在不同例子中重复参考数字和/或字母。这种重复是为了简化和清楚的目的,其本身不指示所讨论各种实施例和/或设置之间的关系。应当注意,在附图中所图示的部件不一定按比例绘制。本发明省略了对公知组件和处理技术及工艺的描述以避免不必要地限制本发明。In order to clearly illustrate the technical features of the solution, the present invention will be described in detail below through specific embodiments and in conjunction with the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing different structures of the invention. In order to simplify the disclosure of the present invention, the components and arrangements of specific examples are described below. Furthermore, the present invention may repeat reference numerals and/or letters in different instances. This repetition is for the purpose of simplicity and clarity and does not in itself indicate a relationship between the various embodiments and/or arrangements discussed. It should be noted that the components illustrated in the figures are not necessarily drawn to scale. Descriptions of well-known components and processing techniques and processes are omitted from the present invention to avoid unnecessarily limiting the present invention.

下面结合附图对本发明实施例所提供的一种基于图片像素值隐写的版权保护方法及系统进行详细说明。A method and system for copyright protection based on image pixel value steganography provided by the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

如图1所示,本发明公开了一种基于图片像素值隐写的版权保护方法,所述方法包括以下操作:As shown in FIG. 1, the present invention discloses a copyright protection method based on image pixel value steganography, and the method includes the following operations:

对图片进行像素点采样,确定可写入图片的字符数量;Sampling the pixels of the picture to determine the number of characters that can be written into the picture;

当所需编码的版权信息文本的字符数量小于所述可写入图片的字符数量时,将所需编码的版权信息文本转换成二进制串;When the number of characters of the copyright information text to be encoded is less than the number of characters of the writable picture, convert the copyright information text to be encoded into a binary string;

将二进制串的比特位与顺序排列的像素点的RGB三值一一对应,并通过二进制串逐位对像素点进行微调,按照1为奇数、0为偶数的规则,将像素点的RGB值奇偶性与对应二进制串位不同的RGB值进行加1或减1,调整为与对应二进制串位的数值奇偶性一一对应,并将所需编码的总长度按逆序写入图片最后N个像素点;One-to-one correspondence between the bits of the binary string and the RGB values of the sequentially arranged pixels, and fine-tune the pixels bit by bit through the binary string. According to the rule that 1 is odd and 0 is even, the RGB value of the pixel is odd and even. Add 1 or subtract 1 to the RGB values whose properties are different from the corresponding binary string bits, adjust them to correspond one-to-one with the numerical parity of the corresponding binary string bits, and write the total length of the required encoding into the last N pixels of the picture in reverse order. ;

在版权保护取证时,对图片最后N个像素点提取编码长度A,根据长度值A,获取图片前A个像素点对应的RGB三值,按照1为奇数、0为偶数的规则,将RGB值的奇偶性转换为包含1、0的二进制串,并对二进制串反向解码出版权信息文本。When collecting evidence for copyright protection, extract the coding length A from the last N pixels of the picture, and obtain the RGB three values corresponding to the first A pixels of the picture according to the length value A. According to the rule that 1 is an odd number and 0 is an even number, the RGB value is The parity of is converted into a binary string containing 1, 0, and the binary string is decoded in reverse for the publishing rights information text.

本发明实施例通过对图片像素点的奇偶性进行和二进制串进行比对,依据约定的规则对像素点进行微调,达到在不影响图片质量本身和体积大小的前提下,将特定内容的版权溯源信息写入文件,并通过反向取证的方式实现了对图片的版权保护。In the embodiment of the present invention, by comparing the parity of the pixel points of the picture with the binary string, and fine-tuning the pixels according to the agreed rules, the copyright of specific content can be traced without affecting the quality and size of the picture itself. The information is written into the file, and the copyright protection of the picture is realized through reverse forensics.

对图片进行格式转换,格式转换是将各种格式的图片统一转换为PNG格式,Web中最常见的图片格式包括G I F、PNG以及JPG等,其他格式并不常见,图片格式之间相互转换是可行的,格式转换后的图片统一为PNG格式,格式统一后减少了后续处理的复杂度。Format conversion of pictures. Format conversion is to uniformly convert pictures of various formats into PNG format. The most common picture formats in the Web include GIF, PNG and JPG, etc. Other formats are not common, and it is feasible to convert between picture formats. Yes, the converted images are in PNG format, which reduces the complexity of subsequent processing.

将格式转换后的图片进行压缩,将体积过大的图片进行压缩,以便在网络中进行传输,该操作可视网络带宽以及存储而定。Compress the format-converted pictures, and compress the pictures that are too large for transmission in the network. This operation depends on the network bandwidth and storage.

为确定能写入的信息量大小,进行图片信息采样。获取图片像素大小,也即图片的宽高,例如手机照片宽高为3120*4160,其结果是12979200。宽高是3120*4160大小的照片,即拥有12979200个像素点,每个像素点都是某个颜色的色块。在色彩体系中,认为每种颜色都是由红绿蓝三种颜色组成的,即红、绿、蓝三种颜色,其中RGB的每种颜色的调和取值范围是0-255,比如红色对应的RGB是(255,0,0)。计算图片提供的信息量,12979200个像素点对应就有12979200*3个颜色取值采样,也即能存储12979200*3=38937600比特位信息。In order to determine the amount of information that can be written, image information sampling is performed. Get the pixel size of the picture, that is, the width and height of the picture. For example, the width and height of a mobile phone photo is 3120*4160, and the result is 12979200. A photo with a width and height of 3120*4160 has 12979200 pixels, and each pixel is a color block of a certain color. In the color system, it is considered that each color is composed of three colors of red, green and blue, namely red, green and blue. The harmonic value range of each color of RGB is 0-255. For example, red corresponds to The RGB is (255, 0, 0). Calculate the amount of information provided by the picture, 12979200 pixels correspond to 12979200*3 color value samples, that is, 12979200*3=38937600 bits of information can be stored.

将特定信息如文件所有者、文件创建时间、唯一序列号等信息编码后写入图片中。收集需要隐藏到图片中的信息,内容不限,可以包含图片创建者姓名以及用户账号、电子邮箱等私人信息,唯一序列号等,只需保证信息可追溯,可唯一确定来源即可。如图2所示,将内容按照UTF-8编码转为二进制串,每个中文是3个字节,英文和数字是2个字节,每个字节是8个比特位,比如“版权”两个汉字对应的二进制是“111001111000100110001000Encode specific information such as file owner, file creation time, unique serial number and other information into the picture. Collect the information that needs to be hidden in the picture. The content is not limited. It can include the name of the creator of the picture, private information such as user account and email address, unique serial number, etc., as long as the information can be traced back and the source can be uniquely determined. As shown in Figure 2, the content is converted into a binary string according to UTF-8 encoding, each Chinese is 3 bytes, English and numbers are 2 bytes, each byte is 8 bits, such as "copyright" The binary corresponding to two Chinese characters is "111001111000100110001000

111001101001110110000011”,计算要编码的信息所占的字符数,和图片信息采样中计算出的数值进行比对,比如要存储的信息包括上传人姓名、用户名称等在内有100个字符,平均按照每个字符占据2.5个字节计算,38937600个比特位是38937600/8=4867200位,能存储4867200/2.5=1946880个字符,远远超出要存储的100个字符。将输入的文本转换为二进制字符串,然后和图片的RGB像素奇偶对应。例如图片前三个像素RGB的值为(222,111,23)、(222,10,23)、(1,58,40),规则为偶数值对应0,奇数值对应1,则这三个像素对应存储的二进制为011001100。反之,已知输入文本的二进制字符串,只需要逐位对像素点进行微调即可,比如二进制串位110010,第一位1是奇数,则第一个像素点的第一个颜色取值222需要变为最接近的奇数223或221,第二位1是奇数,第一个像素点的第二个颜色取值111已经是奇数,则不需要调整,以此类推,即可完成对编码信息的写入。由于人眼的观察精度有限,对像素进行此种方式的微调,人眼无法识别出来,也不影响图片本身的展示效果。将要编码的总长度按照上一步的编码规则记入图片最后5个像素点,按照逆序记录。111001101001110110000011", calculate the number of characters occupied by the information to be encoded, and compare it with the value calculated in the image information sampling. For example, the information to be stored includes 100 characters including the uploader's name, user name, etc. A character occupies 2.5 bytes, and 38937600 bits are 38937600/8=4867200 bits, which can store 4867200/2.5=1946880 characters, far exceeding the 100 characters to be stored. Convert the input text to a binary string , and then correspond to the RGB pixel parity of the picture. For example, the RGB values of the first three pixels of the picture are (222, 111, 23), (222, 10, 23), (1, 58, 40), and the rule is that even values correspond to 0 , the odd value corresponds to 1, then the binary corresponding to the three pixels is 011001100. On the contrary, if the binary string of the input text is known, it is only necessary to fine-tune the pixels bit by bit, such as the binary string bit 110010, the first bit 1 is odd, then the first color value 222 of the first pixel needs to be changed to the nearest odd number 223 or 221, the second 1 is an odd number, and the second color value of the first pixel is 111 already. If it is an odd number, no adjustment is required, and so on, the coding information can be written. Due to the limited observation accuracy of the human eye, fine-tuning the pixels in this way cannot be recognized by the human eye and does not affect the picture itself. The display effect. The total length to be encoded is recorded in the last 5 pixels of the picture according to the encoding rules in the previous step, and recorded in reverse order.

提取版权信息,从图片中提取编码信息,判断图片内容是否被盗用,并提取隐藏信息进行举证。从图片尾部最后5个像素点取出记录的编码长度A,根据长度值A,获取图片的前A个像素点对应的RGB三值,得到其奇偶性,按照偶数值对应0、奇数值对应1的规则转为由0和1表示的二进制串,将二进制串反向解码出文本。Extract copyright information, extract coding information from pictures, determine whether the content of the pictures has been stolen, and extract hidden information for proof. Take the recorded coding length A from the last 5 pixels at the end of the picture, and obtain the RGB three values corresponding to the first A pixels of the picture according to the length value A, and obtain its parity. According to the even value corresponding to 0 and the odd value corresponding to 1 The rule is converted to a binary string represented by 0s and 1s, and the binary string is decoded in reverse to produce text.

本发明实施例通过对特定文本和图片的像素点根据约定规则进行编码的方式,将文本信息写入图片,达到既不影响图片本身质量和展示效果,又能隐藏特定信息在图片中的效果,其操作为可逆的,即可反向提取图片中存储的文本信息,比如A美食网站在上传的照片中写入自己的域名www.aweb.com,B网站用爬虫程序盗取了该照片作为己用,A网站只需要从B网站保存此张照片,进行反向操作,提取出其中A的域名信息,即可证明B网站存在侵权行为,由于人眼的观察精度有限,对像素进行此种微调,人眼是无法识别出来的,也不影响图片本身的展示效果。由于本发明只是对图片像素的奇偶值做了调整,并没有增加任何其它冗余信息,所以这种版权保护和溯源方式不会对图片体积造成明显影响。The embodiment of the present invention writes the text information into the picture by encoding the pixels of the specific text and the picture according to the agreed rules, so as to achieve the effect of not affecting the quality and display effect of the picture itself, and hiding the specific information in the picture, The operation is reversible, and the text information stored in the picture can be extracted in reverse. For example, the food website A writes its own domain name www.aweb.com in the uploaded photo, and the website B uses the crawler program to steal the photo as its own. To use, website A only needs to save this photo from website B, perform the reverse operation, and extract the domain name information of A, which can prove that website B has infringement. Due to the limited observation accuracy of the human eye, such fine-tuning of pixels is carried out. , the human eye cannot recognize it, and it does not affect the display effect of the picture itself. Since the present invention only adjusts the parity value of the picture pixels, and does not add any other redundant information, this copyright protection and source traceability method will not have a significant impact on the picture volume.

如图3所示,本发明实施例还公开了一种基于图片像素值隐写的版权保护系统,所述系统包括:As shown in FIG. 3 , an embodiment of the present invention further discloses a copyright protection system based on steganography of picture pixel values, the system includes:

图片像素点采样模块,用于对图片进行像素点采样,确定可写入图片的字符数量;The picture pixel sampling module is used to sample the pixels of the picture to determine the number of characters that can be written into the picture;

版权信息文本转换模块,用于当所需编码的版权信息文本的字符数量小于所述可写入图片的字符数量时,将所需编码的版权信息文本转换成二进制串;A copyright information text conversion module, used for converting the required encoded copyright information text into a binary string when the number of characters of the required encoded copyright information text is less than the number of characters that can be written into the picture;

像素点RGB值微调模块,用于将二进制串的比特位与顺序排列的像素点的RGB三值一一对应,并通过二进制串逐位对像素点进行微调,按照1为奇数、0为偶数的规则,将像素点的RGB值奇偶性与对应二进制串位不同的RGB值进行加1或减1,调整为与对应二进制串位的数值奇偶性一一对应,并将所需编码的总长度按逆序写入图片最后N个像素点;The pixel point RGB value fine-tuning module is used to correspond the bits of the binary string to the RGB three values of the sequentially arranged pixel points, and fine-tune the pixel points bit by bit through the binary string, according to 1 for odd and 0 for even. As a rule, add 1 or subtract 1 to the RGB value parity of the pixel point and the RGB value with different corresponding binary string bits, adjust it to correspond one-to-one with the numerical parity of the corresponding binary string bits, and set the total length of the required encoding according to Write the last N pixels of the picture in reverse order;

版权信息提取模块,用于在版权保护取证时,对图片最后N个像素点提取编码长度A,根据长度值A,获取图片前A个像素点对应的RGB三值,按照1为奇数、0为偶数的规则,将RGB值的奇偶性转换为包含1、0的二进制串,并对二进制串反向解码出版权信息文本。The copyright information extraction module is used to extract the coding length A for the last N pixels of the picture when collecting evidence of copyright protection, and obtain the RGB three values corresponding to the first A pixels of the picture according to the length value A, according to which 1 is an odd number and 0 is an odd number. The even number rule converts the parity of the RGB value into a binary string containing 1 and 0, and reversely decodes the binary string to publish the copyright information text.

对图片进行格式转换,格式转换是将各种格式的图片统一转换为PNG格式,Web中最常见的图片格式包括GIF、PNG以及JPG等,其他格式并不常见,图片格式之间相互转换是可行的,格式转换后的图片统一为PNG格式,格式统一后减少了后续处理的复杂度。Format conversion of pictures. Format conversion is to uniformly convert pictures of various formats into PNG format. The most common picture formats in the Web include GIF, PNG, and JPG, etc. Other formats are not common, and it is feasible to convert between picture formats. Yes, the converted images are in PNG format, which reduces the complexity of subsequent processing.

将格式转换后的图片进行压缩,将体积过大的图片进行压缩,以便在网络中进行传输,该操作可视网络带宽以及存储而定。Compress the format-converted pictures, and compress the pictures that are too large for transmission in the network. This operation depends on the network bandwidth and storage.

为确定能写入的信息量大小,进行图片信息采样。获取图片像素大小,也即图片的宽高,例如手机照片宽高为3120*4160,其结果是12979200。宽高是3120*4160大小的照片,即拥有12979200个像素点,每个像素点都是某个颜色的色块。在色彩体系中,认为每种颜色都是由红绿蓝三种颜色组成的,即红、绿、蓝三种颜色,其中RGB的每种颜色的调和取值范围是0-255,比如红色对应的RGB是(255,0,0)。计算图片提供的信息量,12979200个像素点对应就有12979200*3个颜色取值采样,也即能存储12979200*3=38937600比特位信息。In order to determine the amount of information that can be written, image information sampling is performed. Get the pixel size of the picture, that is, the width and height of the picture. For example, the width and height of a mobile phone photo is 3120*4160, and the result is 12979200. A photo with a width and height of 3120*4160 has 12979200 pixels, and each pixel is a color block of a certain color. In the color system, it is considered that each color is composed of three colors of red, green and blue, namely red, green and blue. The harmonic value range of each color of RGB is 0-255. For example, red corresponds to The RGB is (255, 0, 0). Calculate the amount of information provided by the picture, 12979200 pixels correspond to 12979200*3 color value samples, that is, 12979200*3=38937600 bits of information can be stored.

将特定信息如文件所有者、文件创建时间、唯一序列号等信息编码后写入图片中。收集需要隐藏到图片中的信息,内容不限,可以包含图片创建者姓名以及用户账号、电子邮箱等私人信息,唯一序列号等,只需保证信息可追溯,可唯一确定来源即可。将内容按照UTF-8编码转为二进制串,每个中文是3个字节,英文和数字是2个字节,每个字节是8个比特位,比如“版权”两个汉字对应的二进制是“111001111000100110001000111001101001110110000011”,计算要编码的信息所占的字符数,和图片信息采样中计算出的数值进行比对,比如要存储的信息包括上传人姓名、用户名称等在内有100个字符,平均按照每个字符占据2.5个字节计算,38937600个比特位是38937600/8=4867200位,能存储4867200/2.5=1946880个字符,远远超出要存储的100个字符。将输入的文本转换为二进制字符串,然后和图片的RGB像素奇偶对应。例如图片前三个像素RGB的值为(222,111,23)、(222,10,23)、(1,58,40),规则为偶数值对应0,奇数值对应1,则这三个像素对应存储的二进制为011001100。反之,已知输入文本的二进制字符串,只需要逐位对像素点进行微调即可,比如二进制串位110010,第一位1是奇数,则第一个像素点的第一个颜色取值222需要变为最接近的奇数223或221,第二位1是奇数,第一个像素点的第二个颜色取值111已经是奇数,则不需要调整,以此类推,即可完成对编码信息的写入。由于人眼的观察精度有限,对像素进行此种方式的微调,人眼无法识别出来,也不影响图片本身的展示效果。将要编码的总长度按照上一步的编码规则记入图片最后5个像素点,按照逆序记录。Encode specific information such as file owner, file creation time, unique serial number and other information into the picture. Collect the information that needs to be hidden in the picture. The content is not limited. It can include the name of the creator of the picture, private information such as user account and email address, unique serial number, etc., as long as the information can be traced back and the source can be uniquely determined. Convert the content into a binary string according to UTF-8 encoding, each Chinese is 3 bytes, English and numbers are 2 bytes, each byte is 8 bits, such as the binary corresponding to the two Chinese characters "copyright" It is "111001111000100110001000111001101001110110000011", calculate the number of characters occupied by the information to be encoded, and compare it with the value calculated in the image information sampling. For example, the information to be stored includes the uploader's name, user name, etc. There are 100 characters. According to the calculation that each character occupies 2.5 bytes, 38937600 bits are 38937600/8=4867200 bits, which can store 4867200/2.5=1946880 characters, far exceeding the 100 characters to be stored. Convert the input text to a binary string, and then correspond to the RGB pixel parity of the image. For example, the RGB values of the first three pixels of the picture are (222, 111, 23), (222, 10, 23), (1, 58, 40). The rule is that even values correspond to 0, and odd values correspond to 1, then these three The binary corresponding to the pixel is 011001100. On the contrary, if the binary string of the input text is known, it is only necessary to fine-tune the pixels bit by bit. For example, the binary string bit is 110010, and the first 1 is an odd number, then the first color of the first pixel is 222. It needs to become the nearest odd number 223 or 221, the second bit 1 is an odd number, and the second color value of the first pixel is already an odd number 111, so no adjustment is required, and so on, the encoding information can be completed. of writing. Due to the limited observation accuracy of the human eye, the fine-tuning of the pixels in this way cannot be recognized by the human eye and does not affect the display effect of the picture itself. The total length to be encoded is recorded in the last 5 pixels of the picture according to the encoding rules in the previous step, and recorded in reverse order.

提取版权信息,从图片中提取编码信息,判断图片内容是否被盗用,并提取隐藏信息进行举证。从图片尾部最后5个像素点取出记录的编码长度A,根据长度值A,获取图片的前A个像素点对应的RGB三值,得到其奇偶性,按照偶数值对应0、奇数值对应1的规则转为由0和1表示的二进制串,将二进制串反向解码出文本。Extract copyright information, extract coding information from pictures, determine whether the content of the pictures has been stolen, and extract hidden information for proof. Take the recorded coding length A from the last 5 pixels at the end of the picture, and obtain the RGB three values corresponding to the first A pixels of the picture according to the length value A, and obtain its parity. According to the even value corresponding to 0 and the odd value corresponding to 1 The rule is converted to a binary string represented by 0s and 1s, and the binary string is decoded in reverse to produce text.

本发明实施例还公开了一种基于图片像素值隐写的版权保护设备,包括:The embodiment of the present invention also discloses a copyright protection device based on picture pixel value steganography, including:

存储器,用于存储计算机程序;memory for storing computer programs;

处理器,用于执行所述计算机程序,以实现所述的基于图片像素值隐写的版权保护方法。The processor is configured to execute the computer program to implement the copyright protection method based on steganography of picture pixel values.

本发明实施例还公开了一种可读存储介质,用于保存计算机程序,其中,所述计算机程序被处理器执行时实现所述的基于图片像素值隐写的版权保护方法。The embodiment of the present invention also discloses a readable storage medium for storing a computer program, wherein when the computer program is executed by a processor, the method for copyright protection based on steganography of picture pixel values is implemented.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention shall be included in the protection of the present invention. within the range.

Claims (10)

1. A copyright protection method based on picture pixel value steganography is characterized by comprising the following operations:
sampling pixel points of the picture, and determining the number of characters which can be written into the picture;
when the number of characters of the copyright information text required to be coded is less than that of the characters of the writable picture, converting the copyright information text required to be coded into a binary string;
the method comprises the steps of enabling bits of a binary string to correspond to RGB three values of pixels arranged in sequence one by one, finely adjusting the pixel points bit by bit through the binary string, adding 1 or subtracting 1 to the RGB value of the pixel points with different parity from the RGB value of the corresponding binary string according to the rule that 1 is an odd number and 0 is an even number, adjusting the value parity of the corresponding binary string to be in one-to-one correspondence, and writing the total length needing to be coded into the last N pixel points of a picture in a reverse order;
when the copyright protection is verified, the coding length A is extracted from the last N pixel points of the picture, the RGB three values corresponding to the A pixel points before the picture are obtained according to the length value A, the parity of the RGB values is converted into a binary string containing 1 and 0 according to the rule that 1 is an odd number and 0 is an even number, and the copyright information text is decoded reversely from the binary string.
2. The method according to claim 1, wherein the copyright information is any one or a combination of a file owner, a file creation time, and a unique serial number.
3. The method according to claim 1, wherein the format of the picture is converted into a uniform format when copyright information is written.
4. The method according to claim 1, wherein the number of characters that can be written into the picture is:
when the characters are Chinese, the number of the characters is the number of pixel points/24; when the characters are English or numbers, the number of the characters is the number of pixel points/16.
5. A picture pixel value steganography-based copyright protection system, the system comprising:
the picture pixel sampling module is used for sampling pixels of the picture and determining the number of characters which can be written into the picture;
the copyright information text conversion module is used for converting the copyright information text to be coded into a binary string when the number of the characters of the copyright information text to be coded is less than that of the characters of the writable picture;
the pixel RGB value fine tuning module is used for corresponding the bits of the binary string to RGB three values of pixels arranged in sequence one by one, finely tuning the pixel points bit by bit through the binary string, adding 1 or subtracting 1 to the RGB value of the pixel points with different RGB values corresponding to the binary string according to the rule that 1 is an odd number and 0 is an even number, adjusting the RGB value parity of the pixel points to be in one-to-one correspondence with the numerical value parity of the corresponding binary string, and writing the total length needing to be coded into the last N pixel points of the picture in a reverse sequence;
and the copyright information extraction module is used for extracting the coding length A from the last N pixel points of the picture when the copyright protection is proved, acquiring RGB three values corresponding to the A pixel points before the picture according to the length value A, converting the parity of the RGB values into binary strings containing 1 and 0 according to the rules that 1 is an odd number and 0 is an even number, and reversely decoding the binary strings to obtain the copyright information text.
6. The system of claim 5, wherein the copyright information is any one or a combination of a file owner, a file creation time, and a unique serial number.
7. The system according to claim 5, wherein the format of the picture is converted into a uniform format when the copyright information is written.
8. The system according to claim 5, wherein the number of characters of the writable picture is:
when the characters are Chinese, the number of the characters is the number of pixel points/24; when the characters are English or numbers, the number of the characters is the number of pixel points/16.
9. A copyright protection device based on steganography of picture pixel values, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the method of copyright protection based on steganography of picture pixel values as claimed in any one of claims 1 to 4.
10. A readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the method of copy right protection based on steganography of picture pixel values according to any one of claims 1 to 4.
CN202010693792.0A 2020-07-17 2020-07-17 Copyright protection method and system based on picture pixel value steganography Withdrawn CN111966973A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010693792.0A CN111966973A (en) 2020-07-17 2020-07-17 Copyright protection method and system based on picture pixel value steganography

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010693792.0A CN111966973A (en) 2020-07-17 2020-07-17 Copyright protection method and system based on picture pixel value steganography

Publications (1)

Publication Number Publication Date
CN111966973A true CN111966973A (en) 2020-11-20

Family

ID=73360756

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010693792.0A Withdrawn CN111966973A (en) 2020-07-17 2020-07-17 Copyright protection method and system based on picture pixel value steganography

Country Status (1)

Country Link
CN (1) CN111966973A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113112472A (en) * 2021-04-09 2021-07-13 百度在线网络技术(北京)有限公司 Image processing method and device
CN114579936A (en) * 2022-03-11 2022-06-03 季华实验室 Image copyright steganography method, infringement judgment method, device, equipment and medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113112472A (en) * 2021-04-09 2021-07-13 百度在线网络技术(北京)有限公司 Image processing method and device
CN113112472B (en) * 2021-04-09 2023-08-29 百度在线网络技术(北京)有限公司 Image processing method and device
CN114579936A (en) * 2022-03-11 2022-06-03 季华实验室 Image copyright steganography method, infringement judgment method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN1604080B (en) Image file container
CN114842483B (en) Standard file information extraction method and system based on neural network and template matching
US20080288857A1 (en) Sharing editable ink annotated images with annotation-unaware applications
CN110245469A (en) Watermark generation method, watermark analytic method, device and the storage medium of webpage
CN112052414A (en) Data processing method and device and readable storage medium
CN111901640B (en) Method and device for protecting copyright of streaming media
US20190259126A1 (en) Image hidden information detector
CN111966973A (en) Copyright protection method and system based on picture pixel value steganography
CN102646179A (en) A PDF file information embedding and extraction method based on PDF file body
US20180322604A1 (en) Digital video content security authentication method and system
CN110874456B (en) Watermark embedding method, watermark extracting method, watermark embedding device, watermark extracting device and data processing method
CN114638232A (en) Method and device for converting text into video, electronic equipment and storage medium
CN114880687A (en) Document security protection method, device, electronic device and storage medium
CN103530574B (en) A kind of hide Info embedding and extracting method based on English PDF document
CN106776498A (en) A kind of method that data export as PDF
CN111241496A (en) Method and device for determining small program feature vector and electronic equipment
Terras Artefacts and errors: Acknowledging issues of representation in the digital imaging of ancient texts
CN110362971A (en) A kind of screen watermark display methods of content-adaptive
CN102855602B (en) Picture processing method and picture processing device
CN113360930A (en) Encryption method for realizing front-end and back-end character dissimilarity and processing terminal
CN118364363A (en) Authentication method and device for same user in different social media platforms
Bushey Trustworthy citizen-generated images and video on social media platforms
CN116702172A (en) Data processing method and device
CN112040239B (en) File repair method and device based on AVI format file structure
CN114756794A (en) Webpage information anti-leakage method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20201120