A color two-dimensional code generation method and device and a laser processing method of a color two-dimensional code
Color QR codes are generated through color replacement and RGB vector synthesis, and are engraved on metal products using laser processing technology. This solves the problem of insufficient information density of black and white QR codes and realizes the application of color QR codes with high information capacity and good stability.
Patent Information
- Application Number
- CN202411994418.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The existing black and white QR codes have insufficient information density on miniaturized medical devices and are difficult to meet traceability requirements. The application of color QR codes on metal products is not yet mature.
Color replacement rules are used to convert black and white QR codes into color QR codes, color QR codes are generated through RGB vector synthesis method, and color QR codes are engraved on metal products using laser processing technology.
The information density of the QR code is improved, the laser processing accuracy is high, the color QR code is stable on metal products, easy to identify, and suitable for QR codes with different code systems.
Smart Images

Figure CN119903865B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer information coding, in particular to a color two-dimensional code generation method and device and a laser processing method of color two-dimensional code. BACKGROUND
[0002] It is increasingly promoted to include traceable unique device identifiers (UDI) on the labels and packaging of medical devices, and by marking two-dimensional codes with UDI information on the surface of the device, traceable management of medical devices can be achieved. With the trend of miniaturization of medical devices, more information needs to be included in smaller sizes, but the information density of black and white two-dimensional codes is low, which is not enough to meet the requirements; therefore, the research on color two-dimensional codes with higher information density is gradually increasing, but the research on color two-dimensional codes is mostly used in the field of printed barcodes and has not been used on metal products. In order to solve the above problems, it is necessary to develop a color two-dimensional code with high information density and a processing method for marking the color two-dimensional code on the metal product. SUMMARY
[0003] In order to improve the information density of the color two-dimensional code and mark the color two-dimensional code on the metal product, the present application provides the following technical solutions:
[0004] A color two-dimensional code generation method, comprising the following steps:
[0005] S1, dividing original information into three segment information with similar byte length;
[0006] S2, three black and white two-dimensional codes with only black and white code elements; the black and white two-dimensional codes are consistent in version and have the same image size;
[0007] S3, color replacement rule is used to replace the black and white code elements in the black and white two-dimensional code with colors to obtain a double-color two-dimensional code; the color replacement rule is to select three different colors as base colors, obtain first, second and third color code elements corresponding to the base colors one by one, replace the white code elements in the black and white two-dimensional code with black code elements, and replace the black code elements in the three black and white two-dimensional codes with first, second and third color code elements in turn;
[0008] S4, RGB vector synthesis method, vector superposition is performed on the code element colors corresponding to the same position code elements in the three double-color two-dimensional codes to obtain a color two-dimensional code with eight colors.
[0009] Preferably, the RGB values of the three base colors are (255, 0, 0), (0, 255, 0) and (0, 0, 255) respectively.
[0010] Preferably, the vector superposition includes the following steps: building a base image with the same image size as the black-and-white two-dimensional code version and with the code element color being RGB(0, 0, 0); then sequentially traversing the three double-color two-dimensional codes, superimposing the code element colors of the code elements at the same position in the double-color two-dimensional codes on the newly built base image, and further obtaining the color two-dimensional code containing eight colors.
[0011] A color two-dimensional code generation device, characterized in that the generation device is used to execute any of the above color two-dimensional code generation methods, and 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 partial information; the black-and-white two-dimensional code encoding module is used to generate the black-and-white two-dimensional code from the partial information; the color replacement module is used to change the black-and-white two-dimensional code into the double-color two-dimensional code; and the vector synthesis module is used to perform vector superposition on the double-color two-dimensional code and output the color two-dimensional code.
[0012] A laser processing method of a color two-dimensional code containing n code element colors, characterized by comprising the following steps:
[0013] S1. Obtaining a mapping table of laser processing parameters and the n code element colors in the 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 blocks, and m≧n; performing contour line extraction on the two-dimensional code blocks to obtain contour line coordinate values of the m contour lines; and setting n different filling patterns corresponding to the n code element colors, and according to the code element color corresponding to the two-dimensional code block, using the corresponding filling pattern to perform pattern filling on the area surrounded by the contour line to obtain m groups of filling pattern coordinate values;
[0015] S3. Importing the contour line coordinate values and the filling pattern coordinate values into a laser processing device, and assigning the contour line coordinate values and the filling line coordinate values corresponding to the two-dimensional code 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 to-be-processed color in the color two-dimensional code according to the mapping table, i=1, 2, …, n;
[0017] S5. Placing and fixing a to-be-processed material, selecting the processing layer corresponding to the i-th to-be-processed color, and performing scanning processing on the surface of the to-be-processed material according to the laser processing parameters of the i-th to-be-processed color to complete the processing of all the i-th to-be-processed colors in the color two-dimensional code.
[0018] S6, judging whether i is equal to n, if yes, completing the processing of the color two-dimensional code; if not, repeating steps S4-S5.
[0019] Preferably, the image processing refers to converting the color two-dimensional code into a true color image, i.e. a two-dimensional code processing image, according to a 24-bit true color coding rule.
[0020] Preferably, the graphic filling refers to filling the area enclosed in the contour line; the filling graphic is a parallel line group with equal intervals; different filling graphics are obtained by adjusting the line interval, deflection angle and offset distance of the parallel line group.
[0021] Preferably, in step S2, the contour line coordinate value is subjected to offset operation to obtain an offset contour line coordinate value, and the filling line coordinate value is subjected to Boolean clipping operation to obtain a clipped filling graphic coordinate value; and in step S3, the offset contour line coordinate value and the clipped filling graphic coordinate value are imported into the laser processing equipment.
[0022] Preferably, the laser processing parameters include scanning speed, laser power and defocusing amount.
[0023] Preferably, the acquisition of the mapping table comprises the following steps:
[0024] S11, adjusting the defocusing amount of the laser processing equipment, and setting the initial defocusing amount as 0;
[0025] S12, selecting an unprocessed material to be processed, and pre-treating the surface of the material to be processed, and then fixing the material to be processed in the laser processing equipment;
[0026] S13, using laser marking software to draw a plurality of square frames, and performing graphic filling on the parallel straight lines with a certain interval in the square frames, and then deleting the square frames, so as to obtain a plurality of parallel line group regions;
[0027] S14, setting the initial scanning speed and the initial laser power of laser processing, and gradually increasing the scanning speed and the laser power, and sequentially processing the plurality of straight line group regions, so as to obtain a test correspondence table of test processing parameters and test color blocks;
[0028] S15, finding out a test color block similar to the color of the color two-dimensional code from the test color blocks, and recording the test processing parameters and the defocusing amount corresponding to the selected test color block according to the test correspondence table, so as to form a selected correspondence table;
[0029] S16, judging whether all the colors in the color two-dimensional code are found, if yes, the collection of all the selected correspondence tables is a mapping table of the color to be processed and the laser processing parameters; if not, adjusting the laser defocusing amount by 1 mm, and repeating steps S11-S15.
[0030] Compared with the prior art, the present application has the following beneficial effects:
[0031] (1) The present application replaces the black and white two-dimensional code with color and superimposes vectors to obtain a color two-dimensional code, so that the same size color two-dimensional code contains the information of three black and white two-dimensional codes, thereby improving the information capacity of the two-dimensional code;
[0032] (2) The color two-dimensional code obtained by the present application 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 the pre-processing program of splitting the color two-dimensional code into black and white two-dimensional codes and the post-processing program of data splicing are needed, and the same identification method as the original two-dimensional code can be used, which is easy to popularize;
[0033] (3) The present application uses laser to process the color two-dimensional code on the product, which has high processing precision, multiple processing materials, and long color retention time and is not easy to damage;
[0034] (4) The present application limits the laser processing range by extracting the contour coordinate values of the contour lines of each two-dimensional code color block in the color two-dimensional code and the filling coordinate values of the filling patterns inside the contour lines, so that the size and position of the two-dimensional code color block processed on the product are completely consistent with the size and position of the same color block in the color two-dimensional code. BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 The flow chart of the color two-dimensional code generation method of the present application;
[0036] Figure 2 The schematic diagram of information division and color replacement of the present application;
[0037] Figure 3 The structural schematic diagram of the color two-dimensional code after vector superposition of the present application;
[0038] Figure 4 The flow chart of the laser processing color two-dimensional code method of the present application;
[0039] Figure 5 The flow chart of obtaining the laser processing parameters and the color mapping table of the color two-dimensional code of the present application. DETAILED DESCRIPTION
[0040] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0041] Example 1:
[0042] A color QR code generation method, which 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 versions of the black and white two-dimensional codes are consistent, and the image sizes are consistent; 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 the 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 version of the two-dimensional code depends on the amount of data to be stored;
[0045] S3. Using a color replacement rule, replace the black and white code elements 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 base colors, obtain a first color code element, a second color code element, and a third color code element corresponding to the base 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, respectively;
[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, in step S2, the present invention uses QRcode, which is widely used, has strong error correction capabilities, and is fast to recognize, to generate a QR code. Specifically, the open source barcode generation tool Zint is first used to write a generation interface in the Qt platform. The three segments of information to be encoded are sequentially generated into black and white QR codes. The three QR codes are ensured to be of the same version, that is, the size and number of code elements are consistent.
[0048] In step S3, the screening of the base colors must meet the following screening principles: (1) the base colors have mutually independent base vectors; (2) the contrast between the multiple composite colors obtained by vector superposition of the base colors is high; and (3) the resultant vector after vector superposition can be decomposed into the base vectors before the superposition.
[0049] In step S4, the vector superposition includes the following steps: a base image is built which is consistent with the black-and-white two-dimensional code image version, has the same size, and has the same code element color, and the code element color of the base image is black with RGB (0, 0, 0); the three double-color two-dimensional codes are sequentially traversed, and the code element colors of the code elements at the same position in the double-color two-dimensional codes are superimposed on the newly built base image according to the vector synthesis method, thereby obtaining a color two-dimensional code containing 8 colors.
[0050] Meanwhile, in step S4, each code element color 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 double-color two-dimensional codes.
[0051] According to the screening principle of the base colors, the RGB values of (255, 0, 0), (0, 255, 0), and (0, 0, 255) are taken as the base colors, the code element color of the first color code element is red with (255, 0, 0), the code element color of the second color code element is green with (0, 255, 0), and the code element color of the third color code element is blue with (0, 0, 255); the RGB values of the above three base colors are different, the contrast of the composite colors is high, and the difference between the composite colors is at least 255.
[0052] Taking the above red, green, and blue as the base colors, and taking the original information as a string of UDI data, as shown in FIG. 1, the components of the data mainly include two parts: a device identifier DI and a production identifier PI. The specific generation steps of the color two-dimensional code of the UDI data are as follows: Figure 2
[0053] S1, the UDI data is divided into three pieces of information with similar byte lengths, obtaining data (01) 0698541007 representing a device identifier, data (17) 251003 representing a production date, and data (10) 2020130004 representing a batch number;
[0054] S2, the three pieces of information are respectively generated into three black-and-white two-dimensional codes with the same number of code elements; specifically, an open source tool Zint is used to write a two-dimensional code generation interface in a Qt platform, the version of the two-dimensional code (representing the size and capacity of the two-dimensional code) is set, the code system is selected as QRcode, and three black-and-white two-dimensional codes 10, 20, and 30 with the same size and the same number of code elements are generated;
[0055] S3, the first color symbol, i.e. red symbol, the second color symbol, i.e. green symbol and the third color symbol, i.e. blue symbol, are obtained from the red, green and blue three colors; the color of the white symbol 12, 22 and 32 in the three black and white two-dimensional codes 10, 20 and 30 is replaced by black with RGB (0, 0, 0), and the black symbol 14, 24 and 34 (indicating that there is no any filling line in the black symbol) is obtained; at the same time, the black symbol 11, 21 and 31 in the black and white two-dimensional code 10, 20 and 30 is replaced by the red symbol 13 (represented by horizontal filling line), the green symbol 23 (represented by vertical filling line) and the blue symbol 33 (represented by inclined filling line), and finally three double-color two-dimensional codes are obtained, which are double-color two-dimensional code 15 with red code black bottom, double-color two-dimensional code 25 with green code black bottom and double-color two-dimensional code 35 with blue code black bottom, as shown in Figure 2
[0056] S4, the symbol colors corresponding to the same position symbols in the above three double-color two-dimensional codes are vector superimposed to obtain a color two-dimensional code with 8 colors. As shown in Figure 3 Figure 3
[0057] No. 1: RGB (255, 0, 0), which is obtained by vector superimposing the RGB of the red color in the double-color two-dimensional code 15, the black color in the double-color two-dimensional codes 25 and 35;
[0058] No. 2: RGB (0, 0, 255), which is obtained by vector superimposing the RGB of the blue color in the double-color two-dimensional code 35, the black color in the double-color two-dimensional codes 15 and 25;
[0059] No. 3: RGB (0, 255, 0); which is obtained by vector superimposing the RGB of the green color in the double-color two-dimensional code 25, the black color in the double-color two-dimensional codes 15 and 35;
[0060] No. 4: RGB (0, 0, 0); which is obtained by vector superimposing the RGB of the black color in the double-color two-dimensional codes 15, 25 and 35;
[0061] No. 5: RGB (0, 255, 255); which is obtained by vector superimposing the RGB of the black color in the double-color two-dimensional code 15, the green color in the double-color two-dimensional code 25 and the blue color in the double-color two-dimensional code 35;
[0062] No. 6: RGB (255, 255, 0); which is obtained by vector superimposing the RGB of the red color in the double-color two-dimensional code 15, the green color in the double-color two-dimensional code 25 and the black color in the double-color two-dimensional code 35;
[0063] No. 7: RGB(255, 0, 255); which is obtained by vector superposition of the RGB of red in the double-color two-dimensional code 15, black in the double-color two-dimensional code 25 and blue in the double-color two-dimensional code 35;
[0064] No. 8: RGB(2525, 255, 255); which is obtained by vector superposition of the RGB of red in the double-color two-dimensional code 15, green in the double-color two-dimensional code 25 and blue in the double-color two-dimensional code 35.
[0065] The above eight colors constitute 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, the information density of the color two-dimensional code 40 is 3 times that of the black-and-white two-dimensional code under the condition of the same size, greatly improving the information capacity. At the same time, the method of vector synthesis for superimposing the double-color two-dimensional code can be applied to two-dimensional codes of different code systems without changing the original code system coding rules. Therefore, when extracting information from the color two-dimensional code, only the pre-processing program of splitting the color two-dimensional code into black-and-white two-dimensional codes and the post-processing program of data splicing are needed, 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 generation device, and the device uses the method in embodiment 1 to generate the color two-dimensional code.
[0068] The color two-dimensional code generation 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 pieces of information, i.e. it is used to perform step S1 in embodiment 1. The black-and-white two-dimensional code encoding module generates black-and-white two-dimensional codes with consistent versions according to the two-dimensional code encoding rules, i.e. it is used to perform step S2 in embodiment 1. The color replacement module is used to replace the colors of the black-and-white two-dimensional codes to obtain three double-color two-dimensional codes for vector superposition, i.e. it is used to perform step S3 in embodiment 1. The vector synthesis module is used to superimpose the three double-color two-dimensional codes into a color two-dimensional code containing eight 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 of a color two-dimensional code.
[0071] The embodiment is to form color by interference principle of light. Specifically, laser is used to oxidize surface of material to be processed to form oxide film; when light irradiates on the oxide film, part of light is reflected on the surface of the oxide film, and another part of light enters inside the oxide film and is reflected; when two columns of reflected light waves meet, interference occurs to form colored light. By adjusting laser processing parameters, oxide films with different thicknesses are formed to obtain different colors.
[0072] If the color two-dimensional code to be processed contains n kinds of code element colors, the processing method comprises the following steps:
[0073] S1, mapping table of laser processing parameters and n kinds of code element colors in the color two-dimensional code is obtained by experiment;
[0074] S2, image processing is performed on the color two-dimensional code to obtain two-dimensional code processing image; pixel points in the two-dimensional code processing image are traversed to obtain m two-dimensional code color blocks, and m≧n; contour line extraction is performed on the two-dimensional code color blocks to obtain contour line coordinate values of m contour lines; n different filling patterns are used to represent n kinds of code element colors; according to the code element color corresponding to the contour line, the region surrounded by the contour line is filled with the filling pattern corresponding to the code element color to obtain m groups of filling pattern coordinate values; the two-dimensional code color block refers to a connected region with the same color in the two-dimensional code processing image;
[0075] S3, the contour line coordinate values and the filling pattern coordinate values are imported into a laser processing device, and the contour line coordinate values and the filling line coordinate values corresponding to the two-dimensional code color blocks with the same code element color are distributed to the same processing layer to obtain n processing layers;
[0076] S4, processing parameters of the i-th color to be processed in the color two-dimensional code are set according to the mapping table, i=1, 2,..., n;
[0077] S5, the material to be processed is placed and fixed, the processing layer corresponding to the i-th color to be processed is selected, and scanning processing is performed on the surface of the material to be processed according to the laser processing parameters of the i-th color to be processed to complete processing of all i-th colors to be processed in the color two-dimensional code;
[0078] S6, whether i is equal to n is judged; if yes, the processing of the color two-dimensional code is completed; if no, steps S4-S5 are repeated.
[0079] Specifically, in step S2, the image processing refers to converting the color two-dimensional code into a true color image, i.e. two-dimensional code processing image, according to 24-bit true color coding rules. The contour line coordinate values and the filling pattern coordinate values are the coordinate values of each contour line and each filling pattern extracted with the top left corner of the two-dimensional code processing image as the origin.
[0080] The graphic filling refers to filling the area enclosed by the contour lines; the filling graphic is a parallel line group with equal intervals, 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 need to be independent of each other. The parameters of the parallel line group include the interval size of the parallel lines, i.e. the line interval, the included 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 line 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 line 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 peripheral contour of the color two-dimensional code, so as to avoid the loss of color two-dimensional code information.
[0081] In step S2, the bias operation and the Boolean clipping operation are further performed on the two-dimensional code graphic, including the following steps:
[0082] S21, importing m contour line coordinate values and m filling line coordinate values into processing software such as Clipper2 open source library;
[0083] S22, performing a bias operation on the contour line coordinate values to obtain bias contour line coordinate values, and then performing a Boolean clipping operation on the filling line coordinate values with the bias contour line as a clipping window to obtain the intersection of the contour line and the parallel line, so as to obtain the clipping filling graphic coordinate values.
[0084] At this time, in step S3, the bias contour line coordinate values and the clipping filling graphic coordinate values are imported into the laser processing equipment.
[0085] In the above steps, the bias operation is to make the multiple contour lines processed on the product to be processed consistent with the area size in each contour line in the color two-dimensional code. In different laser processing processes, the laser spot has a size and has a heat effect on the material. For example, when a square area is processed, the actual side length obtained is larger than the required side length, so it is necessary to shrink a distance to process the correct size. The Boolean clipping operation is to obtain the filling graphic in the contour line after the bias operation; it clips (finds the intersection) the parallel line group with the closed contour line to cut off the parallel line group outside the contour line, and the parallel line group inside the contour line is the filling graphic.
[0086] In step S5, the laser processing parameters include the scanning speed, the laser power and the 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 commodity, so that the color two-dimensional code is not easy to fall off and damage, and the color retention time is long. In the laser processing method, the color two-dimensional code used can be obtained by any color two-dimensional code generation method in Embodiment 1.
[0088] Embodiment 4:
[0089] The difference between this embodiment and Embodiment 1 or 2 or 3 or 4 is that the obtaining of the mapping table comprises the following steps:
[0090] S11, adjusting the defocusing amount of the laser processing equipment, and making the initial defocusing amount 0;
[0091] S12, selecting unprocessed material to be processed, and fixing the surface after pretreatment in the laser processing equipment;
[0092] S13, using laser marking software to draw a plurality of square frames, and performing pattern filling on parallel lines in the square frames at a certain interval, and then deleting the square frames, thereby obtaining a plurality of parallel line group regions;
[0093] S14, setting the initial scanning speed and the initial laser power of laser processing, and gradually increasing the scanning speed and the laser power, and sequentially processing a plurality of straight line group regions to obtain a test processing parameter and a test color block test correspondence table;
[0094] S15, finding out a test color block similar to the color of the color two-dimensional code from the test color block, and recording the test processing parameter and the defocusing amount corresponding to the selected test color block according to the test correspondence table to form a selected correspondence table;
[0095] S16, judging whether all colors in the color two-dimensional code are found, if all colors are found, then the collection of all selected correspondence tables is a mapping table of the color to be processed and the laser processing parameter; if not, adjust the laser defocusing amount by 1mm, and repeat steps S11 and S15 until all colors in the color two-dimensional code are found.
[0096] Taking stainless steel as an example:
[0097] S11, adjusting the distance between the field lens in the laser marking machine and the material platform to adjust the position of the laser focus; at the beginning, the laser focus is just on the surface of the stainless steel, that is, the defocusing amount is 0;
[0098] S12, polishing the surface of 100mm×100mm×2mm 304 stainless steel to a mirror surface, and fixing it on the material platform of the laser marking machine;
[0099] S13, draw a square frame of 2mm*2mm using laser marking software, fill the square with parallel straight lines with a line spacing of 0.01mm using the fill tool, and then delete the square frame to obtain a plurality of parallel line group regions;
[0100] S14, taking a corner of the stainless steel as the origin, two right-angle 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 (%); setting 15mm / s as the initial scanning speed, 3% of the maximum laser power of the device as the initial laser parameter, and gradually increasing the scanning speed and laser power at 15mm / s and 3% of the maximum laser power, using a laser marking machine to process the surface of the stainless steel to obtain 33*33 test color blocks, and obtaining a test correspondence table of 33*33 test processing parameters and test color blocks;
[0101] S15, finding the color similar to the color in the color two-dimensional code from the above 33 test color blocks, recording the test processing parameters and defocusing amount corresponding to the selected test color block according to the test correspondence table, and forming a selected correspondence table;
[0102] S16, judging whether the n colors in the color two-dimensional code are all found, if all are found, the collection of all selected correspondence tables is a mapping table of the color to be processed and the laser processing parameter; if not all are found, the defocusing amount is increased by 1mm as the interval, and steps S11-S15 are repeated.
[0103] It should be noted that the technical features in the above embodiments 1 to 4 can be combined in any way, and the technical solutions formed by the combination all belong to the protection scope of the present application. In this document, terms such as "include", "contain" or any other variants are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or device including the element.
[0104] Although the embodiments of the present application have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and variations can be made to the embodiments without departing from the principles and spirit of the present application, and the scope of the present application is defined by the appended claims and their equivalents.
Claims
1. A method for generating a color QR code, comprising the following steps: S1. Divide the original information into three segments with similar byte lengths; S2. Generate three black-and-white QR codes consisting of only black and white code elements from the three segments of the split information; the black-and-white QR codes are of the same version and have the same image size; S3. Using a color replacement rule, replace the black and white code elements in the black-and-white QR code to obtain a dual-color QR code. The color replacement rule includes selecting three different chromatic colors as base colors, obtaining a first color code element, a second color code element, and a third color code element corresponding to the base colors, replacing the white code element in the black-and-white QR code with a black code element, and replacing the black code elements in the three black-and-white QR codes with the first, second, and third color code elements, respectively. 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 having eight colors; The RGB values of the three basic colors are (255, 0, 0), (0, 255, 0), and (0, 0, 255). 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 sequence, and superimposing the code element colors of the code elements in the same position in the dual-color QR codes on the basic image, thereby obtaining a color QR code containing a total of 8 colors.
2. A color two-dimensional code generating device, characterized in that: The generating device is used to execute the color QR code generating method according to claim 1, and includes an information division module, a black and white QR 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 QR code encoding module is used to generate the black and white QR code from the split information; the color replacement module is used to convert the black and white QR code into the dual-color QR code; the vector synthesis module is used to perform vector superposition on the dual-color QR code and output the color QR code.
3. A laser processing method for a color two-dimensional code according to claim 1, 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 QR code through experiments; S2. Perform image processing on the color QR code to obtain a QR code processed image, traverse the pixel points in the QR code processed image to obtain m QR code color blocks, where m≧n; perform contour line extraction on the QR code color blocks to obtain contour line coordinate values of the m contour lines; and set n different fill patterns corresponding to n code element colors. Based on the code element colors corresponding to the QR code color blocks, use the corresponding fill patterns to fill the areas enclosed by the contour lines to obtain m sets of fill pattern coordinate values; S3, importing the outline coordinate values and the fill pattern coordinate values into a laser processing device, and assigning the outline coordinate values and 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; S4, setting the processing parameters of the i-th color to be processed in the color QR 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.
4. The laser processing method according to claim 3, wherein: 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.
5. The laser processing method according to claim 3, wherein: 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.
6. The laser processing method according to claim 5, wherein: Step S2 further 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 clipped fill graphic coordinate values; 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.
7. The laser processing method according to claim 3, wherein: The laser processing parameters include scanning speed, laser power and defocusing amount.
8. The laser processing method according to claim 3, wherein: Acquisition of the mapping table includes 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 boxes, and filling the square boxes with parallel straight lines at a certain interval, and then deleting the square boxes to obtain a plurality of parallel line group areas; S14, setting an initial scanning speed and initial laser power for 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 values 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 the mapping table between 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
Two-dimensional code generation method and device, and electronic equipment
CN108710932A
Matrix type two-dimensional code, generation and decoding methods and equipment thereof
CN109978111A