Image information anti-counterfeiting encryption method and application thereof in anti-counterfeiting encryption of transparent plastic package
By using grayscale encoding to blur the image information on the transparent plastic bag and generating encryption shares using random functions, the problem of cumbersome image information encryption in existing technologies is solved, achieving simple image information encryption and intuitive decryption effects, thus enhancing the anti-counterfeiting effect of the transparent plastic bag.
Patent Information
- Application Number
- CN202511066234.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-11-28
AI Technical Summary
Existing technologies for encrypting image information on transparent plastic bags are cumbersome and fail to meet the requirements of convenience and practicality. Furthermore, existing anti-counterfeiting technologies are costly, easily copied, and cannot simultaneously achieve the requirements of information security and confidentiality.
By extracting the grayscale encoding matrix of the original image information, blurring processing and generating a random blur matrix using a random function are performed to generate an encryption share matrix. Image encryption is achieved through error diffusion and channel merging. Finally, the encryption shares are printed on both sides of a transparent plastic bag, and decryption is achieved by superimposing them.
It achieves lossless encryption of image information, simplifies the encryption process, enhances resistance to attacks and confidentiality, is compatible with transparent plastic bag printing technology, and improves the stability and durability of encrypted information.
Smart Images

Figure CN121037567A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of printing packaging image anti-counterfeiting technology, and particularly relates to an image information anti-counterfeiting encryption method and application thereof in transparent plastic packaging anti-counterfeiting encryption. BACKGROUND
[0002] In the information age, image information encryption and anti-counterfeiting have become the focus of attention in many fields, especially for the image information printed on various objects, the security and confidentiality requirements are increasing. Transparent plastic bags, as a common packaging material, are widely used in commodity packaging, file bags and many other scenes. However, there are still many deficiencies in the current technology of realizing image information encryption on transparent plastic bags.
[0003] Traditional encryption technology relies on complex mathematical algorithms, which can ensure the security of information to a certain extent, but requires high performance of computing devices. In practical application, especially for the image information printed on plastic bags, the encryption and decryption process is cumbersome, and it is difficult to intuitively show the encryption effect, which is difficult to meet the needs of convenience and practicality.
[0004] Existing printing anti-counterfeiting technologies are diverse, such as holographic anti-counterfeiting, fluorescent anti-counterfeiting, etc. Holographic anti-counterfeiting forms a hologram by recording the amplitude and phase information of the light wave of an object, which has a certain anti-counterfeiting effect, but it is highly dependent on laser equipment, has high production cost, and is easy to be copied by illegal persons using special equipment. Fluorescent anti-counterfeiting uses fluorescent substances to emit light of a specific color under ultraviolet light to distinguish authenticity, but fluorescent substances are easily faded due to factors such as light and time, affecting the durability of the anti-counterfeiting effect, and both of these technologies are difficult to combine with image encryption, and cannot meet the dual needs of information security and anti-counterfeiting. SUMMARY
[0005] In view of the deficiencies of the prior art, the purpose of the present application is to provide an image information anti-counterfeiting encryption method and application thereof in transparent plastic packaging anti-counterfeiting encryption, which realizes lossless encryption of grayscale and color images through specific image encryption technology, ensures that the encrypted image is consistent with the original image size, and the encryption process is simple and the decryption is intuitive, which is suitable for transparent plastic bag printing process.
[0006] In order to achieve the above purpose, the present application adopts the following technical solutions:
[0007] An image information anti-counterfeiting encryption method, comprising the following steps:
[0008] Step 1, extracting the grayscale encoding matrix of the original image information, and respectively performing fuzzy processing on the grayscale encoding matrix of each channel to obtain a fuzzy image information matrix;
[0009] Step 2, a random fuzzy matrix is generated for each channel by using a random function; the random function follows uniform distribution, ensuring that each possible value has equal probability of being selected;
[0010] Step 3, an encrypted share matrix is generated for each channel based on the fuzzy image information matrix and the random fuzzy matrix; the generation process of the encrypted share matrix can be represented by the following formula:
[0011] R2(x,y)=I(x,y)⊙R1(x,y)+(E-I(x,y))⊙(G′(x,y)-R1(x,y))
[0012] Wherein, R1(x,y) represents the random fuzzy matrix, I(x,y) is an indicator matrix, I(i,j)=1 indicates that R1(i,j)>G′(i,j), otherwise I(i,j)=0; I(i,j), G′(i,j) are the values corresponding to the coordinate (i,j) position of the indicator matrix and the fuzzy image information matrix respectively; E is an all-one matrix; ⊙ represents the element-by-element multiplication operation of the matrix;
[0013] Step 4, error diffusion is used for the random fuzzy matrix and the encrypted share matrix of each channel, and the first encrypted share and the second encrypted share are generated by merging the channels; the size of the first encrypted share and the second encrypted share is the same as that of the original image information, without pixel expansion;
[0014] Step 5, the first encrypted share and the second encrypted share are superimposed to obtain the decrypted image C of the approximate target image.
[0015] The application also has the following technical features:
[0016] Preferably, the original image information includes grayscale images and color images;
[0017] The grayscale encoding matrix of the grayscale image is the original image information matrix;
[0018] The extraction process of the grayscale encoding matrix M of the color image is:
[0019] M=[R G B]
[0020] R,G,B=G r (x,y),G g (x,y),G b (x,y)
[0021] G r (x,y),G g (x,y),G b (x,y)=extract_rgb(G(x,y))
[0022] where G r (x,y),G g (x,y),G b (x,y) are the gray-scale encoding matrix of R, G, B channel respectively, G(x,y) is the target color image, extract_rgb() is the function of extracting the gray-scale encoding matrix of color channel, which is expressed as follows in python:
[0023] extract_rgb(G(x,y)) =[:,:,X], X∈{0,1,2}.
[0024] Preferably, the specific operation of the blurring process of the gray-scale encoding matrix of the original image information in step 1 is as follows:
[0025]
[0026] where G(x,y) is the gray-scale encoding matrix of each channel of the original image information, with a size of w x h, and each pixel in G(x,y) has a value ranging from 0 to max(G), where 0 represents white and max(G) represents black. The blurring process maps the range from 0 to max(G) to the range from 0 to 1.
[0027] G'(x,y) is the blurred image information matrix, (x,y) is the pixel position coordinate, and max(G) is the maximum pixel value that the image can take.
[0028] Preferably, the value range of the random value in the process of generating the random blur matrix in step 2 is between 0 and 1. For each pixel value R1(i,j), it is generated as follows:
[0029] R1(i,j) = random_pixel(0,1)
[0030] where random_pixel() is a function that generates random values, and (0,1) is the value range of the random value.
[0031] Preferably, the generation process of the encrypted share matrix R2(x,y) in step 3 includes:
[0032] Step (1), initialize the matrix R2(x,y) to have the same size as the original image information;
[0033] Step (2), iterate through each pixel value R2(i,j) of each pixel point, 1≤i≤w, 1≤j≤h.
[0034] Step (3), process each pixel as follows:
[0035]
[0036] wherein R1(i,j) represents the pixel value corresponding to the random blur matrix at coordinate (i,j), and G'(i,j) represents the pixel value corresponding to the blurred image information matrix at coordinate (i,j).
[0037] Preferably, the error diffusion specific process in step 4 is as follows:
[0038]
[0039] E(i,j) = I(i,j) - B(i,j)
[0040]
[0041] wherein (i,j) is the error diffusion center pixel coordinate, (i+k,j+l) is the neighborhood coordinate involved in error diffusion, I is the image to be processed, Ω is the neighborhood range of error diffusion, w k,l is the weight assigned to I(i+k,j+l), which needs to satisfy ∑w k,l = 1; Threshold is the error diffusion threshold, which ranges from 0.2 to 0.8;
[0042] The specific process of channel merging in step 4 is as follows:
[0043]
[0044] wherein merge(x,y) is the process of merging R, G, and B channels to generate a color image, which is represented in python as:
[0045] merge(x,y) = cv2.merge([ID b (i,j), ID g (i,j), ID r (i,j)]).
[0046] Preferably, the method of superimposing the first encrypted share and the second encrypted share in step 5 includes superimposing through a fuzzy OR algorithm or printing the first encrypted share and the second encrypted share on the two sides of a transparent plastic bag respectively and manually superimposing.
[0047] Further, the calculation process of the fuzzy OR algorithm superimposition is as follows:
[0048]
[0049] wherein R'1 is the first encrypted share and R'2 is the second encrypted share. which can be represented as:
[0050]
[0051] The application also protects the application of the image information anti-counterfeiting encryption method as described above in the anti-counterfeiting encryption of transparent plastic packaging.
[0052] Preferably, the printing method of the image information for anti-counterfeiting encryption on the transparent plastic packaging comprises the following steps:
[0053] Step one, transforming the first encryption share and the second encryption share from the RGB image to the CMYK image, and setting the opacity as (0-0.8);
[0054] Calculating the C, M, Y, K components of the CMYK image to obtain the C, M, Y, K color separation images, and the calculation formula is as follows:
[0055] d min =min(I r (x,y),I g (x,y),I b (x,y))
[0056] e max =max(I r (x,y),I g (x,y),I b (x,y))
[0057]
[0058] C=I r (x,y)-K
[0059] M=I g (x,y)-K
[0060] Y=I b (x,y)-K
[0061] Wherein, d min is the minimum value in the normalized RGB value, e max is the maximum value in the normalized RGB value, C, M, Y, K are respectively the cyan, magenta, yellow, black color separation image matrix, and c is the adjustment coefficient; I r (x,y), I g (x,y), I b (x,y) respectively represent the gray information matrix of the R, G, B three channels of the RGB image;
[0062] Step two, sequentially halftone processing the C, M, Y, K color separation images obtained in step one, and printing the halftone-processed color separation of the first encryption share and the second encryption share on the corresponding positions of the inner and outer sides of the plastic bag by the intaglio printing method.
[0063] Compared with the prior art, the present application has the following technical effects:
[0064] The present application firstly carries out channel separation and fuzzing processing on the original information to obtain encrypted target information, then generates a random gray / color encryption share by using a random function, calculates another encryption share based on the pixel distribution law of the target information and the random share, and finally prints the two encryption shares on the two sides of a transparent plastic bag respectively to realize decryption by superposition. The scheme combines digital image processing technology and printing anti-counterfeiting technology, retains the core information of the original image, enhances the attack resistance and confidentiality, and is intuitive in decryption and does not require complex equipment. At the same time, the physical properties of the transparent plastic bag are used to protect the encrypted information, improve the stability and durability of the encrypted information, expand the application field, and be suitable for anti-counterfeiting identification, image encryption and information hiding scenes, and effectively improve the security and practicability of image information encryption on the transparent plastic bag. BRIEF DESCRIPTION OF DRAWINGS
[0065] Figure 1 (a) the first encryption share matrix and (b) the second encryption share matrix of Example 1;
[0066] Figure 2 the decrypted image C obtained in Example 2;
[0067] Figure 3 the application schematic diagram printed on the transparent plastic bag of Example 3, (a) is an unfolded plastic bag, and (b) is the effect after superposition. DETAILED DESCRIPTION
[0068] The specific content of the present application is further explained and described in detail in combination with the following examples.
[0069] The present application provides an image information anti-counterfeiting encryption method, comprising the following steps:
[0070] Step 1, extracting the gray scale encoding matrix of the original image information, and respectively performing fuzzing processing on the gray scale encoding matrix of each channel to obtain a fuzzy image information matrix;
[0071] The original image information includes gray scale images and color images, and the format is JPG, PNG or TIFF;
[0072] The original image information includes gray scale images and color images;
[0073] The gray scale encoding matrix of the gray scale image is the original image information matrix;
[0074] The extraction process of the gray scale encoding matrix M of the color image is:
[0075] M = [R G B]
[0076] R,G,B = G r (x,y),G g (x,y),G b (x,y)
[0077] G r (x,y),G g (x,y),G b (x,y) = extract_rgb(G(x,y))
[0078] where G r (x,y),G g (x,y),G b (x,y) are the gray-scale encoding matrix of R, G, B channel respectively, G(x,y) is the target color image, and extract_rgb() is a function for extracting the gray-scale encoding matrix of color channel, which is expressed as follows in python:
[0079] extract_rgb(G(x,y)) =[:,:,X], X∈{0,1,2}.
[0080] The specific operation of fuzzy processing on the gray-scale encoding matrix of the original image information is as follows:
[0081]
[0082] where G(x,y) is the gray-scale encoding matrix of the original image information, with a size of w×h, and each pixel in G(x,y) has a value range of 0~max(G), where 0 represents white and max(G) represents black. Through fuzzy processing, the range is mapped from 0~max(G) to 0~1.
[0083] G'(x,y) is the fuzzy image information matrix, (x,y) is the pixel position coordinate, and max(G) is the maximum pixel value that the image G can take.
[0084] Step 2, for each channel, a random fuzzy matrix is generated using a random function; the random function follows a uniform distribution, ensuring that each possible value has an equal probability of being selected; the generated random fuzzy matrix has a value range of 0~1; for each pixel value R1(i,j), it is generated in the following way:
[0085] R1(i,j) = random_pixel(0,1) random_pixel() is a function of generating random value, (0,1) is the value range of the random value. The generated encrypted share R1 is in the format of JPG or PNG, the resolution is 300-2540 dpi, and the size is the same as the original image information size without pixel expansion.
[0086] Step 3, based on each channel blurred image information matrix and random blur matrix, an encrypted share matrix is generated respectively. The generation process of the encrypted share matrix can be represented by the following formula:
[0087] R2(x,y) = I(x,y) O R1(x,y) + (E-I(x,y)) O (G'(x,y)-R1(x,y))
[0088] Wherein, R1(x,y) represents a random blur matrix, I(x,y) is an indicator matrix, I(i,j) = 1 represents R1(i,j) > G'(i,j), otherwise I(i,j) = 0; I(i,j) and G'(i,j) are respectively the values corresponding to the coordinate (i,j) position of the indicator matrix and the processed image information matrix; E is an all-1 matrix; O represents the element-by-element multiplication operation of the matrix;
[0089] The generation process of the encrypted share matrix R2(x,y) specifically includes:
[0090] Step (1), initialize the matrix R2(x,y) to have the same size as the original image information;
[0091] Step (2), iterate through the pixel value R2(i,j) of each pixel point, 1≤i≤w, 1≤j≤h;
[0092] Step (3), for each pixel, the following processing is performed:
[0093]
[0094] Wherein R1(i,j) represents the pixel value corresponding to the coordinate (i,j) position of the random blur matrix, and G'(i,j) represents the pixel value corresponding to the coordinate (i,j) position of the blurred image information matrix.
[0095] The generated encrypted share R2 is in the format of JPG or PNG, the resolution is 300-2540 dpi, and the size is the same as the original image information size without pixel expansion.
[0096] Step 4, error diffusion is used on the random blur matrix and the encrypted share matrix of each channel, and the first encrypted share and the second encrypted share are generated through channel merging; the size of the first encrypted share and the second encrypted share is the same as the size of the original image information, without pixel expansion; the specific process of error diffusion is as follows:
[0097]
[0098] E(i,j) = I(i,j) - B(i,j)
[0099]
[0100] where (i,j) is the error diffusion center pixel coordinate, (i+k,j+l) is the neighborhood coordinate involved in error diffusion, I is the image to be processed, Ω is the neighborhood range of error diffusion, w k,l is the weight assigned to I(i+k,j+l), which needs to satisfy ∑w k,l = 1; Threshold is the error diffusion threshold, which ranges from 0.2 to 0.8;
[0101] The specific process of channel merging is as follows:
[0102]
[0103] where merge(x,y) is the process of merging R, G, and B channels to generate a color image,
[0104] Taking Python as an example, the specific process is as follows:
[0105] merge(x,y) = cv2.merge([G r (x,y), G g (x,y), G b (x,y)]).
[0106] Step 5, the first encrypted share and the second encrypted share are superimposed to obtain the decrypted image C of the approximate target image. The superimposition method of the first encrypted share and the second encrypted share includes superimposition through the blur OR algorithm or printing the first encrypted share and the second encrypted share on the two sides of a transparent plastic bag respectively and manually superimposing.
[0107] The calculation process of the blur OR algorithm superimposition is as follows:
[0108]
[0109] where R'1 is the first encrypted share and R'2 is the second encrypted share;
[0110] which can be represented as:
[0111]
[0112] The application also provides application of the image information anti-counterfeiting encryption method in transparent plastic package anti-counterfeiting encryption, and a printing method of the image information for anti-counterfeiting encryption on the transparent plastic package, which comprises the following steps:
[0113] Step one, transforming the first encrypted share and the second encrypted matrix from the RGB image into the CMYK image, and setting the opacity as (0-0.8);
[0114] calculating the C, M, Y, K component of the CMYK image to obtain the C, M, Y, K color separation image, and the calculation formula is as follows:
[0115] d min =min(I r (x,y),I g (x,y),I b (x,y))
[0116] e max =max(I r (x,y),I g (x,y),I b (x,y))
[0117]
[0118] C=I r (x,y)-K
[0119] M=I g (x,y)-K
[0120] Y=I b (x,y)-K
[0121] wherein, d min is the minimum value in the normalized RGB value, e max is the maximum value in the normalized RGB value, C, M, Y, K are respectively the cyan color, magenta color, yellow color, black color separation image matrix, and c is an adjustment coefficient; I r (x,y), I g (x,y), I b (x,y) respectively represent the gray information matrix of the R, G, B three channels of the RGB image;
[0122] Step two, the C, M, Y, K color plate images obtained in step one are halftone processed in turn, and the halftone processed first and second encrypted shares and the color plates are printed on the inner and outer sides of the plastic bag respectively by means of intaglio printing; the first and second encrypted shares have the same screening line number, the screening line number is 150-175L / inch, and the screening angles of the C, M, Y, K color plates are 15°, 75°, 0° and 45° respectively.
[0123] Example 1
[0124] Taking house as an example, the size is 600 pixels x 600 pixels, the resolution is 960 dpi, and the format is PNG, and encryption and decryption are performed.
[0125] Step 1, the gray scale coding matrix of the original image information G is blurred to obtain a blurred image information matrix G', and the pixel value of the gray scale coding matrix is blurred to map the range from 0 to 255 to 0 to 1.
[0126] Wherein, the size of the original image information G is 529 pixels x 476 pixels. Each pixel in G has a value range of 0 to 255, where 0 represents white and 255 represents black. The size of the blurred image information matrix G' is the same as that of the original image information matrix, and the value in it can reflect the relative brightness of the original pixel.
[0127] Step 2, a random blur matrix R1 is generated using a random function, and the value of each element of the random blur matrix R1 is in the range of 0 to 1. The function for generating random values follows a uniform distribution, ensuring that each possible value has an equal probability of being selected, and the generated R1 is processed using error diffusion with a threshold of 0.5. The generated encrypted share R1 is in PNG format, with a resolution of 960 dpi, and the size is the same as that of the original image information, without pixel expansion.
[0128] Step 3, R2 is generated based on R1 and G', as shown in (a) and (b), another encrypted share R2 is generated according to certain rules using the generated encrypted share R1 and the blurred image information matrix G', and error diffusion with a threshold of 0.5 is used to make the generated R2 unable to directly reveal the original image information content. The generated encrypted share R2 is in PNG format, with a resolution of 960 dpi, and the size is the same as that of the original image information, without pixel expansion. Figure 1 Step 4, the encrypted shares R1 and R2 are directly superimposed by fuzzy OR algorithm to obtain the decrypted image C of the approximate target image.
[0129] Example 2
[0130]
[0131] Take pencil as an example, the size is 1536 pixels x 1536 pixels, the resolution is 1100 dpi, the format is JPG, and encryption and decryption are performed.
[0132] Preprocessing, extracting the original image information R, G, B three channel gray value matrix.
[0133] Step 1, the R channel of the original image information is blurred to obtain the blurred image information matrix G'. The gray code matrix pixel value is blurred, which is mapped from 0-255 to 0-1.
[0134] Among them, the size of the original image information G is 364 pixels x 330 pixels, and the value of each pixel in G ranges from 0 to 255, where 0 represents white and 255 represents black. The size of the blurred image information matrix G' is the same as that of the original image information matrix, and the value in it can reflect the relative brightness of the original image pixel.
[0135] Step 2, generate encrypted share RR1. Use a random function to generate a random matrix, and the value of the element ranges from 0 to 1. The function of generating random values follows a uniform distribution, which ensures that each possible value has an equal probability of being selected, and the generated RR1 is processed by error diffusion with a threshold of 0.5. The generated encrypted share RR1 is in JPG format and has the same size as the original image information, without pixel expansion.
[0136] Step 3, generate RR2 based on RR1 and G'. Use the generated encrypted share R1 and the blurred image information image G' to generate another encrypted share RR2 according to certain rules, and use error diffusion with a threshold of 0.5 to make the generated RR2 unable to directly reveal the original image information content.
[0137] Step 4, execute steps 1-3 on the G channel of the original image information to generate encrypted shares GR1 and GR2.
[0138] Step 5, execute steps 1-3 on the B channel of the original image information to generate encrypted shares BR1 and BR2.
[0139] Step 6, combine RR1, GR1, BR1; RR2, GR2, BR2 through channels to generate color image encrypted encrypted shares R'1 and R'2,
[0140] Step 7, superimpose the encrypted shares R'1 and R'2 directly through the fuzzy OR algorithm to obtain the decrypted image C of the approximate target image, as shown in Figure 2 The generated encrypted shares R'1 and R'2 are in JPG format, with a resolution of 1100 dpi, and have the same size as the original image information, without pixel expansion.
[0141] Example 3
[0142] Take okimg as an example, the size is 636 pixels x 631 pixels, the resolution is 1440 dpi, the format is JPG, and encryption and decryption are performed.
[0143] Preprocessing, extracting the original image information R, G, B three channel gray value matrix.
[0144] Step 1, the R channel of the original image information is blurred to obtain the blurred image information matrix G'. The gray code matrix pixel value is blurred, which is mapped from 0~255 to 0~1.
[0145] Among them, the size of the original image information G is 636 pixels x 631 pixels. Each pixel in G has a value range of 0~255, where 0 represents white and 255 represents black. The size of the blurred image information matrix G' is the same as that of the original image information matrix, and the value in it can reflect the relative brightness of the original image pixel.
[0146] Step 2, generate encrypted share RR1: generate a random matrix using a random function, and the value of the element is in the range of 0~1. And the function of generating random values follows uniform distribution, which ensures that each possible value has equal probability of being selected, and the generated RR1 is processed by error diffusion with a threshold of 0.5. The generated encrypted share RR1 is in JPG format, and the size is the same as that of the original image information, without pixel expansion.
[0147] Step 3, generate RR2 based on RR1 and G': generate another encrypted share RR2 according to certain rules using the generated encrypted share R1 and the blurred image information matrix G', and use error diffusion with a threshold of 0.5 to make the generated RR2 cannot directly reveal the original image information content.
[0148] Step 4, execute steps 1~3 on the G channel of the original image information to generate encrypted shares GR1 and GR2.
[0149] Step 5, execute steps 1~3 on the B channel of the original image information to generate encrypted shares BR1 and BR2.
[0150] Step 6, combine RR1, GR1, BR1; RR2, GR2, BR2 through channels to generate color image encrypted encrypted shares R'1 and R'2.
[0151] Step 7, print the encrypted shares R'1 and R'2 on both sides of the transparent plastic bag respectively, and the image opacity is 0.5, such as Figure 3As shown, the plastic bag material is PVC, the adjustment coefficient is selected as 15, the obtained C, M, Y and K color separation images are halftone processed in sequence, and the color separation of the halftone processed R'1 and R'2 is printed on the corresponding positions of the upper and lower layers of the plastic bag by means of intaglio printing. In the intaglio printing process, the screen ruling number of R'1 and R'2 is the same, the screen ruling number is 175L / inch, and the screen angles of C, M, Y and K color separations are 15°, 75°, 0° and 45° respectively. Finally, the C, M, Y and K inks are used to print the corresponding positions on the two sides of the inside of the transparent plastic package, and the encrypted shares R'1 and R'2 are formed by superimposition, and the size is the same as the size of the original image information, without pixel expansion.
[0152] Step 8, by moving the relative position of the encrypted shares, they are overlapped, and the decrypted information C similar to the original information is displayed by superposition.
Claims
1. A method for anti-counterfeiting and encryption of image information, characterized in that, Includes the following steps: Step 1: Extract the grayscale encoding matrix of the original image information, and blur the grayscale encoding matrix of each channel to obtain the blurred image information matrix. Step 2: Generate a random fuzzy matrix for each channel using a random function; the random function follows a uniform distribution to ensure that each possible value has an equal probability of being selected. Step 3: Generate an encrypted share matrix based on the blurred image information matrix and the random blur matrix of each channel. The generation process of the encrypted share matrix can be expressed by the following formula: R2(x,y)=I(x,y)⊙R1(x,y)+(E-I(x,y))⊙(G ′ (x,y)-R1(x,y)) Where R1(x,y) represents the random fuzzy matrix, I(x,y) is the indicator matrix, and I(i,j)=1 indicates that R1(i,j)>G ′ (i,j), otherwise I(i,j)=0; I(i,j) and G′(i,j) are the values corresponding to the coordinates (i,j) of the indicator matrix and the blurred image information matrix, respectively; E is a matrix of all 1s; ⊙ represents the element-wise multiplication operation of the matrix; Step 4: Apply error diffusion to the random blur matrix and encryption share matrix of each channel, and generate the first encryption share and the second encryption share via channel merging; the size of the first encryption share and the second encryption share is the same as the size of the original image information, without pixel expansion; Step 5: Superimpose the first encrypted share and the second encrypted share to obtain the decrypted image C, which approximates the target image.
2. The image information anti-counterfeiting encryption method as described in claim 1, characterized in that, The original image information includes grayscale images and color images; The grayscale encoding matrix of the grayscale image is the original image information matrix; The extraction process of the grayscale encoding matrix M of the color image is as follows: M = [RGB] R,G,B=G r (x,y),G g (x,y),G b (x,y) G r (x,y),G g (x,y),G b (x,y)=extract_rgb(G(x,y)) Among them, G r (x,y),G g (x,y),G b (x,y) are the grayscale encoding matrices for the R, G, and B channels, respectively, where G(x,y) is the target color image, and extract_rgb() is the function to extract the grayscale encoding matrices for the color channels. In Python, this is represented as: extract_rgb(G(x,y))=[:,:,X],X∈{0,1,2}.
3. The image information anti-counterfeiting encryption method as described in claim 1, characterized in that, The specific steps for blurring the grayscale encoding matrix of the original image information described in step 1 are as follows: Wherein, G(x,y) is the grayscale encoding matrix of each channel of the original image information, with a size of w×h. The value range of each pixel in G(x,y) is 0 to max(G), where 0 represents white and max(G) represents black. Through blurring, its range is mapped from 0 to max(G) to 0 to 1. G ′ (x,y) is the blurred image information matrix, (x,y) is the pixel position coordinate, and max(G) is the maximum pixel value that the image can take.
4. The image information anti-counterfeiting encryption method as described in claim 1, characterized in that, In step 2, the random values in the process of generating the random fuzzy matrix range from 0 to 1; for each pixel value R1(i,j), the generation method is as follows: R1(i,j)=random_pixel(0,1) The function `random_pixel()` generates random values, and (0,1) represents the range of random values.
5. The image information anti-counterfeiting encryption method as described in claim 1, characterized in that, The process of generating the encrypted share matrix R2(x,y) in step 3 specifically includes: Step (1): Initialize matrix R2(x,y) to have the same size as the original image information. Step (2): Iterate through the pixel value R2(i,j) of each pixel, 1≤i≤w, 1≤j≤h. Step (3) involves processing each pixel as follows: Where R1(i,j) represents the pixel value corresponding to the random fuzzy matrix at coordinate (i,j), and G ′ (i,j) represents the pixel value corresponding to the coordinate (i,j) position of the blurred image information matrix.
6. The image information anti-counterfeiting encryption method as described in claim 1, characterized in that, The specific process of error propagation described in step 4 is as follows: E(i,j)=I(i,j)-B(i,j) Where (i,j) are the pixel coordinates of the error diffusion center, (i+k,j+l) are the coordinates of the neighborhood involved in the error diffusion, I is the image to be processed, Ω is the neighborhood range of the error diffusion, and w k,l The weights assigned to I(i+k,j+l) must satisfy ∑w k,l =1; Threshold is the error propagation threshold, which ranges from 0.2 to 0.
8. The specific process of channel merging described in step 4 is as follows: Here, merge(x,y) represents the process of merging the R, G, and B channels to generate a color image, which is expressed in Python as: merge(x,y)=cv2.merge([ID b (i,j),ID g (i,j),ID r (i,j)])。 7. The image information anti-counterfeiting encryption method as described in claim 1, characterized in that, The method for superimposing the first encrypted share and the second encrypted share as described in step 5 includes superimposing them using a fuzzy OR algorithm or manually superimposing them by printing the first encrypted share and the second encrypted share on both sides of a transparent plastic bag.
8. The image information anti-counterfeiting encryption method as described in claim 7, characterized in that, The calculation process of the superposition of the fuzzy OR algorithm is as follows: Wherein, R′1 is the first encrypted share, and R′2 is the second encrypted share; It can be represented as:
9. The application of an image information anti-counterfeiting encryption method as described in any one of claims 1 to 8 in the anti-counterfeiting encryption of transparent plastic packaging.
10. The application of the image information anti-counterfeiting encryption method as described in claim 9 in the anti-counterfeiting encryption of transparent plastic packaging, characterized in that, The method for printing image information for anti-counterfeiting encryption on transparent plastic packaging includes the following steps: Step 1: Convert the first and second encrypted shares from RGB images to CMYK images, and set the opacity to (0~0.8); The C, M, Y, and K components of the CMYK image are calculated to obtain the C, M, Y, and K color plate image. The calculation formula is as follows: d min =min(I r (x,y),I g (x,y),I b (x,y)) e max =max(I r (x,y),I g (x,y),I b (x,y)) C=I r (x,y)-K M=I g (x,y)-K Y=I b (x,y)-K Where, d min It is the minimum value among the normalized RGB values, e max It is the maximum value in the normalized RGB values, C, M, Y, and K are the cyan, magenta, yellow, and black color plate image matrices respectively, and c is the adjustment coefficient; I r (x,y),I g (x,y),I b (x,y) represent the grayscale information matrices of the R, G, and B channels of the RGB image, respectively; Step 2: Perform halftone processing on the C, M, Y, and K color plates obtained in Step 1. Then, print the first and second encrypted color plates after halftone processing on the corresponding positions on the inside and outside of the plastic bag using gravure printing.