Method and device for generating color two-dimensional code and laser processing method for color two-dimensional code

By dividing the original information into three segments and performing color replacement and vector synthesis, a high-information density color QR code is generated, and laser processing methods are used to accurately mark metal products, which solves the problem of color QR code marking on metal products in the prior art, and achieves efficient and accurate color QR code marking.

CN119903865AActive Publication Date: 2025-04-29HUAZHONG UNIV OF SCI & TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411994418.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-29
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

It is difficult for the prior art to efficiently mark high information density color QR codes on metal products, and there are few researches on color QR codes processing on metal surfaces.

Method used

By dividing the original information into three segments of split information, a black and white QR code with the same version is generated, and a color replacement rule and RGB vector synthesis method are used to obtain a color QR code with 8 colors. At the same time, laser processing method is used to accurately mark color QR codes on metal products.

Benefits of technology

The information density of color QR codes is improved, so that they contain three times the information of black and white QR codes under the same size conditions. The laser processing method has high accuracy and long color retention time, which is suitable for QR codes of different code systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119903865A_ABST
    Figure CN119903865A_ABST
Patent Text Reader

Abstract

The invention discloses a color two-dimensional code generation method, a color two-dimensional code generation device and a color two-dimensional code laser processing method. The color two-dimensional code generation method comprises the following steps: S1, dividing original information into three sections of split information with similar byte lengths; s2, generating three black and white two-dimensional codes with only black code elements and white code elements according to the three segments of split information; the black and white two-dimensional codes are consistent in version and same in image size; s3, performing color replacement on black code elements and white code elements in the black and white two-dimensional code by adopting a color replacement rule to obtain a double-color two-dimensional code; and S4, carrying out vector superposition on the code element colors corresponding to the code elements at the same positions in the three double-color two-dimensional codes by adopting an RGB vector synthesis method to obtain a color two-dimensional code with eight colors. The color two-dimensional code generated by adopting the method has high information capacity, can be identified by using an original identification method, and is easy to popularize.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer information coding, and in particular to a method and device for generating a color two-dimensional code and a laser processing method for the color two-dimensional code. Background Art

[0002] The inclusion of a traceable unique device identifier (UDI) on the label and packaging of medical devices is increasingly being promoted. By marking a QR code with UDI information on the surface of the device, the traceability management of medical devices can be achieved. With the trend of miniaturization of medical devices, more information needs to be included in a smaller size, but the information density of black and white QR codes is low and is not enough to meet the requirements; therefore, the research on color QR codes with higher information density has gradually increased, but the research on color QR codes is mostly used in the field of printed barcodes and has not yet been used on metal products. In order to solve the above problems, it is necessary to develop a color QR code with high information density and a processing method that can mark the color QR code on metal products. Summary of the invention

[0003] In order to improve the information density of the color two-dimensional code and to mark the color two-dimensional code on the metal product, the present invention provides the following technical solutions:

[0004] A method for generating a color two-dimensional code comprises the following steps:

[0005] S1. Divide the original information into three segments with similar byte lengths;

[0006] S2, convert the three pieces of split information into three black and white two-dimensional codes with only black code elements and white code elements; the black and white two-dimensional codes have the same version and the same image size;

[0007] S3, using a color replacement rule to replace the black code element and the white code element in the black-and-white two-dimensional code to obtain a dual-color two-dimensional code; the color replacement rule is to select three different colored colors as basic colors, obtain a first color code element, a second color code element and a third color code element corresponding to the basic colors, replace the white code element in the black-and-white two-dimensional code with a black code element, and replace the black code elements in the three black-and-white two-dimensional codes with the first, second and third color code elements in sequence;

[0008] S4, RGB vector synthesis method, vector superposition of the code element colors corresponding to the code elements at the same position in the three dual-color two-dimensional codes to obtain a color two-dimensional code with 8 colors.

[0009] Preferably, the RGB values ​​of the three basic colors are (255, 0, 0), (0, 255, 0) and (0, 0, 255), respectively.

[0010] Preferably, the vector superposition includes the following steps: creating a basic image that is consistent with the black and white QR code version, has the same image size, and has code element colors of RGB (0,0,0); then traversing the three dual-color QR codes in turn, superimposing the code element colors of the code elements in the same position in the dual-color QR codes onto the newly created basic image, thereby obtaining a color QR code containing a total of 8 colors.

[0011] A color two-dimensional code generating device, characterized in that the generating device is used to execute any of the above-mentioned color two-dimensional code generating methods, and comprises an information division module, a black-and-white two-dimensional code encoding module, a color replacement module and a vector synthesis module; the information division module is used to divide the original information into separate information; the black-and-white two-dimensional code encoding module is used to generate the black-and-white two-dimensional code from the separate information; the color replacement module is used to convert the black-and-white two-dimensional code into the dual-color two-dimensional code; the vector synthesis module is used to perform vector superposition on the dual-color two-dimensional code and output the color two-dimensional code.

[0012] A laser processing method for a color two-dimensional code, wherein the color two-dimensional code includes n code element colors, characterized in that it comprises the following steps:

[0013] S1. Obtaining a mapping table between laser processing parameters and n code element colors in a color two-dimensional code through experiments;

[0014] S2, performing image processing on the color two-dimensional code to obtain a two-dimensional code processing image, traversing the pixel points in the two-dimensional code processing image to obtain m two-dimensional code color blocks, and m≧n; performing contour line extraction on the two-dimensional code color blocks to obtain contour line coordinate values ​​of m contour lines; and setting n different filling graphics corresponding to n code element colors, according to the code element color corresponding to the two-dimensional code color block, using the corresponding filling graphics to perform graphic filling on the area surrounded by the contour line to obtain m groups of filling graphic coordinate values;

[0015] S3, importing the outline coordinate values ​​and the fill pattern coordinate values ​​into a laser processing device, and assigning the outline coordinate values ​​and the fill pattern coordinate values ​​corresponding to the two-dimensional code color blocks with the same code element color to the same processing layer, thereby obtaining n processing layers;

[0016] S4, setting the processing parameters of the i-th color to be processed in the color two-dimensional code according to the mapping table, i=1, 2, ..., n;

[0017] S5. Place and fix the material to be processed, select the processing layer corresponding to the i-th color to be processed, and scan and process the surface of the material to be processed according to the laser processing parameters of the i-th color to be processed to complete the processing of all i-th colors to be processed in the color QR code;

[0018] S6. Determine whether i is equal to n. If it is equal to n, complete the processing of the color two-dimensional code; if it is not equal to n, repeat steps S4 to S5.

[0019] Preferably, the image processing refers to converting a color two-dimensional code into a true color image, namely, a two-dimensional code processed image, according to a 24-bit true color coding rule.

[0020] Preferably, the graphic filling refers to filling the area enclosed by the contour line; the filling graphic is a group of parallel lines with equal spacing; different filling graphics are obtained by adjusting the line spacing, deflection angle and offset distance of the parallel line group.

[0021] Preferably, step S2 also includes performing an offset operation on the contour line coordinate values ​​to obtain offset contour line coordinate values, and performing a Boolean clipping operation on the fill line coordinate values ​​to obtain clipping fill graphic coordinate values; and in step S3, the offset contour line coordinate values ​​and clipping fill graphic coordinate values ​​are imported into the laser processing equipment.

[0022] Preferably, the laser processing parameters include scanning speed, laser power and defocusing amount.

[0023] Preferably, obtaining the mapping table includes the following steps:

[0024] S11, adjusting the defocus amount of the laser processing equipment and setting the initial defocus amount to 0;

[0025] S12, selecting an unprocessed material to be processed, pre-treating the surface of the material to be processed, and then fixing the material in the laser processing equipment;

[0026] S13, using laser marking software to draw a plurality of square frames, and fill the square frames with parallel straight lines at a certain interval, and then delete the square frames, thereby obtaining a plurality of parallel line group areas;

[0027] S14, setting the initial scanning speed and initial laser power of laser processing, and gradually increasing the scanning speed and laser power, processing multiple straight line group areas in sequence, and obtaining a test correspondence table of test processing parameters and test color blocks;

[0028] S15, finding a test color block with a color similar to that of the color QR code from the test color blocks, and recording the test processing parameters and defocus amount corresponding to the selected test color block according to the test correspondence table to form a selected correspondence table;

[0029] S16. Determine whether all colors in the color QR code are aligned. If so, the set of all the selected corresponding tables is a mapping table of the color to be processed and the laser processing parameters. If not, adjust the laser defocus amount at a spacing of 1 mm and repeat steps S11 to S15.

[0030] Compared with the prior art, the present invention has the following beneficial effects:

[0031] (1) The present invention performs color replacement and vector superposition on the black and white two-dimensional code to obtain a color two-dimensional code, so that the color two-dimensional code of the same size contains the information of three black and white two-dimensional codes, thereby increasing the information capacity of the two-dimensional code;

[0032] (2) The color two-dimensional code obtained by the present invention can be applied to two-dimensional codes of different code systems without changing the encoding rules of the original code system; and when extracting information from the color two-dimensional code, only a pre-processing program for splitting the color two-dimensional code into black and white two-dimensional codes and a post-processing program for data splicing need to be added, and the same recognition method as the original two-dimensional code can be used, which is easy to promote;

[0033] (3) The present invention uses laser to process the color two-dimensional code on the product, and the processing precision is high, the processing material is large, and the color of the laser processed color two-dimensional code is kept for a long time and is not easy to be damaged;

[0034] (4) The present invention limits the laser processing range by extracting the contour coordinate values ​​of the contour lines of each QR code color block in the color QR code and the filling coordinate values ​​of the filled graphics within the filled contour lines, so that the size and position of the QR code color block processed on the product are completely consistent with the size and position of the same color block in the color QR code. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is a flow chart of the method for generating a color two-dimensional code according to the present invention;

[0036] Figure 2 It is a schematic diagram of information division and color replacement of the present invention;

[0037] Figure 3 This is a schematic diagram of the color two-dimensional code structure after vector superposition of the present invention;

[0038] Figure 4 This is a flow chart of the laser processing color two-dimensional code method of the present invention;

[0039] Figure 5 The present invention is a flow chart for obtaining laser processing parameters and a color mapping table of a color two-dimensional code. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] Embodiment 1:

[0042] A color QR code generation method, the method generates a color QR code based on RGB vector synthesis method, such as Figure 1 As shown, it includes the following steps:

[0043] S1. Divide the original information into three segments with similar byte lengths;

[0044] S2. Generate three black-and-white two-dimensional code images with only black code elements and white code elements from the three segments of the split information; the black-and-white two-dimensional codes have the same version and the same image size; wherein the code element is the basic unit in the two-dimensional code (usually the smallest square block), and one code element represents a data storage bit in the two-dimensional code; the version refers to the size and structure of the two-dimensional code, which determines the amount of data that the two-dimensional code can store. There are 40 versions of the two-dimensional code, from 1 to 40. The higher the version number, the larger the size of the two-dimensional code and the more data can be stored. The two-dimensional code of version 1 is 21×21 code elements, while version 40 is 177×177 code elements. With each additional version, the size of the two-dimensional code will increase by 4 code elements (2 code elements on each side), so that more information can be stored; the choice of the two-dimensional code version depends on the amount of data that needs to be stored;

[0045] S3, using a color replacement rule to replace the black code element and the white code element in the black-and-white two-dimensional code to obtain a dual-color two-dimensional code; the color replacement rule is to select three different colored colors as basic colors, obtain a first color code element, a second color code element and a third color code element corresponding to the basic colors, replace the white code element in the black-and-white two-dimensional code with a black code element, and replace the black code elements in the three black-and-white two-dimensional codes with the first, second and third color code elements in sequence;

[0046] S4. Based on the RGB vector synthesis method, the code element colors corresponding to the code elements at the same position in the three dual-color two-dimensional codes are vector-superimposed to obtain a color two-dimensional code with 8 colors.

[0047] Specifically, the present invention uses QRcode, which is widely used, has strong error correction capability and fast recognition, to generate a two-dimensional code in step S2. Specifically, the open source barcode generation tool Zint is first used to write a generation interface in the Qt platform, and the three segments of information to be encoded are sequentially generated into black and white two-dimensional codes, and the versions of the three two-dimensional codes are ensured to be consistent, that is, the size and number of code elements of the two-dimensional codes are consistent.

[0048] In step S3, the screening of the basic colors must meet the following screening principles: (1) the basic colors have independent basic vectors; (2) the contrast between the multiple synthetic colors obtained by vector superposition of the basic colors is high; (3) the resultant vector after vector superposition can be decomposed into the basic vectors before synthesis.

[0049] In step S4, vector superposition includes the following steps: constructing a basic image that is consistent with the black and white two-dimensional code image version, equal in size, and has the same code element color, wherein the code element color in the basic image is black of RGB (0,0,0); traversing the three dual-color two-dimensional codes in turn, and superimposing the code element colors of the code elements in the same position in the dual-color two-dimensional code on the newly created basic image according to the vector synthesis method, thereby obtaining a color two-dimensional code containing a total of 8 colors.

[0050] Meanwhile, in step S4, the color of each code element in the color two-dimensional code is the vector sum of the code element colors corresponding to the code elements at the same position in the three dual-color two-dimensional codes.

[0051] According to the screening principle of basic colors, the RGB values ​​of (255, 0, 0), (0, 255, 0) and (0, 0, 255) are used as basic colors, and the code element color of the first color code element is red (255, 0, 0), the code element color of the second color code element is green (0, 255, 0) and the code element color of the third color code element is blue (0, 0, 255); the RGB values ​​of the above three basic colors are greatly different, the contrast of the formed composite color is high, and the difference value between the composite colors is at least 255.

[0052] Take the red, green and blue as the basic colors, and take the original information as a string of UDI data as an example. Figure 2 As shown, the data mainly consists of two parts: device identifier DI and production identifier PI. The specific steps for generating the color QR code of the UDI data are as follows:

[0053] S1. Split the UDI data into three pieces of information with similar byte lengths, and obtain data (01) 0698541007 representing the device identifier, data (17) 251003 representing the production date, and data (10) 2020130004 representing the batch number;

[0054] S2. Generate three black and white QR codes with the same number of code elements from the three segments of the split information respectively; specifically, use the open source tool Zint to write a QR code generation interface in the Qt platform, set the QR code version (representing the size and capacity of the QR code), select the code system as QRcode, and generate three black and white QR codes 10, 20 and 30 with the same QR code size and code element number;

[0055] S3, obtain the first color code element, i.e., the red code element, the second color code element, i.e., the green code element, and the third color code element, i.e., the blue code element, corresponding to the three colors of red, green, and blue; replace the colors of the white code elements 12, 22, and 32 in the three black and white two-dimensional codes 10, 20, and 30 with black, whose RGB is (0, 0, 0), and obtain the corresponding black code elements 14, 24, and 34 (indicating that there is no fill line in the black code element); at the same time, replace the black code elements 11, 21, and 31 in the black and white two-dimensional codes 10, 20, and 30 with the red code element 13 (represented by a horizontal fill line), the green code element 23 (represented by a vertical fill line), and the blue code element 33 (represented by an inclined fill line), and finally obtain three dual-color two-dimensional codes, namely, the dual-color two-dimensional code 15 with a red code and a black background, the dual-color two-dimensional code 25 with a green code and a black background, and the dual-color two-dimensional code 35 with a blue code and a black background, as shown in FIG. Figure 2 As shown;

[0056] S4, vector superposition of the code element colors corresponding to the code elements at the same position in the above three dual-color two-dimensional codes to obtain a color two-dimensional code with 8 colors. Figure 3 As shown, the red code black background two-dimensional code 15, the green code black background two-dimensional code 25 and the blue code black background two-dimensional code 35 are vector-superimposed to obtain a color two-dimensional code 40 with 8 colors. The color two-dimensional code 40 is composed of the following 8 colors, such as Figure 3 As shown:

[0057] No. 1: RGB (255, 0, 0), which is obtained by vector superposition of the RGB of the red color in the dual-color QR code 15 and the black color in the dual-color QR codes 25 and 35;

[0058] No. 2: RGB (0,0,255), which is obtained by vector superposition of the blue color in the dual-color QR code 35 and the black color in the dual-color QR codes 15 and 25;

[0059] No. 3: RGB (0, 255, 0); obtained by vector superposition of the RGB of the green color in the dual-color QR code 25 and the black color in the dual-color QR codes 15 and 35;

[0060] No. 4: RGB (0,0,0); obtained by vector superposition of the black RGB in the dual-color QR codes 15, 25, and 35;

[0061] No. 5: RGB (0, 255, 255); obtained by vector superposition of RGB of 15 black, 25 green and 35 blue of the dual-color QR code;

[0062] No. 6: RGB (255, 255, 0); obtained by vector superposition of RGB of 15 red, 25 green and 35 black in the dual-color QR code;

[0063] No. 7: RGB (255, 0, 255); obtained by vector superposition of RGB of 15 red, 25 black and 35 blue in the dual-color QR code;

[0064] No. 8: RGB (2525, 255, 255); it is obtained by vector superposition of RGB of 15 red, 25 green and 35 blue of the dual-color QR code.

[0065] The above eight colors form the final color two-dimensional code 40. Since one color two-dimensional code 40 is equivalent to the combination of three black and white two-dimensional codes, under the condition of the same size, the information density of the color two-dimensional code 40 is three times that of the black and white two-dimensional code, which greatly improves the information capacity. At the same time, the use of vector synthesis method to superimpose the two-color two-dimensional code can be applied to two-dimensional codes of different code systems without changing the encoding rules of the original code system. Therefore, when extracting information from the color two-dimensional code, it is only necessary to add a pre-processing program for splitting the color two-dimensional code into black and white two-dimensional codes and a post-processing program for data splicing, and the original recognition method can be used to recognize the color two-dimensional code, which is easy to promote.

[0066] Embodiment 2:

[0067] The difference between this embodiment and embodiment 1 is that this embodiment is a color two-dimensional code generating device, and the device uses the method in embodiment 1 to generate a color two-dimensional code.

[0068] The color two-dimensional code generating device includes an information division module, a black-and-white two-dimensional code encoding module, a color replacement module and a vector synthesis module. The information division module is used to divide the original information into three segments of separate information, that is, it is used to execute step S1 in Example 1. The black-and-white two-dimensional code encoding module generates a black-and-white two-dimensional code with the same version according to the two-dimensional code encoding rules. That is, it is used to execute step S2 in Example 1. The color replacement module is used to replace the color of the black-and-white two-dimensional code to obtain three dual-color two-dimensional codes for vector superposition, that is, it is used to execute step S3 in Example 1. The vector synthesis module is used to superimpose 3 dual-color two-dimensional codes into a color two-dimensional code containing a total of 8 colors according to the RGB vector synthesis principle.

[0069] Embodiment 3:

[0070] The difference between this embodiment and embodiment 1 or 2 is that this embodiment is a laser processing method for a color two-dimensional code.

[0071] This embodiment uses the interference principle of light to form color. Specifically, laser is used to oxidize the surface of the material to be processed to form an oxide film; when light irradiates the oxide film, part of the light is reflected on the surface of the oxide film, and the other part of the light enters the inside of the oxide film and is reflected. When the two reflected light waves meet, interference occurs to form colored light. By adjusting the laser processing parameters to form oxide films of different thicknesses, different colors can be obtained.

[0072] If the color two-dimensional code to be processed contains n code element colors, the processing method includes the following steps:

[0073] S1. Obtaining a mapping table between laser processing parameters and n code element colors in a color two-dimensional code through experiments;

[0074] S2, performing image processing on the color two-dimensional code to obtain a two-dimensional code processing image, traversing the pixel points in the two-dimensional code processing image to obtain m two-dimensional code color blocks, and m≧n; performing contour line extraction on the two-dimensional code color block to obtain contour line coordinate values ​​of m contour lines; using n different filling graphics to represent n code element colors, according to the code element colors corresponding to the contour lines, using the filling graphics corresponding to the code element colors, performing graphic filling on the area surrounded by the contour lines to obtain m groups of filling graphic coordinate values; the two-dimensional code color block refers to a connected area with the same color in the two-dimensional code processing image;

[0075] S3, importing the outline coordinate values ​​and the fill pattern coordinate values ​​into a laser processing device, and assigning the outline coordinate values ​​and the fill pattern coordinate values ​​corresponding to the two-dimensional code color blocks with the same code element color to the same processing layer, thereby obtaining n processing layers;

[0076] S4, setting the processing parameters of the i-th color to be processed in the color two-dimensional code according to the mapping table, i=1, 2, ..., n;

[0077] S5. Place and fix the material to be processed, select the processing layer corresponding to the i-th color to be processed, and scan and process the surface of the material to be processed according to the laser processing parameters of the i-th color to be processed to complete the processing of all i-th colors to be processed in the color QR code;

[0078] S6. Determine whether i is equal to n. If it is equal to n, complete the processing of the color two-dimensional code; if it is not equal to n, repeat steps S4 to S5.

[0079] Specifically, in step S2, the image processing refers to converting the color QR code into a true color image, i.e., a QR code processed image, according to the 24-bit true color coding rule. The contour line coordinate values ​​and the fill pattern coordinate values ​​are the coordinate values ​​of each contour line and each fill pattern extracted with the upper left corner of the QR code processed image as the origin.

[0080] The graphic filling refers to filling the area enclosed by the contour line; the filling graphic is a group of parallel lines with equal spacing, and n kinds of filling graphics are obtained by adjusting the parameters of the parallel line group; the parameters of the parallel line group in each filling graphic must be independent of each other. The parameters of the parallel line group include the spacing between the parallel lines, i.e., the line spacing, the angle between the parallel lines and the X-axis, i.e., the deflection angle, and the distance between the parallel lines and the contour line, i.e., the offset distance. In a specific implementation, when the parallel line group is completely contained in the contour line, the distance between the parallel lines and the contour line is defined as a negative number; when the parallel line group completely contains the contour line, the distance between the parallel lines and the contour line is defined as a positive number. By adjusting the offset distance of the parallel line group, each filling graphic can completely cover the outer contour of the color two-dimensional code to avoid the loss of color two-dimensional code information.

[0081] Step S2 also includes performing an offset operation and a Boolean clipping operation on the two-dimensional code graphic, including the following steps:

[0082] S21, importing m contour line coordinate values ​​and m fill line coordinate values ​​into processing software such as Clipper2 open source library;

[0083] S22, performing an offset operation on the contour line coordinate value to obtain an offset contour line coordinate value, and then performing a Boolean clipping operation on the fill line coordinate value with the offset contour line as a clipping window to obtain the intersection of the contour line and the parallel line to obtain a clipped fill graphic coordinate value.

[0084] At this time, in step S3, the offset contour line coordinate value and the cut and fill graphic coordinate value are imported into the laser processing equipment.

[0085] In the above steps, the offset operation is to make the multiple contour lines processed on the product to be processed consistent with the area size within each contour line in the color two-dimensional code. In different laser processing processes, the laser spot has a size and will have a thermal impact on the material. For example, when processing a square area, the actual side length obtained is longer than the required side length, so it needs to be retracted a certain distance to obtain the correct size. The Boolean clipping operation is to obtain the filled figure within the contour line after the offset operation; it uses the closed contour line to clip the parallel line group (find the intersection), cut off the parallel line group outside the contour line, and obtain the parallel line group inside the contour as the filled figure.

[0086] In step S5, the laser processing parameters include scanning speed, laser power and defocusing amount.

[0087] The color two-dimensional code obtained by the above processing method has high processing efficiency, and the color two-dimensional code is integrated with the processed product, so that the color two-dimensional code is not easy to fall off or be damaged, and the color is kept for a long time. In the laser processing method, the color two-dimensional code used can be a two-dimensional code obtained by any color two-dimensional code generation method in Example 1.

[0088] Embodiment 4:

[0089] The difference between this embodiment and embodiment 1, 2, 3 or 4 is that obtaining the mapping table includes the following steps:

[0090] S11, adjusting the defocus amount of the laser processing equipment and making its initial defocus amount 0;

[0091] S12, selecting an unprocessed material to be processed, pre-treating the surface, and then fixing it in a laser processing device;

[0092] S13, using laser marking software to draw a plurality of square frames, and fill the square frames with parallel straight lines at a certain interval, and then delete the square frames, thereby obtaining a plurality of parallel line group areas;

[0093] S14, setting the initial scanning speed and initial laser power of laser processing, and gradually increasing the scanning speed and laser power, processing multiple straight line group areas in sequence, and obtaining a test correspondence table of test processing parameters and test color blocks;

[0094] S15, finding a test color block with a color similar to that of the color QR code from the test color blocks, and recording the test processing parameters and defocus amount corresponding to the selected test color block according to the test correspondence table to form a selected correspondence table;

[0095] S16. Determine whether all colors in the color QR code are aligned. If so, the set of all selected corresponding tables is a mapping table of the color to be processed and the laser processing parameters. If not, adjust the laser defocus amount at intervals of 1 mm, and repeat steps S11 and S15 until all colors in the color QR code are aligned.

[0096] Take stainless steel as the material to be processed as an example:

[0097] S11. Adjust the distance between the mid-field mirror and the loading platform in the laser marking machine, and adjust the position of the laser focus; at the beginning, make the laser focus just on the stainless steel surface, that is, the defocus amount is 0;

[0098] S12. Grind and polish the surface of 100mm×100mm×2mm 304 stainless steel to a mirror finish, and fix it on the loading platform of the laser marking machine;

[0099] S13, using laser marking software to draw a 2 mm×2 mm square frame, using a fill tool to fill the square with a group of parallel straight lines with a line spacing of 0.01 mm, and then deleting the square frame, thereby obtaining multiple parallel line group areas;

[0100] S14. Take one corner of the stainless steel as the origin, the two right-angled sides as the X and Y coordinate axes, the X coordinate axis as the scanning speed (mm / s), and the Y coordinate axis as the laser power percentage (%); set 15 mm / s as the initial scanning speed, 3% of the maximum laser power of the equipment as the initial laser parameter, and gradually increase the scanning speed and laser power by 15 mm / s and 3% of the maximum laser power, use a laser marking machine to process on the surface of the stainless steel, obtain 33×33 test color blocks, and obtain a test correspondence table of 33×33 test processing parameters and test color blocks;

[0101] S15, finding a color similar to the color QR code from the 33 test color blocks, and recording the test processing parameters and defocus values ​​corresponding to the selected test color blocks according to the test correspondence table, and forming a selected correspondence table;

[0102] S16. Determine whether all n colors in the color QR code are aligned. If so, the set of all selected corresponding tables is the mapping table of the color to be processed and the laser processing parameters. If not, increase the defocus amount by 1 mm and repeat steps S11 to S15.

[0103] It should be noted that the technical features in the above-mentioned embodiments 1 to 4 can be combined in any way, and the combined technical solutions all belong to the protection scope of the present application. In this article, terms such as "including", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements.

[0104] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for generating a color two-dimensional code, comprising the following steps: S1. Divide the original information into three segments with similar byte lengths; S2, generating three black-and-white two-dimensional codes with only black code elements and white code elements from the three segments of the split information; the black-and-white two-dimensional codes have the same version and the same image size; S3, using a color replacement rule to replace the black code element and the white code element in the black-and-white two-dimensional code to obtain a dual-color two-dimensional code; the color replacement rule is to select three different colored colors as basic colors, obtain a first color code element, a second color code element and a third color code element corresponding to the basic colors, replace the white code element in the black-and-white two-dimensional code with a black code element, and replace the black code elements in the three black-and-white two-dimensional codes with the first, second and third color code elements in sequence; S4. Using the RGB vector synthesis method, the code element colors corresponding to the code elements at the same position in the three dual-color two-dimensional codes are vector-superimposed to obtain a color two-dimensional code with 8 colors.

2. The color two-dimensional code generation method according to claim 1, characterized in that: The RGB values ​​of the three basic colors are (255, 0, 0), (0, 255, 0) and (0, 0, 255) respectively.

3. The color two-dimensional code generation method according to claim 2, characterized in that: The vector superposition includes the following steps: creating a basic image that is consistent with the black and white QR code version, has the same image size, and has code element colors of RGB (0,0,0); then traversing the three dual-color QR codes in turn, superimposing the code element colors of the code elements in the same position in the dual-color QR codes onto the basic image, thereby obtaining a color QR code containing a total of 8 colors.

4. A color two-dimensional code generating device, characterized in that: The generating device is used to execute the color two-dimensional code generating method as described in any one of claims 1 to 3, and comprises an information division module, a black and white two-dimensional code encoding module, a color replacement module and a vector synthesis module; the information division module is used to divide the original information into the split information; the black and white two-dimensional code encoding module is used to generate the black and white two-dimensional code from the split information; the color replacement module is used to convert the black and white two-dimensional code into the dual-color two-dimensional code; the vector synthesis module is used to perform vector superposition on the dual-color two-dimensional code and output the color two-dimensional code.

5. A laser processing method for a color two-dimensional code, wherein the color two-dimensional code comprises n code element colors, characterized in that: The following steps are involved: S1. Obtaining a mapping table between laser processing parameters and n code element colors in a color two-dimensional code through experiments; S2, performing image processing on the color two-dimensional code to obtain a two-dimensional code processing image, traversing the pixel points in the two-dimensional code processing image to obtain m two-dimensional code color blocks, and m≧n; performing contour line extraction on the two-dimensional code color blocks to obtain contour line coordinate values ​​of m contour lines; and setting n different filling graphics corresponding to n code element colors, according to the code element color corresponding to the two-dimensional code color block, using the corresponding filling graphics to perform graphic filling on the area surrounded by the contour line to obtain m groups of filling graphic coordinate values; S3, importing the outline coordinate value and the fill pattern coordinate value into a laser processing device, and assigning the outline coordinate value and the fill pattern coordinate value corresponding to the two-dimensional code color block with the same code element color to the same processing layer, thereby obtaining n processing layers; S4, setting the processing parameters of the i-th color to be processed in the color two-dimensional code according to the mapping table, i=1, 2, ..., n; S5. Place and fix the material to be processed, select the processing layer corresponding to the i-th color to be processed, and scan and process the surface of the material to be processed according to the laser processing parameters of the i-th color to be processed to complete the processing of all i-th colors to be processed in the color QR code; S6. Determine whether i is equal to n. If it is equal to n, complete the processing of the color two-dimensional code; if it is not equal to n, repeat steps S4 to S5.

6. The laser processing method according to claim 5, characterized in that: The image processing refers to converting the color two-dimensional code into the two-dimensional code processing image according to the 24-bit true color encoding rule.

7. The laser processing method according to claim 5, characterized in that: The filling pattern is a group of parallel lines with equal spacing; different filling patterns can be obtained by adjusting the line spacing, deflection angle and offset distance of the parallel line group.

8. The laser processing method according to claim 7, characterized in that: Step S2 also includes performing an offset operation on the contour line coordinate value to obtain an offset contour line coordinate value, and performing a Boolean clipping operation on the fill line coordinate value to obtain a clipped fill graphic coordinate value; And in step S3, the offset contour line coordinate value and the cut and fill graphic coordinate value are imported into the laser processing equipment.

9. The laser processing method according to claim 5, characterized in that: The laser processing parameters include scanning speed, laser power and defocusing amount.

10. The laser processing method according to claim 5, characterized in that: The acquisition of the mapping table comprises the following steps: S11, adjusting the defocus amount of the laser processing equipment and setting the initial defocus amount to 0; S12, selecting an unprocessed material to be processed, pre-treating the surface of the material to be processed, and then fixing the material in the laser processing equipment; S13, using laser marking software to draw a plurality of square frames, and fill the square frames with parallel straight lines at a certain interval, and then delete the square frames, thereby obtaining a plurality of parallel line group areas; S14, setting the initial scanning speed and initial laser power of laser processing, and gradually increasing the scanning speed and laser power, processing multiple straight line group areas in sequence, and obtaining a test correspondence table of test processing parameters and test color blocks; S15, finding a test color block with a color similar to that of the color QR code from the test color blocks, and recording the test processing parameters and defocus amount corresponding to the selected test color block according to the test correspondence table to form a selected correspondence table; S16. Determine whether all colors in the color QR code are aligned. If so, the set of all the selected corresponding tables is a mapping table of the color to be processed and the laser processing parameters. If not, adjust the laser defocus amount at a spacing of 1 mm and repeat steps S11 to S15.

Citation Information

Patent Citations

  • Method for encoding and decoding colored two-dimensional code capable of bearing multiple black and white two-dimensional codes

    CN104657698A

  • Two-dimensional code generation method and device, and electronic equipment

    CN108710932A

  • Matrix type two-dimensional code, generation and decoding methods and equipment thereof

    CN109978111A

  • Narrow-strip 2-dimensional bar codes, methods, apparatuses, and devices for generating and identifying narrow-strip 2-dimensional bar codes

    US20210248337A1