Image encryption region determination method and device, electronic equipment and storage medium

By dynamically selecting the number of channels and determining the secure region through frequency domain analysis, the problems of low security and high size requirements in existing image encryption methods are solved, thus achieving efficient image encryption.

CN116188764BActive Publication Date: 2026-06-05CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILE INFORMATION TECHNOLOGY CO LTD
Filing Date
2022-12-29
Publication Date
2026-06-05

Smart Images

  • Figure CN116188764B_ABST
    Figure CN116188764B_ABST
Patent Text Reader

Abstract

The application provides a method and device for determining an image encryption region, electronic equipment and a storage medium, and relates to the field of data security. The method comprises the following steps: obtaining a first preprocessed image; obtaining the size of the first preprocessed image and the length of text corresponding to target embedded information; converting the format of the first preprocessed image into a preset format to obtain a target preprocessed image; determining the target number of channels corresponding to the length of text and the size of the first preprocessed image according to the correspondence between the length of text, the size of the first preprocessed image and the number of channels; and performing identification processing on the target preprocessed image based on the target number of channels to obtain two-dimensional matrix data matching the target number of channels, wherein the two-dimensional matrix data is the information of a secure region. The secure region information obtained is determined as a region in the first processed image, which can improve the security of image encryption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data security, specifically to a method, apparatus, electronic device, and storage medium for determining an image encryption region. Background Technology

[0002] With the continuous development of the Internet and information technology, the scope of dissemination of images, videos, audio, and other electronic documents on the Internet is constantly expanding. This means that images, videos, audio, and other electronic documents may be arbitrarily tampered with and used, making it impossible to guarantee their reliability.

[0003] To ensure reliability, encryption methods are employed to prevent unauthorized alteration of images, videos, audio, and other electronic documents. Encryption methods involve arbitrarily selecting a region from the original image and directly embedding the watermark image into that region, or using deep learning networks to analyze regions with complex image textures and embedding the encryption information into those textured areas. Watermarking encryption methods suffer from low security, while deep learning models face challenges such as requiring large encrypted image sizes and difficulties in authentication.

[0004] Therefore, existing image encryption methods suffer from problems such as low security, high size requirements, and difficulty in authentication. Summary of the Invention

[0005] This application provides a method, apparatus, electronic device, and storage medium for determining an image encryption region, which can solve problems such as low security, high size requirements, and difficulty in identification in image encryption methods.

[0006] In a first aspect, embodiments of this application provide a method for determining an image encryption region, the method comprising:

[0007] Obtain the first preprocessed image;

[0008] Obtain the dimensions of the first preprocessed image and the text length corresponding to the target embedding information;

[0009] Convert the format of the first preprocessed image to the preset format to obtain the target preprocessed image;

[0010] Based on the correspondence between the text length, the size of the first preprocessed image, and the number of channels, determine the target number of channels corresponding to the text length and the size of the first preprocessed image;

[0011] The target preprocessed image is identified based on the target number of channels to obtain two-dimensional matrix data that matches the target number of channels. The two-dimensional matrix data contains information about the safe area.

[0012] In one possible implementation, the target preprocessed image is identified based on the target number of channels to obtain two-dimensional matrix data matching the target number of channels. The method for determining the image encryption region includes:

[0013] The target preprocessed image is divided into image regions by pre-defined image units, resulting in multiple image units.

[0014] Based on the target number of channels, the image units are identified and processed to obtain a two-dimensional matrix of image units that match the target number of channels.

[0015] In one possible embodiment, after dividing the target preprocessed image into multiple image units by predefined image units, and before identifying the image units according to the target number of channels to obtain a two-dimensional matrix of image units matching the target number of channels, the method for determining the image encryption region further includes:

[0016] By performing discrete cosine transform on the image units, the information of the image units and the components of the image units are converted into image data and channels, respectively.

[0017] Image data is classified into corresponding channels according to frequency, and the number of first channels corresponding to the type of each component of the image unit is obtained.

[0018] In one possible implementation, after classifying the image data into corresponding channels according to frequency and obtaining the first channel number corresponding to the type of each component of the image unit, the method for determining the image encryption region further includes: obtaining preset coefficients corresponding to the type of the components in the target preprocessed image.

[0019] The number of second channels is calculated based on the preset coefficients corresponding to the text length, the size of the target preprocessed image, and the component type. The number of second channels corresponding to the first channel number of the component type is counted to obtain the target number of channels corresponding to the preset coefficients of the text length, the size of the first preprocessed image, and the component type.

[0020] Secondly, embodiments of this application provide an image encryption region determination device, which includes a first acquisition module for acquiring a first preprocessed image.

[0021] The second acquisition module is used to acquire the size of the first preprocessed image and the length of the text corresponding to the target embedding information.

[0022] The conversion module is used to convert the format of the first preprocessed image to a preset format to obtain the target preprocessed image.

[0023] The determination module is used to determine the target number of channels corresponding to the text length and the size of the first preprocessed image based on the correspondence between the text length, the size of the first preprocessed image and the number of channels.

[0024] The recognition module is used to perform recognition processing on the target preprocessed image based on the target number of channels, and obtain two-dimensional matrix data that matches the target number of channels. The two-dimensional matrix data is information about the safe area.

[0025] Thirdly, embodiments of this application provide an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the above-mentioned method for determining the image encryption region.

[0026] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, characterized in that, when executed by a processor, the computer program implements various processes of the above-described embodiment for determining the image encryption region.

[0027] Fifthly, embodiments of this application provide a computer program product in which instructions, when executed by the processor of an electronic device, cause the electronic device to perform the various processes for determining the aforementioned image encryption region.

[0028] The image encryption region determination method, apparatus, electronic device, computer-readable storage medium, and computer program product provided in this application embodiment obtain a first preprocessed image, further obtain the size of the first preprocessed image and the text length corresponding to the target embedded information, and convert the format of the first preprocessed image to a preset format to obtain a target preprocessed image. Based on the correspondence between the text length, the size of the first preprocessed image, and the number of channels, the target number of channels corresponding to the text length and the size of the first preprocessed image is determined. This allows for dynamic selection of the most representative channels, reducing channel inference time. Furthermore, the target preprocessed image can be recognized and processed based on the target number of channels to obtain two-dimensional matrix data matching the target number of channels. This two-dimensional matrix data represents information about the secure region. Therefore, the image encryption region determination method provided in this application embodiment is not limited by the size of the first preprocessed image. The target number of channels can be determined based on the size of the first preprocessed image and the text length of the target embedded information, enabling dynamic channel selection, reducing inference time, and effectively determining the corresponding secure region information embedded by the target embedded information based on the target number of channels. Moreover, embedding the target embedded information into the secure region information based on the determined secure region information improves the security of image encryption. Attached Figure Description

[0029] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application are briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0030] Figure 1 A flowchart illustrating a method for determining an image encryption region provided in this application embodiment;

[0031] Figure 2 This is a structural diagram of a first type of network structure in a method for determining an image encryption region provided in an embodiment of this application;

[0032] Figure 3 This is a structural diagram of the second type of network structure in a method for determining an image encryption region provided in an embodiment of this application;

[0033] Figure 4 This is a structural diagram of a third type of network structure in an image encryption region determination method provided in an embodiment of this application;

[0034] Figure 5 This is a structural diagram of the fourth type of network structure in a method for determining an image encryption region provided in an embodiment of this application;

[0035] Figure 6 This is a structural diagram of a secure region filtering model in an image encryption region determination method provided in an embodiment of this application;

[0036] Figure 7 This is a structural block diagram of a method for determining an image encryption region provided in an embodiment of this application;

[0037] Figure 8 This is a structural diagram of an electronic device for a method of determining an image encryption region provided in an embodiment of this application. Detailed Implementation

[0038] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0039] It should be noted that, in this document, relational terms such as "first," "second," etc., are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0040] With the continuous development of the Internet and information technology, the scope of dissemination of user-created images, videos, audio, and other electronic documents on the Internet is constantly expanding. This means that images, videos, audio, and other electronic documents may be arbitrarily tampered with and used, making it impossible to guarantee their reliability.

[0041] To ensure its reliability, encryption methods are adopted for images, videos, audio, and other electronic documents to prevent others from arbitrarily tampering with them.

[0042] The applicant's research has revealed the following technical problems with current methods for determining image encryption regions: Encryption methods either arbitrarily select a region from the original image and directly embed it into another region of the original image, or use deep learning networks to analyze regions with complex image textures and embed the encryption information into these textured regions. Watermarking encryption methods suffer from low security, while deep learning models have limitations such as requiring large encrypted image sizes and presenting challenges in authentication.

[0043] Therefore, existing image encryption methods suffer from problems such as low security, high size requirements, and difficulty in authentication.

[0044] In view of the above research findings, this application provides a method for determining the encrypted region of an image to solve the aforementioned technical problems existing in the prior art.

[0045] The technical concept of this application embodiment lies in the following: It is not limited by the size of the first preprocessed image; the number of target channels can be determined based on the size of the first preprocessed image and the text length of the target embedded information, enabling dynamic channel selection, reducing inference time, and effectively determining the corresponding security region information embedded by the target embedded information based on the number of target channels. Furthermore, embedding the target embedded information into the security region information based on the determined security region information can improve the security of image encryption.

[0046] This embodiment provides a method for determining the encrypted region of an image, such as... Figure 1 As shown, the steps are as follows:

[0047] S101: Obtain the first preprocessed image;

[0048] The first preprocessed image is the image to be encrypted, into which information is to be embedded.

[0049] In some embodiments, the first preprocessed image can be any editable electronic image. In some specific embodiments, the first preprocessed image can be an RGB image, which may be an image acquired from a camera or video stream.

[0050] In one example, the user needs to obtain the original image that needs to be encrypted. In this embodiment of the application, the original image can be called the first preprocessed image. The first preprocessed image can be an RGB image. RGB represents the colors in the three channels, which represent the three primary colors RED, GREEN and BLUE respectively. It means that the colors in the RGB image are mixed according to a certain proportion of the three primary colors to display the actual colors of the RGB image.

[0051] S102: Obtain the size of the first preprocessed image and the text length corresponding to the target embedding information.

[0052] The size of the first preprocessed image can be any size, and the target embedding information can include embedding information such as the time or location of the image capture.

[0053] In some embodiments, the size of the image to be encrypted can be obtained, and the text length of the target embedded information corresponding to the image to be encrypted can be obtained by calculating the information content. The information content of the target embedded information can be determined as the number of characters in the target embedded information.

[0054] Since the original images are stored on different devices, the sizes of the original images obtained from different devices are also different. However, in this embodiment, the size of the original image is not limited, allowing processing of images of any size and increasing the diversity of the original images. The size of the first preprocessed image and the length of the text corresponding to the target embedded information are obtained to prepare for determining the encrypted region in the image.

[0055] S103: Convert the format of the first preprocessed image to the preset format to obtain the target preprocessed image.

[0056] The format of the first preprocessed image is converted to a preset format, and the image converted to the preset format is called the target preprocessed image.

[0057] In one example, the first preprocessed image can be in RGB format, and the preset format can be YCbCr format. Converting the RGB format of the first preprocessed image to YCbCr format means converting the RGB color space components to YCbCr color space components. The YCbCr color space has three components: Y, Cb, and Cr. The Y component represents the pixel brightness, the Cb component represents the blue component chromaticity, and the Cr component represents the red component chromaticity.

[0058] Since the human eye is more sensitive to brightness than to chromaticity, slightly reducing the information in the color channels while keeping the brightness constant will not result in a decrease in image quality as perceived by the human eye. Therefore, reducing color information can reduce storage space, so YCbCr format images can replace RGB format images for image storage and transmission, saving space resources.

[0059] S104: Determine the target number of channels corresponding to the text length and the size of the first preprocessed image based on the correspondence between the text length, the size of the first preprocessed image and the number of channels.

[0060] Record and store the dimensions of the first preprocessed image and the text length of the target embedding information to be embedded, in preparation for determining the target number of channels.

[0061] In some embodiments, before determining the target number of channels corresponding to the text length and the size of the first preprocessed image based on the correspondence between the text length, the size of the first preprocessed image, and the number of channels, the method includes constructing the correspondence between the text length, the size of the first preprocessed image, and the number of channels. The specific process for constructing the correspondence is as follows: Obtain the first number of channels, and based on the size of the first preprocessed image and the number of second channels in the first preprocessed image occupied by the text length of the target embedded information, correlate this correspondence with the size of the first preprocessed image and the text length of the target embedded information, and record and store this correspondence.

[0062] Based on the recorded and stored correspondence, the corresponding number of target channels can be determined according to the first preprocessed image of different sizes and different text lengths.

[0063] S105: Based on the target channel number, the preprocessed image of the target is identified and processed to obtain two-dimensional matrix data that matches the target channel number. The two-dimensional matrix data is information about the safe area.

[0064] The spatial domain is the space composed of image pixels. The spatial domain can also be called the image space. In the image space, processing pixel values ​​directly with length (distance) as the independent variable is called spatial domain processing.

[0065] The frequency domain describes the characteristics of an image with frequency (i.e., wavenumber) as the independent variable. It can decompose the spatial variation of pixel values ​​in an image into a linear superposition of simple vibratory functions with different amplitudes, spatial frequencies, and phases. The composition and distribution of various frequency components in an image are called the spatial spectrum.

[0066] Existing image encryption methods analyze and process images in the spatial domain. However, deep learning networks are limited by GPU memory and have restrictions on the size of the input image; images that are too large require downsampling to reduce their size, which can easily lead to the loss of much original image information. This application's embodiment analyzes and processes images in the frequency domain. Low-frequency components of the image change slowly and generally consist of content within the image edges, while high-frequency components represent rapidly changing parts of the image, often including image edges, details, or noise. This not only solves the problem of excessively large image sizes but also preserves more of the original image information. Furthermore, it reduces the communication bandwidth between the CPU and GPU, addressing deployment issues. Analyzing the image's features in the frequency domain maintains high resolution without being limited by the original image size. Dynamic channel selection reduces inference time. By recognizing and processing the target preprocessed image, the optimal information embedding position is effectively determined, reducing resource consumption and making large-scale commercial applications possible.

[0067] The two-dimensional matrix information may include safe region information. The safe region can embed target embedding information into the first preprocessed image. The safe region information can represent the safe region of the first preprocessed image. The safe region information can be the edges of the image that change rapidly or the high-frequency regions with complex textures.

[0068] In some embodiments, the target number of channels, determined by the correspondence between the text length in S104 and the size of the first preprocessed image and the number of channels, can be input into the safe region filtering model. The model uses discrete convolution (Conv), continuous convolution (DConv), normalization (BN), and activation (ReLU) functions to obtain a corresponding two-dimensional matrix data of the target preprocessed image that matches the target number of channels. This two-dimensional matrix data can include safe region information. The construction of the safe region filtering model includes four types of network structures. These four types of network structures are combined alternately to identify the target preprocessed image and obtain the safe region information of the first preprocessed image.

[0069] The four types of network structures in the secure region filtering model are as follows: Figure 2 As shown, Figure 2This represents the first type of network structure (Type 1), which can also be called a shortcut structure. The first layer of the first type of network structure is a discrete convolutional layer with a 1×1 kernel. The 1×1 matrix data obtained from the first layer is input into the second layer (a continuous convolutional layer), which transforms it into a 3×3 matrix data result. The 3×3 matrix data result from the second layer is input into the third layer, where discrete convolution is used to transform the 3×3 matrix data result into a 1×1 matrix data result. This completes the matrix data transformation of the first type of network structure.

[0070] like Figure 3 As shown, Figure 3 This represents the second type of network structure (Type 2), also known as the direct shortcut connection structure. The direct shortcut connection structure allows intermediate convolutional layers to learn residuals. First, the input matrix data is processed in the first type of network structure. The result of this processing is then input into the second layer of the second type of network structure, where it undergoes a normalization function (BN). The BN-processed matrix data is then input back into the first type of network structure for further processing. Finally, the processed matrix data is input into an activation function (ReLU) to obtain the final matrix data. Logical operations are then performed between the input matrix data and the final matrix data to obtain the target matrix data. This target matrix data is then input into the seventh layer, where the target matrix data undergoes another activation function processing to obtain the data processed by the second type of network structure.

[0071] like Figure 4 As shown, Figure 4 This represents the third type of network structure (Type3), which can also be called the transformed shortcut connection structure. It obtains data of the same size through transformation. S2 indicates that spatial subsampling is performed through convolution with a stride of 2, meaning that data in the first type of network structure is sampled according to the method of having a stride of 2. Therefore, Type1 (S2) in Type3 means that the amount of data sampled in the third type of network structure is half the amount of data sampled in the first type of network structure. The third type of network structure also includes discrete convolution function (Conv), continuous convolution function (DConv), normalization function (BN), activation function (ReLU), and Type1, which together realize the data transformation of the Type3 network structure.

[0072] like Figure 5 As shown, Figure 5This represents the fourth type of network structure (Type 3). The fourth type of network structure (Type 4) can also be called a short connection structure, which can improve the correlation between the output and input results. Type 4 uses Type 1, the normalization function (BN), and the activation function (ReLU) to improve the data correlation between the input and output.

[0073] Based on the above, it can be determined that the safe regions for embedding target information are concentrated in the edge regions and areas with complex textures of the image. Therefore, a 15-layer safe region selection model can be constructed. The initial number of channels input to the safe region selection model is the number of target channels C passed through the dynamic channels. The first data in the figure represents the number of 3×3 kernels in the convolutional layer, and the data in parentheses is height×width×number of channels. All filters used are randomly initialized and learned through an end-to-end training process. In the network model, we alternate between type 2 and type 3 structures, and finally use type 4 structure. The first to third layers use type 3, the third to fifth layers use type 2, the fifth to seventh layers use type 3, the seventh to ninth layers use type 2, the ninth to eleventh layers use type 3, the eleventh to thirteenth layers use type 2, and the fourteenth and fifteenth layers use type 4.

[0074] The 15-layer security region filtering model can output two-dimensional matrix data, which can be security region data. That is, the security region filtering model can determine the security region where the target embedding information is to be embedded. It can also make the size of images of different sizes become uniform after using the security region filtering model, without discarding the original image data, thus improving the security of image encryption.

[0075] The image encryption region determination method provided in this application is not limited by the size of the first preprocessed image. Based on the size of the first preprocessed image and the text length of the target embedded information, the number of target channels can be determined, enabling dynamic channel selection, reducing inference time, and effectively determining the corresponding security region information embedded by the target embedded information based on the number of target channels. Furthermore, embedding the target embedded information into the determined security region information improves the security of image encryption.

[0076] In some embodiments, the target preprocessed image is identified based on the target number of channels to obtain two-dimensional matrix data matching the target number of channels, including: dividing the target preprocessed image into image regions by preset image units to obtain multiple image units; and identifying the image units according to the target number of channels to obtain two-dimensional matrix data of the image units matching the target number of channels.

[0077] Users can preset the size of an image unit and divide the target preprocessed image into image regions according to the size of the image unit. Given that the size of the target preprocessed image is x×y and the size of the image unit is m×n, the starting point coordinates (i, j) of the segmentation can be determined based on position selection rules.

[0078]

[0079]

[0080] Here, mod is the modulo function, which obtains the remainder between x and n. The remainder is divided by 2 and rounded to determine the corresponding starting point x-coordinate i. Similarly, the corresponding starting point y-coordinate j can be determined.

[0081] Based on the dimensions of the computed image units and the target preprocessed image, the number of image units z can be determined as follows:

[0082]

[0083] Therefore, by dividing the image region of the target preprocessed image according to the size of the image unit, the number of divisions corresponding to the length and width can be obtained by multiplying them together to get the number of corresponding image units.

[0084] In one example, if the target is determined to have a preprocessed image size of 20×20 and an image unit size of 8×8, the starting point coordinates (i, j) of the block can be determined based on the position selection rules:

[0085]

[0086]

[0087] Therefore, we can determine that i = 3, j = 3, which means the coordinates of the starting point of the block are (3, 3).

[0088] Based on the dimensions of the computed image units and the target preprocessed image, the number of image units z can also be determined as follows:

[0089]

[0090] Therefore, z = 2, which means that after dividing the image region of the target preprocessed image, two image units can be obtained.

[0091] Based on the number of target channels, each image unit is identified and processed to obtain the corresponding two-dimensional matrix data of the image unit. The two-dimensional matrix data can be the security region data, which can represent the sorting information of the image units corresponding to the security region information. Multiple target embedding information can be embedded sequentially into the security region corresponding to the security region information.

[0092] Dividing the preprocessed target image into regions yields multiple image units. Recognizing these image units accelerates model recognition, allows for the acquisition of secure regions for embedding target information, and enhances the security of image encryption.

[0093] In some embodiments, after dividing the target preprocessed image into multiple image units by predefined image units, and before identifying the image units according to the target number of channels to obtain a two-dimensional matrix of image units matching the target number of channels, the method for determining the image encryption region may include: converting the information of the image unit and the components of the image unit into image data and channels respectively by performing discrete cosine transform on the image unit; classifying the image data into corresponding channels according to frequency to obtain the first channel number corresponding to the type of each component of the image unit.

[0094] Since the target preprocessed image is in YCbCr format, the components of a YCbCr format image can be of three types: Y, Cb, and Cr. The components of a YCbCr format image can be assigned to one of the three component types: Y, Cb, and Cr.

[0095] By performing Discrete Cosine Transform (DCT) on each image unit, the image unit can be converted into a frequency channel. The text information in the image unit can also be converted into image data in the frequency channel. The image data is classified into the corresponding frequency channel according to the same frequency, and the first channel number corresponding to the type of each component of the image unit is obtained.

[0096] In one example, the first preprocessed image can have dimensions of 448×448×3. The first preprocessed image is converted into a target preprocessed image and divided into 8×8 pixel image units. After performing DCT transformation on each image unit, a spatial spectrum can be generated. DCT transformation can convert each component in the image unit into 192 frequency channels. The text information in the image unit is converted into 192 frequency channels after DCT transformation. For the channel corresponding to the type of Y component, the current dimension of 448×448×1 becomes 56×56×64. Since each component type includes 64 frequency channels, the final dimension of the entire image becomes 56×56×192.

[0097] By obtaining the first channel number corresponding to the type of each component, we can prepare for the target channel number corresponding to each component type in the future, thereby improving the rate of obtaining the target channel number.

[0098] In some embodiments, image data is classified into corresponding channels according to frequency to obtain the first channel number corresponding to the type of each component of the image unit. The method for determining the image encryption region further includes: obtaining the preset coefficient corresponding to the type of the component in the target preprocessed image; calculating the second channel number according to the text length, the size of the first preprocessed image and the preset coefficient corresponding to the type of the component, and counting the second channel number corresponding to the first channel number of the component type to obtain the target channel number corresponding to the text length, the size of the first preprocessed image and the preset coefficient corresponding to the type of the component.

[0099] After obtaining the preset coefficients corresponding to the component type, determine the target number of channels according to the following channel number selection formula:

[0100]

[0101] Where C is the target number of channels, λ is the preset coefficient, M is the text length of the target embedded information, x and y are the length and width of the first preprocessed image, respectively, and the preset coefficients corresponding to the component types Y, Cb and Cr can be represented as λ1, λ2 and λ3, respectively. The target number of channels in the first number of channels corresponding to the component type is calculated according to the preset coefficients corresponding to the component type. The target number of channels can be counted by the following formula:

[0102] C = Y C +Cb C +Cr C

[0103] The target channel number C can include the target channel number corresponding to the preset coefficients of the three component types, and the target channel number corresponding to the three component types can be represented as Y. C Cb C and Cr C .

[0104] In one example, the preset coefficient and Taking the Y-type component as an example, if the size of the first preprocessed image is 64×64 and the text length is 5, then the number of the second channel Y corresponding to the Y-type component is determined. C =32, meaning that 32 of the 64 frequency channels corresponding to the Y-type component are selected as the second channel corresponding to the Y-type component.

[0105] The second channel number corresponding to the preset coefficients of the three component types is obtained respectively. The second channel number of the three component types is counted as the target channel number. The target channel number includes the channel number corresponding to the three component types. This can effectively reduce the inference time of channel selection and improve the speed of image encryption.

[0106] In addition, see Figure 7 This application also provides an image encryption determination device 700, which includes a first acquisition module 701, a second acquisition module 702, a conversion module 703, a determination module 704, and an identification module 705. These modules work together to complete the image encryption determination process, specifically:

[0107] The first acquisition module 701 is used to acquire the first preprocessed image.

[0108] The second acquisition module 702 is used to acquire the size of the first preprocessed image and the text length corresponding to the target embedding information.

[0109] The conversion module 703 is used to convert the format of the first preprocessed image to a preset format to obtain the target preprocessed image.

[0110] The determination module 704 is used to determine the target number of channels corresponding to the text length and the size of the first preprocessed image based on the correspondence between the text length, the size of the first preprocessed image and the number of channels.

[0111] The recognition module 705 is used to perform recognition processing on the target preprocessed image based on the target number of channels to obtain two-dimensional matrix data that matches the target number of channels. The two-dimensional matrix data is information about the safe area.

[0112] In some embodiments, the recognition module 705 is further configured to perform recognition processing on the target preprocessed image based on the target number of channels to obtain two-dimensional matrix data matching the target number of channels. The device may also include: a region division module, configured to divide the target preprocessed image into image regions through preset image units to obtain multiple image units.

[0113] The recognition module is also used to perform recognition processing on image units according to the target number of channels, and obtain two-dimensional matrix data of image units that match the target number of channels.

[0114] In some embodiments, in the region division module, after dividing the target preprocessed image into image regions by preset image units to obtain multiple image units, before performing recognition processing on the image units according to the target number of channels to obtain two-dimensional matrix data of image units matching the target number of channels, the device further includes a splitting module. The scanning module performs line-by-line scanning of the target document, including: a conversion module, used to convert the information of the image units and the components of the image units into image data and channels respectively by performing discrete cosine transform on the image units.

[0115] The classification module is used to classify image data into corresponding channels according to frequency, and obtain the first channel number corresponding to the type of each component of the image unit.

[0116] In some embodiments, after the classification module classifies the image data into corresponding channels according to frequency and obtains the first channel number corresponding to the type of each component of the image unit, the device further includes a third acquisition module for acquiring preset coefficients corresponding to the type of the components in the target preprocessed image.

[0117] The statistics module is used to calculate the number of second channels based on the text length, the size of the target preprocessed image, and the preset coefficients corresponding to the component types, and to count the number of second channels corresponding to the first channel number of the component types, so as to obtain the target number of channels based on the text length, the size of the first preprocessed image, and the preset coefficients corresponding to the component types.

[0118] The various modules of the image encryption region determination device provided in this application embodiment can achieve... Figure 1 It provides functions for determining the various steps of the image encryption region and achieves the corresponding technical effects. For the sake of brevity, it will not be elaborated here.

[0119] This application also provides an electronic device, such as... Figure 8 As shown, the electronic device 800 may include: a processor 801, a memory 802, a communication interface 803, and a bus 810.

[0120] Specifically, the processor 801 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured according to the embodiments of the present application.

[0121] Memory 802 may include mass storage for data or instructions. For example, and not limitingly, memory 802 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. In one embodiment, memory 802 may include removable or non-removable (or fixed) media, or memory 802 may be non-volatile solid-state memory. Memory 802 may be internal or external to the integrated gateway housing device.

[0122] In one embodiment, memory 802 may be read-only memory (ROM). In one embodiment, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.

[0123] Storage 802 may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this disclosure.

[0124] The processor 801 reads and executes computer program instructions stored in the memory 802 to achieve... Figure 1 The methods S101 to S105 in the illustrated embodiment achieve the following: Figure 1 The embodiments shown achieve the corresponding technical effects by performing their methods / steps, which will not be elaborated here for the sake of brevity.

[0125] In one example, the electronic device 800 may also include a communication interface 803 and a bus 810. For example, Figure 8 As shown, the processor 801, memory 802, and communication interface 803 are connected through bus 810 and complete communication with each other.

[0126] The communication interface 803 is mainly used to realize communication between various modules, devices, units and equipment in the embodiments of the present invention.

[0127] Bus 810 includes hardware, software, or both, that couples together components of an electronic device that embeds files in a document. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, a Wireless Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable single buses or combinations of two or more of these. Where appropriate, bus 810 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.

[0128] The electronic device can execute the image encryption region determination method in the embodiments of this application, thereby achieving the combination Figure 1 The method for determining the encrypted region of an image is described.

[0129] Furthermore, in conjunction with the image encryption region determination method in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; these computer program instructions are executed by a processor using any of the image encryption region determination methods in the above embodiments.

[0130] This application also provides a computer program product in which the instructions, when executed by the processor of an electronic device, cause the electronic device to perform various processes implementing any of the above-described methods for determining the image encryption region.

[0131] This application, employing the above technical solutions, provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for determining an image encryption region. By acquiring a first preprocessed image, further acquiring the size of the first preprocessed image and the text length corresponding to the target embedded information, and converting the format of the first preprocessed image to a preset format, a target preprocessed image can be obtained. Based on the correspondence between the text length, the size of the first preprocessed image, and the number of channels, the target number of channels corresponding to the text length and the size of the first preprocessed image is determined. This allows for dynamic selection of the most representative channels, reducing channel inference time. Furthermore, the target preprocessed image can be recognized and processed based on the target number of channels to obtain two-dimensional matrix data matching the target number of channels. This two-dimensional matrix data represents information about the secure region. Therefore, the image encryption region determination method provided by this application is not limited by the size of the first preprocessed image. The target number of channels can be determined based on the size of the first preprocessed image and the text length of the target embedded information, enabling dynamic channel selection, reducing inference time, and effectively determining the corresponding secure region information embedded in the target embedded information based on the target number of channels. Furthermore, embedding target embedding information into the security area information based on the determined security area information can improve the security of image encryption.

[0132] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.

[0133] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable read-only memory (EROM), floppy disks, compact disc read-only memory (CD-ROM), optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0134] It should also be noted that the exemplary embodiments mentioned in this invention describe methods or systems based on a series of steps or apparatus. However, this invention is not limited to the order of the steps described above; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0135] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), electronic devices, and storage media according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to create a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0136] The above description is merely a specific embodiment of the present invention. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the protection scope of the present invention.

Claims

1. A method for determining an image encryption region, characterized in that, The method includes: Obtain the first preprocessed image; Obtain the size of the first preprocessed image and the text length corresponding to the target embedding information; The format of the first preprocessed image is converted to a preset format to obtain the target preprocessed image; Based on the correspondence between the text length, the size of the first preprocessed image, and the number of channels, a target number of channels corresponding to the text length and the size of the first preprocessed image is determined; the target preprocessed image is then processed for recognition based on the target number of channels to obtain two-dimensional matrix data matching the target number of channels, wherein the two-dimensional matrix data represents information about a safe area; The identification process includes: inputting the target channel number into a safe region filtering model, and processing the target preprocessed image through discrete convolution function, continuous convolution function, normalization function and activation function in the model.

2. The method for determining the image encryption region according to claim 1, characterized in that, The step of performing target preprocessing on the target image based on the target number of channels to obtain two-dimensional matrix data matching the target number of channels includes: The target preprocessed image is divided into image regions by pre-defined image units to obtain multiple image units; Based on the target number of channels, the image units are identified to obtain two-dimensional matrix data of image units that match the target number of channels.

3. The method for determining the image encryption region according to claim 2, characterized in that, After dividing the target preprocessed image into image regions using preset image units to obtain multiple image units, and before performing recognition processing on the image units according to the target number of channels to obtain two-dimensional matrix data of image units matching the target number of channels, the method further includes: By performing discrete cosine transform on the image unit, the information of the image unit and the components of the image unit are converted into image data and channels, respectively. The image data is classified into corresponding channels according to frequency to obtain the first channel number corresponding to the type of each component of the image unit.

4. The method for determining the image encryption region according to claim 3, characterized in that, After classifying the image data into corresponding channels according to frequency to obtain the first channel number corresponding to the type of each component of the image unit, the method further includes: Obtain the preset coefficients corresponding to the types of components in the target preprocessed image; The number of second channels is calculated based on the text length, the size of the target preprocessed image, and the preset coefficients corresponding to the component types. The number of second channels corresponding to the first channel number of the component types is counted to obtain the target number of the text length, the size of the first preprocessed image, and the preset coefficients corresponding to the component types.

5. A device for determining an image encryption region, characterized in that, The device includes: The first acquisition module is used to acquire the first preprocessed image; The second acquisition module is used to acquire the size of the first preprocessed image and the text length corresponding to the target embedding information; The conversion module is used to convert the format of the first preprocessed image to a preset format to obtain the target preprocessed image; The determining module is used to determine the target number of channels corresponding to the text length and the size of the first preprocessed image based on the correspondence between the text length, the size of the first preprocessed image, and the number of channels. The recognition module is used to perform recognition processing on the target preprocessed image based on the target number of channels to obtain two-dimensional matrix data that matches the target number of channels, wherein the two-dimensional matrix data is information of the safe area; The identification process includes: inputting the target channel number into a safe region filtering model, and processing the target preprocessed image through discrete convolution function, continuous convolution function, normalization function and activation function in the model.

6. An electronic device, the 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 performs the method for determining the image encryption region as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for determining the image encryption region as described in any one of claims 1 to 4.

8. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device performs the method for determining the image encryption region as described in any one of claims 1 to 4.