Laser engraving method integrating picture processing and direct engraving and cutting

By integrating image processing and direct engraving and cutting functions into the laser engraving machine, the problems of complex operations and interruption recovery are solved, the equipment's autonomous processing and interruption recovery are realized, the user operation process is simplified and efficiency is improved.

CN118789121APending Publication Date: 2024-10-18SHENZHEN AOFENUO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410927042.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Existing laser engraving machines are complex to operate, making it difficult for middle-aged and elderly users and technical novices to use them, and restarting after an unexpected interruption during the engraving process is time-consuming and inconvenient.

Method used

Design a laser engraving method that integrates image processing and direct engraving and cutting. By importing image files into the device, establishing a file management interface and image conversion unit, generating GCODE data, and creating record files during the engraving process to achieve the interruption recovery function.

Benefits of technology

It simplifies the use steps, making it easier for middle-aged and elderly users and novice users without professional knowledge to operate. It realizes the entire process of the device from image processing to GCODE code generation and engraving. It has an interruption recovery function and improves the convenience and efficiency of operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118789121A_ABST
    Figure CN118789121A_ABST
Patent Text Reader

Abstract

The invention discloses a laser engraving method integrating picture processing and direct engraving and cutting. Comprising the following steps: A1, importing an image file to be engraved or cut into a laser engraving machine; a2, establishing a file management interface; a3, establishing an image conversion unit, and generating GCODE data; and A4, after the GCODE data is generated, the engraving machine carries out corresponding engraving according to the GCODE data, and when abnormal interruption occurs, a recovery option is provided. The laser engraving machine equipment does not need to depend on a computer or a mobile phone to carry out image processing, the whole process from image processing to GCODE code generation to actual engraving can be directly completed by the equipment, the use steps are greatly simplified, great convenience is brought to middle-aged and elderly users and small white users without professional knowledge, and the working efficiency is improved. Therefore, product application is simpler, and meanwhile, the system has an interrupt recovery function, so that corresponding countermeasures can be taken for emergencies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of laser engraving, in particular to a laser engraving method integrating image processing and direct engraving and cutting. Background Art

[0002] As a high-precision and high-efficiency engraving tool, laser engraving machines have been widely used in handicraft production, billboard manufacturing and personalized customization.

[0003] At present, most laser engraving machines on the market usually need to rely on computers or mobile phones to process images, generate GCODE codes, and then load them into the laser engraving machine for operation. This working method is complicated and inconvenient for middle-aged and elderly users and technically novice users. In addition, if the engraving process is interrupted by an accident, it is a time-consuming and inconvenient process to restart the work.

[0004] Therefore, it is particularly important to develop a laser engraving machine that is more intelligent, convenient and has interruption recovery function. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, an object of the present invention is to provide a laser engraving method integrating image processing and direct engraving and cutting.

[0006] In order to achieve the above object, the present invention adopts the following technical solution: A laser engraving method integrating image processing and direct engraving and cutting comprises the following steps: A1. Import the image file you want to engrave or cut into the laser engraving machine; A2. Establish a file management interface, and allow the file management interface to preview the imported image files and select the required images, as well as adjust the size and position of the images; A3. Establish an image conversion unit. According to the selection of engraving materials and the setting of engraving parameters, start generating GCODE data for the selected image. First, according to the grayscale conversion formula: Gray=0.333*R+0.333*G+0.333*B, the values ​​are taken according to the R, G, and B color parameters in the image, and the color channel value range is set as: 0≤R≤255,0≤G≤255,0≤B≤255,0≤Gray≤255; After getting the Gray value in each pixel block, we rely on the formula: S=1−(Gray÷255)*1000.0; Among them, S is the laser output power, so that the Gray value is associated with the laser output power, combined with the engraving path, the path distance is represented by N S values, forming the GCODE data required for engraving. Such data can be processed by the Gcode parser to obtain more position and grayscale information, thereby improving the efficiency of engraving; A4. After the GCODE data is generated, the engraving machine performs corresponding engraving based on the GCODE data: At the beginning of engraving, the engraving record file CarvingRecords.esf is created through SPIFFS. The file is modified regularly during the engraving process. If an abnormal interruption occurs during the engraving process, the information at the time of interruption is saved in the record file CarvingRecords.esf and stored in the flash. When an engraving is completed, the flash is queried to see if the CarvingRecords.esf file exists. If it exists, the user is reminded that there are unfinished engraving projects, and the engraving picture information is displayed in the reminder window. Then the user is required to choose whether to continue engraving. If the user chooses to continue engraving, the engraving interface is jumped to and the previous engraving data is restored. If the user chooses to cancel, the current engraving record file is deleted to complete the entire engraving task.

[0007] Preferably, step A3 includes an image engraving process, which is specifically as follows: when the user clicks on the interactive screen to start image engraving, two tasks will be started, one is a GCODE sending task, and the other is an image conversion task; The GCODE sending task will be processed by flow control and continuously obtain GCODE data from the image conversion unit. The image conversion unit will send a piece of generated GCODE data to the GCODE sending task each time according to the engraving parameters set by the user; By relying on the data parameter rate being greater than the speed at which the engraving operation consumes data, the entire task cycle can run normally until the image data processing is completed and the entire engraving task is completed at the same time.

[0008] Preferably, step A3 also includes a process of vector graphics cutting. When vector graphics cutting is selected, the process of vector graphics cutting is: B1. Open the SVG file and parse the SVG context; B2, parse the context content and obtain a single image shape; B3, obtaining the third-order Bezier feature points in a single figure; B4, according to the third-order Bezier feature points, the Bezier fitting curve is obtained by De Casteljau algorithm; B5. Then generate GCode data according to the coordinate values ​​of each point in the acquired path; B6. Repeat the steps from B2 to B5 until all data processing is completed.

[0009] Preferably, in step B4, the De Casteljau algorithm formula is: , where each recursion level is represented by a superscript. The control points are at the zero level and do not require a superscript. B represents the control points, where: 0 < t < 1, 0 < i < n, n represents an n-degree curve. Since a 3-degree curve is used for depiction, n = 3, and 0 < j < i.

[0010] Preferably, in step A1, import the image to be engraved or cut via a USB flash drive or WiFi.

[0011] Preferably, in step A2, for the image preview function, the imported image is saved as a pre-loaded file with a size of 480 * 320 pixels in the SD card. In this way, the device only needs to be loaded once to directly preview the image, which reduces the image preview time and facilitates the user to quickly find the desired image among multiple pictures.

[0012] Due to the adoption of the above solution, the beneficial effect of the present invention is to provide an intelligent laser engraving method integrating image processing and direct engraving and cutting functions, enabling the laser engraving machine device to complete the entire process from image processing to GCODE code generation and then to actual engraving directly by itself without relying on a computer or mobile phone, greatly simplifying the usage steps, extremely facilitating middle-aged and elderly users and novice users without professional knowledge, making the product operation more concise, and at the same time having an interruption recovery function to facilitate corresponding countermeasures for emergencies. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 is a schematic diagram of the overall steps of an embodiment of the present invention.

[0014] Figure 2 is a schematic diagram of the 3rd-order Bezier feature points of an embodiment of the present invention.

[0015] Figure 3 is a graphical schematic diagram of the De Casteljau algorithm of an embodiment of the present invention.

[0016] Figure 4 is a flow schematic diagram of the engraving process of an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0017] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and 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.

[0018] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0019] In the description of the present invention, it should be noted that, 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 directly connected or indirectly connected through an intermediate medium. It can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0020] like Figures 1 to 4 As shown, the present embodiment provides a laser engraving method integrating image processing and direct engraving and cutting, comprising the following steps: A1. Import the image file you want to engrave or cut into the laser engraving machine; A2. Establish a file management interface, and allow the file management interface to preview the imported image files and select the required images, as well as adjust the size and position of the images; A3. Establish an image conversion unit. According to the selection of engraving materials and the setting of engraving parameters, start generating GCODE data for the selected image. First, according to the grayscale conversion formula: Gray=0.333*R+0.333*G+0.333*B, the values ​​are taken according to the R, G, and B color parameters in the image, and the color channel value range is set as: 0≤R≤255,0≤G≤255,0≤B≤255,0≤Gray≤255; After getting the Gray value in each pixel block, we rely on the formula: S=1−(Gray÷255)*1000.0; Among them, S is the laser output power, so that the value of Gray is associated with the laser output power, combined with the engraving path, the distance of the path is represented by N S values, and the GCODE data required for engraving is formed. For example, if the number of compressed value blocks is 16, then the horizontal distance of the laser moving from P1 to P2 is less than 16, and it can be converted by the following method. The horizontal moving starting point P1 (x, y) and the moving end point P2 (x1, y1), where P1 and P2 have multiple color segments, the S value corresponding to the color segment is stored in the container segments[], but the total length is not greater than 16, then: dx=x1-x; Str; Str = "X" + dx; For(intI=0;I <dx;i++) { Str+=segments[i]; Str+=':' ; } Str-=':' ; Clustered=STR; Uncompressed code: G1X0.1S400 G1X0.2S300 G1X0.3S0 G1X0.1S40 G1X0.3S100 G1X0.1S100 G1X0.1S0 G1X0.1S521 G1X0.2S0 After the image is converted, one GCODE no longer corresponds to one S value (S value indicates the power of laser output), but a distance is represented by N S values: (N<=16): G1X1.5S400:300:0:0:100:100:0:521:0. In this way, the information density of GCODE is increased by N times compared to ordinary GCODE. The GCODE parser can obtain more position and grayscale information when processing such data, thereby improving the engraving efficiency.

[0021] A4. After the GCODE data is generated, the engraving machine performs corresponding engraving based on the GCODE data: At the beginning of engraving, the engraving record file CarvingRecords.esf is created through SPIFFS. The file is modified regularly during the engraving process. If an abnormal interruption occurs during the engraving process, the information at the time of interruption is saved in the record file CarvingRecords.esf and stored in the flash. When an engraving is completed, the flash is queried to see if the CarvingRecords.esf file exists. If it exists, the user is reminded that there are unfinished engraving projects, and the engraving picture information is displayed in the reminder window. Then the user is required to choose whether to continue engraving. If the user chooses to continue engraving, the engraving interface is jumped to and the previous engraving data is restored. If the user chooses to cancel, the current engraving record file is deleted to complete the entire engraving task.

[0022] Furthermore, step A3 includes an image engraving process, which is specifically as follows: when the user clicks on the interactive screen to start image engraving, two tasks will be started, one is a GCODE sending task, and the other is an image conversion task; The GCODE sending task will be processed by flow control and continuously obtain GCODE data from the image conversion unit. The image conversion unit will send a piece of generated GCODE data to the GCODE sending task each time according to the engraving parameters set by the user; By relying on the data parameter rate being greater than the speed at which the engraving operation consumes data, the entire task cycle can run normally until the image data processing is completed and the entire engraving task is completed at the same time.

[0023] Furthermore, step A3 also includes a process of vector graphics cutting. When vector graphics cutting is selected, the process of vector graphics cutting is: B1. Open the SVG file and parse the SVG context; B2, parse the context content and obtain a single image shape; B3. Get the third-order Bezier feature points in a single figure, such as Figure 2 As shown; B4, according to the third-order Bezier feature points, the Bezier fitting curve is obtained by De Casteljau algorithm; B5. Then generate GCode data according to the coordinate values ​​of each point in the acquired path; B6. Repeat steps B2 to B5 until all data are processed.

[0024] Further, in step B4, the De Casteljau algorithm formula is: , each recursive level is represented by a superscript. The control point is the zeroth level and does not require a superscript. B represents the control point, where: 0 < t < 1, 0 < i < n, n represents an n-degree curve. Since a cubic curve is used for depiction, thus n = 3, 0 < j < i, where, it can be illustrated as Figure 3 shown. From top to bottom, the top of the tower finally obtained is the desired point.

[0025] Furthermore, in step A1, the image to be engraved or cut is imported via a USB flash drive or WiFi.

[0026] Furthermore, in step A2, for the image preview function, the imported image is saved in the SD card as a pre-loaded file with a size of 480 * 320 pixels. In this way, the device only needs to be loaded once to directly preview the image, which reduces the image preview time and facilitates the user to quickly find the desired image among multiple images.

[0027] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structural or equivalent process transformations made by using the specification and drawings of the present invention, or directly or indirectly applied to other related technical fields, are similarly included in the patent protection scope of the present invention.

Claims

1. A laser engraving method integrating image processing and direct engraving and cutting, characterized in that: The following steps are involved: A1. Import the image file you want to engrave or cut into the laser engraving machine; A2. Establish a file management interface, and allow the file management interface to preview the imported image files and select the required images, as well as adjust the size and position of the images; A3. Establish an image conversion unit. According to the selection of engraving materials and the setting of engraving parameters, start generating GCODE data for the selected image. First, according to the grayscale conversion formula: Gray=0.333*R+0.333*G+0.333*B, the values ​​are taken according to the R, G, and B color parameters in the image, and the color channel value range is set as: 0≤R≤255,0≤G≤255,0≤B≤255,0≤Gray≤255; After getting the Gray value in each pixel block, we rely on the formula: S=1−(Gray÷255)*1000.0; Among them, S is the laser output power, so that the Gray value is associated with the laser output power, combined with the engraving path, the path distance is represented by N S values, forming the GCODE data required for engraving. Such data can be processed by the Gcode parser to obtain more position and grayscale information, thereby improving the efficiency of engraving; A4. After the GCODE data is generated, the engraving machine performs corresponding engraving based on the GCODE data: At the beginning of engraving, the engraving record file CarvingRecords.esf is created through SPIFFS. The file is modified regularly during the engraving process. If an abnormal interruption occurs during the engraving process, the information at the time of interruption is saved in the record file CarvingRecords.esf and stored in the flash. When an engraving is completed, the flash is queried to see if the CarvingRecords.esf file exists. If it exists, the user is reminded that there are unfinished engraving projects, and the engraving picture information is displayed in the reminder window. Then the user is required to choose whether to continue engraving. If the user chooses to continue engraving, the engraving interface is jumped to and the previous engraving data is restored. If the user chooses to cancel, the current engraving record file is deleted to complete the entire engraving task.

2. A laser engraving method integrating image processing and direct engraving and cutting as claimed in claim 1, characterized in that: Step A3 includes an image engraving process, which is specifically as follows: when the user clicks on the interactive screen to start image engraving, two tasks will be started, one is a GCODE sending task, and the other is an image conversion task; The GCODE sending task will be processed by flow control and continuously obtain GCODE data from the image conversion unit. The image conversion unit will send a piece of generated GCODE data to the GCODE sending task each time according to the engraving parameters set by the user; By relying on the data parameter rate being greater than the speed at which the engraving operation consumes data, the entire task cycle can run normally until the image data processing is completed and the entire engraving task is completed at the same time.

3. A laser engraving method integrating image processing and direct engraving and cutting as claimed in claim 2, characterized in that: Step A3 also includes a process of vector graphics cutting. When vector graphics cutting is selected, the process of vector graphics cutting is as follows: B1. Open the SVG file and parse the SVG context; B2, parse the context content and obtain a single image shape; B3, obtaining the third-order Bezier feature points in a single figure; B4, according to the third-order Bezier feature points, the Bezier fitting curve is obtained by De Casteljau algorithm; B5. Then generate GCode data according to the coordinate values ​​of each point in the acquired path; B6. Repeat steps B2 to B5 until all data are processed.

4. A laser engraving method integrating image processing and direct engraving and cutting as claimed in claim 3, characterized in that: In the said step B4, the formula of the De Casteljau algorithm is as follows: , each recursive level is represented by a superscript. The control points are at the zero level and do not require a superscript. B represents the control points, where: 0 < t < 1, 0 < i < n, n represents an n-degree curve. Since a cubic curve is used for depiction, thus n = 3, 0 < j < i.

5. A laser engraving method integrating image processing and direct engraving and cutting as claimed in claim 4, characterized in that: In step A1, import the image you want to engrave or cut via USB or WiFi.

6. A laser engraving method integrating image processing and direct engraving and cutting as claimed in claim 4, characterized in that: In step A2, the image preview function saves the imported image in the SD card as a preloaded file with a size of 480*320 pixels, so that the device only needs to load it once to directly preview the image, which reduces the image preview time and allows users to quickly find the desired image among multiple images.