Image processing method and device, equipment and medium
By dividing the image into sub-images and decomposing in the frequency domain, filtering and analyzing features, and generating watermark description information, the problem of traditional clear watermark affecting image quality is solved, and high-quality image copyright protection and authentication are achieved.
Patent Information
- Application Number
- CN202311583580.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-24
- Publication Date
- 2025-05-27
AI Technical Summary
Traditional methods of adding clear watermarks to images can affect image quality, resulting in low image quality.
By dividing the image to be processed into multiple sub-images and decomposing it in the frequency domain, candidate sub-image features that conform to the preset frequency band characteristics are screened, principal component analysis is performed, image features are constructed, and watermark description information is generated based on image features and watermark information.
There is no need to embed watermarks into the image, thereby maintaining image quality while achieving effective copyright protection and authentication of the image.
Smart Images

Figure CN120047299A_ABST
Abstract
Description
Technical Field
[0001] This application relates to network media technology, and more particularly to the field of artificial intelligence, especially to an image processing method, apparatus, device, and medium. Background Art
[0002] With the development of computer technology, watermarking technology has emerged. A watermark is a transparent mark embedded in an image, video, or document for protecting the copyright of a work and identity authentication. It can be in the form of an image, text, number, etc. In the field of images, in traditional technology, visible watermarks are usually added to images, where visible watermarks are usually semi-transparent text or graphics. By directly embedding the watermark into the image, it can be easily detected by the naked eye. The purpose of visible watermarks is to remind viewers that this is a copyrighted work to reduce the possibility of piracy or unauthorized use.
[0003] However, the traditional method of adding visible watermarks to images directly embeds the visible watermark into the image, which will affect the image quality, resulting in low image quality. Summary of the Invention
[0004] Based on this, it is necessary to provide an image processing method, apparatus, device, and medium that can maintain image quality for the above technical problems.
[0005] In a first aspect, this application provides an image processing method, the method comprising:
[0006] Obtain an image to be processed, and divide the image to be processed into a plurality of sub-images;
[0007] For each of the sub-images, decompose the sub-image in the frequency domain to obtain a plurality of candidate sub-image features of the sub-image, where different candidate sub-image features correspond to different frequency bands;
[0008] From the plurality of candidate sub-image features, screen out the candidate sub-image features corresponding to the preset frequency band features to obtain the sub-image features of the sub-image;
[0009] Perform principal component analysis on the sub-image features of each of the plurality of sub-images respectively to obtain the eigenvalue corresponding to each of the plurality of sub-images;
[0010] Based on the eigenvalues corresponding to each of the plurality of sub-images, construct the image features of the image to be processed;
[0011] Obtain watermark information, and generate watermark description information for the image to be processed according to the image features and the watermark information.
[0012] In a second aspect, this application provides an image processing apparatus, the apparatus comprising:
[0013] A division module, configured to obtain an image to be processed and divide the image to be processed into a plurality of sub-images;
[0014] A decomposition module, configured to, for each of the sub-images, decompose the targeted sub-image in the frequency domain to obtain a plurality of candidate sub-image features of the targeted sub-image, where different candidate sub-image features correspond to different frequency bands;
[0015] A screening module, configured to screen, from the plurality of candidate sub-image features, the candidate sub-image features corresponding to preset frequency band features to obtain the sub-image features of the targeted sub-image;
[0016] An analysis module, configured to perform principal component analysis on the sub-image features of each of the plurality of sub-images respectively to obtain the eigenvalue corresponding to each of the plurality of sub-images;
[0017] A construction module, configured to construct the image features of the image to be processed based on the eigenvalues corresponding to the plurality of sub-images respectively;
[0018] A generation module, configured to obtain watermark information, and generate watermark description information for the image to be processed according to the image features and the watermark information.
[0019] In one embodiment, the decomposition module is further configured to, for each of the sub-images, based on the targeted sub-image, perform decomposition in the frequency domain layer by layer until the last layer decomposes in the frequency domain to obtain a plurality of candidate sub-image features of the targeted sub-image.
[0020] In one embodiment, the decomposition module is further configured to, for each of the sub-images, use the targeted sub-image as the decomposition object in the first round, use the first round as the current round, perform decomposition of the decomposition object in the frequency domain in the current round to obtain a plurality of candidate object features of the decomposition object, where different candidate object features correspond to different frequency bands; screen, from the plurality of candidate object features, the candidate object features corresponding to preset frequency band features to obtain the object features of the decomposition object; use the next round as the current round, use the object features as the decomposition object in the current round, and return to the step of performing decomposition of the decomposition object in the frequency domain in the current round to obtain a plurality of candidate object features of the decomposition object for iterative execution until the iteration ends when a decomposition stop condition is met, and use the plurality of candidate object features obtained in the last round of decomposition as the plurality of candidate sub-image features of the targeted sub-image.
[0021] In one embodiment, the decomposition stop condition is that the decomposition round reaches a preset even number of rounds, and the decomposition object is a matrix containing multiple elements. If the decomposition round corresponding to the current round is odd, each row element in the matrix is decomposed in the frequency domain in the current round. If the decomposition round corresponding to the current round is even, each column element in the matrix is decomposed in the frequency domain in the current round.
[0022] In one embodiment, the screening module is further configured to determine a target frequency band from the frequency bands corresponding to the multiple candidate sub-image features, where any frequency included in the target frequency band is lower than any frequency included in the remaining frequency bands. The remaining frequency bands are the frequency bands corresponding to the multiple candidate sub-image features except the target frequency band; from the multiple candidate sub-image features, screen the candidate sub-image features corresponding to the target frequency band to obtain the sub-image features of the targeted sub-image.
[0023] In one embodiment, the sub-image feature is a sub-image feature matrix, and the analysis module is further configured to perform singular value decomposition on each sub-image feature matrix to obtain at least one singular value of the targeted sub-image feature matrix; determine the eigenvalue corresponding to the targeted sub-image feature matrix according to the largest singular value among the at least one singular value.
[0024] In one embodiment, the construction module is further configured to obtain at least one encryption key; based on the at least one encryption key, select multiple eigenvalue pairs from the eigenvalues corresponding to the multiple sub-images, and each eigenvalue pair includes two eigenvalues; for each eigenvalue pair, determine the difference between the two eigenvalues included in the targeted eigenvalue pair to obtain the eigenvalue difference corresponding to the targeted eigenvalue pair; construct the image feature of the image to be processed according to the eigenvalue differences corresponding to the multiple eigenvalue pairs.
[0025] In one embodiment, the eigenvalues corresponding to the multiple sub-images are located in an eigenvalue matrix, and the construction module is further configured to, for each encryption key, generate a random number sequence corresponding to the targeted encryption key based on the targeted encryption key; determine multiple position pairs in the eigenvalue matrix according to the random number sequences corresponding to the at least one encryption key, and each position pair includes two positions; for each position pair, determine the eigenvalue pair corresponding to the targeted position pair according to the eigenvalues located at the two positions included in the targeted position pair in the eigenvalue matrix.
[0026] In one embodiment, the device further includes:
[0027] A copyright determination module, configured to obtain at least one decryption key; construct image features of the image to be processed based on the at least one decryption key; generate watermark information according to the watermark description information and the image features of the image to be processed constructed based on the at least one decryption key; when the generated watermark information is consistent with the obtained watermark information, determine that the ownership of the image to be processed belongs to the holder of the at least one decryption key.
[0028] In one embodiment, the image features are an image feature matrix, the watermark information is a watermark information matrix, and the watermark description information is a watermark description information matrix; the generation module is further configured to fuse each element in the image feature matrix with each element in the watermark information matrix to obtain a watermark description information matrix for the image to be processed.
[0029] In one embodiment, the partitioning module is further configured to determine the image size of the image to be processed; when the image size of the image to be processed is not an integer multiple of a preset image size, perform edge padding on the image to be processed to obtain a padded image, where the image size of the padded image is an integer multiple of the preset image size, and the preset image size is smaller than the image size of the image to be processed; divide the padded image into a plurality of non-overlapping sub-images that meet the preset image size.
[0030] In one embodiment, the partitioning module is further configured to, when the image size of the image to be processed is an integer multiple of the preset image size, divide the image to be processed into a plurality of non-overlapping sub-images that meet the preset image size.
[0031] In one embodiment, the apparatus further includes:
[0032] A content determination module, configured to obtain a target image to be verified, determine target image features of the target image; generate watermark information according to the watermark description information and the target image features; when the generated watermark information is consistent with the obtained watermark information, determine that the image content of the target image is consistent with the image content of the image to be processed.
[0033] In a third aspect, the present application provides a computer device, including a memory and a processor, where a computer program is stored in the memory, and when the processor executes the computer program, the steps in the method embodiments of the present application are implemented.
[0034] In a fourth aspect, the present application provides a computer-readable storage medium, storing a computer program, and when the computer program is executed by a processor, the steps in the method embodiments of the present application are implemented.
[0035] Fifth aspect, the present application provides a computer program product, including a computer program which, when executed by a processor, implements the steps in the method embodiments of the present application.
[0036] In the above image processing method, apparatus, device and medium, by dividing the image to be processed into multiple sub-images, for each sub-image, decomposing the sub-image in the frequency domain to obtain multiple candidate sub-image features of the sub-image, where different candidate sub-image features correspond to different frequency bands. By screening the candidate sub-image features corresponding to the preset frequency band features from the multiple candidate sub-image features, the sub-image features of the sub-image are obtained, and principal component analysis is respectively performed on the sub-image features of each of the multiple sub-images to obtain the eigenvalues corresponding to each of the multiple sub-images. By constructing the image features of the image to be processed based on the eigenvalues corresponding to each of the multiple sub-images, and according to the image features and the obtained watermark information, watermark description information for the image to be processed is generated. Compared with the traditional method of adding a visible watermark to an image, in the present application, by decomposing and feature screening each sub-image obtained by dividing the image to be processed in the frequency domain, the sub-image features of each sub-image are obtained, and then by performing principal component analysis on the sub-image features of each sub-image, the eigenvalues representing the important information of the sub-image are obtained, so as to construct the image features of the image to be processed based on the eigenvalues of each sub-image, and generate the watermark description information for the image to be processed based on the image features and the watermark information, without embedding the watermark into the image, thereby being able to maintain the image quality. Description of the Drawings
[0037] Figure 1 It is an application environment diagram of the image processing method in an embodiment;
[0038] Figure 2 It is a schematic flowchart of the image processing method in an embodiment;
[0039] Figure 3 It is a schematic diagram of decomposing a sub-image in the frequency domain in an embodiment;
[0040] Figure 4 It is a schematic diagram of the traditional method of embedding watermark information into the image to be processed;
[0041] Figure 5 It is a schematic diagram of fusing watermark information with the image features of the image to be processed to obtain watermark description information in an embodiment;
[0042] Figure 6 It is a schematic flowchart of performing two decompositions on a sub-image in an embodiment;
[0043] Figure 7 It is a schematic diagram of each frequency band obtained by decomposing a sub-image in the frequency domain in an embodiment;
[0044] Figure 8 Schematic diagram of the ownership authentication process of the image in one embodiment;
[0045] Figure 9 Schematic diagram of dividing the image to be processed into multiple sub-images in one embodiment;
[0046] Figure 10 Schematic diagram of dividing the image to be processed into multiple sub-images in another embodiment;
[0047] Figure 11 Schematic flowchart of the image processing method in another embodiment;
[0048] Figure 12 Block diagram of the structure of the image processing device in one embodiment;
[0049] Figure 13 Block diagram of the structure of the image processing device in another embodiment;
[0050] Figure 14 Internal structure diagram of the computer device in one embodiment;
[0051] Figure 15 Internal structure diagram of the computer device in another embodiment. Detailed implementation manners
[0052] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] The image processing method provided by the present application can be applied to, for example Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be set separately, integrated on the server 104, or placed on the cloud or other servers. Among them, the terminal 102 can be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, vehicle-mounted terminals, intelligent voice interaction devices, aircraft, smart home appliances, and portable wearable devices. The smart home appliances can be smart speakers, smart TVs, smart air conditioners, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides network security services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, cloud security, host security, etc., CDN, and basic cloud computing services such as big data and artificial intelligence platforms. The terminal 102 and the server 104 can be directly or indirectly connected through wired or wireless communication methods, and this application does not make any restrictions here.
[0054] The server 104 can obtain the image to be processed, divide the image to be processed into multiple sub-images. For each sub-image, the server 104 can decompose the sub-image in the frequency domain to obtain multiple candidate sub-image features of the sub-image. Different candidate sub-image features correspond to different frequency bands. The server 104 can screen out the candidate sub-image features corresponding to the preset frequency band features from the multiple candidate sub-image features to obtain the sub-image features of the sub-image. The server 104 can perform principal component analysis on the sub-image features of each of the multiple sub-images respectively to obtain the eigenvalues corresponding to the multiple sub-images respectively. The server 104 can construct the image features of the image to be processed based on the eigenvalues corresponding to the multiple sub-images respectively. The server 104 can obtain the watermark information and generate the watermark description information for the image to be processed according to the image features and the watermark information.
[0055] It can be understood that the terminal 102 can obtain the image to be processed and send the image to the server 104, and the server 104 can receive the image sent by the terminal 102. This embodiment does not make any limitations on this, and it can be understood that Figure 1 the application scenarios in are only for illustrative purposes and are not limited thereto.
[0056] It should be noted that the image processing methods in some embodiments of this application utilize artificial intelligence technology. For example, the candidate sub-image features of a sub-image are determined using artificial intelligence technology, and the feature value corresponding to the sub-image is also determined using artificial intelligence technology. To facilitate a better understanding of artificial intelligence, the concept of artificial intelligence is described as follows. Specifically, artificial intelligence uses a digital computer or a machine controlled by a digital computer to simulate, extend, and expand human intelligence, and is a theory, method, technology, and application system that can perceive the environment, acquire knowledge, and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines to enable the machines to have the functions of perception, reasoning, and decision-making. Based on artificial intelligence technology, this application generates watermark description information for the image to be processed, which can improve the stability of the generated watermark description information.
[0057] In one embodiment, as Figure 2 shown, an image processing method is provided. This method can be applied to a computer device, which can be a terminal or a server. That is, this method can be executed independently by the terminal or the server, or can be implemented through the interaction between the terminal and the server. This embodiment takes the application of this method to a computer device as an example for description, including the following steps:
[0058] Step 202: Obtain the image to be processed and divide the image to be processed into multiple sub-images.
[0059] Specifically, the computer device can obtain the image to be processed and divide the obtained image to be processed into multiple sub-images. It can be understood that the image size of each divided sub-image is smaller than the image size of this image.
[0060] In one embodiment, the computer device can divide the image to be processed into multiple non-overlapping sub-images, or can also divide the image to be processed into multiple sub-images with at least partial overlap.
[0061] In one embodiment, the computer device can divide the image to be processed into multiple sub-images with the same size, or can also divide the image to be processed into multiple sub-images with different sizes.
[0062] Step 204: For each sub-image, decompose the targeted sub-image in the frequency domain to obtain multiple candidate sub-image features of the targeted sub-image, and different candidate sub-image features correspond to different frequency bands.
[0063] Specifically, for each of the multiple sub-images obtained by dividing the image to be processed, the computer device can decompose the targeted sub-image in the frequency domain to obtain multiple candidate sub-image features of the targeted sub-image. It can be understood that the computer device can decompose the targeted sub-image in the frequency domain into multiple candidate sub-image features corresponding to different frequency bands respectively, where different candidate sub-image features correspond to different frequency bands. It can be understood that the number of candidate sub-image features is consistent with the number of frequency bands, and one candidate sub-image feature corresponds to one frequency band.
[0064] In one embodiment, for each sub-image, the computer device can perform a single-level decomposition of the targeted sub-image in the frequency domain, that is, decompose the targeted sub-image in the frequency domain once to obtain multiple candidate sub-image features of the targeted sub-image.
[0065] In one embodiment, as Figure 3 shown, for each of the multiple sub-images obtained by dividing the image to be processed, the computer device can decompose the targeted sub-image in the frequency domain to obtain multiple candidate sub-image features of the targeted sub-image, namely candidate sub-image feature 1, candidate sub-image feature 2, candidate sub-image feature 3, and candidate sub-image feature 4. Among them, different candidate sub-image features correspond to different frequency bands, that is, candidate sub-image feature 1 corresponds to the first frequency band, candidate sub-image feature 2 corresponds to the second frequency band, candidate sub-image feature 3 corresponds to the third frequency band, and candidate sub-image feature 4 corresponds to the fourth frequency band.
[0066] In one embodiment, the computer device can determine the wavelet basis function. For each sub-image, the computer device can perform a discrete wavelet transform on the targeted sub-image based on the wavelet basis function to decompose the targeted sub-image in the frequency domain to obtain multiple candidate sub-image features of the targeted sub-image. Among them, the wavelet basis function determines the basic waveform of signal analysis.
[0067] Step 206, from multiple candidate sub-image features, filter out the candidate sub-image features corresponding to the preset frequency band features to obtain the sub-image features of the targeted sub-image.
[0068] Specifically, for each of the multiple sub-images obtained by dividing the image to be processed, the computer device can determine the frequency band that meets the preset frequency band features from the frequency bands corresponding to the multiple candidate sub-image features obtained by decomposing the targeted sub-image. Furthermore, the computer device can filter out the candidate sub-image features corresponding to the determined frequency band from the multiple candidate sub-image features, and use the determined candidate sub-image features as the candidate sub-image features corresponding to the preset frequency band features to obtain the sub-image features of the targeted sub-image.
[0069] In one embodiment, a candidate sub-image feature that conforms to a preset frequency band feature may refer to a candidate sub-image feature corresponding to a frequency band that contains a preset frequency among multiple frequency bands corresponding to multiple candidate sub-image features.
[0070] Step 208: Perform principal component analysis on the sub-image features of each of the multiple sub-images respectively to obtain the eigenvalue corresponding to each of the multiple sub-images.
[0071] Among them, principal component analysis refers to a technique for extracting the main components of an analysis object. It can be understood that the extracted main components can be used to represent the analysis object.
[0072] Specifically, for each of the multiple sub-images obtained by dividing the image to be processed, the computer device can perform principal component analysis on the sub-image features of the sub-image targeted, so as to extract the eigenvalue of the sub-image features of the sub-image targeted from the sub-image features of the sub-image targeted, and obtain the eigenvalue corresponding to the sub-image targeted. It can be understood that the extracted eigenvalue can be used to represent the eigenvalue of the sub-image features of the sub-image targeted.
[0073] In one embodiment, the sub-image feature is a sub-image feature matrix, and the principal component analysis includes singular value decomposition. For each sub-image feature matrix, the computer device can perform singular value decomposition on the sub-image feature matrix targeted to obtain at least one singular value of the sub-image feature matrix targeted. The computer device can determine the eigenvalue corresponding to the sub-image feature matrix targeted according to any one of the at least one singular value.
[0074] Step 210: Based on the eigenvalues corresponding to each of the multiple sub-images, construct the image feature of the image to be processed.
[0075] In one embodiment, the image feature is an image feature matrix. The computer device can construct the image feature matrix of the image to be processed based on the eigenvalues corresponding to each of the multiple sub-images. It can be understood that each element included in the constructed image feature matrix is determined based on the eigenvalues corresponding to each of the multiple sub-images respectively.
[0076] In one embodiment, the image feature is an image feature matrix. The computer device can obtain at least one encryption key, and construct the image feature matrix of the image to be processed based on the encryption key and the eigenvalues corresponding to each of the multiple sub-images. It can be understood that each element included in the constructed image feature matrix is determined based on the encryption key and the eigenvalues corresponding to each of the multiple sub-images respectively.
[0077] In one embodiment, the image feature is an image feature matrix. The computer device can use the eigenvalues corresponding to each of the multiple sub-images as each element included in the image feature matrix respectively.
[0078] In one embodiment, the computer device may construct the image features of the image to be processed based on the eigenvalue corresponding to each of the multiple sub-images. It can be understood that the constructed image features include the eigenvalue corresponding to each of the multiple sub-images.
[0079] Step 212: Obtain the watermark information, and generate watermark description information for the image to be processed according to the image features and the watermark information.
[0080] Among them, the watermark information, that is, the watermark, is used to protect the copyright of the work and identity authentication. The watermark information may be at least one of an image, text, a number, etc. The watermark description information is an identifier used to describe the watermark information. It can be understood that the watermark description information for the image to be processed is information that integrates the image features of the image and the watermark information.
[0081] Specifically, the computer device may obtain the watermark information, and fuse the image features of the image and the watermark information to obtain the watermark description information for the image to be processed.
[0082] In one embodiment, the computer device may obtain the watermark information, and perform an exclusive OR operation on the image features of the image and the watermark information to obtain the watermark description information for the image to be processed.
[0083] In the above image processing method, by dividing the image to be processed into multiple sub-images, for each sub-image, the sub-image is decomposed in the frequency domain to obtain multiple candidate sub-image features of the sub-image, and different candidate sub-image features correspond to different frequency bands. By screening the candidate sub-image features corresponding to the preset frequency band features from the multiple candidate sub-image features, the sub-image features of the sub-image are obtained. The principal component analysis is respectively performed on the sub-image features of each of the multiple sub-images to obtain the eigenvalue corresponding to each of the multiple sub-images. By constructing the image features of the image to be processed based on the eigenvalue corresponding to each of the multiple sub-images, and generating the watermark description information for the image to be processed according to the image features and the obtained watermark information. Compared with the traditional method of adding a visible watermark to the image, in this application, by decomposing and feature screening each sub-image obtained by dividing the image to be processed in the frequency domain, the sub-image features of each sub-image are obtained, and then through the principal component analysis of the sub-image features of each sub-image, the eigenvalue for characterizing the important information of the sub-image is obtained, so as to construct the image features of the image to be processed based on the eigenvalue of each sub-image, and generate the watermark description information for the image to be processed based on the image features and the watermark information, without embedding the watermark into the image, thus being able to maintain the image quality.
[0084] It can be understood that in the traditional technology, such as Figure 4As shown, the watermark information, i.e., ABCD, is directly embedded into the image. However, the traditional method of directly embedding watermark information into the image will affect the image quality, resulting in low image quality. In the technical solution of this application, as Figure 5 shown, this application constructs the image features of the image to be processed, and fuses the image features and the watermark information, i.e., ABCD, to obtain the watermark description information for the image to be processed, without embedding the watermark into the image, thus being able to maintain the image quality.
[0085] In one embodiment, for each sub-image, the sub-image is decomposed in the frequency domain to obtain multiple candidate sub-image features of the sub-image, including: for each sub-image, based on the sub-image, it is decomposed in the frequency domain level by level until the last level is decomposed in the frequency domain to obtain multiple candidate sub-image features of the sub-image.
[0086] Specifically, for each sub-image among the multiple sub-images obtained by dividing the image to be processed, the computer device can decompose the sub-image in the frequency domain level by level until the last level is decomposed in the frequency domain to obtain multiple candidate sub-image features of the sub-image.
[0087] In one embodiment, the computer device can determine the wavelet basis function and the scale factor. For each sub-image, the computer device can perform discrete wavelet transform on the sub-image based on the wavelet basis function and the scale factor level by level to decompose the sub-image in the frequency domain level by level until the last level is decomposed in the frequency domain to obtain multiple candidate sub-image features of the sub-image. Among them, the wavelet basis function determines the basic waveform of signal analysis, and the scale factor determines the accuracy of analyzing the signal, that is, the number of levels of layer-by-layer decomposition. For example, when the scale factor is 1, it means that the sub-image has been subjected to 1 discrete wavelet transform; when the scale factor is 2, it means that the sub-image has been subjected to 2 discrete wavelet transforms; when the scale factor is 3, it means that the sub-image has been subjected to 3 discrete wavelet transforms. It can be understood that the more times the discrete wavelet transform is performed, that is, the more levels of decomposition, the more detailed candidate sub-image features can be obtained.
[0088] In the above embodiment, by decomposing in the frequency domain level by level based on the sub-image until the last level is decomposed in the frequency domain to obtain multiple candidate sub-image features of the sub-image, more detailed candidate sub-image features can be obtained, thereby improving the acquisition accuracy of the candidate sub-image features.
[0089] In one embodiment, for each sub-image, based on the targeted sub-image, decomposition is performed level by level in the frequency domain until multiple candidate sub-image features of the targeted sub-image are obtained through frequency domain decomposition at the last level, including: for each sub-image, taking the targeted sub-image as the decomposition object in the first round, taking the first round as the current round, performing the current round of decomposition on the decomposition object in the frequency domain to obtain multiple candidate object features of the decomposition object, where different candidate object features correspond to different frequency bands; screening out the candidate object features corresponding to the preset frequency band features from the multiple candidate object features to obtain the object features of the decomposition object; taking the next round as the current round, taking the object features as the decomposition object of the current round, and returning to the step of performing the current round of decomposition on the decomposition object in the frequency domain to obtain multiple candidate object features of the decomposition object for iterative execution until the iteration ends when the decomposition stop condition is met, and taking the multiple candidate object features obtained from the last round of decomposition as the multiple candidate sub-image features of the targeted sub-image.
[0090] Specifically, for each sub-image among the multiple sub-images obtained by dividing the image to be processed, the computer device can take the targeted sub-image as the decomposition object in the first round, take the first round as the current round, and perform the current round of decomposition on the decomposition object in the frequency domain to obtain multiple candidate object features of the decomposition object, where different candidate object features correspond to different frequency bands. Furthermore, the computer device can screen out the candidate object features corresponding to the preset frequency band features from the multiple candidate object features obtained from the current round of decomposition to obtain the object features of the decomposition object. The computer device can take the next round as the current round, take the object features obtained in the previous round as the decomposition object of the current round, and return to the step of performing the current round of decomposition on the decomposition object in the frequency domain to perform multiple rounds of decomposition iteratively until the iteration ends when the decomposition stop condition is met. The computer device can directly take the multiple candidate object features obtained from the last round of decomposition as the multiple candidate sub-image features of the targeted sub-image.
[0091] In one embodiment, the decomposition stop condition can be that the decomposition round reaches a preset round.
[0092] In one embodiment, the decomposition stop condition can be that the decomposition round reaches a preset odd round.
[0093] In the above embodiments, by using the targeted sub-image as the decomposition object in the first round, taking the first round as the current round, decomposing the decomposition object in the frequency domain in the current round to obtain multiple candidate object features of the decomposition object, screening the candidate object features corresponding to the preset frequency band characteristics from the multiple candidate object features to obtain the object features of the decomposition object; taking the next round as the current round and using the object features as the decomposition object in the current round to perform iterative decomposition until the decomposition stops when the decomposition stop condition is met, and using the multiple candidate object features obtained in the last round of decomposition as the multiple candidate sub-image features of the targeted sub-image, more detailed candidate sub-image features can be obtained, thereby further improving the acquisition accuracy of the candidate sub-image features.
[0094] In one embodiment, the decomposition stop condition is that the decomposition round reaches a preset even number of rounds, and the decomposition object is a matrix containing multiple elements. If the decomposition round corresponding to the current round is odd, each row element in the matrix is decomposed in the frequency domain in the current round. If the decomposition round corresponding to the current round is even, each column element in the matrix is decomposed in the frequency domain in the current round.
[0095] Specifically, the decomposition object is a matrix containing multiple elements. For each sub-image among the multiple sub-images obtained by dividing the image to be processed, the computer device can use the targeted sub-image as the decomposition object in the first round, that is, a matrix containing multiple elements, take the first round as the current round, and determine whether the decomposition round corresponding to the current round is odd or even. If the decomposition round corresponding to the current round is odd, each row element in the matrix is decomposed in the frequency domain in the current round to obtain multiple candidate object features of the matrix. If the decomposition round corresponding to the current round is even, each column element in the matrix is decomposed in the frequency domain in the current round to obtain multiple candidate object features of the matrix. Among them, different candidate object features correspond to different frequency bands. It can be understood that if the decomposition round corresponding to the first round is odd, the computer device can decompose each row element in the matrix in the frequency domain in the current round to obtain multiple candidate object features of the matrix. Furthermore, the computer device can screen the candidate object features corresponding to the preset frequency band characteristics from the multiple candidate object features obtained in the current round of decomposition to obtain the object features of the matrix. The computer device can take the next round as the current round, use the object features obtained in the previous round as the matrix in the current round, and return to the step of determining whether the decomposition round corresponding to the current round is odd or even to perform iterative decomposition for multiple rounds until the decomposition round reaches the preset even number of rounds and the iteration ends. The computer device can use the multiple candidate object features obtained in the last even-numbered round of decomposition as the multiple candidate sub-image features of the targeted sub-image.
[0096] In one embodiment, the decomposition stop condition is that the decomposition round reaches two rounds. Specifically, for each sub-image, the computer device may use the targeted sub-image as the decomposition object for the first round, that is, a matrix containing multiple elements. Since the decomposition round corresponding to the first round is odd, the computer device may perform the first-round decomposition on each row element of the matrix in the frequency domain to obtain multiple candidate object features of the matrix. Among them, different candidate object features correspond to different frequency bands. The computer device may screen out the candidate object features corresponding to the preset frequency band characteristics from the multiple candidate object features obtained in the first-round decomposition to obtain the object features of the matrix. The computer device may use the object features obtained in the first round as the matrix for the second-round decomposition. Since the decomposition round corresponding to the second round is even, the computer device may perform the second-round decomposition on each column element of the matrix in the frequency domain to obtain multiple candidate object features of the matrix. Among them, different candidate object features correspond to different frequency bands. Furthermore, the computer device may use the multiple candidate object features obtained in the second-round decomposition as multiple candidate sub-image features of the targeted sub-image.
[0097] In one embodiment, as Figure 6 shown, the decomposition stop condition is that the decomposition round reaches two rounds. Specifically, for each sub-image, the computer device may use the targeted sub-image as the decomposition object for the first round, that is, a matrix containing multiple elements. The computer device may perform the first-round decomposition on each row element of the matrix in the frequency domain to obtain candidate object feature 1 and candidate object feature 2 of the matrix. Among them, candidate object feature 1 corresponds to the high-frequency band, and candidate object feature 2 corresponds to the low-frequency band. The computer device may screen out candidate object feature 2 corresponding to the low-frequency band from candidate object feature 1 and candidate object feature 2 obtained in the first-round decomposition. The computer device may use candidate object feature 2 obtained in the first round as the matrix for the second-round decomposition. The computer device may perform the second-round decomposition on each column element of the matrix in the frequency domain to obtain candidate object feature 2.1 and candidate object feature 2.2 of the matrix. Among them, candidate object feature 2.1 corresponds to the high-frequency band, and candidate object feature 2.2 corresponds to the low-frequency band. Furthermore, the computer device may use candidate object feature 2.1 and candidate object feature 2.2 obtained in the second-round decomposition as two candidate sub-image features of the targeted sub-image.
[0098] In one embodiment, the decomposition stop condition is that the decomposition round reaches two rounds, and the sub-image is an 8×8 matrix. For each 8×8 sub-image, the computer device can use the targeted sub-image as the decomposition object in the first round, that is, a matrix containing 64 elements. The computer device can perform the first-round discrete wavelet transform on each row of elements in the matrix in the frequency domain, that is, the first-round decomposition, to obtain the candidate object features corresponding to a high-frequency band and the candidate object features corresponding to a low-frequency band of the 8×8 matrix. Among them, both candidate object features are 8×4 matrices. The computer device can screen the candidate object features corresponding to the low-frequency band from the two candidate object features obtained by the first-round discrete wavelet transform to obtain the object features of the matrix. The computer device can use the object features obtained in the first round as the matrix for the second-round discrete wavelet transform. The computer device can perform the second-round discrete wavelet transform on each column of elements in the 8×4 matrix in the frequency domain to obtain the candidate object features corresponding to a high-frequency band and the candidate object features corresponding to a low-frequency band of the 8×4 matrix. Among them, both candidate object features are 4×4 matrices. Furthermore, the computer device can use the two candidate object features obtained by the second-round discrete wavelet transform as the two candidate sub-image features of the targeted sub-image.
[0099] In the above embodiment, by defining the decomposition stop condition as reaching a preset even number of decomposition rounds, the decomposition object as a matrix containing multiple elements, and by defining that when the corresponding decomposition round in this round is odd, each row of elements in the matrix is decomposed in the frequency domain in this round, and when the corresponding decomposition round in this round is even, each column of elements in the matrix is decomposed in the frequency domain in this round, it is possible to fully consider each dimension of the decomposition object during the frequency decomposition process, thereby further improving the accuracy of obtaining candidate sub-image features.
[0100] In one embodiment, screening the candidate sub-image features corresponding to the preset frequency band characteristics from multiple candidate sub-image features to obtain the sub-image features of the targeted sub-image includes: determining the target frequency band from the frequency bands corresponding to each of the multiple candidate sub-image features, where any frequency included in the target frequency band is lower than any frequency included in the remaining frequency bands, and the remaining frequency bands are the frequency bands other than the target frequency band among the frequency bands corresponding to each of the multiple candidate sub-image features; screening the candidate sub-image features corresponding to the target frequency band from the multiple candidate sub-image features to obtain the sub-image features of the targeted sub-image.
[0101] Among them, any frequency included in the target frequency band is lower than any frequency included in the remaining frequency bands, and the remaining frequency bands are the frequency bands other than the target frequency band among the frequency bands corresponding to each of the multiple candidate sub-image features. It can be understood that the target frequency band is the frequency band containing the lowest frequency among the frequency bands corresponding to each of the multiple candidate sub-image features. The candidate sub-image features meeting the preset frequency band characteristics can refer to the candidate sub-image features corresponding to the target frequency band among the multiple frequency bands corresponding to the multiple candidate sub-image features.
[0102] Specifically, the computer device can determine a target frequency band from the frequency bands corresponding to multiple candidate sub-image features, where any frequency included in the determined target frequency band is lower than any frequency included in the remaining frequency bands. The remaining frequency bands are the frequency bands other than the target frequency band among the frequency bands corresponding to multiple candidate sub-image features. Further, the computer device can screen the candidate sub-image features corresponding to the target frequency band from multiple candidate sub-image features, and use the screened candidate sub-image features corresponding to the target frequency band as the sub-image features of the targeted sub-image.
[0103] In one embodiment, as Figure 7 shown, the computer device can determine the first frequency band as the target frequency band from the frequency bands corresponding to multiple candidate sub-image features, namely the first frequency band, the second frequency band, the third frequency band, and the fourth frequency band, where any frequency included in the determined first frequency band, for example, the frequency corresponding to point A, is lower than the remaining frequency bands, namely the second frequency band, the third frequency band, and the fourth frequency band.
[0104] In the above embodiment, since the candidate sub-image features corresponding to the low-frequency band are less affected by image noise than those corresponding to the high-frequency band, therefore, screening the candidate sub-image features corresponding to the low-frequency band, which contains the minimum frequency of the image in the frequency domain, that is, the target frequency band, from multiple candidate sub-image features to obtain the sub-image features of the targeted sub-image can improve the stability of the obtained sub-image features, and thus can improve the robustness of the subsequent generated watermark description information.
[0105] In one embodiment, the sub-image feature is a sub-image feature matrix. Principal component analysis is respectively performed on the sub-image features of multiple sub-images to obtain the eigenvalues corresponding to the multiple sub-images, including: for each sub-image feature matrix, performing singular value decomposition on the targeted sub-image feature matrix to obtain at least one singular value of the targeted sub-image feature matrix; determining the eigenvalue corresponding to the targeted sub-image feature matrix according to the largest singular value among the at least one singular value.
[0106] Specifically, for each sub-image feature matrix, the computer device can perform singular value decomposition on the targeted sub-image feature matrix to obtain at least one singular value of the targeted sub-image feature matrix. The computer device can determine the largest singular value from the obtained at least one singular value, and determine the eigenvalue corresponding to the targeted sub-image feature matrix according to the largest singular value.
[0107] In one embodiment, for each sub-image feature matrix, the computer device may perform singular value decomposition on the targeted sub-image feature matrix to obtain at least one singular value of the targeted sub-image feature matrix. The computer device may determine the largest singular value from the obtained at least one singular value and directly use the largest singular value as the eigenvalue corresponding to the targeted sub-image feature matrix.
[0108] In one embodiment, for each sub-image feature matrix, the computer device may perform singular value decomposition on the targeted sub-image feature matrix to obtain at least one singular value of the targeted sub-image feature matrix. The computer device may determine the largest singular value from the obtained at least one singular value, perform weighted processing on the largest singular value, and use the result obtained after weighting as the eigenvalue corresponding to the targeted sub-image feature matrix.
[0109] In the above embodiments, since the largest singular value of the sub-image feature matrix contains the most important information of the sub-image feature matrix, therefore, for each sub-image feature matrix, performing singular value decomposition on the targeted sub-image feature matrix to obtain at least one singular value of the targeted sub-image feature matrix, and determining the eigenvalue corresponding to the targeted sub-image feature matrix according to the largest singular value among the at least one singular value can improve the accuracy of the obtained eigenvalue, and thus can further improve the robustness of the subsequent generated watermark description information.
[0110] In one embodiment, constructing the image feature of the image to be processed based on the eigenvalues respectively corresponding to multiple sub-images includes: obtaining at least one encryption key; based on the at least one encryption key, selecting multiple eigenvalue pairs from the eigenvalues respectively corresponding to the multiple sub-images, where each eigenvalue pair contains two eigenvalues; for each eigenvalue pair, determining the difference between the two eigenvalues included in the targeted eigenvalue pair to obtain the feature difference corresponding to the targeted eigenvalue pair; and constructing the image feature of the image to be processed according to the feature differences respectively corresponding to the multiple eigenvalue pairs.
[0111] Specifically, the computer device may obtain at least one encryption key. It can be understood that the encryption key can be set by the owner of the image to be processed. The computer device may, based on the obtained at least one encryption key, select multiple eigenvalue pairs from the eigenvalues respectively corresponding to the multiple sub-images, where each eigenvalue pair contains two eigenvalues. For each eigenvalue pair, the computer device may calculate the difference between the two eigenvalues included in the targeted eigenvalue pair and use the calculated difference as the feature difference corresponding to the targeted eigenvalue pair. Furthermore, the computer device may construct the image feature of the image to be processed according to the feature differences respectively corresponding to the multiple eigenvalue pairs.
[0112] In one embodiment, for each encryption key, the computer device may generate a random number sequence corresponding to the encryption key based on the encryption key. Further, the computer device may select a plurality of eigenvalue pairs from the eigenvalues corresponding to the respective sub-images according to the random number sequences corresponding to at least one encryption key.
[0113] In one embodiment, the image feature is an image feature matrix. The computer device may perform binary classification on the feature differences corresponding to the respective plurality of eigenvalue pairs and construct an image feature matrix of the image to be processed based on the classification result. For example, if the feature difference is greater than 0, a 1 is placed in a preset matrix, and if the feature difference is less than or equal to 0, a 0 is placed in the preset matrix to obtain the image feature matrix of the image.
[0114] In one embodiment, the image feature is an image feature matrix. The computer device may use the feature differences corresponding to the respective plurality of eigenvalue pairs as the elements in a preset matrix to obtain the image feature matrix of the image.
[0115] In the above embodiments, by selecting a plurality of eigenvalue pairs from the eigenvalues corresponding to the respective sub-images based on at least one encryption key obtained. For each eigenvalue pair, by determining the difference between the two eigenvalues included in the eigenvalue pair, the feature difference corresponding to the eigenvalue pair is obtained, and the image feature of the image to be processed is constructed according to the feature differences corresponding to the respective plurality of eigenvalue pairs. When the subsequently generated watermark description information is used to verify the copyright of the image, the copyright ownership of the image can be proven based on the encryption key held by the copyright owner, improving the security of copyright authentication.
[0116] In one embodiment, the eigenvalues corresponding to the respective sub-images are located in an eigenvalue matrix. Selecting a plurality of eigenvalue pairs from the eigenvalues corresponding to the respective sub-images based on at least one encryption key includes: for each encryption key, generating a random number sequence corresponding to the encryption key based on the encryption key; determining a plurality of position pairs in the eigenvalue matrix according to the random number sequences corresponding to at least one encryption key, each position pair including two positions; for each position pair, determining the eigenvalue pair corresponding to the position pair according to the eigenvalues located at the two positions included in the position pair in the eigenvalue matrix.
[0117] Specifically, for each encryption key, the computer device may generate a random number sequence corresponding to the encryption key based on the encryption key. Further, the computer device may determine multiple position pairs in the eigenvalue matrix according to the random number sequences respectively corresponding to at least one encryption key, where each determined position pair includes two positions. For each position pair, the computer device may determine the eigenvalue pair corresponding to the position pair according to the eigenvalues respectively located at the two positions included in the position pair targeted. It can be understood that each eigenvalue pair includes the eigenvalues located at the two positions included in the corresponding position pair in the eigenvalue matrix.
[0118] In one embodiment, the computer device may determine multiple position pairs in the eigenvalue matrix according to the sequence values included in the random number sequences respectively corresponding to at least one encryption key. For each position pair, the computer device may determine the eigenvalue pair corresponding to the position pair according to the eigenvalues respectively located at the two positions included in the position pair targeted.
[0119] In one embodiment, the computer device may obtain four encryption keys, namely k1, k2, k3, and k4. The computer device may respectively generate random number sequences m1, m2, m3, and m4 corresponding to k1, k2, k3, and k4 based on k1, k2, k3, and k4, where each random number sequence includes multiple sequence values. The computer device may determine multiple position pairs in the eigenvalue matrix according to m1, m2, m3, and m4. For each position pair, the computer device may determine the eigenvalue pair corresponding to the position pair according to the eigenvalues respectively located at the two positions included in the position pair targeted. One position in the position pair is determined by m1 and m2, and the other position is determined by m3 and m4. It can be understood that if the determined eigenvalue pair includes eigenvalues S_ij and S_pq, then i comes from the random number sequence m1, j comes from the random number sequence m2, p comes from the random number sequence m3, and q comes from the random number sequence m4.
[0120] In the above embodiments, for each encryption key, by generating a random number sequence corresponding to the encryption key based on the encryption key and determining multiple position pairs in the eigenvalue matrix according to the random number sequences respectively corresponding to at least one encryption key. For each position pair, by determining the eigenvalue pair corresponding to the position pair according to the eigenvalues respectively located at the two positions included in the position pair targeted, when the subsequently generated watermark description information is used to verify the copyright of the image, the security of copyright authentication can be further improved.
[0121] In one embodiment, the method further includes: obtaining at least one decryption key; constructing image features of the image to be processed based on the at least one decryption key; generating watermark information according to the watermark description information and the image features of the image constructed based on the at least one decryption key; and when the generated watermark information is consistent with the obtained watermark information, determining that the ownership of the image belongs to the holder of the at least one decryption key.
[0122] Specifically, the computer device can obtain the image to be processed, divide the image to be processed into multiple sub-images, and for each sub-image, decompose the sub-image in the frequency domain to obtain multiple candidate sub-image features of the sub-image, where different candidate sub-image features correspond to different frequency bands. The computer device can screen out the candidate sub-image features corresponding to the preset frequency band features from the multiple candidate sub-image features to obtain the sub-image features of the sub-image. The computer device can perform principal component analysis on the sub-image features of each of the multiple sub-images respectively to obtain the eigenvalues corresponding to the multiple sub-images respectively. The computer device can obtain at least one decryption key, and based on the at least one decryption key, select multiple eigenvalue pairs from the eigenvalues corresponding to the multiple sub-images respectively, where each eigenvalue pair contains two eigenvalues. For each eigenvalue pair, the computer device can determine the difference between the two eigenvalues included in the eigenvalue pair to obtain the feature difference corresponding to the eigenvalue pair, and construct the image features of the image to be processed according to the feature differences corresponding to the multiple eigenvalue pairs respectively. Furthermore, as Figure 8 shown, the computer device can generate watermark information according to the watermark description information and the image features of the image constructed based on the at least one decryption key, and compare the generated watermark information with the watermark information obtained when generating the watermark description information. When the generated watermark information is consistent with the obtained watermark information, it is determined that the ownership of the image belongs to the holder of the at least one decryption key. When the generated watermark information is inconsistent with the obtained watermark information, it is determined that the ownership of the image does not belong to the holder of the at least one decryption key. It can be understood that only the copyright authenticator holding the decryption key can extract the correct watermark information from the watermark description information, that is, the watermark information obtained when generating the watermark description information. The copyright authenticator without the decryption key cannot extract the correct watermark information from the watermark description information.
[0123] In one embodiment, the eigenvalue corresponding to each of the multiple sub-images is located in the eigenvalue matrix. The computer device can obtain at least one decryption key. For each decryption key, based on the decryption key, a random number sequence corresponding to the decryption key is generated. According to the random number sequences respectively corresponding to the at least one decryption key, multiple position pairs are determined in the eigenvalue matrix, and each position pair includes two positions. For each position pair, the computer device can determine the eigenvalue pair corresponding to the position pair according to the eigenvalues respectively located at the two positions included in the position pair, and each eigenvalue pair includes two eigenvalues. For each eigenvalue pair, the computer device can determine the difference between the two eigenvalues included in the eigenvalue pair, obtain the eigenvalue difference corresponding to the eigenvalue pair, and construct the image feature of the image to be processed according to the eigenvalue differences respectively corresponding to the multiple eigenvalue pairs.
[0124] In the above embodiment, by constructing the image feature of the image to be processed based on the at least one decryption key obtained, it can be understood that a copyright authenticator who does not hold the decryption key cannot construct the correct image feature. Furthermore, according to the watermark description information and the image feature of the image constructed based on the at least one decryption key, the watermark information is generated. It can be understood that a copyright authenticator who does not hold the decryption key cannot extract the correct watermark information from the watermark description information. When the generated watermark information is consistent with the obtained watermark information, it is determined that the ownership of the image belongs to the holder of the at least one decryption key, which can further improve the security of copyright authentication.
[0125] In one embodiment, the image feature is an image feature matrix, the watermark information is a watermark information matrix, and the watermark description information is a watermark description information matrix; generating the watermark description information for the image to be processed according to the image feature and the watermark information includes: fusing each element in the image feature matrix with each element in the watermark information matrix to obtain the watermark description information matrix for the image to be processed.
[0126] Specifically, the computer device can fuse each element in the image feature matrix with each element in the watermark information matrix to obtain the watermark description information matrix for the image to be processed. It can be understood that each element in the watermark description information matrix is the element fusion result obtained by fusing each element in the image feature matrix with each element in the watermark information matrix.
[0127] In one embodiment, the values of the elements in the image feature matrix and the values of the elements in the watermark information matrix include 1 or 0. The computer device may perform an exclusive OR operation on the values of the elements in the image feature matrix with the values of the elements in the watermark information matrix respectively to obtain a watermark description information matrix for the image to be processed. It can be understood that each element in the watermark description information matrix is the operation result obtained by performing an exclusive OR operation on the corresponding elements in the image feature matrix and the watermark information matrix respectively. It can be understood that the values of the elements in the watermark description information matrix include 1 or 0.
[0128] In the above embodiment, by fusing the elements in the image feature matrix with the elements in the watermark information matrix respectively to obtain a watermark description information matrix for the image to be processed, the accuracy of the watermark description information matrix can be improved, and thus the robustness of the watermark description information can be further improved.
[0129] In one embodiment, dividing the image to be processed into multiple sub-images includes: determining the image size of the image to be processed; when the image size of the image to be processed is not an integer multiple of the preset image size, padding the image to be processed at the edges to obtain a padded image, where the image size of the padded image is an integer multiple of the preset image size, and the preset image size is smaller than the image size of the image; dividing the padded image into multiple non-overlapping sub-images that meet the preset image size.
[0130] Specifically, the computer device may determine the image size of the image to be processed and compare the image size of the image with the preset image size. When the image size of the image to be processed is not an integer multiple of the preset image size, that is, the length indicated by the image size of the image to be processed cannot be divided evenly by the length indicated by the preset image size, or the width indicated by the image size of the image to be processed cannot be divided evenly by the width indicated by the preset image size, the computer device may pad the image to be processed at the edges to obtain a padded image, where the image size of the padded image is an integer multiple of the preset image size, that is, the length indicated by the image size of the padded image can be divided evenly by the length indicated by the preset image size, and the width indicated by the image size of the padded image can be divided evenly by the width indicated by the preset image size, and the preset image size is smaller than the image size of the image. Furthermore, the computer device may divide the padded image into multiple non-overlapping sub-images that meet the preset image size.
[0131] In the above embodiments, when the image size of the image to be processed is not an integer multiple of the preset image size, the image to be processed is padded at the edges to obtain a padded image, where the image size of the padded image is an integer multiple of the preset image size, and the preset image size is smaller than the image size of the image. Then, by dividing the padded image into multiple non-overlapping sub-images that meet the preset image size, the image features of the image to be processed obtained subsequently can be enhanced, thereby further enhancing the robustness of the watermark description information generated subsequently.
[0132] In one embodiment, the method further includes: when the image size of the image to be processed is an integer multiple of the preset image size, the image to be processed is divided into multiple non-overlapping sub-images that meet the preset image size.
[0133] Specifically, when the image size of the image to be processed is an integer multiple of the preset image size, that is, the length indicated by the image size of the image can be divided evenly by the length indicated by the preset image size, and the width indicated by the image size of the image can be divided evenly by the width indicated by the preset image size, the computer device can divide the image to be processed into multiple non-overlapping sub-images that meet the preset image size.
[0134] In one embodiment, as Figure 9 shown, if the image size of the image to be processed is 256×256 and the preset image size is 8×8, then the image size of the image to be processed is exactly an integer multiple of the preset image size, and the computer device can divide the image to be processed into 1024 non-overlapping sub-images with an image size of 8×8. As Figure 10 shown, if the image size of the image to be processed is 260×260 and the preset image size is 8×8, then the image size of the image to be processed is not an integer multiple of the preset image size, and the computer device can pad the edges of the image to be processed, that is, increase the length and width of the image to be processed by 4 each, to obtain a padded image with an image size of 264×264, which is an integer multiple of the preset image size 8×8. Then, the computer device can divide the padded image with an image size of 264×264 into 1089 non-overlapping sub-images with an image size of 8×8.
[0135] In the above embodiments, when the image size of the image to be processed is an integer multiple of the preset image size, by dividing the image to be processed into multiple non-overlapping sub-images that meet the preset image size, the image features of the image to be processed obtained subsequently can be enhanced, thereby further enhancing the robustness of the watermark description information generated subsequently.
[0136] In one embodiment, the method further includes: obtaining a target image to be verified, and determining target image features of the target image; generating watermark information according to watermark description information and the target image features; and when the generated watermark information is consistent with the obtained watermark information, determining that the image content of the target image is consistent with the image content of the image to be processed.
[0137] Specifically, the computer device can obtain the target image to be verified, that is, the target image for which image content verification is to be performed, and determine the target image features of the target image. The computer device can generate watermark information according to the watermark description information and the target image features, and compare the generated watermark information with the obtained watermark information. When the generated watermark information is consistent with the obtained watermark information, the computer device can determine that the image content of the target image is consistent with the image content of the image to be processed, that is, the image content of the target image has passed the integrity verification.
[0138] In one embodiment, the computer device can divide the target image into multiple sub-target images. For each sub-target image, decompose the sub-target image in the frequency domain to obtain multiple candidate sub-target image features of the sub-target image, and different candidate sub-target image features correspond to different frequency bands. The computer device can screen out the candidate sub-target image features corresponding to the preset frequency band features from the multiple candidate sub-target image features to obtain the sub-target image features of the sub-target image. The computer device can respectively perform principal component analysis on the sub-target image features of the multiple sub-target images to obtain the eigenvalues corresponding to the multiple sub-target images respectively, and construct the target image features of the target image based on the eigenvalues corresponding to the multiple sub-target images respectively.
[0139] In one embodiment, for each sub-target image, the computer device can perform decomposition in the frequency domain level by level based on the sub-target image until the last level of frequency domain decomposition obtains multiple candidate sub-target image features of the sub-target image.
[0140] In one embodiment, for each sub-target image, the computer device can use the sub-target image as the decomposition object in the first round, use the first round as the current round, decompose the decomposition object in the frequency domain in the current round to obtain multiple candidate object features of the decomposition object, and different candidate object features correspond to different frequency bands. The computer device can screen out the candidate object features corresponding to the preset frequency band features from the multiple candidate object features to obtain the object features of the decomposition object, use the next round as the current round, use the object features as the decomposition object in the current round, and return to the step of decomposing the decomposition object in the frequency domain in the current round to obtain multiple candidate object features of the decomposition object for iterative execution until the iteration ends when the decomposition stop condition is met, and use the multiple candidate object features obtained in the last round of decomposition as the multiple candidate sub-target image features of the sub-target image.
[0141] In one embodiment, the decomposition stop condition is that the decomposition round reaches a preset even number of rounds, and the decomposition object is a matrix containing multiple elements. If the decomposition round corresponding to the current round is odd, the elements in each row of the matrix are decomposed in the frequency domain in this round. If the decomposition round corresponding to the current round is even, the elements in each column of the matrix are decomposed in the frequency domain in this round.
[0142] In one embodiment, the computer device can determine a target frequency band from the frequency bands corresponding to multiple candidate sub-target image features. Any frequency included in the target frequency band is lower than any frequency included in the remaining frequency bands. The remaining frequency bands are the frequency bands corresponding to multiple candidate sub-target image features except the target frequency band. The computer device can screen the candidate sub-target image features corresponding to the target frequency band from multiple candidate sub-target image features to obtain the sub-target image features of the targeted sub-target image.
[0143] In one embodiment, for each sub-target image feature matrix, the computer device can perform singular value decomposition on the sub-target image feature matrix to obtain at least one singular value of the sub-target image feature matrix. Furthermore, the computer device can determine the eigenvalue corresponding to the sub-target image feature matrix according to the largest singular value among the at least one singular value.
[0144] In one embodiment, the computer device can determine a target frequency band from the frequency bands corresponding to multiple candidate sub-target image features. Any frequency included in the target frequency band is lower than any frequency included in the remaining frequency bands. The remaining frequency bands are the frequency bands corresponding to multiple candidate sub-target image features except the target frequency band. Screen the candidate sub-target image features corresponding to the target frequency band from multiple candidate sub-target image features to obtain the sub-target image features of the targeted sub-target image.
[0145] In one embodiment, for each sub-target image feature matrix, the computer device can perform singular value decomposition on the sub-target image feature matrix to obtain at least one singular value of the sub-target image feature matrix. Furthermore, the computer device can determine the eigenvalue corresponding to the sub-target image feature matrix according to the largest singular value among the at least one singular value.
[0146] In one embodiment, the computer device can determine the target image size of the target image. When the target image size of the target image is not an integer multiple of the preset target image size, edge padding is performed on the target image to obtain the padded target image. The target image size of the padded target image is an integer multiple of the preset target image size, and the preset target image size is smaller than the target image size of the target image. The computer device can divide the padded target image into multiple non-overlapping sub-target images that meet the preset target image size.
[0147] In one embodiment, when the target image size of the target image is an integer multiple of the preset target image size, the computer device can divide the target image into multiple sub-target images that meet the preset target image size and do not overlap with each other.
[0148] In one embodiment, the computer device can perform an exclusive OR operation on the image feature and the obtained watermark information to generate watermark description information for the image to be processed. Therefore, the computer device can perform an exclusive OR operation on the watermark description information and the target image feature to generate watermark information.
[0149] In the above embodiment, by determining the target image feature of the obtained target image, watermark information is generated according to the watermark description information and the target image feature. When the generated watermark information is consistent with the obtained watermark information, it is determined that the image content of the target image is consistent with the image content of the image to be processed, which can improve the accuracy of judging the content integrity of the image.
[0150] As Figure 11 shown, in one embodiment, an image processing method is provided. This method can be applied to a computer device, and the computer device can be a terminal or a server. That is, this method can be executed independently by the terminal or the server, or can be implemented through the interaction between the terminal and the server. This embodiment takes this method applied to a computer device as an example for illustration, and this method specifically includes the following steps:
[0151] Step 1102, obtain the image to be processed and determine the image size of the image to be processed.
[0152] Step 1104, when the image size of the image to be processed is not an integer multiple of the preset image size, perform edge padding on the image to be processed to obtain the padded image. The image size of the padded image is an integer multiple of the preset image size, and the preset image size is smaller than the image size of the image. Divide the padded image into multiple sub-images that meet the preset image size and do not overlap with each other.
[0153] Step 1106, when the image size of the image to be processed is an integer multiple of the preset image size, divide the image to be processed into multiple sub-images that meet the preset image size and do not overlap with each other.
[0154] Step 1108, for each sub-image, use the targeted sub-image as the decomposition object for the first round, use the first round as the current round, and perform decomposition on the decomposition object in the frequency domain to obtain multiple candidate object features of the decomposition object. Different candidate object features correspond to different frequency bands.
[0155] Step 1110, from the multiple candidate object features, screen out the candidate object features corresponding to the preset frequency band features to obtain the object feature of the decomposition object.
[0156] Step 1112: Take the next round as the current round, take the object feature as the decomposition object for the current round, and return the step of decomposing the decomposition object in the frequency domain for the current round to obtain multiple candidate object features of the decomposition object for iterative execution until the iteration ends when the decomposition stop condition is met, and take the multiple candidate object features obtained from the last round of decomposition as the multiple candidate sub-image features of the targeted sub-image, where different candidate sub-image features correspond to different frequency bands.
[0157] Step 1114: Determine the target frequency band from the frequency bands corresponding to each of the multiple candidate sub-image features, where any frequency included in the target frequency band is lower than any frequency included in the remaining frequency bands, and the remaining frequency bands are the frequency bands other than the target frequency band among the frequency bands corresponding to each of the multiple candidate sub-image features.
[0158] Step 1116: Screen the candidate sub-image features corresponding to the target frequency band from the multiple candidate sub-image features to obtain the sub-image features of the targeted sub-image.
[0159] Step 1118: For each sub-image feature matrix, perform singular value decomposition on the targeted sub-image feature matrix to obtain at least one singular value of the targeted sub-image feature matrix.
[0160] Step 1120: Determine the eigenvalue corresponding to the targeted sub-image feature matrix according to the largest singular value among the at least one singular value.
[0161] Step 1122: Obtain at least one encryption key, and for each encryption key, generate a random number sequence corresponding to the targeted encryption key based on the targeted encryption key.
[0162] Step 1124: Determine multiple position pairs in the eigenvalue matrix where the eigenvalues corresponding to the multiple sub-images are located according to the random number sequences corresponding to each of the at least one encryption key, and each position pair includes two positions.
[0163] Step 1126: For each position pair, determine the eigenvalue pair corresponding to the targeted position pair according to the eigenvalues located at the two positions included in the targeted position pair in the eigenvalue matrix, and each eigenvalue pair includes two eigenvalues.
[0164] Step 1128: For each eigenvalue pair, determine the difference between the two eigenvalues included in the targeted eigenvalue pair to obtain the characteristic difference corresponding to the targeted eigenvalue pair.
[0165] Step 1130: Construct the image feature of the image to be processed according to the characteristic differences corresponding to each of the multiple eigenvalue pairs, obtain the watermark information, and generate the watermark description information for the image to be processed according to the image feature and the watermark information.
[0166] Step 1132: Obtain at least one decryption key. Based on the at least one decryption key, construct the image features of the image to be processed. Generate watermark information according to the watermark description information and the image features of the image constructed based on the at least one decryption key.
[0167] Step 1134: When the generated watermark information is consistent with the obtained watermark information, determine that the ownership of the image belongs to the holder of the at least one decryption key.
[0168] This application also provides an application scenario that applies the above image processing method. Specifically, the image processing method can be applied to the copyright authentication scenario of poster images. It can be understood that the image to be processed can be a poster image. Specifically, the computer device can obtain the poster image and determine the image size of the poster image. When the image size of the poster image is not an integer multiple of the preset image size, perform edge padding on the poster image to obtain the padded poster image, and the image size of the padded poster image is an integer multiple of the preset image size. The preset image size is smaller than the image size of the poster image. Divide the padded poster image into multiple non-overlapping sub-poster images that meet the preset image size. When the image size of the poster image is an integer multiple of the preset image size, divide the poster image into multiple non-overlapping sub-poster images that meet the preset image size.
[0169] For each sub-poster image, the computer device can use the targeted sub-poster image as the decomposition object in the first round, use the first round as the current round, decompose the decomposition object in the frequency domain in the current round to obtain multiple candidate object features of the decomposition object, and different candidate object features correspond to different frequency bands. From the multiple candidate object features, screen out the candidate object features corresponding to the preset frequency band features to obtain the object features of the decomposition object. Use the next round as the current round, use the object features as the decomposition object in the current round, and return to the step of decomposing the decomposition object in the frequency domain in the current round to obtain multiple candidate object features of the decomposition object for iterative execution until the decomposition stop condition is met and the iteration ends. Then, use the multiple candidate object features obtained in the last round of decomposition as the multiple candidate sub-poster image features of the targeted sub-poster image, and different candidate sub-poster image features correspond to different frequency bands.
[0170] The computer device can determine a target frequency band from the frequency bands corresponding to each of multiple candidate sub-poster image features. Any frequency included in the target frequency band is lower than any frequency included in the remaining frequency bands. The remaining frequency bands are the frequency bands other than the target frequency band among the frequency bands corresponding to each of the multiple candidate sub-poster image features. From the multiple candidate sub-poster image features, the candidate sub-poster image features corresponding to the target frequency band are screened to obtain the sub-poster image features of the targeted sub-poster image. For each sub-poster image feature matrix, the targeted sub-poster image feature matrix is subjected to singular value decomposition to obtain at least one singular value of the targeted sub-poster image feature matrix. According to the largest singular value among the at least one singular value, the eigenvalue corresponding to the targeted sub-poster image feature matrix is determined.
[0171] The computer device can obtain at least one encryption key. For each encryption key, based on the targeted encryption key, a random number sequence corresponding to the targeted encryption key is generated. According to the random number sequences corresponding to each of the at least one encryption key, in the eigenvalue matrix where the eigenvalues corresponding to multiple sub-poster images are located, multiple position pairs are determined. Each position pair contains two positions. For each position pair, according to the eigenvalues located at the two positions included in the targeted position pair in the eigenvalue matrix, the eigenvalue pair corresponding to the targeted position pair is determined. Each eigenvalue pair contains two eigenvalues. For each eigenvalue pair, the difference between the two eigenvalues included in the targeted eigenvalue pair is determined to obtain the characteristic difference corresponding to the targeted eigenvalue pair. According to the characteristic differences corresponding to each of the multiple eigenvalue pairs, the poster image feature of the poster image is constructed, the watermark information is obtained, and based on the poster image feature and the watermark information, the watermark description information for the poster image is generated for subsequent use in authenticating the copyright of the poster image.
[0172] In the case where the copyright of the poster image needs to be authenticated, the computer device can obtain at least one decryption key. Based on the at least one decryption key, the poster image feature of the poster image is constructed. According to the watermark description information and the poster image feature of the poster image constructed based on the at least one decryption key, the watermark information is generated. When the generated watermark information is consistent with the obtained watermark information, it is determined that the ownership of the poster image belongs to the holder of the at least one decryption key. It can be understood that only the copyright authenticator holding the decryption key can extract the correct watermark information from the watermark description information, that is, the watermark information obtained when generating the watermark description information. The copyright authenticator who does not hold the decryption key cannot extract the correct watermark information from the watermark description information.
[0173] In this application, each sub-poster image obtained by dividing a poster image is decomposed and feature-screened in the frequency domain to obtain the sub-poster image features of each sub-poster image. Then, through principal component analysis of the sub-poster image features of each sub-poster image, eigenvalues for characterizing important information of the sub-poster image are obtained. Thus, based on the eigenvalues of each sub-poster image, watermark description information for the poster image is generated without embedding the watermark into the poster image, which can maintain the quality of the poster image and can effectively authenticate the copyright of the poster image based on the generated watermark description information, improving the accuracy of copyright authentication.
[0174] This application also provides an application scenario that applies the above image processing method. Specifically, the image processing method can be applied to the content integrity authentication scenario of business images. It can be understood that the image to be processed can be a business image required for a company's business processing. In this application, each sub-business image obtained by dividing a business image is decomposed and feature-screened in the frequency domain to obtain the sub-business image features of each sub-business image. Then, through principal component analysis of the sub-business image features of each sub-business image, eigenvalues for characterizing important information of the sub-business image are obtained. Thus, based on the eigenvalues of each sub-business image, watermark description information for the business image is generated without embedding the watermark into the business image, which can maintain the quality of the business image and can authenticate the content integrity of the business image based on the generated watermark description information, improving the accuracy of business processing.
[0175] It should be understood that although the steps in the flowcharts of the above embodiments are shown in sequence, these steps are not necessarily executed in sequence. Unless there is a clear description in this article, the execution of these steps has no strict sequence limit, and these steps can be executed in other sequences. Moreover, at least a part of the steps in the above embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution sequence of these sub-steps or stages is not necessarily sequential either, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.
[0176] In one embodiment, as Figure 12 shown, an image processing apparatus 1200 is provided, which specifically includes:
[0177] A division module 1202, configured to obtain an image to be processed and divide the image to be processed into multiple sub-images;
[0178] A decomposition module 1204, configured to decompose each sub-image in the frequency domain to obtain multiple candidate sub-image features of the targeted sub-image, where different candidate sub-image features correspond to different frequency bands;
[0179] A screening module 1206, configured to screen out candidate sub-image features corresponding to a preset frequency band feature from multiple candidate sub-image features to obtain the sub-image features of the targeted sub-image;
[0180] An analysis module 1208, configured to perform principal component analysis on the sub-image features of each of the multiple sub-images respectively to obtain the eigenvalue corresponding to each of the multiple sub-images;
[0181] A construction module 1210, configured to construct the image features of the image to be processed based on the eigenvalues corresponding to each of the multiple sub-images;
[0182] A generation module 1212, configured to obtain watermark information, and generate watermark description information for the image to be processed according to the image features and the watermark information.
[0183] In one embodiment, the decomposition module 1204 is further configured to, for each sub-image, perform decomposition in the frequency domain level by level based on the targeted sub-image until the last level decomposes in the frequency domain to obtain multiple candidate sub-image features of the targeted sub-image.
[0184] In one embodiment, the decomposition module 1204 is further configured to, for each sub-image, use the targeted sub-image as the decomposition object in the first round, use the first round as the current round, decompose the decomposition object in the frequency domain in the current round to obtain multiple candidate object features of the decomposition object, where different candidate object features correspond to different frequency bands; screen out candidate object features corresponding to a preset frequency band feature from multiple candidate object features to obtain the object features of the decomposition object; use the next round as the current round, use the object features as the decomposition object in the current round, and return to the step of decomposing the decomposition object in the frequency domain in the current round to obtain multiple candidate object features of the decomposition object for iterative execution until the decomposition stop condition is met to end the iteration, and use the multiple candidate object features obtained in the last round of decomposition as the multiple candidate sub-image features of the targeted sub-image.
[0185] In one embodiment, the decomposition stop condition is that the decomposition round reaches a preset even number of rounds, and the decomposition object is a matrix containing multiple elements. If the decomposition round corresponding to the current round is odd, each row element in the matrix is decomposed in the frequency domain in the current round. If the decomposition round corresponding to the current round is even, each column element in the matrix is decomposed in the frequency domain in the current round.
[0186] In one embodiment, the screening module 1206 is further configured to determine a target frequency band from the frequency bands corresponding to the multiple candidate sub-image features, where any frequency included in the target frequency band is lower than any frequency included in the remaining frequency bands, and the remaining frequency bands are the frequency bands other than the target frequency band among the frequency bands corresponding to the multiple candidate sub-image features; screen the candidate sub-image features corresponding to the target frequency band from the multiple candidate sub-image features to obtain the sub-image features of the targeted sub-image.
[0187] In one embodiment, the sub-image feature is a sub-image feature matrix, and the analysis module 1208 is further configured to perform singular value decomposition on each sub-image feature matrix to obtain at least one singular value of the targeted sub-image feature matrix; determine the eigenvalue corresponding to the targeted sub-image feature matrix according to the largest singular value among the at least one singular value.
[0188] In one embodiment, the construction module 1210 is further configured to obtain at least one encryption key; based on the at least one encryption key, select multiple eigenvalue pairs from the eigenvalues corresponding to the multiple sub-images, where each eigenvalue pair includes two eigenvalues; for each eigenvalue pair, determine the difference between the two eigenvalues included in the targeted eigenvalue pair to obtain the characteristic difference corresponding to the targeted eigenvalue pair; construct the image feature of the image to be processed according to the characteristic differences corresponding to the multiple eigenvalue pairs.
[0189] In one embodiment, the eigenvalues corresponding to the multiple sub-images are located in an eigenvalue matrix, and the construction module 1210 is further configured to, for each encryption key, generate a random number sequence corresponding to the targeted encryption key based on the targeted encryption key; determine multiple position pairs in the eigenvalue matrix according to the random number sequences corresponding to the at least one encryption key, where each position pair includes two positions; for each position pair, determine the eigenvalue pair corresponding to the targeted position pair according to the eigenvalues located at the two positions included in the targeted position pair in the eigenvalue matrix.
[0190] In one embodiment, as Figure 13 shown, the apparatus further includes:
[0191] A copyright determination module 1214, configured to obtain at least one decryption key; construct the image feature of the image to be processed based on the at least one decryption key; generate watermark information according to the watermark description information and the image feature of the image constructed based on the at least one decryption key; when the generated watermark information is consistent with the obtained watermark information, determine that the ownership of the image belongs to the holder of the at least one decryption key.
[0192] In one embodiment, the image feature is an image feature matrix, the watermark information is a watermark information matrix, and the watermark description information is a watermark description information matrix; the generating module 1212 is further configured to fuse each element in the image feature matrix with each element in the watermark information matrix to obtain a watermark description information matrix for the image to be processed.
[0193] In one embodiment, the partitioning module 1202 is further configured to determine the image size of the image to be processed; when the image size of the image to be processed is not an integer multiple of the preset image size, perform edge padding on the image to be processed to obtain a padded image, where the image size of the padded image is an integer multiple of the preset image size, and the preset image size is smaller than the image size of the image; divide the padded image into a plurality of non-overlapping sub-images that meet the preset image size.
[0194] In one embodiment, the partitioning module 1202 is further configured to, when the image size of the image to be processed is an integer multiple of the preset image size, divide the image to be processed into a plurality of non-overlapping sub-images that meet the preset image size.
[0195] In one embodiment, as Figure 13 shown, the apparatus further includes:
[0196] A content determination module 1216, configured to obtain a target image to be verified, determine the target image feature of the target image; generate watermark information according to the watermark description information and the target image feature; when the generated watermark information is consistent with the obtained watermark information, determine that the image content of the target image is consistent with the image content of the image to be processed.
[0197] The above image processing device divides the image to be processed into multiple sub-images. For each sub-image, it decomposes the targeted sub-image in the frequency domain to obtain multiple candidate sub-image features of the targeted sub-image, where different candidate sub-image features correspond to different frequency bands. By screening the candidate sub-image features corresponding to the preset frequency band features from the multiple candidate sub-image features, the sub-image features of the targeted sub-image are obtained. Principal component analysis is respectively performed on the sub-image features of each of the multiple sub-images to obtain the eigenvalues corresponding to each of the multiple sub-images. Based on the eigenvalues corresponding to each of the multiple sub-images, the image features of the image to be processed are constructed, and according to the image features and the obtained watermark information, the watermark description information for the image to be processed is generated. Compared with the traditional method of adding visible watermarks to images, in this application, each sub-image obtained by dividing the image to be processed is decomposed in the frequency domain and feature screening is performed to obtain the sub-image features of each sub-image. Then, through principal component analysis of the sub-image features of each sub-image, the eigenvalues representing the important information of the sub-image are obtained. Thus, based on the eigenvalues of each sub-image, the image features of the image to be processed are constructed, and based on the image features and the watermark information, the watermark description information for the image to be processed is generated without embedding the watermark into the image, thereby being able to maintain the image quality.
[0198] Each module in the above image processing device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form for the processor to call and execute the operations corresponding to each of the above modules.
[0199] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 14 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used for the processor to exchange information with external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements an image processing method.
[0200] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structural diagram may be as shown in Figure 15 . The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements an image processing method. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen may be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device may be a touch layer covering the display screen, or may be a button, a trackball, or a touchpad provided on the computer device housing, or may also be an external keyboard, a touchpad, or a mouse, etc.
[0201] Those skilled in the art can understand that Figure 14 and Figure 15 the structures shown in are only block diagrams of some structures related to the solution of the present application, and do not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0202] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, it implements the steps in the above method embodiments.
[0203] In one embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by the processor, it implements the steps in the above method embodiments.
[0204] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by the processor, it implements the steps in the above method embodiments.
[0205] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions.
[0206] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0207] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope described in this specification.
[0208] The above-described embodiments only represent several implementation manners of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can still be made, and these all belong to the protection scope of this application. Therefore, the protection scope of the patent of this application should be subject to the appended claims.
Claims
1. An image processing method, characterized in that, the method includes: obtaining an image to be processed and dividing the image to be processed into a plurality of sub-images; for each of the sub-images, decomposing the targeted sub-image in the frequency domain to obtain a plurality of candidate sub-image features of the targeted sub-image, where different candidate sub-image features correspond to different frequency bands; selecting, from the plurality of candidate sub-image features, the candidate sub-image features corresponding to the preset frequency band features to obtain the sub-image features of the targeted sub-image; performing principal component analysis on the sub-image features of each of the plurality of sub-images respectively to obtain the eigenvalues corresponding to the plurality of sub-images respectively; constructing the image features of the image to be processed based on the eigenvalues corresponding to the plurality of sub-images respectively; obtaining watermark information, and generating watermark description information for the image to be processed according to the image features and the watermark information.
2. The method according to claim 1, characterized in that, for each of the sub-images, decomposing the targeted sub-image in the frequency domain to obtain a plurality of candidate sub-image features of the targeted sub-image, includes: for each of the sub-images, based on the targeted sub-image, hierarchically decomposing in the frequency domain until the last level of frequency domain decomposition obtains a plurality of candidate sub-image features of the targeted sub-image.
3. The method according to claim 2, characterized in that, for each of the sub-images, based on the targeted sub-image, hierarchically decomposing in the frequency domain until the last level of frequency domain decomposition obtains a plurality of candidate sub-image features of the targeted sub-image, includes: for each of the sub-images, taking the targeted sub-image as the decomposition object in the first round, taking the first round as the current round, decomposing the decomposition object in the frequency domain in the current round to obtain a plurality of candidate object features of the decomposition object, where different candidate object features correspond to different frequency bands; selecting, from the plurality of candidate object features, the candidate object features corresponding to the preset frequency band features to obtain the object features of the decomposition object; taking the next round as the current round, taking the object features as the decomposition object in the current round, and returning to the step of decomposing the decomposition object in the frequency domain in the current round to obtain a plurality of candidate object features of the decomposition object for iterative execution until the decomposition stop condition is met to end the iteration, and taking the plurality of candidate object features obtained in the last round of decomposition as the plurality of candidate sub-image features of the targeted sub-image.
4. The method according to claim 3, characterized in that, the decomposition stop condition is that the decomposition round reaches a preset even number of rounds, the decomposition object is a matrix containing a plurality of elements, if the decomposition round corresponding to the current round is odd, then decomposing each row element in the matrix in the frequency domain in the current round, if the decomposition round corresponding to the current round is even, then decomposing each column element in the matrix in the frequency domain in the current round.
5. The method according to claim 1, characterized in that, selecting, from the plurality of candidate sub-image features, the candidate sub-image features corresponding to the preset frequency band features to obtain the sub-image features of the targeted sub-image, includes: Determine a target frequency band from the frequency bands corresponding to each of the multiple candidate sub-image features, where any frequency included in the target frequency band is lower than any frequency included in the remaining frequency bands, and the remaining frequency bands are the frequency bands other than the target frequency band among the frequency bands corresponding to each of the multiple candidate sub-image features; Screen the candidate sub-image features corresponding to the target frequency band from the multiple candidate sub-image features to obtain the sub-image features of the targeted sub-image.
6. The method according to claim 1, wherein, the sub-image features are sub-image feature matrices, and the principal component analysis is respectively performed on the sub-image features of each of the multiple sub-images to obtain the eigenvalues corresponding to each of the multiple sub-images, including: For each of the sub-image feature matrices, perform singular value decomposition on the targeted sub-image feature matrix to obtain at least one singular value of the targeted sub-image feature matrix; Determine the eigenvalue corresponding to the targeted sub-image feature matrix according to the largest singular value among the at least one singular value.
7. The method according to claim 1, wherein, constructing the image features of the image to be processed based on the eigenvalues corresponding to each of the multiple sub-images includes: Obtain at least one encryption key; Based on the at least one encryption key, select multiple eigenvalue pairs from the eigenvalues corresponding to each of the multiple sub-images, and each eigenvalue pair includes two eigenvalues; For each eigenvalue pair, determine the difference between the two eigenvalues included in the targeted eigenvalue pair to obtain the feature difference corresponding to the targeted eigenvalue pair; Construct the image features of the image to be processed according to the feature differences corresponding to each of the multiple eigenvalue pairs.
8. The method according to claim 7, wherein, the eigenvalues corresponding to each of the multiple sub-images are located in an eigenvalue matrix, and selecting multiple eigenvalue pairs from the eigenvalues corresponding to each of the multiple sub-images based on the at least one encryption key includes: For each encryption key, generate a random number sequence corresponding to the targeted encryption key based on the targeted encryption key; Determine multiple position pairs in the eigenvalue matrix according to the random number sequences corresponding to each of the at least one encryption key, and each position pair includes two positions; For each position pair, determine the eigenvalue pair corresponding to the targeted position pair according to the eigenvalues respectively located at the two positions included in the targeted position pair in the eigenvalue matrix.
9. The method according to claim 7, wherein, the method further includes: Obtain at least one decryption key; Construct the image features of the image to be processed based on the at least one decryption key; Generate watermark information according to the watermark description information and the image features of the image to be processed constructed based on the at least one decryption key; When the generated watermark information is consistent with the obtained watermark information, it is determined that the ownership of the image to be processed belongs to the holder of the at least one decryption key.
10. The method according to claim 1, wherein, The image feature is an image feature matrix, the watermark information is a watermark information matrix, and the watermark description information is a watermark description information matrix; The generating, according to the image feature and the watermark information, watermark description information for the image to be processed includes: Fusing each element in the image feature matrix with each element in the watermark information matrix to obtain a watermark description information matrix for the image to be processed.
11. The method according to claim 1, wherein, The dividing the image to be processed into a plurality of sub-images includes: Determining the image size of the image to be processed; When the image size of the image to be processed is not an integer multiple of a preset image size, padding the edges of the image to be processed to obtain a padded image, the image size of the padded image being an integer multiple of the preset image size, and the preset image size being smaller than the image size of the image to be processed; Dividing the padded image into a plurality of non-overlapping sub-images that satisfy the preset image size.
12. The method according to claim 11, wherein, The method further includes: When the image size of the image to be processed is an integer multiple of the preset image size, dividing the image to be processed into a plurality of non-overlapping sub-images that satisfy the preset image size.
13. The method according to any one of claims 1 to 12, wherein, The method further includes: Obtaining a target image to be verified and determining the target image feature of the target image; Generating watermark information according to the watermark description information and the target image feature; When the generated watermark information is consistent with the obtained watermark information, determining that the image content of the target image is consistent with the image content of the image to be processed.
14. An image processing apparatus, wherein, The apparatus includes: A dividing module, configured to obtain an image to be processed and divide the image to be processed into a plurality of sub-images; A decomposing module, configured to decompose each of the sub-images in the frequency domain to obtain a plurality of candidate sub-image features of the corresponding sub-image, and different candidate sub-image features correspond to different frequency bands; A screening module, configured to screen, from the plurality of candidate sub-image features, candidate sub-image features corresponding to preset frequency band features to obtain the sub-image feature of the corresponding sub-image; An analyzing module, configured to perform principal component analysis on the sub-image features of each of the plurality of sub-images respectively to obtain the eigenvalue corresponding to each of the plurality of sub-images; A constructing module, configured to construct the image feature of the image to be processed based on the eigenvalues corresponding to each of the plurality of sub-images; A generating module, configured to obtain watermark information and generate watermark description information for the image to be processed according to the image feature and the watermark information.
15. A computer device, including a memory and a processor, the memory storing a computer program, wherein, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 13 are implemented.
16. A computer-readable storage medium stores a computer program, characterized in that, when the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 13.
17. A computer program product includes a computer program, characterized in that, when the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 13.