An image processing method and apparatus
By segmenting the image, generating chaotic sequences, and transforming cat faces, combined with hashing and deep learning techniques, image blocks are encrypted and restored. This solves the problems of high computational complexity and distortion in existing image encryption technologies, and improves both security and resolution.
Patent Information
- Application Number
- CN202310280707.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-21
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2043-03-21
AI Technical Summary
Existing image encryption technologies have high computational complexity in ensuring that images are not distorted, resulting in low decryption efficiency and distortion.
By segmenting the image to be encrypted, generating chaotic sequences and cat face transformations, and combining hash values and deep learning techniques, chaotic transformations and cat face transformations are applied to the image blocks to generate encrypted images. Finally, the scrambling parameters are encrypted using RSA public keys to achieve secure encryption and restoration of the image.
It effectively ensures image security, while improving image resolution and decryption efficiency.
Smart Images

Figure CN116309164B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of information security technology, and particularly relates to an image processing method and device. BACKGROUND
[0002] Image recognition is widely used in various business scenarios of banks, such as face authentication recognition, fingerprint recognition, personal ID card related information recognition and the like. With the rapid development of network technology and multimedia technology, digital images, as one of the most important information carriers, have increasing application requirements in fields such as business and finance. Therefore, the security of digital images has attracted widespread attention.
[0003] In the process of image encryption and decryption, not only the image needs to be effectively hidden and encrypted, but also the image needs to be restored almost without detail loss or distortion. In order to ensure that the image is not distorted, the existing image encryption technology usually uses a complex encryption algorithm, which not only increases the calculation complexity in the decryption process, greatly reduces the decryption efficiency, and the distortion phenomenon still exists. SUMMARY
[0004] In view of the problems in the prior art, the embodiments of the present application provide an image processing method and device, which can at least partially solve the problems in the prior art.
[0005] In one aspect, the present application provides an image processing method, comprising:
[0006] The image to be encrypted is divided to obtain image blocks, the number of iterations of a chaotic mapping is determined according to the image size of the image to be encrypted, and a chaotic sequence is generated according to chaotic mapping parameters and the number of iterations;
[0007] The hash value of the image to be encrypted is calculated, and the hash value is equally divided to obtain fragments equal in number to the image blocks, the chaotic numbers of the chaotic sequence are determined according to each fragment and the image size, the number of transformations of cat face transformation corresponding to each image block is determined according to each chaotic number, and cat face transformation is performed on each image block according to the number of transformations to obtain an encrypted image after block transformation and disorder;
[0008] The encrypted image is processed to obtain an original image, the original image is recovered according to a pre-learned mapping relationship between a low-resolution image and a high-resolution image to obtain an optimized image.
[0009] The chaotic numbers of the chaotic sequence are determined according to each fragment and the image size, comprising:
[0010] Data conversion is performed on each fragment to obtain a decimal number;
[0011] The remainder operation is performed on each decimal number according to the image size, and a chaotic number of a chaotic sequence is obtained.
[0012] The transformation number of the cat face transformation corresponding to each image block is determined according to each chaotic number.
[0013] Each chaotic number is respectively rounded, and an integer value corresponding to each chaotic number is obtained, and each integer value is determined as the transformation number of the cat face transformation corresponding to each image block.
[0014] The rounding of each chaotic number to obtain an integer value corresponding to each chaotic number comprises:
[0015] The parameter of the remainder function is determined according to the control factor, and the integer value corresponding to each chaotic number is calculated according to the determined parameter of the remainder function.
[0016] Before the step of splitting the to-be-encrypted image to obtain each image block, the image processing method further comprises:
[0017] The to-be-encrypted image is subjected to degradation processing to obtain a low-resolution image.
[0018] The to-be-encrypted image is determined as a high-resolution image, and a mapping relationship between the low-resolution image and the high-resolution image is learned.
[0019] The image processing method further comprises:
[0020] The mapping relationship is subjected to cat face transformation, and the transformation number is a random number, to obtain a scrambled and encrypted mapping relationship.
[0021] A scrambling parameter is obtained; the scrambling parameter comprises an image block number, the control factor, a cat face transformation parameter, the random number and the chaotic mapping parameter.
[0022] The scrambling parameter is taken as plaintext, and the plaintext is subjected to public key encryption to obtain ciphertext.
[0023] After the step of subjecting the plaintext to public key encryption to obtain ciphertext, the image processing method further comprises:
[0024] The ciphertext is decrypted by using a private key to obtain the scrambling parameter.
[0025] The encrypted image and the scrambled and encrypted mapping relationship are subjected to restoration processing by using the scrambling parameter to obtain the original image and the mapping relationship.
[0026] In one aspect, the present application provides an image processing device, comprising:
[0027] The generating unit is configured to split the image to be encrypted to obtain image blocks, determine the iteration number of a chaotic mapping according to the image size of the image to be encrypted, and generate a chaotic sequence according to the chaotic mapping parameter and the iteration number;
[0028] The transforming unit is configured to calculate a hash value of the image to be encrypted, divide the hash value into segments equal in number to the image blocks, determine chaotic numbers of the chaotic sequence according to each segment and the image size, determine the transformation number of a cat face transformation corresponding to each image block according to each chaotic number, and perform the cat face transformation on each image block according to the transformation number, to obtain an encrypted image after block transformation and permutation.
[0029] The restoring unit is configured to perform restoration processing on the encrypted image to obtain an original image, perform restoration on the original image according to a mapping relationship between low-resolution images and high-resolution images learned in advance, and obtain an optimized image.
[0030] In another aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory and a bus, wherein,
[0031] The processor and the memory complete communication with each other through the bus;
[0032] The memory stores program instructions executable by the processor, and the processor calling the program instructions can execute the following method:
[0033] The image to be encrypted is split to obtain image blocks, the iteration number of a chaotic mapping is determined according to the image size of the image to be encrypted, and a chaotic sequence is generated according to the chaotic mapping parameter and the iteration number;
[0034] The hash value of the image to be encrypted is calculated, the hash value is divided into segments equal in number to the image blocks, chaotic numbers of the chaotic sequence are determined according to each segment and the image size, the transformation number of a cat face transformation corresponding to each image block is determined according to each chaotic number, and the cat face transformation is performed on each image block according to the transformation number, to obtain an encrypted image after block transformation and permutation.
[0035] The encrypted image is subjected to restoration processing to obtain an original image, the original image is restored according to a mapping relationship between low-resolution images and high-resolution images learned in advance, and an optimized image is obtained.
[0036] An embodiment of the present application provides a non-transitory computer readable storage medium, comprising:
[0037] The non-transitory computer readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the following method:
[0038] The image to be encrypted is divided to obtain image blocks, the iteration number of chaotic mapping is determined according to the image size of the image to be encrypted, and a chaotic sequence is generated according to the chaotic mapping parameter and the iteration number;
[0039] The hash value of the image to be encrypted is calculated, and the hash value is equally divided to obtain segments equal in number to the image blocks, the chaotic numbers of the chaotic sequence are determined according to each segment and the image size, the transformation numbers of cat face transformation corresponding to each image block are determined according to each chaotic number, and cat face transformation is performed on each image block according to each transformation number to obtain an encrypted image after block transformation and shuffling;
[0040] The encrypted image is restored to obtain an original image, and the original image is recovered according to the mapping relationship between the low-resolution image and the high-resolution image learned in advance to obtain an optimized image.
[0041] The image processing method and device provided by the embodiment of the application divide the image to be encrypted to obtain image blocks, determine the iteration number of chaotic mapping according to the image size of the image to be encrypted, and generate a chaotic sequence according to the chaotic mapping parameter and the iteration number; calculate the hash value of the image to be encrypted, and equally divide the hash value to obtain segments equal in number to the image blocks, determine the chaotic numbers of the chaotic sequence according to each segment and the image size, determine the transformation numbers of cat face transformation corresponding to each image block according to each chaotic number, and perform cat face transformation on each image block according to each transformation number to obtain an encrypted image after block transformation and shuffling; the encrypted image is restored to obtain an original image, and the original image is recovered according to the mapping relationship between the low-resolution image and the high-resolution image learned in advance to obtain an optimized image, which not only effectively ensures the security of the image, but also improves the resolution of the image. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor. In the drawings:
[0043] Figure 1 is a flowchart of the image processing method provided by an embodiment of the application.
[0044] Figure 2 is a flowchart of the image processing method provided by another embodiment of the application.
[0045] Figure 3This is a schematic diagram illustrating the degradation process of the image to be encrypted provided in an embodiment of the present invention.
[0046] Figure 4 This is a schematic diagram illustrating the deep learning algorithm flow provided in an embodiment of the present invention.
[0047] Figure 5 This is a schematic diagram illustrating the convolutional neural network process provided in an embodiment of the present invention.
[0048] Figure 6 This is a schematic diagram of the structure of an image processing device provided in an embodiment of the present invention.
[0049] Figure 7 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments and descriptions of the present invention are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other.
[0051] Figure 1 This is a schematic flowchart of an image processing method provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the image processing method provided in this embodiment of the invention includes:
[0052] Step S1: Divide the image to be encrypted into image blocks, determine the number of iterations of the chaotic mapping based on the image size of the image to be encrypted, and generate a chaotic sequence based on the chaotic mapping parameters and the number of iterations.
[0053] Step S2: Calculate the hash value of the image to be encrypted, and divide the hash value equally to obtain segments equal to the number of image blocks. Determine the chaos number of the chaotic sequence based on each segment and the image size. Determine the number of cat face transformations corresponding to each image block based on each chaos number. Perform cat face transformations on each image block according to each number of transformations to obtain the encrypted image after block transformation scrambling.
[0054] Step S3: Perform restoration processing on the encrypted image to obtain the original image. Restore the original image according to the pre-learned mapping relationship between low-resolution images and high-resolution images to obtain the optimized image.
[0055] In step S1 above, the device segments the image to be encrypted into image blocks, determines the number of iterations for the chaotic mapping based on the image size of the image to be encrypted, and generates a chaotic sequence based on the chaotic mapping parameters and the number of iterations. The device can be a computer device executing this method, such as a server. It should be noted that the data acquisition and analysis involved in this embodiment of the invention are authorized by the user. The image to be encrypted can further be a grayscale image to be encrypted.
[0056] The image A to be encrypted can be represented by a matrix, denoted as M×M (M is the image size). The elements in the matrix represent the pixel grayscale values, and the positions of the matrix elements represent the pixel positions.
[0057] If the number of rows and columns of a matrix are different, the matrix can be supplemented to obtain a matrix with the same number of rows and columns.
[0058] like Figure 2 As shown, the number of image blocks in each image block obtained after segmentation is denoted as l.
[0059] If the image size is M, then the number of iterations for the chaotic mapping is M×M.
[0060] The chaotic mapping can be specifically a Sine chaotic mapping, and the chaotic mapping parameters can include a given initial value X(0) and a system parameter α; correspondingly, a chaotic sequence is generated based on the chaotic mapping parameters and the number of iterations, including:
[0061] For a given initial value X(0) and system parameter α, perform M×M iterations on the Sine chaotic map to generate a dataset of size 1×M. 2 A chaotic sequence, which is a one-dimensional chaotic sequence, can be represented as:
[0062] In step S2 above, the device calculates the hash value of the image to be encrypted, divides the hash value into equal parts to obtain segments equal to the number of image blocks, determines the chaos number of the chaotic sequence based on each segment and the image size, determines the number of cat face transformations corresponding to each image block based on each chaos number, and performs cat face transformations on each image block according to each number of transformations to obtain the encrypted image after block transformation scrambling.
[0063] Furthermore, the hash value of the image to be encrypted can be calculated using the Secure Hash Algorithm-512 (SHA-512), and the result is a 512-bit binary number.
[0064] Determining the number of chaotic sequences based on each segment and the image size includes:
[0065] The data of each segment is converted to obtain a decimal number;
[0066] The chaotic number of the chaotic sequence is obtained by performing a remainder calculation on each decimal number based on the image size.
[0067] The hash value can be divided into l segments, with any remaining digits padded with zeros, and each segment converted to a decimal number N = (N1, N2, ..., N...). l ).
[0068] Using the above decimal numbers as the number of bits, select chaotic numbers from the chaotic sequence K to obtain... N j =mod(N) j M 2 And j = 1, 2, ..., l.
[0069] The step of determining the number of transformations corresponding to each image patch based on each chaos number includes:
[0070] Each chaotic number is rounded down to obtain an integer value corresponding to each chaotic number. Each integer value is then used as the number of transformations for the cat face transformation corresponding to each image patch.
[0071] The step of rounding each chaotic number to obtain the corresponding integer value includes:
[0072] The parameters of the remainder function are determined based on the control factor, and the integer values corresponding to each chaotic number are calculated based on the remainder function after the parameters are determined.
[0073] For the above chaotic numbers Rounding down, we get And j = 1, 2, ..., l, where β is the control factor.
[0074] Each image block is subjected to cat face transformation according to the number of transformations, resulting in an encrypted image after block transformation and scrambling, including:
[0075] Let k1, k2, ..., k l The number of transformations for each image block is taken as the number of transformations to perform the cat face transformation. The cat face transformation is then performed on each image block to obtain the encrypted image A' after block transformation and scrambling. The cat face transformation is the Arnold transformation.
[0076] In step S3 above, the device performs restoration processing on the encrypted image to obtain the original image. Based on the pre-learned mapping relationship between low-resolution and high-resolution images, the original image is restored to obtain an optimized image. The encrypted image A' is restored to obtain the original image A. The high-resolution image in image A is then restored using the mapping relationship F obtained through deep learning; that is, further optimization is performed on the original image A, and the optimized high-resolution image is used as the optimized image.
[0077] like Figure 2 As shown, before the step of segmenting the image to be encrypted into image blocks, the image processing method further includes:
[0078] The image to be encrypted is degraded to obtain a low-resolution image; the low-resolution image is denoted as B, and its size is also M×M.
[0079] The image to be encrypted is determined to be a high-resolution image, and the mapping relationship between the low-resolution image and the high-resolution image is learned. The mapping relationship is denoted as F, and its size is also M×M.
[0080] The elements in the mapping matrix represent the mapping relationship between pixels from low resolution to high resolution, and the positions of the matrix elements represent the pixel positions.
[0081] The image processing method further includes:
[0082] The mapping relationship is transformed using a cat face transformation, with the number of transformations being random, to obtain a scrambled and encrypted mapping relationship; the random number is denoted as k', which can be generated randomly, and the scrambled and encrypted mapping relationship is denoted as F'.
[0083] Obtain the scrambling parameters; the scrambling parameters include the number of image blocks, the control factor, the cat face transformation parameters, the random number, and the chaotic mapping parameters; the cat face transformation parameters can be referred to in the subsequent Arnold block transformation related instructions, namely a and b.
[0084] The scrambling parameters are used as plaintext, and the plaintext is encrypted with a public key to obtain ciphertext.
[0085] The scrambled parameter (l,β,a,b,k',X(0),α)=P is used as plaintext, and the RSA encryption algorithm is used to encrypt it with a public key to obtain the ciphertext R.
[0086] After the step of encrypting the plaintext with a public key to obtain ciphertext, the image processing method further includes:
[0087] The ciphertext is decrypted using the private key to obtain the scrambling parameters; the ciphertext R is decrypted using the RSA private key to obtain the scrambling parameters (l, β, a, b, X(0), α).
[0088] The encrypted image and the scrambled encrypted mapping relationship are restored using the scrambling parameters to obtain the original image and the mapping relationship. The encrypted image A' and the scrambled encrypted mapping relationship F' are restored using (l, β, a, b, X(0), α) to obtain the original image A and the mapping relationship F.
[0089] likeFigure 3 As shown, the degradation operation on the image to be encrypted is explained below:
[0090] Image degradation refers to blurring a real high-resolution image beforehand to obtain a low-resolution version of the high-resolution image. The degradation operations in this embodiment of the invention employ blurring, downsampling, and noise reduction. Blurring is simulated using two convolutions; downsampling is randomly selected from nearest neighbor, bilinear, and bicubic interpolation; and noise is generated through Gaussian noise of varying levels and image compression of different qualities.
[0091] The degradation process is expressed by the following formula:
[0092]
[0093] in, I represents a low-resolution image, k represents a high-resolution image, n' represents Gaussian noise, and ↓ s Indicates a downsampling factor of s. This represents the convolution operation.
[0094] The formula for the reverse process of degradation is expressed as follows:
[0095]
[0096] in, Represents a high-resolution estimated map. Represents a low-resolution image, φ -1 Represents the inverse transform, θ β This indicates various factors that cause image blurring, such as noise and motion blur.
[0097] like Figure 4 As shown, the deep learning algorithm is explained below:
[0098] First, the image to be encrypted is obtained, and a degradation operation is performed on it to obtain a low-resolution image. The undegraded image to be encrypted is then used as the high-resolution image. Then, the low-resolution image and the high-resolution image are... Figure 1 Before being fed into the convolutional neural network, a one-to-one correspondence between high-resolution and low-resolution image patches is first extracted. Then, the one-to-one correspondence between the image patches is fed into the convolutional neural network to learn the transformation matrix from low-resolution to high-resolution image. Under the constraint of the mean squared error loss function, this transformation matrix is continuously iterated and optimized to finally obtain the mapping relationship F.
[0099] The mean squared error loss function is as follows:
[0100]
[0101] in, This is the judgment result of the convolutional neural network, y i This is the actual result, where n is the number of samples.
[0102] like Figure 5 As shown, the convolutional neural network is explained below:
[0103] A convolutional neural network consists of eight convolutional layers. Before processing an image, the convolutional neural network first extracts corresponding image patches from the input low-resolution and high-resolution images. Then, the extracted image patches are fed into the eight convolutional layers to learn the features between the low-resolution and high-resolution image patches. Finally, the features of the low-resolution and high-resolution image patches are concatenated to obtain the features of the low-resolution and high-resolution images.
[0104] The following is a supplementary explanation of the above Sine chaotic mapping:
[0105] The Sine chaotic map is a one-dimensional chaotic map algorithm, and its formula is as follows:
[0106] X(t+1)=αsin[πX(t)],t=0,1,2,...,n (4)
[0107] Where X(t) is the mapping variable; α is the system parameter.
[0108] The following is an additional explanation of the Arnold block transform:
[0109] Assuming the grayscale image to be encrypted is an N×N two-dimensional matrix A, the Arnold transform formula for a two-dimensional image is as follows:
[0110]
[0111] Where x and y represent the position of a pixel in a grayscale image of size N×N before the transformation; N is the size of the matrix; x' and y' represent the pixel position after the transformation; and a and b are control parameters.
[0112] The inverse Arnold block transform formula is:
[0113]
[0114] Due to the periodicity of the Arnold transform, assuming a period of T, an image scrambled k times will be restored to the original image after being transformed (Tk) times. Furthermore, the period T is positively correlated with the size N of the image matrix. To address this issue, this invention employs a block-based transform strategy, dividing the original image into l blocks and performing the Arnold transform on each sub-block. Since the number of scrambling iterations for each sub-block is k1, k2, ..., k... l Their sizes vary, effectively avoiding the risk that encrypted images can be easily recovered.
[0115] The following is an additional explanation of the Logistic chaotic mapping:
[0116] The Logistic mapping is a one-dimensional chaotic mapping algorithm, and its formula is as follows:
[0117] Y(t+1)=μY(t)[1-Y(t)], t=0,1,2,...,n,μ∈(0,4) (4)
[0118] Where Y(t) is the mapping variable; μ is the system parameter. When 0 < Y(0) < 1 and 3.5699456 < μ < 4 are satisfied, the Logistic function is in a chaotic state, generating an unpredictable and disordered sequence of numbers. For a given initial value Y(0), after N×N iterations, Y(1), Y(2), ..., Y(N) are generated. 2 A set of unordered sequences.
[0119] The specific formula for normalizing array x(i) is as follows:
[0120] x'(i)=mod(256×x(i),256), (i=1,2,...,N 2 (5)
[0121] The specific formula for the bitwise XOR operation is as follows:
[0122] D(i)=bitxor(x'(i),C(i)),(i=1,2,...,N 2 (6)
[0123] The function `bitxor` performs a bitwise XOR operation on `x'(i)` and `C(i)`, returning `D(i)`. Furthermore, due to the properties of XOR, performing the same XOR operation twice on a given value will restore it to its original value. `C(i)` represents the matrix element `C` mentioned above.
[0124] This invention combines deep learning technology with image encryption and decryption technology. Deep learning learns the mapping relationship between images from low resolution to high resolution, while an unordered Arnold transform is used to encrypt both the image to be encrypted and the mapping relationship. To effectively avoid the risk of easy recovery after multiple Arnold transforms, this invention divides the image to be encrypted into blocks and introduces a hash value and a Sine chaotic mapping. The hash value is used as the number of bits in the chaotic sequence to determine the number of transforms for different blocks, increasing the randomness of the number of transforms for each block and effectively avoiding the risk of easy recovery of the encrypted image.
[0125] To further ensure the security of the encrypted image, the scrambling parameters of the unordered block transformation are used as plaintext and encrypted with the public key using the RSA asymmetric encryption algorithm. After obtaining the ciphertext, the scrambling parameters are decrypted using the RSA private key, and the encrypted image and mapping relationship are recovered. The decrypted mapping relationship is then used to recover the high-resolution image from the decrypted image. This not only effectively ensures the image's security but also improves its resolution.
[0126] The image processing method provided in this invention involves segmenting an image to be encrypted into image blocks, determining the number of iterations for chaotic mapping based on the image size of the image to be encrypted, and generating a chaotic sequence based on the chaotic mapping parameters and the number of iterations; calculating the hash value of the image to be encrypted and dividing the hash value equally into segments equal to the number of image blocks; determining the chaos number of the chaotic sequence based on each segment and the image size; determining the number of cat face transformations corresponding to each image block based on each chaos number; performing cat face transformations on each image block according to each number of transformations to obtain an encrypted image after block transformation and scrambling; restoring the encrypted image to obtain the original image; and recovering the original image based on a pre-learned mapping relationship between low-resolution and high-resolution images to obtain an optimized image. This method not only effectively ensures image security but also improves image resolution.
[0127] Further, determining the chaos number of the chaotic sequence based on each segment and the image size includes:
[0128] The data of each segment is converted to obtain a decimal number; the description in the above embodiment can be referred to, and will not be repeated here.
[0129] The chaos number of the chaotic sequence is obtained by performing a modulo operation on each decimal number based on the image size. This can be referred to the description in the above embodiment, and will not be repeated here.
[0130] The image processing method provided in this invention can quickly and conveniently determine the chaos number of a chaotic sequence.
[0131] Furthermore, determining the number of transformations for the cat face transformation corresponding to each image patch based on each chaos number includes:
[0132] Each chaotic number is rounded down to obtain an integer value corresponding to that chaotic number. Each integer value is then used as the number of transformations for the cat face transformation corresponding to each image patch. Refer to the description in the above embodiment; further details are omitted here.
[0133] The image processing method provided in this invention can quickly and conveniently determine the number of transformations of the cat face transformation corresponding to each image block.
[0134] Further, the step of rounding each chaotic number to obtain the corresponding integer value includes:
[0135] The parameters of the modulo function are determined based on the control factor, and the integer values corresponding to each chaotic number are calculated based on the modulo function after determining the parameters. Refer to the description in the above embodiment; further details are omitted here.
[0136] The image processing method provided in this embodiment of the invention can further determine the chaos number of a chaotic sequence quickly and conveniently.
[0137] Furthermore, before the step of segmenting the image to be encrypted into image blocks, the image processing method further includes:
[0138] The image to be encrypted is degraded to obtain a low-resolution image; the description in the above embodiments is provided and will not be repeated here.
[0139] The image to be encrypted is determined to be a high-resolution image, and the mapping relationship between the low-resolution image and the high-resolution image is learned. This can be referred to the description in the above embodiments, and will not be repeated here.
[0140] The image processing method provided in this invention can effectively learn mapping relationships.
[0141] Furthermore, the image processing method further includes:
[0142] The mapping relationship is transformed using a cat face transformation, with the number of transformations being random, to obtain the scrambled and encrypted mapping relationship; the description in the above embodiment can be referred to, and will not be repeated here.
[0143] Obtain the scrambling parameters; the scrambling parameters include the number of image blocks, the control factor, the cat face transformation parameters, the random number, and the chaotic mapping parameters; refer to the description of the above embodiments, and will not be repeated here.
[0144] The scrambling parameters are used as plaintext, and the plaintext is encrypted using a public key to obtain ciphertext. This can be referred to the description in the above embodiments, and will not be repeated here.
[0145] The image processing method provided in this embodiment of the invention further ensures the information security of the scrambled parameters.
[0146] Furthermore, after the step of encrypting the plaintext with a public key to obtain ciphertext, the image processing method further includes:
[0147] The ciphertext is decrypted using the private key to obtain the scrambling parameters; the description in the above embodiment is as described above and will not be repeated here.
[0148] The encrypted image and the scrambled encrypted mapping relationship are restored using the scrambling parameters to obtain the original image and the mapping relationship. This can be referred to the description in the above embodiments, and will not be repeated here.
[0149] The image processing method provided in this embodiment of the invention can further quickly and conveniently obtain the original image and mapping relationship.
[0150] It should be noted that the image processing method provided in this embodiment of the invention can be used in the financial field, or in any technical field other than the financial field. This embodiment of the invention does not limit the application field of the image processing method.
[0151] Figure 6 This is a schematic diagram of the structure of an image processing device provided in an embodiment of the present invention, as shown below. Figure 6 As shown, the image processing apparatus provided in this embodiment of the invention includes a generation unit 601, a transformation unit 602, and a restoration unit 603, wherein:
[0152] The generation unit 601 is used to segment the image to be encrypted to obtain image blocks, determine the number of iterations of the chaotic mapping based on the image size of the image to be encrypted, and generate a chaotic sequence based on the chaotic mapping parameters and the number of iterations. The transformation unit 602 is used to calculate the hash value of the image to be encrypted, divide the hash value equally to obtain segments equal to the number of image blocks, determine the chaos number of the chaotic sequence based on each segment and the image size, determine the number of cat face transformations corresponding to each image block based on each chaos number, and perform cat face transformations on each image block according to each number of transformations to obtain an encrypted image after block transformation and scrambling. The recovery unit 603 is used to restore the encrypted image to obtain the original image, and restore the original image based on the pre-learned mapping relationship between low-resolution images and high-resolution images to obtain an optimized image.
[0153] Specifically, the generation unit 601 in the device is used to segment the image to be encrypted to obtain image blocks, determine the number of iterations of the chaotic mapping based on the image size of the image to be encrypted, and generate a chaotic sequence based on the chaotic mapping parameters and the number of iterations; the transformation unit 602 is used to calculate the hash value of the image to be encrypted, and divide the hash value equally to obtain segments equal to the number of image blocks, determine the chaos number of the chaotic sequence based on each segment and the image size, determine the number of transformations of the cat face transformation corresponding to each image block based on each chaos number, and perform cat face transformation on each image block according to each number of transformations to obtain the encrypted image after block transformation and scrambling; the recovery unit 603 is used to restore the encrypted image to obtain the original image, and restore the original image based on the pre-learned mapping relationship between low-resolution images and high-resolution images to obtain the optimized image.
[0154] The image processing apparatus provided in this embodiment of the invention segments an image to be encrypted into image blocks. It determines the number of iterations for chaotic mapping based on the image size of the image to be encrypted and generates a chaotic sequence based on the chaotic mapping parameters and the number of iterations. It calculates the hash value of the image to be encrypted and divides the hash value equally into segments equal to the number of image blocks. It determines the number of chaotic sequences based on each segment and the image size, determines the number of cat-face transformations corresponding to each image block based on each number of chaotic sequences, and performs cat-face transformations on each image block according to the number of transformations to obtain an encrypted image after block transformation and scrambling. It then restores the encrypted image to obtain the original image and recovers the original image based on a pre-learned mapping relationship between low-resolution and high-resolution images to obtain an optimized image. This not only effectively ensures image security but also improves image resolution.
[0155] Furthermore, the transformation unit 602 is specifically used for:
[0156] The data of each segment is converted to obtain a decimal number;
[0157] The chaotic number of the chaotic sequence is obtained by performing a remainder calculation on each decimal number based on the image size.
[0158] The image processing apparatus provided in this embodiment of the invention can quickly and conveniently determine the number of chaos in a chaotic sequence.
[0159] Furthermore, the transformation unit 602 is specifically used for:
[0160] Each chaotic number is rounded down to obtain an integer value corresponding to each chaotic number. Each integer value is then used as the number of transformations for the cat face transformation corresponding to each image patch.
[0161] The image processing apparatus provided in this embodiment of the invention can quickly and conveniently determine the number of transformations of the cat face transformation corresponding to each image block.
[0162] Furthermore, the transformation unit 602 is specifically used for:
[0163] The parameters of the remainder function are determined based on the control factor, and the integer values corresponding to each chaotic number are calculated based on the remainder function after the parameters are determined.
[0164] The image processing apparatus provided in this embodiment of the invention is further capable of quickly and conveniently determining the chaos number of a chaotic sequence.
[0165] Furthermore, before the step of segmenting the image to be encrypted into image blocks, the image processing device is also used to:
[0166] The image to be encrypted is degraded to obtain a low-resolution image;
[0167] The image to be encrypted is determined to be a high-resolution image, and the mapping relationship between the low-resolution image and the high-resolution image is learned.
[0168] The image processing apparatus provided in this embodiment of the invention can effectively learn mapping relationships.
[0169] Furthermore, the image processing apparatus is also used for:
[0170] The mapping relationship is subjected to cat face transformation, and the number of transformations is random, to obtain the scrambled and encrypted mapping relationship;
[0171] Obtain scrambling parameters; the scrambling parameters include the number of image blocks, the control factor, the cat face transformation parameters, the random number, and the chaotic mapping parameters;
[0172] The scrambling parameters are used as plaintext, and the plaintext is encrypted with a public key to obtain ciphertext.
[0173] The image processing apparatus provided in this embodiment of the invention further ensures the information security of the scrambled parameters.
[0174] Furthermore, after the step of encrypting the plaintext with a public key to obtain ciphertext, the image processing device is further configured to:
[0175] The ciphertext is decrypted using the private key to obtain the scrambling parameters;
[0176] The encrypted image and the scrambled encrypted mapping relationship are restored using the scrambling parameters to obtain the original image and the mapping relationship.
[0177] The image processing apparatus provided in this embodiment of the invention is further capable of quickly and conveniently acquiring the original image and mapping relationship.
[0178] The embodiments of the image processing apparatus provided in this invention can be used to execute the processing flow of the above-described method embodiments. Its functions will not be repeated here, but can be referred to the detailed description of the above-described method embodiments.
[0179] Figure 7 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as... Figure 7 As shown, the electronic device includes: a processor 701, a memory 702, and a bus 703;
[0180] The processor 701 and the memory 702 communicate with each other via the bus 703.
[0181] The processor 701 is used to call program instructions in the memory 702 to execute the methods provided in the above-described method embodiments, including, for example:
[0182] The image to be encrypted is segmented to obtain image blocks. The number of iterations of the chaotic mapping is determined according to the image size of the image to be encrypted, and a chaotic sequence is generated according to the chaotic mapping parameters and the number of iterations.
[0183] Calculate the hash value of the image to be encrypted, and divide the hash value equally to obtain segments equal to the number of image blocks. Determine the chaos number of the chaotic sequence based on each segment and the image size. Determine the number of cat face transformations corresponding to each image block based on each chaos number. Perform cat face transformations on each image block according to each number of transformations to obtain the encrypted image after block transformation scrambling.
[0184] The encrypted image is restored to obtain the original image. The original image is then recovered based on the pre-learned mapping relationship between low-resolution and high-resolution images to obtain the optimized image.
[0185] This embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can perform the methods provided in the above-described method embodiments, such as:
[0186] The image to be encrypted is segmented to obtain image blocks. The number of iterations of the chaotic mapping is determined according to the image size of the image to be encrypted, and a chaotic sequence is generated according to the chaotic mapping parameters and the number of iterations.
[0187] Calculate the hash value of the image to be encrypted, and divide the hash value equally to obtain segments equal to the number of image blocks. Determine the chaos number of the chaotic sequence based on each segment and the image size. Determine the number of cat face transformations corresponding to each image block based on each chaos number. Perform cat face transformations on each image block according to each number of transformations to obtain the encrypted image after block transformation scrambling.
[0188] The encrypted image is restored to obtain the original image. The original image is then recovered based on the pre-learned mapping relationship between low-resolution and high-resolution images to obtain the optimized image.
[0189] This embodiment provides a computer-readable storage medium storing a computer program that causes the computer to execute the methods provided in the above-described method embodiments, including, for example:
[0190] The image to be encrypted is segmented to obtain image blocks. The number of iterations of the chaotic mapping is determined according to the image size of the image to be encrypted, and a chaotic sequence is generated according to the chaotic mapping parameters and the number of iterations.
[0191] Calculate the hash value of the image to be encrypted, and divide the hash value equally to obtain segments equal to the number of image blocks. Determine the chaos number of the chaotic sequence based on each segment and the image size. Determine the number of cat face transformations corresponding to each image block based on each chaos number. Perform cat face transformations on each image block according to each number of transformations to obtain the encrypted image after block transformation scrambling.
[0192] The encrypted image is restored to obtain the original image. The original image is then recovered based on the pre-learned mapping relationship between low-resolution and high-resolution images to obtain the optimized image.
[0193] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0194] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0195] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0196] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0197] In the description of this specification, the references to terms such as "an embodiment," "a specific embodiment," "some embodiments," "for example," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0198] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An image processing method, characterized in that, include: The image to be encrypted is segmented to obtain image blocks. The number of iterations of the chaotic mapping is determined according to the image size of the image to be encrypted, and a chaotic sequence is generated according to the chaotic mapping parameters and the number of iterations. The hash value of the image to be encrypted is calculated using the Secure Hash Algorithm-512, and the hash value is divided equally to obtain segments equal to the number of image blocks. The chaos number of the chaotic sequence is determined based on each segment and the image size. The number of cat face transformations corresponding to each image block is determined based on each chaos number. The cat face transformation is performed on each image block according to each number of transformations to obtain the encrypted image after block transformation and scrambling. The hash value is a 512-bit binary number. The encrypted image is restored to obtain the original image. The original image is then recovered based on the pre-learned mapping relationship between low-resolution and high-resolution images to obtain the optimized image. The step of determining the chaos number of the chaotic sequence based on each segment and the image size includes: The data of each segment is converted to obtain a decimal number; The chaos number of the chaotic sequence is obtained by performing a remainder calculation on each decimal number based on the image size; Prior to the step of segmenting the image to be encrypted into image blocks, the image processing method further includes: The image to be encrypted is degraded to obtain a low-resolution image; The image to be encrypted is determined to be a high-resolution image, and the mapping relationship between the low-resolution image and the high-resolution image is learned; The image processing method further includes: The mapping relationship is subjected to cat face transformation, and the number of transformations is random, to obtain the scrambled and encrypted mapping relationship; Obtain scrambling parameters; the scrambling parameters include the number of image blocks, control factor, cat face transformation parameters, the random number, and the chaotic mapping parameters; The scrambling parameters are used as plaintext, and the plaintext is encrypted with a public key to obtain ciphertext; After the step of encrypting the plaintext with a public key to obtain ciphertext, the image processing method further includes: The ciphertext is decrypted using the private key to obtain the scrambling parameters; The encrypted image and the scrambled encrypted mapping relationship are restored using the scrambling parameters to obtain the original image and the mapping relationship.
2. The image processing method according to claim 1, characterized in that, The step of determining the number of transformations corresponding to each image patch based on each chaos number includes: Each chaotic number is rounded down to obtain an integer value corresponding to each chaotic number. Each integer value is then used as the number of transformations for the cat face transformation corresponding to each image patch.
3. The image processing method according to claim 2, characterized in that, The step of rounding each chaotic number to obtain the corresponding integer value includes: The parameters of the remainder function are determined based on the control factor, and the integer values corresponding to each chaotic number are calculated based on the remainder function after the parameters are determined.
4. An image processing apparatus, characterized in that, include: The generation unit is used to segment the image to be encrypted into image blocks, determine the number of iterations of the chaotic mapping based on the image size of the image to be encrypted, and generate a chaotic sequence based on the chaotic mapping parameters and the number of iterations. A transformation unit is used to calculate the hash value of the image to be encrypted using the secure hash algorithm-512, and to divide the hash value equally to obtain segments equal to the number of image blocks. Based on each segment and the image size, the chaos number of the chaotic sequence is determined. Based on each chaos number, the number of cat-face transformations corresponding to each image block is determined. Cat-face transformations are then performed on each image block according to the number of transformations, resulting in an encrypted image after block transformation and scrambling. The hash value is a 512-bit binary number. The recovery unit is used to restore the encrypted image to obtain the original image, and restore the original image according to the pre-learned mapping relationship between low-resolution images and high-resolution images to obtain an optimized image; Specifically, the transformation unit is used for: The data of each segment is converted to obtain a decimal number; The chaos number of the chaotic sequence is obtained by performing a remainder calculation on each decimal number based on the image size; Prior to the step of segmenting the image to be encrypted into image blocks, the image processing device is further configured to: The image to be encrypted is degraded to obtain a low-resolution image; The image to be encrypted is determined to be a high-resolution image, and the mapping relationship between the low-resolution image and the high-resolution image is learned; The image processing device is also used for: The mapping relationship is subjected to cat face transformation, and the number of transformations is random, to obtain the scrambled and encrypted mapping relationship; Obtain scrambling parameters; the scrambling parameters include the number of image blocks, control factor, cat face transformation parameters, the random number, and the chaotic mapping parameters; The scrambling parameters are used as plaintext, and the plaintext is encrypted with a public key to obtain ciphertext; After the step of encrypting the plaintext with a public key to obtain ciphertext, the image processing device is further configured to: The ciphertext is decrypted using the private key to obtain the scrambling parameters; The encrypted image and the scrambled encrypted mapping relationship are restored using the scrambling parameters to obtain the original image and the mapping relationship.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, 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 3.
Citation Information
Patent Citations
Human face super-resolution reconstruction method based on generative adversarial network and sub-pixel convolution
CN107154023A
Image encryption method based on parallel compressed sensing and secret sharing
CN114944911A