A method for quickly creating batches of character information for laser marking
By judging and converting the attributes of converted text, the batch creation of character information in laser marks is achieved, and the problems of low production efficiency and inconsistent identification in the existing technology are solved, and processing efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202411801179.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-12-09
AI Technical Summary
The prior art is difficult to realize the rapid batch creation of character information in laser marks, resulting in low production efficiency and the aesthetics and consistency of product marks, while increasing operational errors and production time.
By judging the text recognition attributes and edit attributes of the converted text, combined with the font track database and big data retrieval of the laser identification device, it is converted into target character information, and the batch creation of character information recognized by the laser software can be achieved.
It improves the efficiency and accuracy of word processing, simplifies the operation process, reduces the possibility of errors caused by artificial modification, ensures that the target character information meets the requirements of laser identification, and expands the scope of application of laser identification.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of information processing, and in particular to a method for quickly creating batches of character information for laser marking. Background Art
[0002] During the production process, product identification often needs to be customized according to the specific needs of customers, including product logos, uniquely designed texts, and special characters with anti-counterfeiting properties. These customized contents may face compatibility issues on different software platforms, making them difficult to edit when changing software, thus affecting the consistency of the identification effect. In addition, in order to meet the process requirements, the existing design content may need to be modified, such as converting curves into point groups or small circle patterns. In traditional methods, in order to ensure the accuracy and consistency of laser marking, it is usually necessary to remake all content or make special characters independently. However, this method has many disadvantages: large-scale character production requires a lot of time and energy, the operation steps are cumbersome, and manual operation is prone to introduce errors. For the processing of special characters, since they are stored separately in a character set and cannot be mixed with regular characters in the same text, it makes it difficult to unify the editing and processing process. Therefore, there is an urgent need for a method that can quickly create character information that can be recognized by laser software in batches, so that content that meets the requirements of laser software can be modified and generated in batches without remaking all content. The implementation of this method will help improve production efficiency, ensure the beauty and consistency of product identification, and reduce operation errors and production time.
[0003] Chinese patent publication number: CN116579828A discloses a personalized customization method and system for service-oriented manufacturing, the method comprising: obtaining an order from a customer, extracting identification information of the product to be processed from the order; obtaining identification information of the product to be processed from the order, searching for components of the product to be processed according to the identification information; obtaining features of the product to be processed from the order, adjusting and / or replacing the components according to the features of the product to be processed, and obtaining component features of the product to be processed; searching for component models that match the component features of the product to be processed from the design software according to the component features of the product to be processed, and assembling the component models into product models; generating production data of the product corresponding to the product model according to the product model. However, this solution only realizes the intelligence of the customization process, and cannot realize the batch and rapid creation of character information for laser marking in the customization process, and has low production efficiency. It cannot ensure the aesthetics and consistency of product marking while reducing operation errors and production time. Summary of the invention
[0004] To this end, the present invention provides a method for quickly creating batches of character information for laser marking, so as to overcome the problem of low production efficiency caused by the prior art that due to the various input methods of the text to be converted, it is impossible to realize the quick batch creation of character information for laser marking with diversified input methods during the customized processing process, and it is impossible to ensure the aesthetics and consistency of the product marking while reducing operational errors and production time.
[0005] To achieve the above object, the present invention provides a method for quickly creating character information in batches for laser marking, comprising:
[0006] Step S1, judging the text recognition attribute of the text to be converted;
[0007] Step S2, determining whether the text recognition attribute of the text to be converted is an editing attribute of a recognizable text, and obtaining the editing attribute of the text to be converted;
[0008] Step S3, converting the text to be converted whose editing attribute is editable text to obtain target character information of the text to be converted;
[0009] Step S4, converting the text to be converted whose editing attribute is non-editable text to obtain target character information of the text to be converted;
[0010] Step S5, determining the storage mode of the text to be converted whose text recognition attribute is unrecognizable text, and obtaining the storage mode of the text to be converted;
[0011] Step S6, converting the text to be converted in which the text to be converted is saved as a single text and a single picture, to obtain target character information of the text to be converted;
[0012] Step S7, converting the text to be converted in a single picture in which all texts are saved to obtain target character information of the text to be converted.
[0013] Furthermore, in the step S1, the character recognition attribute of the character to be converted is judged according to the input mode of the character to be converted, wherein:
[0014] When the input mode of the text to be converted is text input, determining that the text recognition attribute of the text to be converted is recognizable text;
[0015] When the input mode of the text to be converted is vector file input, determining that the text recognition attribute of the text to be converted is recognizable text;
[0016] When the input mode of the text to be converted is picture input, it is determined that the text recognition attribute of the text to be converted is unrecognizable text.
[0017] Furthermore, in the step S2, the character recognition attribute of the character to be converted is judged as the editing attribute of the recognizable character according to the input mode of the character to be converted, wherein:
[0018] When the input mode of the text to be converted is vector file input, the editing attribute of the text to be converted is determined to be non-editable text;
[0019] When the input mode of the text to be converted is text input, the text recognition attribute of the text to be converted is judged as the editing attribute of the recognizable text according to the font trajectory database of the laser marking device, wherein:
[0020] If the font of the text to be converted exists in the font trajectory database of the laser marking device, determining that the editing attribute of the text to be converted is editable text;
[0021] If the font of the text to be converted does not exist in the font trajectory database of the laser marking device, a big data search is performed on the font of the text to be converted, and a supplementary judgment is made on the editing attributes of the recognizable text based on the big data search results, wherein:
[0022] When a font that is consistent with the conversion font of the text to be converted is retrieved by the big data and the software usage is retrieved, the retrieved font is added to the font track database as a supplementary font, and the editing attribute of the text to be converted is determined to be editable text;
[0023] When a font that is consistent with the conversion font of the text to be converted is retrieved by the big data and cannot be retrieved by the software usage, the retrieved font is added as a supplementary font to the font track database, and the editing attribute of the text to be converted is determined to be editable text;
[0024] When the big data cannot retrieve a font that is consistent with the conversion font of the text to be converted, and the software usage retrieves it, the text recognition attribute of the text to be converted is modified to unrecognizable text;
[0025] When the big data cannot retrieve a font that is consistent with the conversion font of the text to be converted, and the software usage cannot retrieve it, the creation of the text to be converted is abandoned.
[0026] Further, in the step S3, the text to be converted whose editing attribute is editable text is converted by an editable text conversion method to obtain target character information of the text to be converted, and the editable text conversion method includes:
[0027] Step S21, reading the text to be converted in the text input, and obtaining the font, character height and content of each character in the text to be converted;
[0028] Step S22, drawing the character information of each character according to the font, character height and content of each character, and drawing the recognizable trajectory of each character according to the character information of each character;
[0029] Step S23, converting the recognizable trajectory of each character into a new trajectory of each character according to the image group parameters;
[0030] Step S24, combining the characters with the new trajectories of the characters to obtain a trajectory combination of the characters, taking the trajectory combination collection of the characters as target character information of the characters to be converted, and saving the target character information of the characters to be converted to FONTA.
[0031] Further, in the step S4, the text to be converted whose editing attribute is non-editable text is converted by a non-editable text conversion method to obtain target character information of the text to be converted, and the non-editable text conversion method includes:
[0032] Step S31, obtaining the text to be converted input in the form of a vector file, modifying the file name of the text to be converted into the text content of the vector file, and obtaining the text to be converted after the file name is modified;
[0033] Step S32, placing the text to be converted after the file name is modified in a vector folder;
[0034] Step S33, loading the vector folder;
[0035] Step S34, loading the text to be converted after each modified file name in the vector folder;
[0036] Step S35, obtaining the recognizable tracks of the text to be converted in the text to be converted after the file name is modified;
[0037] Step S36, converting the recognizable tracks of the characters to be converted into new tracks of the characters to be converted according to the graph group parameters;
[0038] Step S37, combining the file name of each character to be converted with the new trajectory of each character to be converted to obtain a trajectory combination of each character, taking the trajectory combination collection of each character as the target character information of the character to be converted, and saving the target character information of the character to be converted to FONTA.
[0039] Furthermore, in the step S5, the storage mode of the text to be converted whose text recognition attribute is unrecognizable text is judged by the storage mode judgment model to obtain the storage mode of the text to be converted.
[0040] Further, in the step S6, the text to be converted whose storage mode is single text saving single picture is converted by a single text saving single picture conversion method to obtain target character information of the text to be converted, and the single text saving single picture conversion method includes:
[0041] Step S41, modifying the name of the picture of the text to be converted into the content of the text to be converted, and placing the picture of the text to be converted after the name modification into a single text storage single picture folder;
[0042] Step S42, loading the single text to save a single picture folder;
[0043] Step S43, inputting the image group parameters of the images of each text to be converted in the single image folder storing the single text;
[0044] Step S44, inputting the modification ratio of each image of the text to be converted;
[0045] Step S45, loading the first picture in the folder;
[0046] Step S46, identifying the text outline of the first image and converting it into a dxf file for storage;
[0047] Step S47, loading the dxf file to obtain a recognizable track of the text content to be converted;
[0048] Step S48, converting the recognizable trajectory of the text content to be converted into a new trajectory of the text content to be converted according to the graph group parameters;
[0049] Step S49, saving the text content to be converted and combining it with the new trajectory of the text content to be converted to obtain a trajectory combination of the text content to be converted;
[0050] Step S410, load the next picture in the folder, repeat steps S46-S49 until all the pictures in the folder are loaded, obtain the trajectory combination of each text content to be converted, use the collection of trajectory combinations of each text content to be converted as the target character information of the text to be converted, and save the target character information of the text to be converted to FONTA.
[0051] Furthermore, in the step S46, when saving the dxf file, each image track is transformed into an actual size by a proportional conversion method.
[0052] Further, in the step S7, the text to be converted whose storage mode is to save all texts in a single picture is converted by a conversion method for saving all texts in a single picture to obtain target character information of the text to be converted, and the conversion method for saving all texts in a single picture includes:
[0053] Step S52, loading all the text single pictures;
[0054] Step S53, inputting the starting position and row and column size of all the single text images, dividing all the single text images according to the starting position and row and column size, and obtaining the unit area of all the single text images;
[0055] Step S54, sorting the unit areas to obtain a unit area sequence;
[0056] Step S55, identifying the text outline of the first unit area in the unit area sequence, and converting it into a dxf file for storage;
[0057] Step S56, loading the dxf file to obtain a recognizable trajectory of the first unit area;
[0058] Step S57, converting the identifiable trajectory of the first unit area into a new trajectory of the first unit area according to the graph group parameters;
[0059] Step S58, combining the text content of the first unit area with the new trajectory of the first unit area to obtain a trajectory combination of the first unit area;
[0060] Step S59, loading the next unit area in the unit area sequence, repeating steps S55-S58 until all unit areas in the unit area sequence are loaded, obtaining the trajectory combination of each unit area, taking the trajectory combination collection of each unit area as the target character information of the text to be converted, and saving the target character information of the text to be converted to FONTA.
[0061] Furthermore, in the step S54, the unit areas are sorted according to an area sorting method to obtain a unit area sequence.
[0062] Compared with the prior art, the beneficial effect of the present invention lies in that the method judges the text recognition attribute of the text to be converted through step S1, so as to quickly create character information recognizable by laser software according to the text recognition attribute of the text to be converted. The method judges the text editing attribute as recognizable and editable text through step S2, so as to directly process the editable text without additional recognition and conversion process, thereby shortening the processing time, improving the efficiency and accuracy of text processing, and ensuring that the character information can be quickly converted into a format recognizable by laser software. The method directly converts the editable text into target character information through step S3, so as to quickly convert the edited recognizable text, simplify the operation process, ensure that the target character information meets the laser marking requirements, and reduce the possibility of errors in human modification. The method converts the non-editable text through step S4 to generate the target character information. The method can automatically process the uneditable text and generate standardized target character information through a special conversion process, thereby overcoming the limitation of the uneditable text and expanding the application scope of the laser marking. The method judges the storage method of the unrecognizable text through step S5 to provide a special storage method judgment process for the unrecognizable text, thereby ensuring that all types of text information can be recorded and processed, thereby enhancing the system's ability to process diversified text and adapting to the needs of different scenarios. The method generates target character information word by word for the single-word and single-image storage method through step S6, which is convenient for use when word-by-word adjustment or marking is required, improves the flexibility of detailed management, and is suitable for laser marking scenarios with special requirements for single characters. The method uniformly processes all text into a single file through step S7 to simplify storage and subsequent calls, thereby reducing the complexity of file management and improving overall generation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 The figure is a flow chart of the method for quickly creating batches of character information for laser marking according to the present embodiment. DETAILED DESCRIPTION
[0064] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0065] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.
[0066] It should be noted that, in the description of the present invention, terms such as "up", "down", "left", "right", "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings. This is merely for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.
[0067] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0068] See also Figure 1 As shown, it is a schematic diagram of the process of the method for quickly creating batches of character information for laser marking in this embodiment, and the method includes:
[0069] Step S1, judging the text recognition attribute of the text to be converted;
[0070] Step S2, determining whether the text recognition attribute of the text to be converted is an editing attribute of a recognizable text, and obtaining the editing attribute of the text to be converted;
[0071] Step S3, converting the text to be converted whose editing attribute is editable text to obtain target character information of the text to be converted;
[0072] Step S4, converting the text to be converted whose editing attribute is non-editable text to obtain target character information of the text to be converted;
[0073] Step S5, determining the storage mode of the text to be converted whose text recognition attribute is unrecognizable text, and obtaining the storage mode of the text to be converted;
[0074] Step S6, converting the text to be converted in which the text to be converted is saved as a single text and a single picture, to obtain target character information of the text to be converted;
[0075] Step S7, converting the text to be converted in a single picture in which all texts are saved to obtain target character information of the text to be converted.
[0076] Specifically, the method is set in a laser marking device management terminal, and can quickly create character information recognizable by laser software in batches to meet the diverse input methods of the text to be converted, so that without reproducing all the content, batches of content that meets the requirements of the diversified input methods of the laser software can be modified and generated, thereby improving production efficiency, ensuring the aesthetics and consistency of product identification, and reducing operational errors and production time. The method judges the text recognition attributes of the text to be converted through step S1, so that the character information recognizable by the laser software can be quickly created according to the text recognition attributes of the text to be converted. The method judges the text editing attributes as recognizable and editable text through step S2, so as to directly process the editable text without the need for additional recognition and conversion processes, thereby shortening the processing time and improving the efficiency and accuracy of text processing, thereby ensuring that the character information can be quickly converted into a format recognizable by the laser software. The method directly converts the editable text into the target character information through step S3, so as to quickly convert the edited recognizable text. The operation process is simplified to ensure that the target character information meets the requirements of laser marking and reduce the possibility of errors caused by human modification. The method converts the uneditable text through step S4 to generate target character information and automatically processes the uneditable text, thereby generating standardized target character information through a special conversion process, overcoming the limitations of uneditable text to expand the scope of application of laser marking. The method judges the storage method of the unrecognizable text through step S5 to provide a special storage method judgment process for the unrecognizable text, ensuring that all types of text information can be recorded and processed, thereby enhancing the system's ability to process diversified text and adapting to different scene requirements. The method generates target character information word by word for the single-word and single-image storage method through step S6, which is convenient for use when word-by-word adjustment or marking is required, improves the flexibility of detailed management, and is suitable for laser marking scenarios with special requirements for single characters. The method uniformly processes all text into a single file through step S7 to simplify storage and subsequent calls to reduce the complexity of file management and improve overall generation efficiency.
[0077] Specifically, in step S1, the character recognition attribute of the character to be converted is judged according to the input mode of the character to be converted, wherein:
[0078] When the input mode of the text to be converted is text input, determining that the text recognition attribute of the text to be converted is recognizable text;
[0079] When the input mode of the text to be converted is vector file input, determining that the text recognition attribute of the text to be converted is recognizable text;
[0080] When the input mode of the text to be converted is picture input, it is determined that the text recognition attribute of the text to be converted is unrecognizable text.
[0081] Specifically, the text recognition attribute of the text to be converted refers to the text attribute of whether the laser marking device can automatically identify the trajectory of the text to be converted, including recognizable text and unrecognizable text. The text to be converted refers to data information that can be directly processed by the laser marking device and is waiting to be converted to meet the processing effect. The input method of the text to be converted refers to the method of inputting the text to be converted into the laser marking device, including text input, vector file input and picture input. The text input refers to text information directly input through the keyboard. The input content is standard characters or text with a clear format. The laser marking device can directly parse its trajectory information, which is suitable for scenes that require fast editing and conversion. The characters can be directly used for laser processing. The vector file input refers to inputting vector files storing text information, such as SVG, DXF and other formats, into the laser marking device. The vector file contains path information and can accurately describe the trajectory and shape of the text. The laser marking device can directly read these trajectories for processing. , no additional conversion is required, and it is often used in scenarios that require precise control of text shape and design, such as patterned text marking. The image input refers to inputting an image file containing text content, such as JPG, PNG, BMP and other formats, into the laser marking device. The text in the image usually exists in the form of pixels, and the laser marking device cannot directly recognize its trajectory. It needs to be recognized by OCR optical character recognition or manually converted into a vector trajectory before it can be used for processing. It is suitable for scenarios where existing image content or non-editable text needs to be marked. The image input includes saving a single image with a single text and saving a single image with all text. The single text saving a single image means that the input image is saved in a way that there is only one text on a picture, and the all text saving a single image means that the input image is saved in a way that there are multiple texts on a picture. The recognizable text refers to the text that can be directly recognized by the laser marking device, and the unrecognizable text refers to the text that cannot be directly recognized by the laser marking device.
[0082] Specifically, in step S2, the character recognition attribute of the character to be converted is judged as the editing attribute of the recognizable character according to the input mode of the character to be converted, wherein:
[0083] When the input mode of the text to be converted is vector file input, the editing attribute of the text to be converted is determined to be non-editable text;
[0084] When the input mode of the text to be converted is text input, the text recognition attribute of the text to be converted is judged as the editing attribute of the recognizable text according to the font trajectory database of the laser marking device, wherein:
[0085] If the font of the text to be converted exists in the font trajectory database of the laser marking device, determining that the editing attribute of the text to be converted is editable text;
[0086] If the font of the text to be converted does not exist in the font trajectory database of the laser marking device, a big data search is performed on the font of the text to be converted, and a supplementary judgment is made on the editing attributes of the recognizable text based on the big data search results, wherein:
[0087] When a font that is consistent with the conversion font of the text to be converted is retrieved by the big data and the software usage is retrieved, the retrieved font is added to the font track database as a supplementary font, and the editing attribute of the text to be converted is determined to be editable text;
[0088] When a font that is consistent with the conversion font of the text to be converted is retrieved by the big data and cannot be retrieved by the software usage, the retrieved font is added as a supplementary font to the font track database, and the editing attribute of the text to be converted is determined to be editable text;
[0089] When the big data cannot retrieve a font that is consistent with the conversion font of the text to be converted, and the software usage retrieves it, the text recognition attribute of the text to be converted is modified to unrecognizable text;
[0090] When the big data cannot retrieve a font that is consistent with the conversion font of the text to be converted, and the software usage cannot retrieve it, the creation of the text to be converted is abandoned.
[0091] Specifically, the editing properties of the text to be converted refer to whether the laser marking device can generate the text properties of the text to be converted by directly drawing the text to be converted, including editable text and non-editable text. In this embodiment, the laser marking device has a font corresponding to the text to be converted. The text to be converted can be directly drawn, which is editable text. If it cannot be drawn directly, the trajectory can only be obtained by loading a file, which is non-editable text. Editable text is usually a form of changing the trajectory of an existing font, such as changing a font with a curve trajectory to a font with a circle trajectory. Non-editable text is usually adding or replacing the original trajectory, and can be transformed on the new trajectory. The font trajectory database of the laser marking device refers to a database of converted fonts of the text to be converted pre-stored in the laser marking device. The big data retrieval refers to the use of a large database and a search algorithm to find font information that matches the converted font of the text to be converted, so as to expand the font resource library of the laser marking device, and enhance the diversity and adaptability of the font resource library in the case of missing font trajectory database. The software use refers to the applicability and compatibility of the font or its converted form in a specific software application.
[0092] Specifically, in step S3, the text to be converted whose editing attribute is editable text is converted by an editable text conversion method to obtain target character information of the text to be converted, and the editable text conversion method includes:
[0093] Step S21, reading the text to be converted in the text input, and obtaining the font, character height and content of each character in the text to be converted;
[0094] Step S22, generating character information of each character according to the font, character height and content of each character, and drawing a recognizable trajectory of each character according to the character information of each character;
[0095] Step S23, converting the recognizable trajectory of each character into a new trajectory of each character according to the image group parameters;
[0096] Step S24, combining the characters with the new trajectories of the characters to obtain a trajectory combination of the characters, taking the trajectory combination collection of the characters as target character information of the characters to be converted, and saving the target character information of the characters to be converted to FONTA.
[0097] Specifically, the font of each character refers to a specific glyph design used to depict the character to be converted, the character height refers to the vertical size or height of the character in a specific font, the content refers to the specific text or character of the converted character, the character information of each character refers to the sum of information obtained by the font, character height and content set of each character, the recognizable trajectory of each character is a preliminary path or line generated according to the character information, the image group parameters refer to a parameter set guiding the conversion of the recognizable trajectory into a new trajectory, including information such as scaling, rotation, deformation, etc., to ensure that the character trajectory meets specific design or processing requirements, the new trajectory of each character refers to the character path or line adjusted according to the image group parameters, and FONTA refers to a database or file system for storing target character information.
[0098] Specifically, in the step S4, the text to be converted whose editing attribute is non-editable text is converted by a non-editable text conversion method to obtain target character information of the text to be converted, and the non-editable text conversion method includes:
[0099] Step S31, obtaining the text to be converted input in the form of a vector file, modifying the file name of the text to be converted into the text content of the vector file, and obtaining the text to be converted after the file name is modified;
[0100] Step S32, placing the text to be converted after the file name is modified in a vector folder;
[0101] Step S33, loading the vector folder;
[0102] Step S34, loading the text to be converted after each modified file name in the vector folder;
[0103] Step S35, obtaining the recognizable tracks of the text to be converted in the text to be converted after each file name is modified;
[0104] Step S36, converting the recognizable tracks of the characters to be converted into new tracks of the characters to be converted according to the graph group parameters;
[0105] Step S37, combining the file name of each character to be converted with the new trajectory of each character to be converted to obtain a trajectory combination of each character, taking the trajectory combination collection of each character as the target character information of the character to be converted, and saving the target character information of the character to be converted to FONTA.
[0106] Specifically, the text content of the vector file refers to the specific text information of the text to be converted stored in the vector file. It serves as a substitute for the file name to make the file easier to identify and manage. The vector folder refers to a specific directory or storage location for storing vector files, so as to centrally store the vector files of the text to be converted, which is convenient for subsequent loading and operation. The recognizable trajectory of the text to be converted refers to the text path information extracted from the vector file, which can be used for identification and drawing. It provides basic path data for the conversion process. The new trajectory of the text to be converted refers to the path or shape adjusted according to the image group parameters to generate a new text trajectory, which is different from the original path and may be scaled, rotated or otherwise transformed for final output and generation of target character information.
[0107] Specifically, in step S5, the storage mode of the text to be converted whose text recognition attribute is unrecognizable text is determined by the storage mode judgment model to obtain the storage mode of the text to be converted.
[0108] Specifically, the storage method of the text to be converted refers to the storage method of the text to be converted when it is input, including saving a single picture for a single text and saving a single picture for all text. The storage method judgment model refers to a convolutional neural network model that takes the text to be converted input by the picture as the model input and the storage method of the unrecognizable text as the model output. This embodiment does not limit the construction method of the storage method judgment model. Those skilled in the art can freely set it according to actual conditions, and only need to meet the judgment requirements of the storage method of the recognizable text. For example, the storage method of the text to be converted input by the historical picture-historical text to be converted can be set as the model construction data set, and 70% of the model construction data set is divided into a model training set, and 30% of the model construction data set is divided into a model verification set. The convolutional neural network model is trained according to the model training set, and the trained convolutional neural network model is verified according to the model verification set. When the accuracy rate obtained by verification reaches 98%, the trained convolutional neural network model is output as the storage method judgment model.
[0109] Specifically, in step S6, the text to be converted whose storage mode is to save a single picture as a single text is converted by a single text saving a single picture conversion method to obtain target character information of the text to be converted, and the single text saving a single picture conversion method includes:
[0110] Step S41, modifying the name of the picture of the text to be converted into the content of the text to be converted, and placing the picture of the text to be converted after the name modification into a single text storage single picture folder;
[0111] Step S42, loading the single text to save a single picture folder;
[0112] Step S43, inputting the image group parameters of the images of each text to be converted in the single image folder storing the single text;
[0113] Step S44, inputting the modification ratio of each image of the text to be converted;
[0114] Step S45, loading the first picture in the folder;
[0115] Step S46, identifying the text outline of the first image and converting it into a dxf file for storage;
[0116] Step S47, loading the dxf file to obtain a recognizable track of the text content to be converted;
[0117] Step S48, converting the recognizable trajectory of the text content to be converted into a new trajectory of the text content to be converted according to the graph group parameters;
[0118] Step S49, saving the text content to be converted and combining it with the new trajectory of the text content to be converted to obtain a trajectory combination of the text content to be converted;
[0119] Step S410, load the next picture in the folder, repeat steps S46-S49 until all the pictures in the folder are loaded, obtain the trajectory combination of each text content to be converted, use the collection of trajectory combinations of each text content to be converted as the target character information of the text to be converted, and save the target character information of the text to be converted to FONTA.
[0120] Specifically, the text content to be converted refers to the single text content contained in each picture, which is used to identify and recognize the text in each picture. The single text saving single picture folder refers to the folder that stores the picture corresponding to each text to be converted, so as to centrally manage the picture files to be converted. The image group parameters of the pictures of each text to be converted refer to the parameters used to define how to process or group images, so as to guide how to operate or transform the images during the image processing process. The modification ratio of the pictures of each text to be converted refers to the ratio of image scaling or resizing, so as to adjust the image size to adapt to subsequent processing steps. The first picture in the folder refers to the first picture in the folder, which is used as the starting picture for processing. row recognition and conversion, the text outline of the first picture refers to the boundary or shape of the text recognized in the picture, which is converted into a vector format for subsequent processing, the dxf file refers to a vector graphics file format used for computer-aided design software, the recognizable trajectory of the text content to be converted refers to the path information that can be used for identification extracted from the text outline, so as to represent the text shape in a vector format, the new trajectory of the text content to be converted refers to the text trajectory adjusted according to the drawing group parameters to generate the final text path information, the next picture in the folder refers to the next picture after the currently processed picture, and all the pictures in the folder refer to all the pictures to be processed contained in the folder.
[0121] Specifically, in step S46, when saving the dxf file, each image track is transformed into an actual size by a proportional conversion method to obtain a dxf file to be saved.
[0122] Specifically, the ratio conversion method includes:
[0123] Step S461, obtaining the track size height H and the picture pixel height U of the picture track;
[0124] Step S462, obtaining the height F of the dxf file;
[0125] Step S463, calculating the modification ratio DX according to the track size height H of the image track and the image pixel height U, and setting DX=H / U;
[0126] Step S464, calculating the size C of the dxf file to be saved according to the modification ratio DX, and setting C=F×DX.
[0127] Specifically, in this embodiment, the track size is 20, the pixels in the saved image are 238*231, the image pixel height is 238, the size of the dxf file is 237.4*230.2, and the size of the dxf file is F=237.4, so the modification ratio DX=20 / 238=0.084. The size of the saved dxf file is C=F×DX=19.94.
[0128] Specifically, in step S7, the text to be converted whose storage mode is to save all texts in a single picture is converted by a conversion method to save all texts in a single picture to obtain target character information of the text to be converted, and the conversion method to save all texts in a single picture includes:
[0129] Step S52, loading all the text single pictures;
[0130] Step S53, inputting the starting position and row and column size of all the single text images, dividing all the single text images according to the starting position and row and column size, and obtaining the unit area of all the single text images;
[0131] Step S54, sorting the unit areas to obtain a unit area sequence;
[0132] Step S55, identifying the text outline of the first unit area in the unit area sequence, and converting it into a dxf file for storage;
[0133] Step S56, loading the dxf file to obtain a recognizable trajectory of the first unit area;
[0134] Step S57, converting the identifiable trajectory of the first unit area into a new trajectory of the first unit area according to the graph group parameters;
[0135] Step S58, combining the text content of the first unit area with the new trajectory of the first unit area to obtain a trajectory combination of the first unit area;
[0136] Step S59, loading the next unit area in the unit area sequence, repeating steps S55-S58 until all unit areas in the unit area sequence are loaded, obtaining the trajectory combination of each unit area, taking the trajectory combination collection of each unit area as the target character information of the text to be converted, and saving the target character information of the text to be converted to FONTA.
[0137] Specifically, the single image of all texts refers to image data in which all texts are stored in a single image, the starting position of the single image of all texts refers to the starting coordinate position of the first text or unit area in the image for determining where to start dividing the image, the row and column size refers to a grid specification for guiding how to divide the image into multiple unit areas, including the number of rows, the number of columns, and the pixels in each row and column, the unit area refers to a basic unit for processing text recognition and conversion, and each small area obtained by dividing according to the row and column size contains a text, the first unit area refers to the first area to be processed in the unit area sequence as the starting unit area for text recognition and conversion, and the text content of the first unit area refers to the actual text information contained in the first unit area, that is, the text information from the area the readable text content extracted from the image, the text contour of the first unit area refers to the contour used to generate vectorization for subsequent processing, the boundary or shape of the text identified in the first unit area, the new trajectory of the first unit area refers to the final trajectory information of the first unit area, the vector trajectory of the first unit area adjusted according to the image group parameters, the unit area sequence refers to ensuring that all unit areas are processed in a specific order, the order of processing unit areas, usually from left to right and from top to bottom, the next unit area refers to being loaded in sequence for conversion in the loop processing, the next unit area after the currently processed unit area, all unit areas refer to complete batch processing to convert all text, all divided unit areas cover the entire single image of all text.
[0138] Specifically, in the step S54, the unit areas are sorted according to the area sorting method to obtain a unit area sequence.
[0139] Specifically, the region sorting method includes:
[0140] Step S541, marking the unit areas of all the text single pictures with numbers from small to large without duplication in the order of left first then right, top first then bottom;
[0141] Step S542 , obtaining digital labels of all unit areas, sorting the digital labels of all unit areas from small to large, and using the sorting as the unit area order.
[0142] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
Claims
1. A method for quickly creating batches of character information for laser marking, characterized in that: include: Step S1, judging the text recognition attribute of the text to be converted; Step S2, determining whether the text recognition attribute of the text to be converted is an editing attribute of a recognizable text, and obtaining the editing attribute of the text to be converted; Step S3, converting the text to be converted whose editing attribute is editable text to obtain target character information of the text to be converted; Step S4, converting the text to be converted whose editing attribute is non-editable text to obtain target character information of the text to be converted; Step S5, determining the storage mode of the text to be converted whose text recognition attribute is unrecognizable text, and obtaining the storage mode of the text to be converted; Step S6, converting the text to be converted in which the text to be converted is saved as a single text and a single picture, to obtain target character information of the text to be converted; Step S7, converting the text to be converted in which the storage mode of the text to be converted is to store all texts in a single image, to obtain target character information of the text to be converted; In step S2, the character recognition attribute of the character to be converted is judged as the editing attribute of the recognizable character according to the input mode of the character to be converted, wherein: When the input mode of the text to be converted is vector file input, the editing attribute of the text to be converted is determined to be non-editable text; When the input mode of the text to be converted is text input, the text recognition attribute of the text to be converted is judged as the editing attribute of the recognizable text according to the font trajectory database of the laser marking device, wherein: If the font of the text to be converted exists in the font trajectory database of the laser marking device, determining that the editing attribute of the text to be converted is editable text; If the font of the text to be converted does not exist in the font trajectory database of the laser marking device, a big data search is performed on the font of the text to be converted, and a supplementary judgment is made on the editing attributes of the recognizable text based on the big data search results, wherein: When a font that is consistent with the conversion font of the text to be converted is retrieved by the big data and the software usage is retrieved, the retrieved font is added to the font track database as a supplementary font, and the editing attribute of the text to be converted is determined to be editable text; When a font that is consistent with the conversion font of the text to be converted is retrieved by the big data and cannot be retrieved by the software usage, the retrieved font is added as a supplementary font to the font track database, and the editing attribute of the text to be converted is determined to be editable text; When the big data cannot retrieve a font that is consistent with the conversion font of the text to be converted, and the software usage retrieves it, the text recognition attribute of the text to be converted is modified to unrecognizable text; When the big data cannot retrieve a font that is consistent with the conversion font of the text to be converted, and the software usage cannot retrieve it, the creation of the text to be converted is abandoned.
2. The method for rapidly creating batch character information for laser marking according to claim 1, characterized in that: In step S1, the character recognition attribute of the character to be converted is judged according to the input mode of the character to be converted, wherein: When the input mode of the text to be converted is text input, determining that the text recognition attribute of the text to be converted is recognizable text; When the input mode of the text to be converted is vector file input, determining that the text recognition attribute of the text to be converted is recognizable text; When the input mode of the text to be converted is picture input, it is determined that the text recognition attribute of the text to be converted is unrecognizable text.
3. The method for rapidly creating batch character information for laser marking according to claim 1, characterized in that: In the step S3, the text to be converted whose editing attribute is editable text is converted by an editable text conversion method to obtain target character information of the text to be converted, and the editable text conversion method includes: Step S21, reading the text to be converted in the text input, and obtaining the font, character height and content of each character in the text to be converted; Step S22, drawing the character information of each character according to the font, character height and content of each character, and drawing the recognizable trajectory of each character according to the character information of each character; Step S23, converting the recognizable trajectory of each character into a new trajectory of each character according to the image group parameters; Step S24, combining the characters with the new trajectories of the characters to obtain a trajectory combination of the characters, taking the trajectory combination collection of the characters as target character information of the characters to be converted, and saving the target character information of the characters to be converted to FONTA.
4. The method for rapidly creating batch character information for laser marking according to claim 1, characterized in that: In the step S4, the text to be converted whose editing attribute is non-editable text is converted by a non-editable text conversion method to obtain target character information of the text to be converted, and the non-editable text conversion method includes: Step S31, obtaining the text to be converted input in the form of a vector file, modifying the file name of the text to be converted into the text content of the vector file, and obtaining the text to be converted after the file name is modified; Step S32, placing the text to be converted after the file name is modified into a vector folder; Step S33, loading the vector folder; Step S34, loading the text to be converted after each modified file name in the vector folder; Step S35, obtaining the recognizable tracks of the text to be converted in the text to be converted after each file name is modified; Step S36, converting the recognizable tracks of the characters to be converted into new tracks of the characters to be converted according to the graph group parameters; Step S37, combining the file name of each character to be converted with the new trajectory of each character to be converted to obtain a trajectory combination of each character, taking the trajectory combination collection of each character as the target character information of the character to be converted, and saving the target character information of the character to be converted to FONTA.
5. The method for rapidly creating batch character information for laser marking according to claim 1, characterized in that: In the step S5, the storage mode of the text to be converted whose text recognition attribute is unrecognizable text is determined by the storage mode judgment model to obtain the storage mode of the text to be converted.
6. The method for rapidly creating batch character information for laser marking according to claim 1, characterized in that: In the step S6, the text to be converted whose storage mode is to save a single picture as a single text is converted by a single text saving a single picture conversion method to obtain target character information of the text to be converted, and the single text saving a single picture conversion method includes: Step S41, modifying the name of the picture of the text to be converted into the content of the text to be converted, and placing the picture of the text to be converted after the name modification into a single text storage single picture folder; Step S42, loading the single text to save a single picture folder; Step S43, inputting the image group parameters of the images of each text to be converted in the single image folder storing the single text; Step S44, inputting the modification ratio of each image of the text to be converted; Step S45, loading the first picture in the folder; Step S46, identifying the text outline of the first image and converting it into a dxf file for storage; Step S47, loading the dxf file to obtain a recognizable track of the text content to be converted; Step S48, converting the recognizable trajectory of the text content to be converted into a new trajectory of the text content to be converted according to the graph group parameters; Step S49, saving the text content to be converted and combining it with the new trajectory of the text content to be converted to obtain a trajectory combination of the text content to be converted; Step S410, load the next picture in the folder, repeat steps S46-S49 until all the pictures in the folder are loaded, obtain the trajectory combination of each text content to be converted, use the collection of trajectory combinations of each text content to be converted as the target character information of the text to be converted, and save the target character information of the text to be converted to FONTA.
7. The method for rapidly creating batch character information for laser marking according to claim 6, characterized in that: In step S46, when saving the dxf file, each image track is transformed into an actual size by a proportional conversion method.
8. The method for rapidly creating batch character information for laser marking according to claim 1, characterized in that: In the step S7, the text to be converted whose storage mode is to save all texts in a single picture is converted by a conversion method to save all texts in a single picture to obtain target character information of the text to be converted, and the conversion method to save all texts in a single picture includes: Step S52, loading all the text single pictures; Step S53, inputting the starting position and row and column size of all the single text images, dividing all the single text images according to the starting position and row and column size, and obtaining the unit area of all the single text images; Step S54, sorting the unit areas to obtain a unit area sequence; Step S55, identifying the text outline of the first unit area in the unit area sequence, and converting it into a dxf file for storage; Step S56, loading the dxf file to obtain a recognizable trajectory of the first unit area; Step S57, converting the identifiable trajectory of the first unit area into a new trajectory of the first unit area according to the graph group parameters; Step S58, combining the text content of the first unit area with the new trajectory of the first unit area to obtain a trajectory combination of the first unit area; Step S59, loading the next unit area in the unit area sequence, repeating steps S55-S58 until all unit areas in the unit area sequence are loaded, obtaining the trajectory combination of each unit area, taking the trajectory combination collection of each unit area as the target character information of the text to be converted, and saving the target character information of the text to be converted to FONTA.
9. The method for quickly creating batches of character information for laser marking according to claim 8, characterized in that: In the step S54, the unit areas are sorted according to the area sorting method to obtain a unit area sequence.
Citation Information
Patent Citations
Personalized customization method and system for service-oriented manufacturing
CN116579828A
Biomedical entity recognition method for PDF format paper
CN111797630A
Formula processing method and system for educational resource library
CN113326675A