Method and system for generating scannable image fused with binary digital coding

By combining QR Code encoding rules and data encoding matrix generated by multiple mask methods, combined with preset masks and image fusion algorithms, the problem of monotonous visual effects of QR codes is solved, and a scanned QR code with visual effects is generated. Broaden its scope of application.

CN119047505APending Publication Date: 2024-11-29HUAZHONG AGRI UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411087153.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

The black and white appearance of existing QR codes is difficult to meet the visual design effect, affecting its application and promotion in commercial advertising and other fields, and it is difficult for users to connect the visual appearance of QR codes with the information they carry.

Method used

Using a scanable image generation method with fusion binary digital encoding, the target string is analyzed through QR Code encoding rules, and a data encoding matrix is ​​generated using multiple mask methods. The preset mask and image fusion algorithm are combined to generate visual effects. Scan the QR code image.

Benefits of technology

On the premise of ensuring the robustness of the scanning, the generated QR code images have better visual effects, broaden their scope of application, meet graphic design needs, and improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119047505A_ABST
    Figure CN119047505A_ABST
Patent Text Reader

Abstract

The invention discloses a binary digital coding fused scannable image generation method and system, and the method comprises the steps: obtaining a target character string, and carrying out the analysis and coding of the target character string based on a QR Code coding rule, and obtaining an original array; performing mask operation on the original array by using a plurality of mask modes to obtain a plurality of mask matrixes; adopting at most one preset mask to superpose any one mask matrix to obtain a data coding matrix, and obtaining an original image based on the data coding matrix; obtaining a to-be-fused image and preprocessing the image; and fusing the original image and the preprocessed to-be-fused image based on a preset image fusion method to generate a scannable two-dimensional code image. The two-dimensional code generated by the method can be compatible with the QR Code coding standard, so that the image has a more excellent visual effect on the premise of ensuring that the image has certain scanning robustness, and the application range of the two-dimensional code is widened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of two-dimensional code visual effect optimization, and in particular to a method and system for generating a scannable image integrating binary digital coding. Background Art

[0002] With the popularity of products such as smartphones and smart bracelets, the optical cameras of mobile devices can easily scan and identify scannable images on the display or printed on the surface of objects. Scannable images represented by QR codes have been widely used in life. QR codes use a square array composed of black and white squares to record information. The two-color squares represent logical "0" and "1" respectively. Users use scanning devices to detect and identify image areas, and the decoding program further decodes to obtain the original information contained in the image. This type of black and white QR code has been successfully used in life scenarios such as shared bicycles, restaurant ordering, university classroom sign-in, and graphic advertising design.

[0003] In daily life, the most common QR Code is the QR Code, which can be recognized and decoded by common mobile phone apps on the market. It is often used in commercial advertisements, small program links, personal business cards and other scenarios. However, QR Code was not originally designed for commercial advertising and smartphone scanning. When designing QR Code, more consideration was given to the robustness of the scanned copy rather than the aesthetics. Therefore, its black and white appearance characteristics will affect the visual effect of the actual scene, especially in scenes with high requirements for visual effects such as commercial advertisements and paper business cards. At the same time, it is difficult for users to associate the visual appearance of the black and white QR code with the information it carries. These two shortcomings cause inconvenience to the application and promotion of QR Code in fields such as commercial advertising, and will also affect the overall visual effect of the environment surrounding the QR code.

[0004] Therefore, it is necessary to propose a scannable image generation method and system that integrates binary digital coding, which can make the two-dimensional code image have a more outstanding visual effect while ensuring the scanning robustness of the image, so as to meet the needs of graphic design and broaden the scope of application of the two-dimensional code. Summary of the invention

[0005] In view of this, the present invention provides a scannable image generation method and system integrating binary digital coding, so as to solve the technical problem that the monotonous black and white appearance of the current QR Code two-dimensional code image is difficult to meet the visual design effect, and cannot meet the common application scenarios under the premise of ensuring scanning robustness, resulting in the application scope of the two-dimensional code being limited.

[0006] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:

[0007] In a first aspect, the present invention provides a method for generating a scannable image integrating binary digital coding, comprising:

[0008] Obtain a target string, analyze and encode the target string based on QR Code encoding rules, and obtain an original array;

[0009] Using a plurality of QR Code masking methods to perform masking operations on the original array respectively to obtain a plurality of mask matrices;

[0010] Using at most one preset mask, superimposing any one of the plurality of mask matrices to obtain a data coding matrix, and obtaining an original image based on the data coding matrix;

[0011] Acquire the image to be fused, and preprocess the image to be fused;

[0012] The original image is fused with the preprocessed image to be fused based on a preset image fusion method to generate a scannable two-dimensional code image.

[0013] Furthermore, the method further comprises:

[0014] When the preset mask is not used to superimpose the mask matrix, the image to be fused is directly acquired, and the image to be fused is adaptively binarized to obtain a grayscale image to be fused;

[0015] Convert each of the mask matrices into a corresponding binary grayscale image to obtain a plurality of reference images;

[0016] SSIM structural similarity matching is performed on each of the reference images and the grayscale image to be fused, and the mask matrix corresponding to the reference image with the highest matching degree is used as the data encoding matrix.

[0017] Furthermore, the image to be fused is subjected to adaptive binarization processing, including:

[0018] The brightness mean of all pixels of the image to be fused is calculated, and the brightness mean is used as a threshold to perform grayscale binarization processing on the image to be fused.

[0019] Furthermore, obtaining the original image based on the data encoding matrix includes:

[0020] Expanding the data encoding matrix, and saving the expanded matrix as a binary grayscale image;

[0021] Convert the color depth of the binary grayscale image into RGB mode to obtain an RGB image;

[0022] Perform image transformation processing on the RGB image to obtain an original image.

[0023] Furthermore, the preset masks include diamond masks, Chinese knot masks and square ring masks;

[0024] Performing image transformation processing on the RGB image to obtain the original image includes:

[0025] When the diamond mask is selected, the RGB image is rotated 135° counterclockwise along the geometric center and the missing part is filled with pure white pixels to obtain the original image;

[0026] When the Chinese knot mask is selected, the RGB image is rotated 45° clockwise along the geometric center and the missing part is filled with pure white pixels to obtain the original image;

[0027] When the square ring mask is selected or the template is not selected, the RGB image is directly saved as the original image.

[0028] Furthermore, the preset image fusion method is image saturation addition or image mixing addition.

[0029] Furthermore, the original image is fused with the preprocessed image to be fused by using image saturation addition, including:

[0030] Add the color channels of any pixel on the original image and the corresponding pixel on the image to be fused respectively. If the value of any color channel after addition is greater than 255, set the value of the color channel to 255 to obtain a fused scannable image.

[0031] Furthermore, the original image is fused with the preprocessed image to be fused based on image mixing addition, including:

[0032] Set the image fusion weights α and β, where α = β-1;

[0033] After multiplying the pixel points in each color channel of the original image by the weight α, the pixels are added to the corresponding pixel points in the image to be fused multiplied by the weight β to obtain a preliminary fused image;

[0034] The image brightness of the preliminary fused image is adjusted based on the correction value γ to obtain a fused scannable image.

[0035] Furthermore, the image to be fused is preprocessed, including:

[0036] The image shape is cropped into a square based on the geometric center area of ​​the image to be fused.

[0037] On the other hand, the present invention also provides a system for generating a scannable image integrating binary digital coding, comprising:

[0038] A string acquisition module is used to acquire a target string, analyze and encode the target string based on the QR Code encoding rule, and obtain an original array;

[0039] A masking module, used to perform masking operations on the original array using a plurality of QR Code masking methods to obtain a plurality of mask matrices;

[0040] An encoding module, used to superimpose any one of the plurality of mask matrices using at most one preset mask to obtain a data encoding matrix, and obtain an original image based on the data encoding matrix;

[0041] An image acquisition module, used for acquiring the image to be fused and preprocessing the image to be fused;

[0042] The fusion module is used to fuse the original image with the preprocessed image to be fused based on a preset image fusion method to generate a scannable two-dimensional code image.

[0043] Compared with the prior art, the method for generating a scannable image integrating binary digital coding provided by the present invention first converts the target string into an original data array through the QR Code coding specification to ensure that the data format meets the standard and improves the reliability and scanning success rate of the generated two-dimensional code. Secondly, a variety of QR Code mask operations are adopted to increase the error correction capability and visual quality of the two-dimensional code to cope with environmental interference under different scanning conditions. Then, a data coding matrix is ​​generated, and combined with a preset mask mode, the two-dimensional code is ensured to maintain consistency and standardization under different circumstances, while retaining sufficient information capacity and recognition capabilities. The image to be fused is preprocessed, including color adjustment and size matching, to ensure seamless fusion with the two-dimensional code and avoid visual incoordination or distortion after fusion. Finally, the two-dimensional code image and the preprocessed image to be fused are synthesized using a preset image fusion algorithm to generate an overall beautiful and scannable image. The method of the present invention can meet the generation speed requirements under the preset application scenario, and the generated two-dimensional code has obvious advantages in visual effects, and the optimal visual effect can be achieved by matching different encoding modes for strings of different lengths. The generated two-dimensional code has certain anti-fouling and ease of use in terms of scanning robustness, which can meet daily use needs. It not only ensures the functionality and stability of the QR code, but also improves the visual effect and user experience of the overall image. It has strong practicality and is suitable for large-scale promotion and application. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A schematic flow chart of a method for generating a scannable image integrating binary digital coding provided by the present invention;

[0045] Figure 2A schematic flow chart of another embodiment of the method for generating a scannable image integrating binary digital coding provided by the present invention;

[0046] Figure 3 A schematic diagram of an embodiment of a diamond mask provided by the present invention;

[0047] Figure 4 A schematic diagram of an embodiment of a Chinese knot mask provided by the present invention;

[0048] Figure 5 A schematic diagram of an embodiment of a square ring mask provided by the present invention;

[0049] Figure 6 A schematic diagram of the processing process of image saturation addition provided by the present invention;

[0050] Figure 7 A schematic diagram of the image mixing and addition processing process provided by the present invention;

[0051] Figure 8 A schematic diagram of the structure of a scannable image generation system integrating binary digital coding provided by the present invention. DETAILED DESCRIPTION

[0052] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0053] The present invention provides a method and system for generating a scannable image integrating binary digital coding, which are described below respectively.

[0054] Combination Figure 1 As shown, a specific embodiment of the present invention discloses a method for generating a scannable image integrating binary digital coding, comprising:

[0055] Step S101: obtaining a target character string, analyzing and encoding the target character string based on QR Code encoding rules, and obtaining an original array;

[0056] Step S102: performing mask operations on the original array using a plurality of QR Code masking methods respectively to obtain a plurality of mask matrices;

[0057] Step S103: using at most one preset mask to superimpose any one of the plurality of mask matrices to obtain a data coding matrix, and obtaining an original image based on the data coding matrix;

[0058] Step S104: obtaining the image to be fused, and preprocessing the image to be fused;

[0059] Step S105: Based on a preset image fusion method, the original image is fused with the preprocessed image to be fused to generate a scannable two-dimensional code image.

[0060] The method of this embodiment, first, converts the target string into an array of raw data through the QR Code encoding specification, ensures that the data format meets the standard, and improves the reliability and scanning success rate of the generated two-dimensional code. Secondly, a variety of QR Code mask operations are used to increase the error correction capability and visual quality of the two-dimensional code to cope with environmental interference under different scanning conditions. Then, a data encoding matrix is ​​generated, combined with a preset mask mode, to ensure that the two-dimensional code maintains consistency and standardization under different circumstances, while retaining sufficient information capacity and recognition capabilities. The image to be fused is preprocessed, including color adjustment and size matching, to ensure seamless fusion with the two-dimensional code, and avoid visual inconsistency or distortion after fusion. Finally, the two-dimensional code image and the preprocessed image to be fused are synthesized using a preset image fusion algorithm to generate an overall beautiful and scannable image. The method of this embodiment can meet the generation speed requirements under the preset application scenario, and the generated two-dimensional code has obvious advantages in visual effects, and the optimal visual effect can be achieved by matching different encoding modes for strings of different lengths. The generated two-dimensional code has certain anti-fouling and ease of use in terms of scanning robustness, which can meet daily use needs.

[0061] As a preferred embodiment, in step S103, when the preset mask is not used to superimpose the mask matrix, the image to be fused is directly acquired, and the image to be fused is adaptively binarized to obtain a grayscale image to be fused;

[0062] Convert each of the mask matrices into a corresponding binary grayscale image to obtain a plurality of reference images;

[0063] SSIM structural similarity matching is performed on each of the reference images and the grayscale image to be fused, and the mask matrix corresponding to the reference image with the highest matching degree is used as the data encoding matrix.

[0064] It should be noted here that SSIM (Structural Similarity Index) is an index used to measure the similarity between two images. It takes into account the differences in brightness, contrast and structure of the image, rather than just the difference in pixel values. Using SSIM structural similarity matching, the quality difference between images or the effect of image restoration can be accurately compared.

[0065] As a preferred embodiment, the image to be fused is subjected to adaptive binarization processing, including:

[0066] The brightness mean of all pixels of the image to be fused is calculated, and the brightness mean is used as a threshold to perform grayscale binarization processing on the image to be fused.

[0067] As a preferred embodiment, obtaining the original image based on the data encoding matrix includes:

[0068] Expanding the data encoding matrix, and saving the expanded matrix as a binary grayscale image;

[0069] Convert the color depth of the binary grayscale image into RGB mode to obtain an RGB image;

[0070] Perform image transformation processing on the RGB image to obtain an original image.

[0071] As a preferred embodiment, the preset masks include a diamond mask, a Chinese knot mask and a square ring mask;

[0072] Performing image transformation processing on the RGB image to obtain the original image includes:

[0073] When the diamond mask is selected, the RGB image is rotated 135° counterclockwise along the geometric center and the missing part is filled with pure white pixels to obtain the original image;

[0074] When the Chinese knot mask is selected, the RGB image is rotated 45° clockwise along the geometric center and the missing part is filled with pure white pixels to obtain the original image;

[0075] When the square ring mask is selected or no mask is selected, the RGB image is directly saved as the original image.

[0076] Among the three types of QR codes generated by different masks mentioned above, the square ring code has the largest secondary design space, which is conducive to designer users to further add icons and texts in and around the image; the diamond code has beautiful meaning and simple appearance, and is suitable for use in various advertisements, personal business cards, and postcard printing; the Chinese knot code has the most complex and gorgeous appearance, the most recognizable, and has unique cultural connotations.

[0077] As a preferred embodiment, in step S104, the image to be fused is preprocessed, including:

[0078] The image shape is cropped into a square based on the geometric center area of ​​the image to be fused.

[0079] As a preferred embodiment, in step S105, the image fusion method adopts image saturation addition or image mixing addition.

[0080] As a preferred embodiment, the original image is fused with the preprocessed image to be fused by using image saturation addition, including:

[0081] Add the color channels of any pixel on the original image and the corresponding pixel on the image to be fused respectively. If the value of any color channel after addition is greater than 255, set the value of the color channel to 255 to obtain a fused scannable image.

[0082] As a preferred embodiment, the original image is fused with the preprocessed image to be fused based on image mixing addition, including:

[0083] Set the image fusion weights α and β, where α = β-1;

[0084] After multiplying the pixel points in each color channel of the original image by the weight α, the pixels are added to the corresponding pixel points in the image to be fused multiplied by the weight β to obtain a preliminary fused image;

[0085] The image brightness of the preliminary fused image is adjusted based on the correction value γ to obtain a fused scannable image.

[0086] Combine the following Figure 2 To illustrate the specific logic and algorithm implementation process of the method of the present invention, the method specifically includes the following steps:

[0087] Step A: Get the input string to be encoded entered by the user. The character selection range is the displayable characters in the Unicode character set. It should be noted that in order to prevent the string from being too long, resulting in the generated image being too large to be scanned by existing smartphones, the string length is generally limited to no more than 300 bytes; the error correction level is fixed to the standard of H. QR Code has four error correction levels. Setting it to H level can recover about 30% of the data, which can make the QR code more robust;

[0088] Step B: Use the QR Code encoding standard to perform data analysis and encoding on the string. The encoding is performed until the step before the QR Code mask (i.e., data encoding, QR Code version selection and error correction level selection are completed). At this time, the data is stored in array A0 in binary form.

[0089] Step C: Apply 8 different mask operations of QR Code to array A0, and store the results in 8 different arrays A1 to A8;

[0090] Step D: The user can select at most one of the three preset masks and use the mask to overlay any matrix from A1 to A8 to obtain matrix A'. (The three mask examples and processing will be combined later in this article. Figure 3-Figure 5 It should be noted that there is no special restriction on the rules for selecting matrices from A1 to A8, and the rules can be set according to the actual situation. In actual applications, it is recommended to select according to the visual effects of each matrix;

[0091] If no mask is selected, the image to be fused I input by the user is directly obtained. m , and take I m The geometric center area is automatically cropped into a square to obtain a square image I m1 . Convert A1 to A8 in step C directly into binary grayscale images and scale them to the same grayscale as I m1 The same size and the binarized I m1 Perform SSIM structural similarity matching to obtain the similarities between A1 and A8. m1 The image with the highest matching score is A i , let the matrix corresponding to the obtained image be matrix A'.

[0092] It should be noted that the above m1 The following process is recommended for grayscale binarization: Calculate I m1 The average brightness of all pixels is L, and L is used as the standard for threshold binarization. m1 Perform grayscale binarization processing;

[0093] Step E: According to actual needs, expand the matrix A' by k times, save the expanded matrix as a binary grayscale image I, and convert the color depth of image I into RGB mode. The expanded size will be linearly related to the pixel size of the final image. In order to ensure that the final image can clearly display each module of the QR code and is easy to scan, it is usually recommended that the expanded size is not less than 400.

[0094] Step F: transform the image I after conversion to RGB mode. Specifically, if the diamond mask is selected in step D, the image I is rotated 135° counterclockwise along the geometric center and the missing part is filled with pure white pixels to obtain image I'; if the Chinese knot mask is selected in step D, the image I is rotated 45° clockwise along the geometric center and the missing part is filled with pure white pixels to obtain image I'; if the square ring mask is selected in step D or no mask is selected, the image I is directly saved as image I';

[0095] Step G, obtaining the input image to be fused I input by the user m If the user does not input the image to be fused, the preset image I is selected. m , and take I m The geometric center area of ​​​​the image is automatically cropped into a square, and the square image I m1 .

[0096] Step H: image I m1 Perform image saturation addition or image mixing addition with image I' to obtain the final image I fThe final image is used directly as a normal QR code and can be recognized and scanned by a QR Code scanner.

[0097] The scannable image generated by the method of this embodiment is compatible with the QR Code encoding specification, and can be expressed as a QR code with different outlines, colors, and styles according to the selected mask, mask, image to be fused, and fusion method. It can be recognized and decoded by common mobile phone software, and the image has a more outstanding visual effect while ensuring that the image has a certain scanning robustness; it better solves the conflict problem that the monotonous appearance of the QR code is difficult to meet the needs of graphic design, and broadens the scope of application of the QR code.

[0098] It should be noted that no matter which level of QR Code version the original information corresponds to after encoding, the number of modules adjusted by the mask is no more than the number of modules in the total data area. The final image still has a certain scanning robustness. The final image is different from the traditional black and white QR code in appearance, showing a non-square outer contour. The visual effect shows features such as "diamond" and "Chinese knot" according to the selected mask, and presents a color and texture that is somewhat similar to the image to be fused.

[0099] Combine the following Figure 3-Figure 5 Three mask examples are shown. Masking is the process of processing the mask matrix. The binary grayscale image generated by the processed mask matrix has an irregular outer contour different from the traditional QR code, but can still be recognized and decoded by the QR code scanner.

[0100] like Figure 3 As shown, if the diamond mask is selected, the encoding matrix p0 is obtained after mask processing. The side length of p0 is n. For p0, all elements in the lower right corner area of ​​the two-dimensional array p0 (the area from (n-1) / 2 rows and columns to the end of the array) are set to 0.

[0101] like Figure 4 As shown, if the Chinese knot mask is selected, the original square matrix is ​​expanded before using the mask: suppose the coded square matrix p is obtained after mask processing, and p is expanded by 16 bits in four directions. Let the side length of the coded square matrix p2 be n, the side length of the original square matrix be s, let m = n / 2, and execute the processing of "setting the sequential arrangement area to 0" and "setting the independent point position to 0".

[0102] like Figure 5 As shown, if the square ring mask is selected, the encoding square matrix p1 is obtained after mask processing. The side length of p1 is n, and the side length of the central hollow area sq=(n-7) / 2 2, and all elements of the specific area of ​​the two-dimensional array p1 (starting from (n-sq)+1 row and column to (n-sq) / 2+sq-1 row and column) are set to 0.

[0103] In order to ensure the visual effect of the final image, in some embodiments, the color bit depth of the image to be fused in step G or step E is 24-bit RGB, and the size is close to or not less than the size of the matrix after expansion in step E.

[0104] As a specific embodiment, the image saturation addition in step H is performed on RGB images A and B of the same size to obtain image C. The flowchart is as follows: Figure 6 The specific process is that when performing saturation addition on images A and B, the RGB color channels of any pixel A(x, y) of image A and the corresponding pixel B(x, y) of image B are added separately. If any value after addition is greater than 255, it is set to 255; the result of the operation is saved as image C;

[0105] As a specific embodiment, the image mixing addition in step H is performed by calculating the image dst from the RGB images img1 and img2 of the same size, and the flow chart thereof is as follows: Figure 7 As shown. Set the image fusion weights α and β according to user needs, where α = β-1; the optional correction value γ is used to adjust the image brightness, and the default value is 0. Multiply the pixels in the three color channels of img1 by the weight α and add them to the corresponding pixels of img2 multiplied by the weight β, that is, dst = α·img1+β·img2+γ. The result is stored in the final image dst; if the γ value is not 0, dst and γ are arithmetic added.

[0106] In some embodiments, after performing image saturation addition or image mixing addition, due to the color characteristics of the image to be fused and the parameter selection of α, β, γ, the final image may not be scanned. To reduce the probability of such a situation, when performing image saturation addition, try to select a darker image to be fused. When performing image mixing addition, if the image to be fused is lighter in color, I' in step F can be converted into a negative film and then try image mixing again.

[0107] In some embodiments, if there is no requirement for color image design in the actual use scenario, the image I' in step F can be directly used as the final image. The image I' has the same individual contour features as the final image, but is presented as a black and white dot pattern without color, and can also be recognized and scanned by the barcode scanner.

[0108] In some embodiments, before using and publishing the final image, in order to avoid the image being difficult or impossible to scan due to factors such as secondary design, image display plane, parameter selection, etc., which may damage the interests of the image user, the image user is obliged to check the availability of the image QR code before publishing the image. For images that need to be publicly released, the image design and coding content must not violate public order and good customs.

[0109] like Figure 8 As shown, the embodiment of the present invention further provides a system 800 for generating a scannable image integrating binary digital coding, comprising:

[0110] The string acquisition module 801 is used to acquire a target string, analyze and encode the target string based on the QR Code encoding rule, and obtain an original array;

[0111] A masking module 802 is used to perform masking operations on the original array using multiple QR Code masking methods to obtain multiple mask matrices;

[0112] The encoding module 803 is used to use at most one preset mask to superimpose any one of the plurality of mask matrices to obtain a data encoding matrix, and obtain an original image based on the data encoding matrix;

[0113] An image acquisition module 804 is used to acquire the image to be fused and pre-process the image to be fused;

[0114] The fusion module 805 is used to fuse the original image with the pre-processed image to be fused based on a preset image fusion method to generate a scannable two-dimensional code image.

[0115] The invention is compatible with the QR Code encoding standard and can be recognized and decoded by common mobile phone software. Under the premise of ensuring that the image has a certain scanning robustness, the image has a more outstanding visual effect; it better solves the conflict problem that the monotonous appearance of the QR code is difficult to meet the needs of graphic design, and broadens the application scope of the QR code.

[0116] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A method for generating a scannable image integrating binary digital coding, characterized in that: include: Obtain a target string, analyze and encode the target string based on QR Code encoding rules, and obtain an original array; Using a plurality of QR Code masking methods to perform masking operations on the original array respectively to obtain a plurality of mask matrices; Using at most one preset mask, superimposing any one of the plurality of mask matrices to obtain a data coding matrix, and obtaining an original image based on the data coding matrix; Acquire the image to be fused, and preprocess the image to be fused; The original image is fused with the preprocessed image to be fused based on a preset image fusion method to generate a scannable two-dimensional code image.

2. The method for generating a scannable image integrating binary digital coding according to claim 1, characterized in that: The method further comprises: When the preset mask is not used to superimpose the mask matrix, the image to be fused is directly acquired, and the image to be fused is adaptively binarized to obtain a grayscale image to be fused; Convert each of the mask matrices into a corresponding binary grayscale image to obtain a plurality of reference images; SSIM structural similarity matching is performed on each of the reference images and the grayscale image to be fused, and the mask matrix corresponding to the reference image with the highest matching degree is used as the data encoding matrix.

3. The method for generating a scannable image integrating binary digital coding according to claim 2, characterized in that: Adaptively binarizing the image to be fused, including: The brightness mean of all pixels of the image to be fused is calculated, and the brightness mean is used as a threshold to perform grayscale binarization processing on the image to be fused.

4. The method for generating a scannable image integrating binary digital coding according to claim 1, characterized in that: Obtaining an original image based on the data encoding matrix includes: Expanding the data encoding matrix, and saving the expanded matrix as a binary grayscale image; Convert the color depth of the binary grayscale image into RGB mode to obtain an RGB image; Perform image transformation processing on the RGB image to obtain an original image.

5. The method for generating a scannable image integrating binary digital coding according to claim 4, characterized in that: The preset masks include diamond mask, Chinese knot mask and square ring mask; Performing image transformation processing on the RGB image to obtain the original image includes: When the diamond mask is selected, the RGB image is rotated 135° counterclockwise along the geometric center and the missing part is filled with pure white pixels to obtain the original image; When the Chinese knot mask is selected, the RGB image is rotated 45° clockwise along the geometric center and the missing part is filled with pure white pixels to obtain the original image; When the square ring mask is selected or the template is not selected, the RGB image is directly saved as the original image.

6. The method for generating a scannable image integrating binary digital coding according to claim 1, characterized in that: The preset image fusion method is image saturation addition or image mixing addition.

7. The method for generating a scannable image integrating binary digital codes according to claim 6, characterized in that: The original image is fused with the preprocessed image to be fused by using image saturation addition, including: Add the color channels of any pixel on the original image and the corresponding pixel on the image to be fused respectively. If the value of any color channel after addition is greater than 255, set the value of the color channel to 255 to obtain a fused scannable image.

8. The method for generating a scannable image integrating binary digital codes according to claim 7, characterized in that: The original image is fused with the preprocessed image to be fused based on image mixing addition, including: Set the image fusion weights α and β, where α = β-1; After multiplying the pixel points in each color channel of the original image by the weight α, the pixels are added to the corresponding pixel points in the image to be fused multiplied by the weight β to obtain a preliminary fused image; The image brightness of the preliminary fused image is adjusted based on the correction value γ to obtain a fused scannable image.

9. The method for generating a scannable image integrating binary digital coding according to claim 1, characterized in that: Preprocessing the image to be fused includes: The image shape is cropped into a square based on the geometric center area of ​​the image to be fused.

10. A system for generating a scannable image incorporating binary digital coding, characterized in that: include: A string acquisition module is used to acquire a target string, analyze and encode the target string based on QR Code encoding rules, and obtain an original array; A masking module, used to perform masking operations on the original array using a plurality of QR Code masking methods to obtain a plurality of mask matrices; An encoding module, configured to use at most one preset mask to superimpose any one of the plurality of mask matrices to obtain a data encoding matrix, and obtain an original image based on the data encoding matrix; An image acquisition module, used for acquiring the image to be fused and preprocessing the image to be fused; The fusion module is used to fuse the original image with the preprocessed image to be fused based on a preset image fusion method to generate a scannable two-dimensional code image.

Citation Information

Cited By

  • Trademark graphic code typesetting method and system

    CN120012811A

  • A trademark graphic code layout method and system

    CN120012811B