A method of image watermarking
By segmenting the image into blocks and performing singular value decomposition, the amount of watermark embedding is dynamically adjusted, solving the problems of limited watermark information embedding capacity and weak concealment in existing technologies. This improves the quantity and quality of watermark information and enhances the robustness and security of the image.
Patent Information
- Application Number
- CN202510006287.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2026-07-03
AI Technical Summary
In existing technologies, image watermarking methods have problems such as limited watermark information embedding capacity, weak concealment, poor image quality with watermark, and inability to recover the original carrier image after being attacked.
By dividing the image into blocks, determining the texture complexity of each block, dynamically adjusting the watermark embedding amount, and using singular value decomposition and inverse singular value decomposition techniques to select the largest singular value as the embedding point, the effective embedding and robustness of the watermark information are ensured.
It improves the quantity and quality of watermark information in watermarked images, enhances the concealment and resistance to attacks of watermarks, and maintains the visual effect of the image close to the original image.
Smart Images

Figure CN122335512A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of information security, and in particular relates to a method, apparatus, device, computer-readable storage medium, and computer program product for adding image watermarks. Background Technology
[0002] With the rapid development of information technology, the dissemination of digital content has become increasingly convenient, greatly promoting information exchange and cultural dissemination, but also bringing new challenges to copyright protection. In the field of digital images, watermarking technology, as an effective means of copyright protection, is widely used to prove the originality and ownership of works, and to prevent unauthorized use and distribution. To improve the effectiveness of watermarks in images and prevent them from being deliberately tampered with, it is necessary to increase the effective embedding amount of the watermark image while ensuring its quality, and simultaneously enhance the robustness of the watermark.
[0003] In existing technologies, image watermarking methods mainly include texture threshold-based watermark embedding and block-based watermark embedding of the carrier image. Texture threshold-based watermark embedding is limited by a preset fixed threshold, resulting in limited watermark embedding capacity and less embedded watermark information. Block-based watermark embedding of the carrier image does not consider the image's texture information during embedding, leading to insufficient concealment of the embedded watermark and poor quality of the resulting watermarked image. Therefore, existing image watermarking methods suffer from the problems of limited embedded watermark information and poor watermarked image quality. Summary of the Invention
[0004] This application provides a method, apparatus, device, computer-readable storage medium, and computer program product for adding watermarks to images, which can improve the amount of watermark information and the quality of the watermarked image.
[0005] In a first aspect, embodiments of this application provide a method for adding an image watermark, the method comprising:
[0006] The image is divided into blocks to obtain the target number of block images, wherein the block images do not overlap;
[0007] For each image block, the texture complexity of each image block is determined based on the number of pixels at the image block boundary and the size of the image block.
[0008] The watermark embedding amount for each image block is determined based on the texture complexity, average watermark embedding capacity, and initial texture complexity of each image block; whereby the average watermark embedding capacity is determined based on the total watermark information capacity and the number of targets.
[0009] Perform singular value decomposition on each image block to obtain the maximum singular value of each image block;
[0010] Based on the maximum singular value of each image block and the watermark information corresponding to the watermark embedding amount, determine the singular value of each image block after watermark embedding;
[0011] Inverse singular value decomposition is performed on the singular values of each watermarked image block, and each watermarked image block is reconstructed to obtain the watermarked image.
[0012] In one feasible implementation, singular value decomposition is performed on each image block to obtain the maximum singular value of each image block, including:
[0013] For each image block, the image block is divided into frequency bands to obtain multiple frequency sub-bands, including low-frequency sub-bands;
[0014] Discrete cosine transform coefficients are obtained by performing discrete cosine transform on the low-frequency subband;
[0015] The maximum singular value of the block image is obtained by performing singular value decomposition on the discrete cosine transform coefficients.
[0016] In one feasible implementation, the singular values of each watermarked image block are subjected to inverse singular value decomposition, and each watermarked image block is reconstructed to obtain a watermarked image, including:
[0017] Inverse singular value decomposition is performed on the singular values of each watermarked image block to obtain inverse discrete cosine transform coefficients.
[0018] Based on the inverse discrete cosine transform coefficients, an inverse discrete cosine transform is performed to obtain multiple inverse frequency sub-bands, including an inverse low frequency sub-band.
[0019] Multiple inverse frequency subbands are combined to obtain a watermarked block image, and the watermarked block image is reconstructed to obtain a watermarked image.
[0020] In one feasible implementation, the singular value of each image block after watermark embedding is determined based on the maximum singular value of each image block and the watermark information corresponding to the watermark embedding amount, including:
[0021] For each image block, the maximum singular value of the image block is quantized to obtain the quantized value;
[0022] Based on the watermark information corresponding to the quantization value, quantization step size, and watermark embedding amount, the singular values after watermark embedding in the segmented image are determined.
[0023] In one feasible implementation, the method further includes:
[0024] The attacked watermarked image is divided into blocks to obtain a watermarked block image with watermark;
[0025] Singular value decomposition is performed on each watermarked image block to obtain the singular values and watermark information after watermarking is added.
[0026] The maximum singular value is determined based on the singular values after watermarking and the watermark information;
[0027] The maximum singular value is decomposed into inverse singular value and the block image is reconstructed to obtain the original image.
[0028] In one feasible implementation, singular value decomposition is performed on each watermarked image block to obtain the singular values and watermark information after watermarking, including:
[0029] For each watermarked image block, frequency bands are divided to obtain multiple frequency sub-bands, including low-frequency sub-bands.
[0030] Discrete cosine transform coefficients are obtained by performing discrete cosine transform on the low-frequency subband;
[0031] Singular value decomposition is performed on the discrete cosine transform coefficients to obtain the singular values and watermark information after watermarking.
[0032] In one feasible implementation, inverse singular value decomposition is performed on the maximum singular value, and the block image is reconstructed to obtain the original image, including:
[0033] The inverse singular value decomposition is performed on the maximum singular value to obtain the discrete cosine transform coefficients;
[0034] The low-frequency subband is obtained by performing an inverse discrete cosine transform on the discrete cosine transform coefficients.
[0035] Block images are obtained by combining frequency bands based on low-frequency sub-bands;
[0036] The original image is obtained by reconstructing the segmented image.
[0037] In one feasible implementation, the watermark information is obtained by performing singular value decomposition on the discrete cosine transform coefficients, including:
[0038] The initial watermark information is obtained by performing singular value decomposition on the discrete cosine transform coefficients.
[0039] The initial watermark information is scrambled to obtain scrambled information.
[0040] The watermark information is obtained by descrambling the scrambled information using the key; where the key is the scrambling parameter.
[0041] In one feasible implementation, before determining the singular value of each image block after embedding the watermark based on the maximum singular value of each image block and the watermark information, the method further includes:
[0042] Get the watermarked image;
[0043] The watermark image is binarized, and the binarized watermark image is scrambled based on scrambling parameters to obtain a scrambled image.
[0044] The scrambled image is then subjected to dimensionality reduction processing to obtain the watermark information.
[0045] In one feasible implementation, obtaining the watermark image includes:
[0046] Obtain at least one of the following: an image with copyright markings, user identity information, IP address, and timestamp information;
[0047] A watermarked image is generated based on at least one of the following: copyrighted image, user identity information, IP address, and timestamp information.
[0048] Secondly, embodiments of this application provide an apparatus for adding an image watermark, the apparatus comprising:
[0049] The segmentation module is used to segment an image into blocks to obtain a target number of segmented images, wherein the images of the segmented images do not overlap;
[0050] The determination module is used to determine the texture complexity of each image block based on the number of pixels at the image block boundary and the size of the image block.
[0051] The determining module is further configured to determine the watermark embedding amount of each block image based on the texture complexity, average watermark embedding capacity, and initial texture complexity of each block image; wherein, the average watermark embedding capacity is determined based on the total capacity of the watermark information and the target number;
[0052] The decomposition module is used to perform singular value decomposition on each block of the image to obtain the maximum singular value of each block of the image;
[0053] The determination module is also used to determine the singular value of each segmented image after watermark embedding based on the maximum singular value of each segmented image and the watermark information corresponding to the watermark embedding amount.
[0054] The reconstruction module is used to perform inverse singular value decomposition on the singular values of each watermarked image block and reconstruct each watermarked image block to obtain a watermarked image with the watermark added.
[0055] Thirdly, embodiments of this application provide an electronic device, the device including: a processor, and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the image watermarking method as described in any embodiment of the first aspect.
[0056] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the image watermarking method as described in any embodiment of the first aspect.
[0057] Fifthly, embodiments of this application provide a computer program product in which instructions, when executed by a processor of an electronic device, cause the electronic device to perform an image watermarking method as described in any embodiment of the first aspect.
[0058] The present application discloses a method, apparatus, device, computer-readable storage medium, and computer program product for adding image watermarks. The method involves dividing an image into blocks to obtain a target number of block images, wherein the block images do not overlap. Then, for each block image, the texture complexity of each block image is determined based on the number of pixels at the block image boundary and the size of the block image. By dividing the image into blocks and analyzing the number of pixels at the boundary and the size of each block image, the texture complexity of each block image can be evaluated, thereby providing a basis for subsequent watermark embedding. The watermark embedding amount for each image block is determined based on its texture complexity, average watermark embedding capacity, and initial texture complexity. The average watermark embedding capacity is determined based on the total watermark information capacity and the number of target images. The average watermark embedding capacity for each image block is determined based on the total watermark information capacity and the number of image blocks, ensuring that the total watermark information is reasonably distributed across all sub-blocks. Based on the average watermark embedding capacity of each image block, the watermark embedding amount for each sub-block is dynamically adjusted according to the actual texture information of each image block by comparing texture complexity and initial texture complexity, ensuring effective embedding and sufficient embedding of watermark information, and improving the quality of the watermarked image. Then, singular value decomposition (SVD) is performed on each image block to obtain the maximum singular value. Based on the maximum singular value and the watermark embedding amount, the singular value of each image block after watermark embedding is determined. By performing SVD on the image blocks and selecting the maximum singular value as the embedding point, it is ensured that even if the image is attacked or processed, the embedded watermark information can still be correctly extracted, improving the robustness and security of the watermark. Finally, inverse singular value decomposition (ISVD) is performed on the singular values of each watermarked image block, and each watermarked image block is reconstructed to obtain a watermarked image. This process of embedding the watermark in each image block and then reconstructing it yields a complete watermarked image, ensuring that the image quality and visual effect are as close as possible to the original image, thus improving the watermarked image quality and ensuring successful watermark embedding. Therefore, this embodiment can improve the amount of watermark information in the watermarked image and the quality of the watermarked image. Attached Figure Description
[0059] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0060] Figure 1 This is a flowchart illustrating a method for adding an image watermark according to an embodiment of this application;
[0061] Figure 2 This is a flowchart illustrating an image singular value decomposition method provided in one embodiment of this application;
[0062] Figure 3 This is a flowchart illustrating a method for reconstructing a watermark image according to an embodiment of this application;
[0063] Figure 4 A flowchart illustrating an image singular value decomposition method according to an embodiment of this application is shown;
[0064] Figure 5 This is a flowchart illustrating a method for recovering an original image from a watermarked image according to an embodiment of this application;
[0065] Figure 6 This is a flowchart illustrating a method for singular value decomposition of a watermarked block image according to an embodiment of this application;
[0066] Figure 7 This is a flowchart illustrating a method for extracting watermarks from a watermarked image according to an embodiment of this application;
[0067] Figure 8 This is a schematic diagram of the structure of an image watermarking device provided in one embodiment of this application;
[0068] Figure 9 This is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of this application. Detailed Implementation
[0069] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0070] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus 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 apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0071] With the rapid development of information technology, the dissemination of digital content has become increasingly convenient, greatly promoting information exchange and cultural dissemination, but also bringing new challenges to copyright protection. In the field of digital images, watermarking technology, as an effective means of copyright protection, is widely used to prove the originality and ownership of works, and to prevent unauthorized use and distribution. In reality, there are problems such as malicious actors attacking, damaging, and removing watermarks for illegal purposes, and there is a conflict between increasing the embedding capacity of watermarks and the quality of the watermarked image. To improve the effectiveness of watermarks in watermarked images and prevent them from being deliberately damaged, it is necessary to increase the effective embedding capacity of the watermark image while ensuring its quality, and simultaneously improve the robustness of the watermark.
[0072] In existing technologies, image watermarking methods mainly include texture threshold-based watermark embedding and block-based watermark embedding of the carrier image. Texture threshold-based watermark embedding sets an initial threshold and embeds the watermark in blocks larger than the initial threshold. This method has limited watermark embedding capacity, preventing the embedding of more watermark information. Block-based watermark embedding of the carrier image does not consider the image's texture information during embedding, resulting in insufficient concealment of the embedded watermark and poor quality of the watermarked image. Furthermore, if the watermarked image is tampered with or attacked, the original carrier image cannot be recovered. Therefore, existing image watermarking methods suffer from problems such as limited embedded watermark information and poor watermarked image quality.
[0073] To address the problems of the prior art, embodiments of this application provide a method, apparatus, device, computer storage medium, and computer program product for adding image watermarks. The method for adding image watermarks provided in this application embodiment will be described first below.
[0074] To facilitate understanding of the embodiments of this application, the technical terms used in the embodiments of this application will be explained below.
[0075] Redundant Discrete Wavelet Transform (RDWT) is an improved wavelet transform method that preserves all scale and location information by not downsampling during signal or image decomposition, thus providing higher translation invariance and better noise resistance than the traditional Discrete Wavelet Transform (DWT). Inverse Redundant Discrete Wavelet Transform (IRDWT) is the inverse operation of RDWT, used to reconstruct the original signal or image from subband coefficients obtained after multi-resolution analysis. The main purpose of IRDWT is to recombine the information from each subband into a complete representation that is as close as possible to the original input.
[0076] In image processing and signal analysis, especially when using Discrete Wavelet Transform (DWT) or Redundant Discrete Wavelet Transform (RDWT), the original image is typically decomposed into four distinct subbands: LL, LH, HL, and HH. Each subband represents information from the image across different frequency ranges. The LL subband (Low-Low) combines low-frequency horizontal and vertical directions, containing the image's main energy and most of its visual information, reflecting its overall structure and large-scale features. The LH subband (Low-High) combines low-frequency horizontal and high-frequency vertical directions, primarily containing vertical edge information, i.e., top-to-bottom variations. The HL subband (High-Low) combines high-frequency horizontal and low-frequency vertical directions, primarily containing horizontal edge information, i.e., left-to-right variations. The HH subband (High-High) combines high-frequency horizontal and high-frequency vertical directions, primarily containing diagonal details and other fine texture information, representing the most complex parts of the image.
[0077] The Discrete Cosine Transform (DCT) is a mathematical technique used in signal processing and data compression, widely applied in image, audio, and video coding. DCT is a linear transform that converts a finite-length signal, such as a row or column of pixel values in an image, from the spatial or time domain to the frequency domain, concentrating the signal's energy on a few coefficients, thus facilitating subsequent compression, filtering, and other processing. The Inverse Discrete Cosine Transform (IDCT) is the inverse operation of DCT, used to convert frequency-domain data back to the spatial domain. It converts the frequency-domain coefficients obtained by DCT back to the original spatial-domain signal or image. For a given set of DCT coefficients, IDCT can reconstruct a representation close to the original input.
[0078] Singular Value Decomposition (SVD) is a powerful linear algebra tool widely used in data analysis, image processing, machine learning, and many other fields. It decomposes a matrix into the product of three simpler matrices, revealing the main structure and characteristics of the original data. For any m×n real matrix A, its SVD can be expressed as: A = UΣVT. Here, U is an m×m orthogonal matrix whose column vectors are called left singular vectors, containing the eigenvectors of the input matrix; Σ is an m×n diagonal matrix whose diagonal elements are called singular values, usually ordered from largest to smallest, representing the importance of different features in the input matrix; and V is an n×n orthogonal matrix whose column vectors are called right singular vectors, containing the eigenvectors of the input matrix. Inverse Singular Value Decomposition (ISVD) is the inverse operation of Singular Value Decomposition (SVD). It is used to recombine the left singular vector matrix U, the singular value matrix Σ, and the right singular vector matrix V obtained from SVD decomposition into the original matrix A. The main purpose of ISVD is to ensure that all the information extracted during the SVD process can be accurately restored, thereby recovering the original data or signal.
[0079] Arnold's Cat Map, also known as Arnold's Cat Map, is a chaotic mapping method used in image encryption and watermarking techniques. Arnold's scrambling is a two-dimensional linear transformation, typically applied to square images (images with equal width and height). It scrambles the positions of image pixels through a series of iterative transformations, thus achieving image obfuscation or scrambling. Inverse Arnold's Cat Map, also known as the reverse Arnold's Cat Map, is the inverse operation of Arnold's scrambling. It refers to the process of restoring an image or data scrambled by Arnold's scrambling to its original arrangement. This process relies on the mathematical properties of Arnold's scrambling, ensuring that each iteration accurately undoes the previous operation. It is used to restore the original state from scrambled images or data. Because Arnold's scrambling is a reversible transformation, the original image or data can be accurately restored by applying the inverse scrambling algorithm.
[0080] Figure 1 A flowchart illustrating an embodiment of the image watermarking method provided in this application is shown. Figure 1 As shown, the method includes steps S110 to S160.
[0081] S110: Divide the image into blocks to obtain the target number of block images, wherein the block images do not overlap.
[0082] In the embodiments of this application, images may include all visually appealing images such as pictures, photographs, paintings, clip art, maps, calligraphy works, and film and television scenes. Images may also be still or animated.
[0083] The carrier image to be watermarked is divided into a target number of non-overlapping sub-blocks. Before dividing the carrier image into blocks, it can be binarized to grayscale and subjected to morphological operations.
[0084] S120: For each block image, determine the texture complexity of each block image based on the number of pixels at the block image boundary and the size of the block image.
[0085] Extract the number of pixels a on the boundary of each image block and the image size b of each image block. Based on the number of pixels on the boundary of each image block, the image size, and a positive real number c between 0 and 1, calculate the texture complexity r of each image block. The specific calculation process is shown in formula (1).
[0086] r = a / b + c (1)
[0087] S130: Determine the watermark embedding amount for each image block based on the texture complexity, average watermark embedding capacity, and initial texture complexity of each image block; wherein, the average watermark embedding capacity is determined based on the total capacity of the watermark information and the number of targets.
[0088] The average watermark embedding capacity avg of each sub-block can be calculated based on the total capacity of the watermark information and the number of targets, i.e., the total number of block images. For example, the average watermark embedding capacity avg of each block image is equal to the total capacity of the watermark information divided by the total number of block images. Then, based on the texture complexity r of each block image, the average watermark embedding capacity avg, and a preset initial texture complexity s, the watermark embedding amount i of each block image is calculated. The specific calculation process is shown in formula (2).
[0089] i = avg *(r / s) (2)
[0090] The final watermark embedding capacity of each image block is directly proportional to its texture complexity. The more complex the texture of the image block, the higher the watermark embedding capacity, as complex texture information provides excellent protection for the watermark's concealment. Conversely, the simpler the texture, the smaller the watermark embedding capacity. Dynamically adjusting the watermark embedding capacity based on the texture complexity of the image blocks further enhances the watermark's concealment and the quality of the watermarked image.
[0091] S140: Perform singular value decomposition on each block image to obtain the maximum singular value of each block image.
[0092] In an image, singular values reflect the energy distribution, i.e., the importance of image information. Larger singular values contain the main information and features of the image. Image singular values exhibit good stability; even if the image is subjected to slight perturbations or attacks of a certain degree, such as noise, compression, or cropping, its singular values will not change significantly. Singular value decomposition can be performed on each image block using matrix factorization to obtain the maximum singular value for each block.
[0093] S150: Determine the singular value of each segmented image after watermark embedding based on the maximum singular value of each segmented image and the watermark information corresponding to the watermark embedding amount.
[0094] Based on the watermark embedding amount for each image block and the total watermark information, the watermark information to be embedded in each image block can be determined. Then, the maximum singular value of each image block is quantized, and the watermark information to be embedded in each image block is used to obtain the singular value of each image block after watermark embedding. Quantizing and embedding the watermark at the maximum singular value ensures that the watermark can still be effectively extracted even when the image is attacked, thereby improving the robustness and security of the watermark. This embedding method not only has low computational complexity but also high embedding efficiency. By appropriately selecting the quantization bit depth, the watermark recognition rate can also be optimized.
[0095] S160: Perform inverse singular value decomposition on the singular values of each watermarked image block and reconstruct each watermarked image block to obtain a watermarked image with added watermark.
[0096] After obtaining the singular values of each watermarked image block, inverse singular value decomposition is performed on these singular values to obtain the watermarked image blocks. Finally, all the watermarked image blocks are stitched together in their original positions to form the final watermarked image. Each image block has undergone preprocessing such as binarization and morphological operations before watermarking, and boundary features are preserved during the embedding process. Therefore, the blocks can be accurately reassembled into an image of the original size.
[0097] In one embodiment, to ensure the quality of the watermarked image, the reconstructed image can also be subjected to visual quality checks or quantitative evaluations, such as peak signal-to-noise ratio and structural similarity index, to ensure that the image quality after embedding the watermark meets the requirements.
[0098] This embodiment obtains a target number of block images by dividing the image into blocks, where the blocks do not overlap. Then, for each block image, the texture complexity is determined based on the number of pixels at the block image boundaries and the size of the block image. By dividing the image into blocks and analyzing the number of pixels at the boundaries and the size of each block image, the texture complexity of each block image can be evaluated, thus providing a basis for subsequent watermark embedding. The watermark embedding amount for each block image is determined based on its texture complexity, average watermark embedding capacity, and initial texture complexity. The average watermark embedding capacity is determined based on the total watermark information capacity and the target number. Determining the average watermark embedding capacity for each block image based on the total watermark information capacity and the number of block images ensures that the total watermark information is reasonably distributed across all sub-blocks. Based on the average watermark embedding capacity of each block image, by comparing the texture complexity and the initial texture complexity, the watermark embedding amount for each sub-block can be dynamically adjusted according to the actual texture information of each block image, ensuring effective embedding and the amount of watermark information embedded, and improving the quality of the watermarked image. Then, singular value decomposition (SVD) is performed on each image block to obtain the maximum singular value of each block. Based on the maximum singular value of each image block and the watermark embedding amount, the singular value of each image block after watermark embedding is determined. By performing SVD on the image blocks and selecting the maximum singular value as the embedding point, it is ensured that even if the image is attacked or processed, the embedded watermark information can still be correctly extracted, improving the robustness and security of the watermark. Finally, inverse singular value decomposition is performed on the singular values of each image block after watermark embedding, and each image block after watermark embedding is reconstructed to obtain a watermarked image. Performing inverse singular value decomposition on each image block after watermark embedding and reconstructing each image block after watermark embedding yields a complete watermarked image, ensuring that the image quality and visual effect are as close as possible to the original image, improving the watermark image quality, and ensuring successful watermark embedding. Therefore, the embodiments of this application can improve the amount of watermark information in the watermarked image and the quality of the watermarked image.
[0099] Figure 2 A flowchart illustrating an image singular value decomposition method according to an embodiment of this application is shown.
[0100] In one feasible implementation, step S140: the specific process of performing singular value decomposition on each image block to obtain the maximum singular value of each image block is as follows: Figure 2 As shown, steps S141 to S143 are included.
[0101] S141: For each block image, the block image is divided into frequency bands to obtain multiple frequency sub-bands, including low-frequency sub-bands.
[0102] Redundant Discrete Wavelet Transform (RDWT) is performed on each block image, dividing each block image into four frequency sub-bands: LL, LH, HL, and HH. The low-frequency sub-band (LL) refers to the combination of low-frequency horizontal and low-frequency vertical directions, which contains the main energy and most of the visual information of the block image, reflecting the overall structure and large-scale features of the block image.
[0103] S142: Perform discrete cosine transform on the low-frequency subband to obtain the discrete cosine transform coefficients.
[0104] A Discrete Cosine Transform (DCT) is performed on the low-frequency subband (LL) of each image block, and the DCT coefficients are extracted from the transformed matrix. The DCT coefficients are a set of values obtained by the DCT transform, representing the contribution of the original signal to different frequency components. Most of the energy is concentrated in the low-frequency coefficients, while the high-frequency coefficients are close to zero.
[0105] S143: Perform singular value decomposition on the discrete cosine transform coefficients to obtain the maximum singular value of the block image.
[0106] A Discrete Cosine Transform (DCT) coefficient matrix is constructed based on the discrete cosine transform coefficients obtained from the low-frequency subband (LL) of each image block. Singular value decomposition (SVD) is then performed on the constructed DCT coefficient matrix to extract the largest singular value. The largest singular value of each image block represents the most significant information component, reflecting the main structure and energy distribution of the image block.
[0107] This embodiment introduces redundant discrete wavelet transform to divide each image block into frequency bands. For the low-frequency sub-band containing the main energy and visual information, discrete cosine transform is performed, and then singular value decomposition is performed on the obtained DCT coefficients. The largest singular value is selected as the watermark embedding point. This not only dynamically adjusts the watermark embedding amount according to the texture complexity of each region of the image, ensuring the effectiveness and concealment of the watermark information, but also enhances the robustness of the watermark by utilizing the stability of low-frequency information. Even if the image is attacked or processed, the watermark can still be correctly extracted. In addition, by optimizing the watermark embedding strategy, the amount of watermark information carried is increased while ensuring image quality, effectively solving the problems of limited watermark embedding information and degraded image quality in existing technologies.
[0108] Figure 3 A flowchart illustrating a method for reconstructing a watermarked image according to an embodiment of this application is shown.
[0109] In one feasible implementation, step S160 involves performing inverse singular value decomposition on the singular values of each watermarked image block and reconstructing each watermarked image block to obtain the watermarked image. The specific process is as follows: Figure 3 As shown, steps S161 to S163 are included.
[0110] S161: Perform inverse singular value decomposition on the singular values of each watermarked block image to obtain the inverse discrete cosine transform coefficients.
[0111] After obtaining the singular values of each image block after embedding the watermark, inverse singular value decomposition (ISVD) is performed on the singular values after embedding the watermark to reconstruct the DCT coefficient matrix containing the singular values after embedding the watermark, that is, the DCT coefficient matrix containing the watermark information, which is used as the input of the inverse discrete cosine transform.
[0112] S162: Perform inverse discrete cosine transform based on the coefficients of inverse discrete cosine transform to obtain multiple inverse frequency subbands, including an inverse low frequency subband.
[0113] The inverse discrete cosine transform (IDCT) is performed on the coefficient matrix containing the watermark information. IDCT is the inverse process of DCT, which can transform data in the frequency domain back to the spatial domain. Through the inverse discrete cosine transform, the low-frequency subband (LL) containing the watermark information and other corresponding frequency subbands can be reconstructed from the watermark information.
[0114] S163: Combine multiple inverse frequency subbands to obtain a watermarked block image, and reconstruct the watermarked block image to obtain a watermarked image with added watermark.
[0115] Based on the low-frequency subband (LL) containing watermark information and the LH, HL, and HH frequency subbands of the segmented image, the frequency bands are combined using inverse redundant discrete wavelet transform (IRDWT) to obtain the segmented image with added watermark information. Finally, all the segmented images containing embedded watermarks are stitched together according to their original positions to form the final watermarked image.
[0116] This embodiment reconstructs the DCT coefficients of the watermarked image by performing inverse singular value decomposition on the singular values of the watermarked image blocks. Then, inverse discrete cosine transform is used to recover the low-frequency sub-band and other frequency sub-bands containing the watermark from these coefficients. Finally, multiple inverse frequency sub-bands are combined, and each watermarked image block is reconstructed using inverse redundant discrete wavelet transform. All image blocks are then stitched together in situ to form the final watermarked image. This ensures successful watermark embedding and robustness while preserving the quality and visual consistency of the original image, enhancing the watermark's concealment and resistance to attacks.
[0117] Figure 4 A flowchart illustrating an image singular value decomposition method according to an embodiment of this application is shown.
[0118] In one feasible implementation, step S150: the specific process of determining the singular value of each image block after watermark embedding based on the maximum singular value of each image block and the watermark information corresponding to the watermark embedding amount, as follows: Figure 4 As shown, steps S151 to S152 are included.
[0119] S151: For each image block, quantize the maximum singular value of the image block to obtain the quantized value.
[0120] S152: Determine the singular values of the segmented image after embedding the watermark based on the quantization value, quantization step size, and watermark embedding amount.
[0121] The maximum singular value of each image block is quantized to obtain the quantized value of the maximum singular value of each image block. Then, based on the quantized value of the maximum singular value of each image block, the quantization step size, and the watermark information to be embedded, the singular value of each image block after watermark embedding is calculated. The specific calculation process is shown in formulas (3) and (4).
[0122] q i = round (S i / Δ) (3)
[0123]
[0124] Where `round` is the rounding function, `mod` is the modulo operation function, `Δ` is the quantization step size, and `S` is the quantization step size. i Si and represent the maximum singular value and the singular value after embedding one bit of watermark information in the i-th image block, respectively, and w i This indicates a watermark information.
[0125] The singular values of an image exhibit good stability; even if the image is subjected to slight perturbations or attacks of a certain degree, such as noise, compression, or cropping, its singular values will not change significantly. Therefore, quantizing and embedding a watermark at the largest singular value ensures that the watermark can still be effectively extracted even when the image is attacked, thereby improving the robustness and security of the watermark. This embedding method not only has low computational complexity but also high embedding efficiency. By appropriately selecting the number of quantization bits, the watermark recognition rate can also be optimized.
[0126] This embodiment obtains a quantized value by quantizing the maximum singular value of each image block. Then, it determines the singular value after watermark embedding based on the quantized value, quantization step size, and watermark embedding amount. It utilizes the stability of singular values to ensure that the watermark can still be effectively extracted after the image is attacked. By flexibly adjusting the embedding strategy, it maximizes the embedding amount of watermark information without affecting the image quality. This not only improves the flexibility and robustness of watermark embedding but also ensures efficient embedding and high recognition rate of watermark information, while minimizing the impact on the visual effect of the original image.
[0127] Figure 5 A flowchart illustrating a method for recovering an original image from a watermarked image according to an embodiment of this application is shown.
[0128] In one feasible implementation, the method further includes, for example: Figure 5 Steps S210 to S240 are shown.
[0129] S210: Divide the attacked watermarked image into blocks to obtain watermarked block images.
[0130] The original image can be recovered from a watermarked image, which may include the attacked watermarked image. The attacked watermarked image is divided into non-overlapping watermarked blocks. Based on the total number of bits in the watermark of the attacked watermarked image, i.e., the total amount of one-dimensional watermark information, the texture complexity and corresponding watermark embedding capacity of the attacked watermarked image are calculated.
[0131] S220: Perform singular value decomposition on each watermarked block image to obtain the singular values and watermark information after watermarking.
[0132] Singular value decomposition can be performed on each watermarked watermark block image using matrix decomposition. This can yield the watermark information of each watermark block image when the watermark was previously embedded, as well as the singular values of the watermark after embedding the watermark based on the singular values of the block image when the watermark was previously embedded.
[0133] S230: Determine the maximum singular value based on the singular values after watermarking and the watermark information.
[0134] Based on the watermark information of each watermarked block image when it was previously embedded with watermarks, and the singular values after embedding the watermark based on the singular values of the block images when it was previously embedded with watermarks, the singular values of each watermarked block image when it was previously embedded with watermarks are determined, that is, the maximum singular value of the corresponding block image before each watermarked block image was embedded with watermarks.
[0135] S240: Perform inverse singular value decomposition on the maximum singular value and reconstruct the block image to obtain the original image.
[0136] After obtaining the maximum singular value of each block image before watermarking, inverse singular value decomposition is performed on the maximum singular value of the block image before watermarking to obtain the original block image before watermarking. Finally, all the original block images are spliced together according to their original positions to form the original carrier image before watermarking.
[0137] In one embodiment, after obtaining the maximum singular value of the corresponding block image before embedding the watermark in each watermark block image, quantization is performed in the manner shown in formula (3), and the maximum singular value after quantization is recovered in the manner shown in formula (5). The specific process is as follows.
[0138] q i ' = (q i +0.5)Δ (5)
[0139] Where, q i q represents the maximum singular value after quantization. i ' represents the maximum singular value after restoration, and △ represents the quantization step size. Then, using the maximum singular value restored from each block image before watermarking, inverse singular value decomposition is performed on the maximum singular value of the block image before watermarking to obtain the original block image.
[0140] This embodiment describes a scheme that extracts watermark information and embedded singular values by segmenting the attacked watermark image into blocks and performing singular value decomposition. Based on this information, the original maximum singular value is determined, and the segmented image is reconstructed through inverse singular value decomposition. Finally, the original carrier image is stitched together to recover it. This ensures accurate extraction of watermark information even when the image is attacked, minimizes distortion during the recovery process, and guarantees the quality of the output image. Therefore, it significantly improves the ability to recover the original content from damaged watermark images, enhancing the security and robustness of watermarking technology.
[0141] Figure 6 A flowchart illustrating a method for singular value decomposition of watermarked block images according to an embodiment of this application is shown.
[0142] In one feasible implementation, step S220: the specific process of performing singular value decomposition on each watermarked image block to obtain the singular values and watermark information after watermarking, as follows: Figure 6 As shown, it includes steps S221 to S223.
[0143] S221: Divide the frequency band for each watermarked block image to obtain multiple frequency sub-bands, including low-frequency sub-bands.
[0144] Redundant Discrete Wavelet Transform (RDWT) is performed on each watermarked block image, dividing each watermarked block image into four frequency sub-bands: LL, LH, HL, and HH. The low-frequency sub-band (LL) refers to the combination of low-frequency horizontal and low-frequency vertical directions, which contains the main energy and most of the visual information of the watermarked block image, reflecting the overall structure and large-scale features of the watermarked block image.
[0145] S222: Perform discrete cosine transform on the low-frequency subband to obtain the discrete cosine transform coefficients.
[0146] Discrete cosine transform (DCT) is performed on the low-frequency subband (LL) of each watermarked image block, and DCT coefficients are extracted from the DCT transformed matrix. The DCT coefficients are a set of values obtained by the DCT transform, representing the contribution of the original signal to different frequency components. Most of the energy is concentrated in the low-frequency coefficients, while the high-frequency coefficients are close to zero.
[0147] S223: Perform singular value decomposition on the discrete cosine transform coefficients to obtain the singular values and watermark information after watermarking.
[0148] Based on the discrete cosine transform coefficients obtained from the low-frequency subband (LL) discrete cosine transform of each watermarked block image, a DCT coefficient matrix is constructed. Singular value decomposition is then performed on the constructed DCT coefficient matrix to obtain the watermark information of each watermarked block image when the watermark was previously embedded, as well as the singular values after the watermark was embedded based on the singular values of the block image when the watermark was previously embedded.
[0149] This embodiment divides the frequency band by performing redundant discrete wavelet transform on each watermarked image block, focusing on the low-frequency sub-band containing the main energy and visual information. Then, discrete cosine transform is performed on the low-frequency sub-band to extract DCT coefficients. Finally, singular value decomposition is performed based on these coefficients to accurately recover the singular values after watermarking and the original watermark information. By utilizing the stability and importance of the low-frequency sub-band to reduce noise interference and ensure the clarity and integrity of the watermark information, and by effectively extracting hidden watermark data through singular value decomposition, efficient and accurate watermark information extraction is achieved. This enhances the security and robustness of the watermarking technology, ensuring that the original watermark information can be successfully recovered even if the image is attacked.
[0150] In one feasible implementation, S240: performing inverse singular value decomposition on the maximum singular value and reconstructing the block image to obtain the original image includes: performing inverse singular value decomposition on the maximum singular value to obtain discrete cosine transform coefficients; performing inverse discrete cosine transform on the discrete cosine transform coefficients to obtain a low-frequency sub-band; combining the frequency bands based on the low-frequency sub-band to obtain a block image; and reconstructing the block image to obtain the original image.
[0151] After obtaining the maximum singular value of each image block before watermarking, inverse singular value decomposition (ISVD) is performed on the maximum singular value before watermarking to reconstruct the DCT coefficient matrix that does not contain the singular value of watermarking, i.e., the DCT coefficient matrix that does not contain watermark information, as the input of inverse discrete cosine transform.
[0152] The inverse discrete cosine transform (IDCT) is performed on the discrete cosine transform coefficient matrix without watermark information. IDCT is the inverse process of DCT, which can transform data in the frequency domain back to the spatial domain. Through the inverse discrete cosine transform, the low-frequency subband (LL) without watermark information and other corresponding frequency subbands can be reconstructed from the discrete cosine transform coefficient matrix without watermark information.
[0153] Based on the low-frequency sub-band (LL) of the segmented image that does not contain watermark information and the LH, HL, and HH frequency sub-bands of the segmented image, the frequency bands are combined by inverse redundant discrete wavelet transform (IRDWT) to obtain the segmented image before watermark information is embedded. Finally, all the segmented images that do not contain embedded watermark information are stitched together according to their original positions to form the original carrier image before watermark information is embedded.
[0154] This embodiment recovers the discrete cosine transform (DCT) coefficients by performing inverse singular value decomposition (ISF) on the largest singular value before watermarking. Then, it performs ISF on these coefficients to obtain a low-frequency subband. Based on this low-frequency subband, it reconstructs the segmented image through frequency band combination. Finally, it stitches all the segmented images together to obtain the original carrier image. By leveraging the stability of singular values and the efficiency of DCT, it ensures accurate recovery of the original image even if the image is attacked, while reducing distortion during the recovery process, guaranteeing the quality and visual consistency of the output image, and significantly enhancing the security and robustness of the watermarking technology.
[0155] Figure 7 A flowchart illustrating a method for extracting watermarks from a watermarked image according to an embodiment of this application is shown.
[0156] In one feasible implementation, the specific process of obtaining watermark information by performing singular value decomposition on the discrete cosine transform coefficients in step S223 is as follows: Figure 7 As shown, steps S224 to S226 are included.
[0157] S224: Perform singular value decomposition on the discrete cosine transform coefficients to obtain the initial watermark information.
[0158] A Discrete Cosine Transform (DCT) coefficient matrix is constructed based on the discrete cosine transform coefficients obtained from the low-frequency subband (LL) of each watermarked image block. Singular value decomposition (SVD) is then performed on the constructed DCT coefficient matrix to obtain the maximum singular value after watermarking, which was previously embedded based on the maximum singular value of the image block. Subsequently, according to formulas (6) and (7), the maximum singular value after watermarking is quantized and the initial watermark information is extracted, i.e., the watermark information embedded in each watermarked image block. The specific calculation process is as follows.
[0159]
[0160] Where floor is the floor function. This represents the extracted initial watermark information, where mod is the modulo operation function. This represents the singular value after embedding a single watermark in the i-th image block.
[0161] After extracting the watermark information embedded in each watermark block image, this watermark information belongs to a one-dimensional watermark sequence. Further, the one-dimensional watermark sequence is upgraded to obtain two-dimensional watermark information.
[0162] S225: Scramble the initial watermark information to obtain scrambled information.
[0163] After upscaling the watermark information embedded in each watermark block image, we can obtain the scrambled watermark image information after scrambling the original watermark image.
[0164] S226: Obtain watermark information by descrambling the scrambling information according to the key; where the key is the scrambling parameter.
[0165] To obtain the original watermarked image, the scrambled watermarked image information needs to be descrambled. Descrambling requires using the scrambling parameters (keys) used when scrambling the original watermarked image. These keys are typically stored on the server along with the capacity information of the scrambled and dimensionality-reduced one-dimensional watermark information. Generalized Arnold descrambling is then applied to the scrambled watermarked image information using the scrambling parameters to extract the final original watermarked image.
[0166] This embodiment extracts the maximum singular value after embedding the watermark by performing singular value decomposition on the discrete cosine transform coefficients of the low-frequency sub-bands of each watermarked image block. The initial watermark information is then calculated using quantization and formulas. Subsequently, this watermark information is upsampling, and the scrambling information is descrambled using a key to recover the original watermarked image. This ensures accurate extraction of watermark information even if the image is attacked. Furthermore, the descrambling enhances the security and robustness of the watermark, guaranteeing that only authorized parties can decode and recover the watermark information, significantly improving the effectiveness and reliability of watermark verification.
[0167] In one feasible implementation, before determining the singular value of each block image after embedding the watermark based on the maximum singular value of each block image and the watermark information, the method further includes: acquiring a watermark image; binarizing the watermark image and scrambling the binarized watermark image based on scrambling parameters to obtain a scrambled image; and performing dimensionality reduction processing on the scrambled image to obtain the watermark information.
[0168] Obtain the original watermark image used to add watermark to the carrier image, and preprocess the original watermark image, including binarization. Then, perform generalized Arnold scrambling on the binarized original watermark image, and reduce the dimensionality of the scrambled original watermark image from two dimensions to one dimension. At the same time, save the scrambling parameters of Arnold scrambling as a key stored on the server, and save the total amount of one-dimensional watermark information. The specific process of Arnold scrambling is shown in formula (8).
[0169]
[0170] Where N is the order of the image matrix, a and b are independent parameters, n is the number of iterations, and [x0, y=] T These are the pixel coordinates of the original image, [x n, y n ] T It is the pixel value position after Arnold scrambling.
[0171] The watermark image is obtained from the beneficial effects of weight 9 and binarized. Then, it is scrambled based on scrambling parameters to increase concealment. The scrambled image is then reduced to low-dimensional watermark information, which simplifies the watermark structure and enhances the concealment and security of the watermark. A specific key is used to ensure that only authorized persons can recover the original watermark. Even if the image is attacked, the watermark information can still maintain its integrity and extractability.
[0172] In one feasible implementation, obtaining a watermarked image includes: obtaining at least one of a copyrighted image, user identity information, IP address, and timestamp information; and generating a watermarked image based on at least one of the copyrighted image, user identity information, IP address, and timestamp information.
[0173] It can obtain at least one of the following: copyright-identifying image, user identity information, permission information, IP address, and timestamp information to generate an original watermark image for adding a watermark to a carrier image. The user identity information can include the identity information of the user who generated the watermark image and the identity information of users who viewed the watermark image; the permission information can be used to identify which users have the necessary permissions to view the watermark image; the IP address and timestamp information refer to the IP address at which the watermark image was generated or viewed at what time.
[0174] This embodiment of the method collects at least one of the following: copyrighted images, user identity information, IP addresses, and timestamp information, and generates watermarked images based on this information. This enhances copyright protection, improves traceability by including information on specific usage scenarios and dissemination paths, and makes the watermark more complex and tamper-proof by integrating multiple pieces of information, thus improving its robustness and legal validity. The generation of personalized watermarks optimizes the user experience and ensures that even if the image is attacked, the watermark information remains intact and extractable, significantly enhancing the security and practicality of watermarking technology.
[0175] Based on the same concept, embodiments of this application provide an image watermarking device, which is described below in conjunction with... Figure 8 The image watermarking apparatus provided in the embodiments of this application will be described in detail.
[0176] Figure 8 This is a structural block diagram of an image watermarking device shown in an embodiment of this application.
[0177] like Figure 8 As shown, the device for adding the image watermark may include:
[0178] The segmentation module 810 is used to segment an image into blocks to obtain a target number of segmented images, wherein the images of the segmented images do not overlap;
[0179] The determination module 820 is used to determine the texture complexity of each block image based on the number of pixels at the block image boundary and the size of the block image.
[0180] The determining module 820 is further configured to determine the watermark embedding amount of each block image based on the texture complexity of each block image, the average watermark embedding capacity, and the initial texture complexity; wherein, the average watermark embedding capacity is determined based on the total capacity of the watermark information and the target number;
[0181] The decomposition module 830 is used to perform singular value decomposition on each block image to obtain the maximum singular value of each block image;
[0182] The determining module 820 is also used to determine the singular value of each segmented image after watermark embedding based on the maximum singular value of each segmented image and the watermark information corresponding to the watermark embedding amount.
[0183] The reconstruction module 840 is used to perform inverse singular value decomposition on the singular values of each watermarked image and reconstruct each watermarked image to obtain a watermarked image with watermark added.
[0184] In one embodiment, the decomposition module 830 is specifically used to divide the block image into frequency bands for each block image to obtain multiple frequency sub-bands, including a low-frequency sub-band; perform discrete cosine transform on the low-frequency sub-bands to obtain discrete cosine transform coefficients; and perform singular value decomposition on the discrete cosine transform coefficients to obtain the maximum singular value of the block image.
[0185] In one embodiment, the reconstruction module 840 is specifically used to perform inverse singular value decomposition on the singular values of each watermarked block image to obtain inverse discrete cosine transform coefficients; perform inverse discrete cosine transform based on the inverse discrete cosine transform coefficients to obtain multiple inverse frequency subbands, the multiple inverse frequency subbands including inverse low frequency subbands; combine the multiple inverse frequency subbands to obtain the watermarked block image, and reconstruct the watermarked block image to obtain the watermarked image.
[0186] The determination module 820 is specifically used to quantize the maximum singular value of each segmented image to obtain a quantized value; and to determine the singular value of the segmented image after watermark embedding based on the quantized value, quantization step size and watermark embedding amount corresponding to the watermark information.
[0187] In one embodiment, the reconstruction module 840 is further configured to divide the attacked watermarked image into blocks to obtain watermarked block images; perform singular value decomposition on each watermarked block image to obtain singular values and watermark information after watermarking; determine the maximum singular value based on the singular values and watermark information after watermarking; perform inverse singular value decomposition on the maximum singular value and reconstruct the block images to obtain the original image.
[0188] In one embodiment, the reconstruction module 840 is specifically used to divide the frequency band for each watermarked block image to obtain multiple frequency sub-bands, including a low-frequency sub-band; perform discrete cosine transform on the low-frequency sub-band to obtain discrete cosine transform coefficients; and perform singular value decomposition on the discrete cosine transform coefficients to obtain the singular values and watermark information after watermarking.
[0189] In one embodiment, the reconstruction module 840 is specifically used to perform inverse singular value decomposition on the maximum singular value to obtain discrete cosine transform coefficients; perform inverse discrete cosine transform on the discrete cosine transform coefficients to obtain low-frequency subbands; combine the frequency bands based on the low-frequency subbands to obtain block images; and reconstruct the block images to obtain the original image.
[0190] In one embodiment, the reconstruction module 840 is specifically used to perform singular value decomposition on the discrete cosine transform coefficients to obtain initial watermark information; to scramble the initial watermark information to obtain scrambled information; and to descramble the scrambled information according to the key to obtain watermark information; wherein, the key is the scrambling parameter.
[0191] In one embodiment, the reconstruction module 840 is further configured to: acquire a watermark image before determining the singular value of each block image after embedding the watermark based on the maximum singular value of each block image and the watermark information; binarize the watermark image and scramble the binarized watermark image based on scrambling parameters to obtain a scrambled image; and perform dimensionality reduction processing on the scrambled image to obtain the watermark information.
[0192] In one embodiment, the acquisition module 810 is specifically used to acquire at least one of the following: a copyrighted image, user identity information, IP address, and timestamp information; and to generate a watermarked image based on at least one of the following: the copyrighted image, user identity information, IP address, and timestamp information.
[0193] Figure 8 Each module in the illustrated device has the ability to implement Figures 1 to 7 The functions of each step in the process and their corresponding technical effects are described in detail here for the sake of brevity.
[0194] Figure 9 A schematic diagram of the hardware structure of an electronic device provided in one embodiment of this application is shown.
[0195] The electronic device may include a processor 910 and a memory 920 storing computer program instructions.
[0196] Specifically, the processor 910 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0197] Memory 920 may include mass storage for data or instructions. For example, and not limitingly, memory 920 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 920 may include removable or non-removable (or fixed) media. Where appropriate, memory 920 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 920 is non-volatile solid-state memory.
[0198] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect of this disclosure.
[0199] The processor 910 reads and executes computer program instructions stored in the memory 920 to implement any of the image watermarking methods described in the above embodiments.
[0200] In one example, the electronic device may also include a communication interface 930 and a bus 940. For example, Figure 9 As shown, the processor 910, memory 920, and communication interface 930 are connected via bus 940 and communicate with each other.
[0201] The communication interface 930 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0202] Bus 940 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 940 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0203] The electronic device can perform the image watermarking method described in the embodiments of this application, thereby achieving a combination of Figures 1 to 7 Describes the method for adding image watermarks.
[0204] Furthermore, in conjunction with the image watermarking methods described in the above embodiments, this application can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores computer program instructions; when executed by a processor, these computer program instructions implement any of the image watermarking methods described in the above embodiments.
[0205] This application also provides a computer program product, including a computer program, which, when executed, implements any of the image watermarking methods described in the above embodiments.
[0206] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0207] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0208] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0209] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0210] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A method of image watermarking, characterized by, The method includes: The image is divided into blocks to obtain a target number of block images, wherein the images of the block images do not overlap; For each image block, the texture complexity of each image block is determined based on the number of pixels at the image block boundary and the size of the image block. The watermark embedding amount for each image block is determined based on the texture complexity, average watermark embedding capacity, and initial texture complexity of each image block; wherein, the average watermark embedding capacity is determined based on the total watermark information capacity and the target quantity. Perform singular value decomposition on each image block to obtain the maximum singular value of each image block; Based on the maximum singular value of each image block and the watermark information corresponding to the watermark embedding amount, determine the singular value of each image block after watermark embedding; Inverse singular value decomposition is performed on the singular values of each watermarked image block, and each watermarked image block is reconstructed to obtain the watermarked image.
2. The method of claim 1, wherein, The step of performing singular value decomposition on each image block to obtain the maximum singular value of each image block includes: For each image block, the image block is divided into frequency bands to obtain multiple frequency sub-bands, including low-frequency sub-bands; Discrete cosine transform coefficients are obtained by performing discrete cosine transform on the low-frequency subband; The maximum singular value of the block image is obtained by performing singular value decomposition on the discrete cosine transform coefficients.
3. The method of claim 2, wherein, The step of performing inverse singular value decomposition on the singular values of each watermarked image block and reconstructing each watermarked image block to obtain a watermarked image includes: Inverse singular value decomposition is performed on the singular values of each watermarked image block to obtain inverse discrete cosine transform coefficients. Based on the inverse discrete cosine transform coefficients, an inverse discrete cosine transform is performed to obtain multiple inverse frequency sub-bands, including an inverse low frequency sub-band. Multiple inverse frequency subbands are combined to obtain a watermarked block image, and the watermarked block image is reconstructed to obtain a watermarked image.
4. The method of claim 1, wherein, The step of determining the singular value of each image block after watermark embedding based on the maximum singular value of each image block and the watermark information corresponding to the watermark embedding amount includes: For each image block, the maximum singular value of the image block is quantized to obtain the quantized value; Based on the watermark information corresponding to the quantization value, quantization step size, and watermark embedding amount, the singular values after watermark embedding in the segmented image are determined.
5. The method of claim 1, wherein, The method further includes: The attacked watermarked image is divided into blocks to obtain a watermarked block image with watermark; Singular value decomposition is performed on each watermarked image block to obtain the singular values and watermark information after watermarking is added. The maximum singular value is determined based on the singular values after watermarking and the watermark information; The maximum singular value is subjected to inverse singular value decomposition and the block image is reconstructed to obtain the original image.
6. The method of claim 5, wherein, The process of performing singular value decomposition on each watermarked image block to obtain the singular values and watermark information after watermarking includes: For each watermarked image block, frequency bands are divided to obtain multiple frequency sub-bands, including low-frequency sub-bands; Discrete cosine transform coefficients are obtained by performing discrete cosine transform on the low-frequency subband; Singular value decomposition is performed on the discrete cosine transform coefficients to obtain the singular values and watermark information after watermarking.
7. The method of claim 6, wherein, The step of performing inverse singular value decomposition on the maximum singular value and reconstructing the block image to obtain the original image includes: The maximum singular value is subjected to inverse singular value decomposition to obtain discrete cosine transform coefficients; Perform an inverse discrete cosine transform on the discrete cosine transform coefficients to obtain the low-frequency subband; Block images are obtained by combining frequency bands based on low-frequency sub-bands; The original image is obtained by reconstructing the segmented image.
8. The method of claim 6, wherein, The process of obtaining watermark information by performing singular value decomposition on the discrete cosine transform coefficients includes: The initial watermark information is obtained by performing singular value decomposition on the discrete cosine transform coefficients. The initial watermark information is scrambled to obtain scrambled information; The watermark information is obtained by descrambling the scrambled information using a key; wherein, the key is the scrambling parameter.
9. The method of claim 1, wherein, Before determining the singular value of each image block after embedding the watermark based on the maximum singular value of each image block and the watermark information, the method further includes: Get the watermarked image; The watermark image is binarized, and the binarized watermark image is scrambled based on scrambling parameters to obtain a scrambled image. The scrambled image is then subjected to dimensionality reduction processing to obtain the watermark information.
10. The method of claim 9, wherein, The process of obtaining the watermarked image includes: Obtain at least one of the following: an image with copyright markings, user identity information, IP address, and timestamp information; A watermarked image is generated based on at least one of the copyrighted image, user identity information, IP address, and timestamp information.
