Color image protection method, apparatus, device, and storage medium based on neighboring pixel difference strategy.
By using a watermark generation and detection restoration method based on a neighboring pixel difference strategy, the problem of easy tampering with color images is solved, and the integrity and authenticity of images are protected, preventing misjudgment and erroneous reporting.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MACAO POLYTECHNIC INST
- Filing Date
- 2024-08-12
- Publication Date
- 2026-06-30
AI Technical Summary
In existing technologies, color digital images are easily tampered with and leave little trace, leading to misjudgments and erroneous reporting. There is an urgent need for effective methods to protect color images.
Based on the neighboring pixel difference strategy, a target embedded watermark is generated and embedded into the original color image to detect tampering in the image to be detected, and restoration is performed when tampering is detected, thereby protecting the integrity and authenticity of the image.
It achieves effective information protection for color images, ensuring the integrity and authenticity of the images, and can detect and recover tampered images, preventing misjudgments and erroneous reports.
Smart Images

Figure CN119048325B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security technology, and in particular to a method, apparatus, device, and storage medium for protecting color images based on a neighboring pixel difference strategy. Background Technology
[0002] The rapid development of communication technology, computers, and the internet has enabled people to share resources and easily access online images, audio, and video. However, due to the widespread use of various image processing software, ordinary users can arbitrarily tamper with color digital images without leaving any traces visible to the human eye. This means that what we see is not necessarily the truth. If these fake color images are widely disseminated on the internet, or if some forged images are used in judicial evidence collection, news reporting, photography competitions, etc., the resulting misjudgments and erroneous reports will cause incalculable losses.
[0003] Therefore, there is an urgent need for a color image protection method based on the neighboring pixel difference strategy, so as to protect the integrity and authenticity of color digital images.
[0004] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main objective of this invention is to provide a method, apparatus, device, and storage medium for protecting color images based on a neighboring pixel difference strategy, aiming to solve the technical problem of how to effectively protect information in color images in the prior art.
[0006] To achieve the above objectives, the present invention provides a method for color image protection based on a neighboring pixel difference strategy, the method comprising the following steps:
[0007] Watermark generation is performed based on the original color image to obtain the target embedded watermark;
[0008] The target watermark is embedded into the original color image to obtain the target color image;
[0009] The image to be detected is subjected to tamper detection to obtain the image tamper detection result;
[0010] If the image tampering detection result indicates that the image has been tampered with, then the tampered image is restored to obtain the target color image.
[0011] Optionally, a watermark is generated based on the original color image to obtain a target embedded watermark, specifically including:
[0012] Image authentication data is obtained by encoding and calculating based on the original color image.
[0013] Planar compression is performed on the original color image to obtain a set of image compression coefficients;
[0014] The target embedded watermark is obtained by generating a watermark based on the image authentication data and the image compression coefficient set.
[0015] Optionally, image authentication data is obtained by encoding calculations based on the original color image, specifically including:
[0016] The original color image is divided into blocks to obtain a set of images after block division;
[0017] The segmented image set is input into the red channel for vertical authentication, resulting in a vertical authentication matrix.
[0018] The segmented image set is input into the green channel for horizontal authentication to obtain the horizontal authentication matrix.
[0019] The segmented image set is input into the blue channel for diagonal authentication, resulting in a diagonal authentication matrix.
[0020] The image authentication data is obtained by integrating the vertical authentication matrix, the horizontal authentication matrix, and the diagonal authentication matrix.
[0021] Optionally, planar compression is performed on the original color image to obtain a set of image compression coefficients, specifically including:
[0022] Perform color plane classification on the original color image to obtain a classified image set;
[0023] Each color plane in the classified image set is subjected to planar compression to obtain a set of color plane compression coefficients, wherein each color plane corresponds to a color plane compression.
[0024] Data processing is performed on each compression coefficient of the color plane compression coefficient set to obtain the image compression coefficient set.
[0025] Optionally, the image to be detected is subjected to tamper detection to obtain the image tamper detection result, which specifically includes:
[0026] The image to be detected is divided into blocks to obtain a set of images to be detected after being divided into blocks.
[0027] Each image block to be detected in the segmented image set is subjected to tamper detection to obtain a corresponding image block tamper detection result set, wherein each image block to be detected corresponds to a tamper detection result;
[0028] The image tampering detection result is formed by integrating the set of image block tampering detection results.
[0029] Optionally, tamper detection is performed on each image block in the segmented image set to be detected to obtain a corresponding image block tamper detection result set, wherein each image block to be detected corresponds to a tamper detection result, specifically including:
[0030] The segmented set of images to be detected is input into the color channel for information extraction to obtain the actual image identity data;
[0031] Based on the segmented set of images to be detected, generate corresponding theoretical image identity data for each image block to be detected;
[0032] The actual image identity data and the theoretical image identity data are compared and detected one by one to obtain a set of corresponding image block tampering detection results, wherein each image block to be detected corresponds to a tampering detection result.
[0033] Optionally, if the image tampering detection result indicates that the image has been tampered with, then the tampered image is restored to obtain the target color image, specifically including:
[0034] The tampered image is then subjected to grid processing;
[0035] The tampered image is restored based on the first tampering recovery strategy to obtain the target color image; or includes:
[0036] The tampered image is then subjected to grid processing;
[0037] The tampered image is restored based on the second tampering recovery strategy to obtain the target color image.
[0038] Furthermore, to achieve the above objectives, the present invention also proposes a color image protection device based on a neighboring pixel difference strategy, the color image protection device based on the neighboring pixel difference strategy comprising:
[0039] Watermark generation module: Generates watermarks based on the original color image to obtain the target embedded watermark;
[0040] Watermark embedding module: embeds the target watermark into the original color image to obtain the target color image;
[0041] Image detection module: performs tamper detection on the image to be detected and obtains the image tamper detection result;
[0042] Image restoration module: If the image tampering detection result indicates that the image has been tampered with, the image to be detected is restored to obtain the target color image.
[0043] Furthermore, to achieve the above objectives, the present invention also proposes a color image protection device based on a neighboring pixel difference strategy. The color image protection device based on a neighboring pixel difference strategy includes: a memory, a processor, and a color image protection program based on a neighboring pixel difference strategy stored in the memory and executable on the processor. The color image protection program based on a neighboring pixel difference strategy is configured to implement the steps of the color image protection method based on a neighboring pixel difference strategy as described above.
[0044] Furthermore, to achieve the above objectives, the present invention also proposes a computer-readable storage medium storing a computer program, wherein the storage medium stores a color image protection program based on a neighboring pixel difference strategy, and when the color image protection program based on a neighboring pixel difference strategy is executed by a processor, it implements the steps of the color image protection method based on a neighboring pixel difference strategy as described above.
[0045] This invention generates a target embedded watermark based on the original color image; embeds the target embedded watermark into the original color image to obtain a target color image; performs tamper detection on the image to be detected to obtain an image tamper detection result; if the image tamper detection result indicates that the image has been tampered with, then performs tamper recovery on the tampered image to obtain the target color image. This invention first embeds the generated target embedded watermark into the original color image, and then performs tamper detection on the image to be detected, thereby effectively judging the integrity and authenticity of the image and achieving the protection of image data. Attached Figure Description
[0046] Figure 1 This is a schematic diagram of the structure of a color image protection device based on a neighboring pixel difference strategy in the hardware operating environment of the embodiment of the present invention;
[0047] Figure 2 This is a flowchart illustrating the first embodiment of the color image protection method based on the neighboring pixel difference strategy of the present invention.
[0048] Figure 3 This is a flowchart illustrating the second embodiment of the color image protection method based on the neighboring pixel difference strategy of the present invention.
[0049] Figure 4 This is a flowchart illustrating the third embodiment of the color image protection method based on the neighboring pixel difference strategy of the present invention.
[0050] Figure 5This is a flowchart illustrating the fourth embodiment of the color image protection method based on the neighboring pixel difference strategy of the present invention.
[0051] Figure 6 This is a structural block diagram of the first embodiment of the color image protection device based on the neighboring pixel difference strategy of the present invention.
[0052] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0053] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0054] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a color image protection device based on a neighboring pixel difference strategy in the hardware operating environment of an embodiment of the present invention.
[0055] like Figure 1 As shown, the color image protection device based on a neighboring pixel difference strategy may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0056] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on color image protection devices based on neighboring pixel difference strategies, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0057] like Figure 1As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and a color image protection program based on a neighboring pixel difference strategy.
[0058] exist Figure 1 In the color image protection device based on the neighboring pixel difference strategy shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and memory 1005 in the color image protection device based on the neighboring pixel difference strategy of the present invention can be set in the color image protection device based on the neighboring pixel difference strategy. The color image protection device based on the neighboring pixel difference strategy calls the color image protection program based on the neighboring pixel difference strategy stored in the memory 1005 through the processor 1001 and executes the color image protection method based on the neighboring pixel difference strategy provided in the embodiment of the present invention.
[0059] This invention provides a method for protecting color images based on a neighboring pixel difference strategy, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of a color image protection method based on a neighboring pixel difference strategy according to the present invention.
[0060] In this embodiment, the color image protection method based on the neighboring pixel difference strategy includes the following steps:
[0061] Step S10: Generate a watermark based on the original color image to obtain the target embedded watermark;
[0062] It should be noted that, in the specific implementation, the process of generating a watermark based on the original color image includes the generation process of authentication bits based on APA encoding and the generation process of primary and secondary coefficients of EZW (Embedded Zero-Trees Wavelet) for MAR (Matrix Approximation Retrieval).
[0063] Step S20: Embed the target watermark into the original color image to obtain the target color image;
[0064] It should be noted that the process of embedding the target watermark into the original color image can be achieved through LSB embedding technology (Least Significant Bit, a digital watermarking and information hiding method), thereby ensuring optimal invisibility.
[0065] Step S30: Perform tamper detection on the image to be detected to obtain the image tamper detection result;
[0066] It is understandable that, in the specific implementation, the tamper detection of the image to be detected is actually based on the watermark information on the image to be detected. In this embodiment, the image to be detected is divided into blocks during tamper detection. Therefore, the final image tamper detection result includes the tamper detection results of all blocks of the image to be detected.
[0067] Step S40: If the image tampering detection result is that it has been tampered with, then the tampered image is restored to obtain the target color image.
[0068] It should be noted that, in the specific implementation, the process of restoring a tampered image is essentially to extract the obtained watermark information and perform image self-recovery of the tampered area of the tampered image, ultimately obtaining the target color image.
[0069] This embodiment generates a target embedded watermark based on the original color image; the target embedded watermark is then embedded into the original color image to obtain a target color image; tamper detection is performed on the image to be detected to obtain an image tamper detection result; if the image tamper detection result indicates that the image has been tampered with, the tampered image is restored to obtain the target color image. This embodiment first embeds the generated target embedded watermark into the original color image, and then performs tamper detection on the image to be detected, thereby effectively judging the integrity and authenticity of the image and achieving the protection of image data.
[0070] refer to Figure 3 , Figure 3 This is a flowchart illustrating a second embodiment of a color image protection method based on a neighboring pixel difference strategy according to the present invention.
[0071] Based on the first embodiment described above, in this embodiment, step S10 specifically includes:
[0072] Step S11: Perform encoding calculations based on the original color image to obtain image authentication data;
[0073] It should be noted that in the specific implementation, when the original color image is encoded, it needs to be divided into image blocks first, and then the authentication matrix is calculated for each of these original color image blocks. Finally, the authentication matrix data corresponding to all original color image blocks is obtained, that is, the image authentication data.
[0074] It should also be noted that, in the specific implementation, the encoding calculation is essentially achieved by evaluating pixels in different directions of the original color image patch. Specifically, this includes calculating the red channel information using vertical pixels (e.g., P11 and P21) and ultimately deriving the vertical authentication matrix (Auth_V); calculating the green channel information using horizontal pixels and ultimately deriving the horizontal authentication matrix (Auth_H); and calculating the green channel information using diagonal pixels and ultimately deriving the diagonal authentication matrix (Auth_D). After calculating the vertical, horizontal, and diagonal authentication matrices, the matrices need to be combined to obtain a set of authentication bits (Auth_data) data composed of RGB color channels, i.e., image authentication data. The required payload for the authentication bit data is 1 bit per pixel (bpp).
[0075] Step S12: Perform planar compression on the original color image to obtain a set of image compression coefficients;
[0076] It should be noted that, in the specific implementation, the process of planar compression of the original color image is essentially to generate primary and secondary coefficients for MAR (Matrix Approximation Retrieval) by applying the Embedded Zero-Trees Wavelet EZW compression technique.
[0077] It should also be noted that, in the specific implementation, the planar compression process involves independently performing EZW compression on each color plane of each original color image patch to obtain the corresponding primary and secondary compression coefficients. The primary compression coefficients undergo multiple copying steps to generate the final set of primary coefficients required for MAR. Finally, by recombinating all the obtained primary coefficients with the compressed secondary coefficients, the image compression coefficient set (which can be represented as MAR_data) is obtained.
[0078] Step S13: Generate a watermark based on the image authentication data and the set of image compression coefficients to obtain the target embedded watermark.
[0079] It should be noted that, in the specific implementation, the watermark embedding process after the target watermark is generated is actually to replace the bit plane of the target watermark with the LSB-2 plane of the original image through bit plane replacement technology, thereby ensuring optimal invisibility.
[0080] This embodiment first encodes and calculates the original color image to obtain image authentication data, then performs planar compression on it to obtain a set of image compression coefficients, and finally generates a watermark based on the generated image authentication data and the set of image compression coefficients to obtain the target embedded watermark, which provides a foundation for subsequent watermark embedding.
[0081] Further, image authentication data is obtained by encoding calculations based on the original color image, specifically including: dividing the original color image into blocks to obtain a set of blocks; inputting the set of blocks into the red channel for vertical authentication to obtain a vertical authentication matrix; inputting the set of blocks into the green channel for horizontal authentication to obtain a horizontal authentication matrix; inputting the set of blocks into the blue channel for diagonal authentication to obtain a diagonal authentication matrix; and integrating the vertical authentication matrix, the horizontal authentication matrix, and the diagonal authentication matrix to obtain the image authentication data.
[0082] refer to Figure 4 , Figure 4 This is a flowchart illustrating a third embodiment of a color image protection method based on a neighboring pixel difference strategy according to the present invention.
[0083] Based on the second embodiment described above, in this embodiment, step S12 specifically includes:
[0084] Step S121: Perform color plane classification on the original color image to obtain a set of classified images;
[0085] Understandably, in the actual implementation, different color planes of the original color image need to be processed separately, so it is necessary to classify the color planes of the original color image first.
[0086] Step S122: Perform planar compression on each color plane in the classified image set to obtain a set of color plane compression coefficients, where each color plane corresponds to a color plane compression.
[0087] It should be noted that in the specific implementation, the plane compression process involves performing EZW compression independently on each color plane to obtain the primary and secondary compression coefficients corresponding to each color plane, i.e., the color plane compression coefficients.
[0088] Step S123: Perform data processing based on each compression coefficient of the color plane compression coefficient set to obtain the image compression coefficient set.
[0089] Understandably, in the actual implementation, the main compression coefficients in each color plane compression coefficient need to go through multiple copying steps to generate the final main coefficient set required by MAR, and thus obtain the image compression coefficient set.
[0090] In this embodiment, the image set is first classified according to the color plane type, and then each color plane is compressed separately to obtain a set of color plane compression coefficients. Each color plane corresponds to a color plane compression, and finally the image compression coefficient set is obtained, which prepares for the subsequent watermark generation.
[0091] refer to Figure 5 , Figure 5 This is a flowchart illustrating the fourth embodiment of a color image protection method based on a neighboring pixel difference strategy according to the present invention.
[0092] Based on the first embodiment described above, in this embodiment, step S30 specifically includes:
[0093] Step S31: Divide the image to be detected into blocks to obtain a set of images to be detected after being divided into blocks;
[0094] It should be noted that in the specific implementation, in order to improve the tamper detection efficiency of the image to be detected, the image to be detected needs to be divided into blocks, and then the resulting image blocks (i.e. the set of images to be detected after being divided into blocks) are subjected to subsequent tamper detection. The specific size of the image blocks after being divided can be adjusted according to the actual detection requirements. For example, the size of the image to be detected after being divided into blocks can be set to 2*2.
[0095] Step S32: Perform tamper detection on each image block in the segmented image set to be detected to obtain a corresponding image block tamper detection result set, wherein each image block to be detected corresponds to a tamper detection result;
[0096] It should be noted that, in the specific implementation, each image block to be detected in the block-based image set is first input into the color channel for identity verification matrix extraction, and then the Adjacent Pixel Arithmetic Decoding (APA_Decoding) technique is used to further analyze the integrity of the image data within these blocks.
[0097] It should also be noted that, in the specific implementation, the tampering detection process also includes extracting the watermark information of the image to be detected. The specific process for tampering detection in the red channel is as follows: first, a pre-embedded vertical authentication matrix is extracted from each image block in the image set to be detected (regardless of whether the image block has been tampered with), resulting in a set of matrix data (the actual vertical authentication matrix). Then, a vertical authentication matrix (theoretical vertical authentication matrix) is calculated for the image block using vertical pixel authentication encoding. Finally, the two vertical authentication matrices are compared to obtain the corresponding vertical authentication comparison result for the image block. Similarly, the tampering detection process for other color channels is similar to that of the red channel, generating corresponding horizontal and diagonal authentication comparison results. Finally, the three are integrated to obtain the image block tampering detection result.
[0098] Step S33: Integrate the image patch tampering detection result set to form the image tampering detection result.
[0099] It should be noted that in the specific implementation, if the image block to be detected has not been tampered with, the image block tampering detection result is represented as not tampered (that is, the extracted actual authentication matrix and the calculated theoretical authentication matrix should be seamlessly aligned), and the image block detection result is marked as true 1; if the image block to be detected has been tampered with, the image block tampering detection result is represented as tampered (that is, there is a difference between the extracted actual authentication matrix and the calculated theoretical authentication matrix, and the red layer of the image block has been tampered with), and the image block detection result is marked as false 0.
[0100] It should also be noted that in the specific implementation, all image block detection results are integrated to write tampering detection code, thus finally obtaining the image tampering detection result (a binary code). This image tampering detection result (binary code) can first be used to accurately determine the location of pixel tampering through the misalignment error truth table (MET_Table), and then the tampered pixels are marked according to the positioning results obtained from the MET_Table; after locating and marking the tampered pixels of all image blocks, these image blocks are merged to produce a preliminary result of the tampered region; finally, adaptive morphological processing is applied to it, where the dilation coefficient radius is determined by the ratio of the outer contour area of the tampered region to the total area of the image.
[0101] This embodiment first divides the image to be detected into blocks, and then performs tamper detection on each image block in the block-based image set to be detected, thereby finally obtaining the image tamper detection result and providing a basis for subsequent image processing.
[0102] Further, tamper detection is performed on each image block in the segmented image set to be detected to obtain a corresponding image block tamper detection result set, wherein each image block to be detected corresponds to a tamper detection result. Specifically, this includes: inputting the segmented image set to be detected into the color channel for information extraction to obtain actual image identity data; generating corresponding theoretical image identity data for each image block to be detected based on the segmented image set to be detected; comparing and detecting the actual image identity data and the theoretical image identity data one by one to obtain a corresponding image block tamper detection result set, wherein each image block to be detected corresponds to a tamper detection result.
[0103] Furthermore, if the image tampering detection result indicates that the image has been tampered with, then the tampered image is restored to obtain the target color image. This specifically includes: performing grid processing on the tampered image; restoring the tampered image based on a first tampering restoration strategy to obtain the target color image; or including: performing grid processing on the tampered image; restoring the tampered image based on a second tampering restoration strategy to obtain the target color image.
[0104] It should be noted that in the specific implementation, in order to effectively restore tampered images, corresponding image self-recovery strategies need to be adopted for different image tampering detection results. Mesh processing specifically refers to dividing the tampering detection results into a mesh based on the multiple embedding positions. The selection of the tampering recovery strategy based on the processed tampered image is essentially based on the actual tampering situation in each of the divided meshes. If some meshes in each of the divided meshes are not tampered with, then the tampering recovery strategy is the first tampering recovery strategy; if all of the divided meshes are tampered with and the complete principal coefficients cannot be directly obtained, then the tampering recovery strategy is the second tampering recovery strategy.
[0105] It should also be noted that, in the specific implementation, the first tampering recovery strategy specifically refers to first extracting the complete principal coefficients from the grid with complete principal coefficients, and then filling the damaged parts according to the information of the undamaged pixels around the tampered grid image. For example, if the number of true 1s in the surrounding eight pixels in the same LSB_0 plane is greater than or equal to the number of false 0s, the damaged pixels can be filled with 1s; otherwise, they are filled with 0s. Then, the inverse EZW algorithm is used to calculate the pixel values of the tampered area and fill the tampered grid area accordingly. The second tampering recovery strategy specifically refers to a traversal and piecing method. Specifically, starting from the first pixel of the first grid, the principal coefficients are filtered according to the tampering detection results; if the pixels in the current grid are damaged, the process moves to the next grid and searches for the corresponding pixel position. Once the correct coefficient is found, that is, the relative pixel position in the grid is not damaged, the pixel value is extracted, and the process returns to the next pixel of the first grid to continue searching. This process is repeated until the complete principal coefficient grid is filtered and extracted.
[0106] Furthermore, embodiments of the present invention also propose a computer-readable storage medium storing a computer program, wherein the storage medium stores a color image protection program based on a neighboring pixel difference strategy, and when the color image protection program based on the neighboring pixel difference strategy is executed by a processor, it implements the steps of the color image protection method based on the neighboring pixel difference strategy described above.
[0107] Since this storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be repeated here.
[0108] Reference Figure 6 , Figure 6 This is a structural block diagram of the first embodiment of the color image protection device based on the neighboring pixel difference strategy of the present invention.
[0109] like Figure 6 As shown, the color image protection device based on the neighboring pixel difference strategy proposed in this embodiment of the invention includes:
[0110] Watermark generation module 10: Generates watermarks based on the original color image to obtain the target embedded watermark;
[0111] Watermark embedding module 20: Embeds the target watermark into the original color image to obtain the target color image;
[0112] Image detection module 30: performs tamper detection on the image to be detected and obtains the image tamper detection result;
[0113] Image restoration module 40: If the image tampering detection result is that it has been tampered with, the image to be detected is restored to obtain the target color image.
[0114] This embodiment generates a target embedded watermark based on the original color image; the target embedded watermark is then embedded into the original color image to obtain a target color image; tamper detection is performed on the image to be detected to obtain an image tamper detection result; if the image tamper detection result indicates that the image has been tampered with, the tampered image is restored to obtain the target color image. This embodiment first embeds the generated target embedded watermark into the original color image, and then performs tamper detection on the image to be detected, thereby effectively judging the integrity and authenticity of the image and achieving the protection of image data.
[0115] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solution of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any restrictions on this.
[0116] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.
[0117] In addition, for technical details not described in detail in this embodiment, please refer to the color image protection method based on the neighboring pixel difference strategy provided in any embodiment of the present invention, which will not be repeated here.
[0118] Furthermore, it should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0119] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0120] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0121] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for color image preservation based on a neighboring pixel difference strategy, characterized in that, include: Watermark generation is performed based on the original color image to obtain the target embedded watermark; The target watermark is embedded into the original color image to obtain the target color image; The image to be detected is subjected to tamper detection to obtain the image tamper detection result; If the image tampering detection result indicates that the image has been tampered with, then the tampered image is restored to obtain the target color image; The watermark generation process includes the following steps: Image authentication data is obtained by performing encoding calculations based on the original color image. Perform color plane classification on the original color image to obtain a classified image set; Each color plane in the classified image set is subjected to planar compression to obtain a set of color plane compression coefficients, wherein each color plane corresponds to a color plane compression. Data processing is performed on each compression coefficient of the color plane compression coefficient set to obtain the image compression coefficient set; The target embedded watermark is obtained by generating a watermark based on the image authentication data and the image compression coefficient set.
2. The color image protection method based on the neighboring pixel difference strategy according to claim 1, characterized in that, Image authentication data is obtained by encoding and calculating based on the original color image, specifically including: The original color image is divided into blocks to obtain a set of images after block division; The segmented image set is input into the red channel for vertical authentication, resulting in a vertical authentication matrix. The segmented image set is input into the green channel for horizontal authentication to obtain the horizontal authentication matrix. The segmented image set is input into the blue channel for diagonal authentication, resulting in a diagonal authentication matrix. The image authentication data is obtained by integrating the vertical authentication matrix, the horizontal authentication matrix, and the diagonal authentication matrix.
3. The color image protection method based on the neighboring pixel difference strategy according to any one of claims 1-2, characterized in that, The image to be detected is subjected to tampering detection to obtain the image tampering detection results, which specifically include: The image to be detected is divided into blocks to obtain a set of images to be detected after being divided into blocks. Each image block to be detected in the segmented image set is subjected to tamper detection to obtain a corresponding image block tamper detection result set, wherein each image block to be detected corresponds to a tamper detection result; The image tampering detection result is formed by integrating the set of image block tampering detection results.
4. The color image protection method based on the neighboring pixel difference strategy according to claim 3, characterized in that, Each image block in the segmented image set to be detected is subjected to tamper detection to obtain a corresponding image block tamper detection result set, wherein each image block to be detected corresponds to a tamper detection result, specifically including: The segmented set of images to be detected is input into the color channel for information extraction to obtain the actual image identity data; Based on the segmented set of images to be detected, generate corresponding theoretical image identity data for each image block to be detected; The actual image identity data and the theoretical image identity data are compared and detected one by one to obtain a set of corresponding image block tampering detection results, wherein each image block to be detected corresponds to a tampering detection result.
5. The color image protection method based on the neighboring pixel difference strategy according to claim 4, characterized in that, If the image tampering detection result indicates that the image has been tampered with, then the tampered image is restored to obtain the target color image, specifically including: The tampered image is then subjected to grid processing; The tampered image is restored based on the first tampering recovery strategy to obtain the target color image; or includes: The tampered image is then subjected to grid processing; The tampered image is restored based on the second tampering recovery strategy to obtain the target color image.
6. A color image protection device based on a neighboring pixel difference strategy, characterized in that, The color image protection device based on the neighboring pixel difference strategy includes: Watermark generation module: Generates watermarks based on the original color image to obtain the target embedded watermark; Watermark embedding module: embeds the target watermark into the original color image to obtain the target color image; Image detection module: performs tamper detection on the image to be detected and obtains the image tamper detection result; Image restoration module: If the image tampering detection result indicates that the image has been tampered with, then the image to be detected is restored to obtain the target color image; The watermark generation module is also used to: perform encoding calculations based on the original color image to obtain image authentication data; Perform color plane classification on the original color image to obtain a classified image set; Each color plane in the classified image set is subjected to planar compression to obtain a set of color plane compression coefficients, wherein each color plane corresponds to a color plane compression. Data processing is performed on each compression coefficient of the color plane compression coefficient set to obtain the image compression coefficient set; The target embedded watermark is obtained by generating a watermark based on the image authentication data and the image compression coefficient set.
7. A color image protection device based on a neighboring pixel difference strategy, characterized in that, The color image protection device based on the neighboring pixel difference strategy includes: a memory, a processor, and a color image protection program based on the neighboring pixel difference strategy stored in the memory and executable on the processor. The color image protection program based on the neighboring pixel difference strategy is configured to implement the color image protection method based on the neighboring pixel difference strategy according to any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it can implement the steps in the color image protection method based on the neighboring pixel difference strategy as described in any one of claims 1 to 5.