A graphic and text processing method for laser control system
By using a fisheye camera in the laser control system to correct the machine workstation photos, constructing a background image and matching it with the canvas, and combining it with image and text file format processing, a variety of files to be processed are generated. This solves the problems of cumbersome operation of the laser control system and the single image and text type, and realizes diversified image and text processing of laser engraving.
Patent Information
- Application Number
- CN202511093499.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-06
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-08-06
AI Technical Summary
The existing laser control system is cumbersome to operate when processing images and texts, making it difficult to meet users' personalized creation needs. The image and text types are single and require the installation of host computer software on the device.
By obtaining the machine workstation photos taken by the fisheye camera and performing correction processing, the background image is constructed and matched with the canvas. The image is processed in combination with the file format of the image and text to generate various types of files to be processed, including bitmaps and vector images, and the laser engraving mode and graphic processing parameters are set.
It realizes the diversified image and text processing of laser engraving, improves the image processing accuracy, and meets the laser engraving requirements of users with different visual needs.
Smart Images

Figure CN120599100B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data processing, and in particular relates to a graphic and text processing method of a laser control system. Background Art
[0002] Currently, laser control systems primarily include laser engraving and laser cutting. Laser engraving processes utilize numerical control technology, using laser processing as a medium. The physical transformation of the material being processed, which occurs instantaneously when irradiated by the laser, allows laser engraving to achieve its intended purpose. For example, lasers can be applied to materials such as wood, acrylic, plastic, or stone. However, in the laser application industry, it is often necessary to install the graphics (images or files) to be processed on the device, or download pre-set processing files that match the device from the cloud. These graphics are relatively simple, and the installation of host computer software is cumbersome, making it difficult to meet users' personalized graphic creation needs. Therefore, there is an urgent need to provide a method for processing graphics in a laser control system to address the aforementioned technical issues. Summary of the Invention
[0003] In view of this, the present invention provides a graphic processing method for a laser control system, which can import different graphic file types, perform graphic matching on the background image, canvas and design drawing, and thus form a variety of files to be processed to meet the different visual needs of users for laser engraving. The method is specifically implemented by the following technical solutions.
[0004] The present invention provides a method for processing images and texts in a laser control system, comprising the following steps:
[0005] Obtaining a photo of a machine station taken by a fisheye camera, and performing correction processing on the photo of the machine station to obtain a background image;
[0006] Importing graphics and texts to the server and obtaining the file format of the graphics and texts, and performing image processing on the graphics and texts according to the file format to obtain a design drawing;
[0007] Constructing a canvas according to the background image, and performing a first graphic matching between the background image and the canvas to obtain a canvas background image;
[0008] Performing a second graphic matching between the design drawing and the canvas background image to obtain a canvas design file, and determining a graphic path and graphic processing parameters of the canvas design file;
[0009] The canvas design file is layer-classified based on the graphic path and the graphic processing parameters to obtain a file to be processed, wherein the type of the file to be processed includes a bitmap and a vector map.
[0010] As a preferred embodiment of the above technical solution, the process of importing graphics and texts into a server and obtaining a file format of the graphics and texts, and performing image processing on the graphics and texts according to the file format to obtain a design drawing includes:
[0011] Obtain images and text uploaded by the client using a preset import method, wherein the preset import method includes album import, photo upload, or file addition;
[0012] Extracting text information or image information of the image and text, and loading the image and text into a first canvas;
[0013] Adjusting a first resolution of the first canvas according to the image information, and performing image processing on the image and text according to the first resolution of the first canvas to obtain the design drawing, wherein the image processing includes setting a DPI value and setting an image color, the DPI value is the number of pixels per inch of the image, and the image color is a positive color or grayscale.
[0014] As a preferred embodiment of the above technical solution, adjusting the first resolution of the first canvas according to the image information, and performing image processing on the image and text according to the first resolution of the first canvas to obtain the design drawing includes:
[0015] When it is detected that the average brightness of the image information of the image is not within a preset brightness range, the image in the image is subjected to an inversion process, wherein the inversion process includes RGB channel inversion, brightness compensation, and contrast fine-tuning;
[0016] Extracting the text information using an OCR analysis algorithm to obtain the text information, wherein the OCR analysis algorithm extraction process includes grayscale conversion, halftone dot generation, and CMYK color shift, and the text information belongs to a dense area of the image containing text;
[0017] When it is detected that the color variance of the picture in the picture information is lower than a preset variance threshold, the picture in the picture information is converted to black and white.
[0018] As a preferred embodiment of the above technical solution, constructing a canvas according to the background image, and performing a first graphic matching between the background image and the canvas to obtain a canvas background image, including:
[0019] Extracting contour features of the background image, and identifying preset image information of the background image based on the contour features, wherein the preset image information includes a picture size and a second resolution of a machine workstation photo;
[0020] A second canvas is constructed based on the preset image information, and a first graphic matching is performed between the second canvas and the background image to obtain the canvas background image.
[0021] As a preferred embodiment of the above technical solution, performing a second graphic matching between the design drawing and the canvas background image to obtain a canvas design file includes:
[0022] Obtaining a processing material corresponding to the canvas background image, and adjusting the canvas size of the canvas background image according to the processing material;
[0023] The design drawing is resized according to the canvas size, and the aspect ratio of the design drawing is maintained to fill the canvas background image to obtain a canvas design file.
[0024] As a preferred embodiment of the above technical solution, classifying the canvas design file by layers based on the graphic path and the graphic processing parameters to obtain a file to be processed includes:
[0025] Performing color adjustment, cropping, and artistic processing on the design drawing on the canvas design file to obtain a processed canvas design file;
[0026] According to the processed canvas design file, the corresponding laser engraving mode and graphic processing parameters are set and a corresponding two-dimensional code image is generated. Text is added below the two-dimensional code image to generate the file to be processed.
[0027] As a preferred embodiment of the above technical solution, the graphic processing parameters include laser power, vector path and engraving speed, and the file to be processed is a rd format file.
[0028] As a preferred embodiment of the above technical solution, the corresponding laser engraving mode and graphic processing parameters are set according to the processed canvas design file to obtain the file to be processed, including:
[0029] When the laser engraving mode is the basic processing mode, the image in the to-be-processed file is vector-converted to obtain an engraving path;
[0030] Performing grayscale layering on the image in the to-be-processed file to control the engraving depth corresponding to the engraving path, and extracting a cutting line of the image of the to-be-processed file based on the engraving path and the engraving depth;
[0031] When the laser engraving mode is the creation enhancement mode, topology optimization is performed on the image in the to-be-processed file to obtain a simplified graphic;
[0032] The texture features of the simplified graphics are extracted and the dithering efficiency of the texture features is converted into a physical texture.
[0033] As a preferred embodiment of the above technical solution, a photo of a machine station taken by a fisheye camera is obtained, and the photo of the machine station is corrected to obtain a background image, including:
[0034] Within the field of view of the fisheye camera, a moving checkerboard calibration plate is used to completely cover the field of view, and a plurality of checkerboard images captured by the fisheye camera are obtained;
[0035] Preprocessing, corner point extraction and sorting of the multiple checkerboard images are performed to obtain a set of coordinate points to be corrected of the checkerboard images;
[0036] Constructing a set of actual physical coordinate points of the checkerboard image based on parameter information of a preset checkerboard calibration plate;
[0037] According to the rotation and translation matrices corresponding to the plurality of checkerboard images, a low-level rotation and translation transformation is performed on the actual physical coordinates of the checkerboard images to obtain a rotation and translation transformation coordinate point set;
[0038] A refraction transformation is performed on the rotation and translation transformation coordinate point set to obtain a refraction transformation coordinate point set, and residuals of pixel coordinate points on the checkerboard image are obtained based on the refraction transformation coordinate point set and the coordinate point set to be corrected.
[0039] As a preferred embodiment of the above technical solution, a total residual value corresponding to the multiple checkerboard images is calculated based on the residual of the pixel coordinate points, and the optimal refraction parameter corresponding to the fisheye camera and the optimal rotation and translation matrix corresponding to the checkerboard image are obtained by minimizing the total residual value;
[0040] An actual physical pixel rotation and translation mapping matrix is constructed based on the optimal rotation and translation matrices corresponding to the multiple checkerboard images, and a pixel difference algorithm is used to correct the machine workstation photo according to the actual physical pixel rotation and translation mapping matrix to obtain the background image.
[0041] By obtaining a photo of the machine station taken by a fisheye camera, the photo of the machine station is corrected to obtain a background image, the image and text are imported into the server and the file format of the image and text is obtained, the image and text are processed according to the file format to obtain a design drawing, a canvas is constructed according to the background image, the background image and the canvas are matched with the first graphic to obtain a canvas background image, the design drawing and the canvas background image are matched with the second graphic to obtain a canvas design file, and the graphic path and graphic processing parameters of the canvas design file are determined, and the canvas design file is classified into layers based on the graphic path and graphic processing parameters to obtain a file to be processed. Using a fisheye camera to correct the image can improve the image processing accuracy, and according to the file type of different images and texts, they are imported, and the background image, canvas and design drawing are matched with graphics to form a variety of files to be processed to meet the different needs of users for laser engraving. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1 A flowchart of the image and text processing method of the laser control system provided by the present invention;
[0044] Figure 2 A flow chart of the production design provided by the present invention;
[0045] Figure 3 This is a flowchart of the image correction process provided by the present invention. DETAILED DESCRIPTION
[0046] The following describes embodiments of the present invention in detail. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended only to explain the present invention and are not to be construed as limiting the present invention.
[0047] See Figure 1 The present invention provides a method for processing images and texts in a laser control system, comprising the following steps:
[0048] S1: Obtain a photo of a machine station taken by a fisheye camera, and perform correction processing on the photo of the machine station to obtain a background image;
[0049] S2: Importing images and texts to the server and obtaining the file format of the images and texts, and performing image processing on the images and texts according to the file format to obtain a design drawing;
[0050] S3: constructing a canvas according to the background image, and performing a first graphic matching between the background image and the canvas to obtain a canvas background image;
[0051] S4: performing a second graphic matching on the design drawing and the canvas background image to obtain a canvas design file, and determining a graphic path and graphic processing parameters of the canvas design file;
[0052] S5: Classifying the canvas design file by layers based on the graphic path and the graphic processing parameters to obtain a file to be processed, wherein the types of the file to be processed include bitmap and vector map.
[0053] In this embodiment, the fisheye camera can be installed on the machine (laser control system) or at the location where the user inputs images. This allows for timely capture of images to be laser engraved, calibration of the laser processing head position (machine station), and setting of a machine background image based on the machine format of the laser processing equipment. The imported images are typically in SVG, JPG, or PNG format. The user establishes a communication connection with the laser processing equipment via a mobile terminal (using the same WiFi segment, hotspot sharing, or mini-program connection). The user then imports images stored on the mobile terminal (e.g., photos of pets or flowers) into an operational interface for establishing a communication connection with the laser processing equipment. Editing operations such as file name, material selection, layers, and icon library can be configured. The SVG file and images can then be imported into the document to be designed and saved, or the corresponding drawing files can be obtained by linking to a resource community. Among them, when selecting materials, the background image of the machine format is selected according to the different thickness of the materials. The materials include official materials (default storage) and user-added materials; layers are grouped by color, and different colors represent different layers. The layers can be changed in the processing order by dragging them up and down by the user, and the layers can be hidden or displayed whether to be processed, and the layers can be locked and cannot be operated; the icon library is searched by type and content. Click the number next to the type to display all icons under that type.
[0054] It should be noted that the size and resolution of the background image can be pre-set based on the machine format or processing material, or the resolution of the captured photo. For example, a canvas is constructed based on the background image's size and resolution, and the canvas size is adjusted to perform a primary graphic match (adaptation) between the background image and the canvas. This primary graphic match typically involves scaling, translating, or hiding the canvas grid lines. The background image can include a circular frame, a colored rectangular frame, or an irregularly shaped bounding box. The design's coverage area, display scale, and grayscale can be set on the canvas background image. Secondary graphic matching can involve translation, rotation, scaling, or cropping. The graphic path of the canvas design file is determined based on the canvas's grid lines (coordinates), and element properties primarily include color. Canvas design files are categorized into bitmap and vector graphics, with bitmaps engraved by default and vector graphics cut by default. Layers are then categorized by color, and specific processing parameters in the color parameter library are matched to the corresponding design elements (element properties of the canvas design file). By obtaining a photo of the machine station taken by a fisheye camera, the photo of the machine station is corrected to obtain a background image, the image and text are imported into the server and the file format of the image and text is obtained, the image and text are processed according to the file format to obtain a design drawing, a canvas is constructed according to the background image, the background image and the canvas are matched with the first graphic to obtain a canvas background image, the design drawing and the canvas background image are matched with the second graphic to obtain a canvas design file, and the graphic path and graphic processing parameters of the canvas design file are determined, and the canvas design file is classified into layers based on the graphic path and graphic processing parameters to obtain a file to be processed. Using a fisheye camera to correct the image can improve the image processing accuracy, and according to the file type of different images and texts, they are imported, and the background image, canvas and design drawing are matched with graphics to form a variety of files to be processed to meet the different needs of users for laser engraving.
[0055] Optionally, see Figure 2 , importing graphics and texts to the server and obtaining the file format of the graphics and texts, performing image processing on the graphics and texts according to the file format to obtain a design drawing, including:
[0056] S10: Acquire images and texts uploaded by the client using a preset import method, wherein the preset import method includes album import, photo upload, or file addition;
[0057] S11: extracting text information or image information of the image and text, and loading the image and text into a first canvas;
[0058] S12: Adjusting a first resolution of the first canvas according to the image information, and performing image processing on the image and text according to the first resolution of the first canvas to obtain the design drawing, wherein the image processing includes setting a DPI value and setting an image color, the DPI value is the number of pixels per inch of the image, and the image color is a positive color or grayscale.
[0059] In this embodiment, the first resolution of the first canvas is adjusted according to the image information, and the image and text are processed according to the first resolution of the first canvas to obtain the design drawing, including: when it is detected that the average brightness of the image information of the image and text is not within a preset brightness range, the image in the image and text is inverted, wherein the inversion processing process includes RGB channel inversion, brightness compensation and contrast fine-tuning; the text information is extracted using an OCR analysis algorithm to obtain the text information, wherein the OCR analysis algorithm extraction process includes grayscale conversion, halftone dot generation and CMYK color shift, and the text information belongs to a dense area of the image and text containing text; when it is detected that the image color variance in the image information is lower than a preset variance threshold, the image in the image and text is converted to black and white.
[0060] It should be noted that the client can be a mobile phone, computer, or other mobile terminal. It can be accessed by scanning a QR code to enter the operation interface link, or by logging in to a cloud server and uploading images and text. The images and text can be a single document containing an image (such as a logo) and text (such as a watermark), or multiple documents (such as photos of pets, descriptions of habits, descriptions of external features, and keywords). For example, in the operation interface (toolbar or operation bar), successfully imported images and text can be added to the first canvas. The images in the image and text can be diffused, black and white, dithered, or newsprinted. The images in the image and text can be combined with the inversion operation to obtain more different display effects, such as color or grayscale. Then, set the DPI (DPI represents the number of pixels per inch of the image length. Generally, the higher the DPI, the higher the image printing accuracy). You can also select the cropping area of the original image to crop, flip, or mirror the image as needed. Finally, adjust the brightness and contrast of the image and text. Among them, the inversion operation refers to detecting that the average brightness of the image exceeds the preset threshold (for example, greater than 180 or less than 50). The inversion operation process is through RGB channel inversion, brightness compensation and contrast fine-tuning; news printing refers to recognizing that the image contains text-dense areas and using ORC to analyze the text-dense areas (text recognition or extraction). The news printing process is grayscale conversion, halftone dot (grid point) generation and CMYK color offset; dithering or diffusion refers to the insufficient color depth of the output device or the detection of high-frequency noise. The dithering effect is achieved through Floyd-Steinberg error diffusion, color depth degradation and grain enhancement.
[0061] Optionally, constructing a canvas according to the background image, and performing a first graphic matching between the background image and the canvas to obtain a canvas background image includes:
[0062] Extracting contour features of the background image, and identifying preset image information of the background image based on the contour features, wherein the preset image information includes a picture size and a second resolution of a machine workstation photo;
[0063] A second canvas is constructed based on the preset image information, and a first graphic matching is performed between the second canvas and the background image to obtain the canvas background image.
[0064] In this embodiment, a second graphical matching process is performed between the design drawing and the canvas background image to obtain a canvas design file, including: obtaining the processing material corresponding to the canvas background image, adjusting the canvas size of the canvas background image according to the processing material; and resizing the design drawing according to the canvas size, maintaining the aspect ratio of the design drawing to fill the canvas background image to obtain the canvas design file. The processing material can be a smooth surface such as wood, acrylic, or metal plate, or it can be a non-smooth surface leather. The engraving depth can be set according to the thickness (flatness) of the processing material, and the engraving processing area can be set according to the shape of the processing material (such as a rectangle or circle). The canvas size mainly includes the aspect ratio of the graphics in the canvas design file (the number of horizontal and vertical grids), which improves the accuracy of processing the processing file.
[0065] Optionally, classifying the canvas design file by layers based on the graphic path and the graphic processing parameters to obtain a file to be processed includes:
[0066] Performing color adjustment, cropping, and artistic processing on the design drawing on the canvas design file to obtain a processed canvas design file;
[0067] The corresponding laser engraving mode and graphic processing parameters are set according to the processed canvas design file to obtain the file to be processed, and a corresponding QR code image is generated. Text is added below the QR code image to generate the file to be processed.
[0068] In this embodiment, the graphics processing parameters include laser power, vector path, scanning gap, scanning mode, or engraving speed, and the file to be processed is an rd format file. The file to be processed is obtained by setting the corresponding laser engraving mode and graphics processing parameters according to the processed canvas design file, including: when the laser engraving mode is the basic processing mode, vectorizing the image in the file to be processed to obtain an engraving path; grayscale layering the image in the file to be processed to control the engraving depth corresponding to the engraving path, and extracting the image cutting line of the file to be processed based on the engraving path and the engraving depth; when the laser engraving mode is the creative enhancement mode, topologically optimizing the image in the file to be processed to obtain a simplified graphic; extracting the texture features of the simplified graphic and converting the jitter efficiency of the texture features into physical texture. The text added below the QR code image can be English words, Chinese characters, or numbers, that is, the file to be processed is saved in the rd format file in the form of a QR code graphic.
[0069] It should be noted that during the file processing process, basic and enhanced processing modes can be set based on user-defined creations. The basic processing mode involves vector conversion to convert the image in the canvas design file into an engraving path, grayscale layering to control engraving depth (based on the processing material), contour extraction to generate cutting lines, and dynamic input to adjust device parameters. The enhanced processing mode involves topology optimization to simplify complex graphics in the canvas design file, and texture mapping to convert dither effects into physical textures to prevent boundary overflow. In other words, after completing the design through image processing (such as black and white enhancement and special effects overlay), an enhanced mode (such as graffiti, text, or QR code) is selected to add elements. After vectorization and device parameter binding, the processing instructions (RD file) are finally output. For example, when engraving leather, black and white processing and contrast optimization can be combined, graffiti mode can be used to add a border, contour extraction can be used to generate the graphic path (engraving path), and pressure parameters can be automatically calculated based on the leather thickness. This ensures precise coordination between the creative mode and the device, while safety monitoring logic is used to mitigate processing risks.
[0070] As mentioned above, the main parameters of the first and second canvases are matrix transformation parameters. The implementation principle is: using the Transform Widget, defining the transformation through Matrix4. Common methods include Matrix4.translationValues (translation), Matrix4.rotationZ (rotation), and Matrix4.diagonal3Values (scaling). Doodle mode can be triggered by stylus pressure signals or free-draw gestures. QR code mode generates a QR code image by entering text. Text mode activates by detecting a click on the canvas text box. Material mode selects a material and adds it to the canvas. The specific process of Doodle mode is: creating a file name, entering the processing page to hide the Doodle function box, vector selection (generating the doodle content as a vector image), bitmap selection (generating the doodle content as a bitmap, and can choose different brush sizes for doodle).
[0071] Specifically, in the graffiti mode vector selection, after the graffiti selection instance is drawn, a vector diagram will be generated and added to the canvas. The generated content is selected by default. The length and width of the selected content on the canvas can be edited, or the length and width ratio can be locked. The rotation angle of the selected content on the canvas can be set to delete, rotate, or set processing parameters. The selected canvas content can also be moved outward or inward to scale or enlarge it. The pattern in the canvas can be selected and scaled to select and zoom in and out, and then the relevant parameters for cutting (such as cutting speed, power, processing priority, and whether to output) can be set.
[0072] Specifically, the graffiti mode bitmap selection process is as follows: After selecting a bitmap, graffiti is performed using brushes of different sizes. Once the graffiti is completed, an image is generated and displayed on the canvas. The bitmap can then be manipulated as needed. The processing method for vector-generated content is cutting, while the processing method for bitmap-generated content is engraving. When the canvas can accommodate multiple content images (canvas design files), the multiple content images are combined and restored to their original state, allowing the graffiti mode vectors and bitmaps to coexist. QR code mode selects QR codes and barcodes for content generation. The generated content is all bitmaps, and the only processing mode is engraving. Text mode allows you to fill in text information, select different fonts to generate text images, and then choose to engrave or cut. The default processing mode (method) is engraving. Material mode provides some common vector and bitmap materials. After the vector material operation is completed, you can choose to engrave or cut.
[0073] Specifically, the user's operation information can be processed and generated into the file to be processed in the following ways:
[0074] Input method and processing process. Image input: Users import images (such as PNG, JPG, TXT) through the photo album, taking a photo, or using a file. The app parses the file, extracts the image or text content, and loads it onto the canvas. Canvas adjustment: Automatically adjusts the canvas size based on the image resolution (for example, if the image resolution is 1920x1080, the canvas is initially set to the same resolution, or a fixed canvas size such as 300x300mm is manually selected). Image processing: Images are scaled (such as down to 300dpi for engraving), grayscale converted (for laser engraving), or edge filtered (diffusion, scatter, etc.), or the image size and orientation are adjusted, or excess areas are cropped. Matrix transformation: Gestures are used to update primitives in real time (such as scaling and rotation angles). Parameter input: This includes parameters such as power and speed.
[0075] Image Matching Canvas: The user first selects an image, and the app recommends canvas parameters based on the image size. For example, if the user uploads a 500x500 pixel logo image, the app recommends a canvas size of 50x50mm (suitable for small engraving) and provides resolution adjustment options (300dpi or 600dpi). Canvas Matching Image: The machine's canvas size (such as 100x100mm) requires the user to upload an image that matches the size, or actively crop / scale the image to fit the canvas.
[0076] As mentioned above, a user takes a blurry pet photo (JPG format, dark colors) and hopes to process it into an artistic wood carving with a size of 150x150mm. The machine file creation process is as follows:
[0077] (1) Material acquisition and initial processing: Users take pet photos through the APP camera module and upload them to the canvas. Users find that the brightness is insufficient (the average brightness value is less than 50%) and the photos are slightly blurred. Users perform image processing and optimization on the APP. Figure 2-3 ;
[0078] (2) Canvas adjustment: The user adjusts the 150x150mm canvas (adapted to the size of the wooden board), scales the photo to the canvas size, maintains the aspect ratio, and fills the blank area (optional background color, such as white);
[0079] (3) Image processing: Color adjustment: The app increases brightness (+20%) and contrast (+30%) to make the pet's outline clearer; Cropping: The user manually crops the image, retaining the pet's head area, and the cropped size is 120x120mm, centered on the canvas; Artistic processing: The app provides a variety of filters to convert the image into a high-contrast line drawing suitable for vector engraving;
[0080] (4) (Graphics) Processing parameter settings: Set the parameters to 35% laser power, 1200 mm / s engraving speed, and single-layer engraving;
[0081] (5) Processing file generation: The APP generates an rd file, which contains vector paths and engraving parameters; Output style: Artistic line style pet portrait, suitable for shallow engraving on wood boards, with simple lines and rich layering; Result: The user obtains an rd file, and after the engraving machine executes it, a clear pet portrait is generated on the wood board with smooth lines and an artistic feel.
[0082] In the above example, the user wants to engrave a personalized QR code (pointing to a personal website) containing text and graffiti on a metal plate with a size of 80x80mm. The specific implementation process is as follows:
[0083] (1) Canvas parameter selection: The user selects an 80x80mm canvas to match the size of the metal plate. The app provides grid auxiliary lines to help users align text and graffiti.
[0084] (2) Image processing:
[0085] QR code generation: The user enters the website URL, and the app generates a 40x40mm QR code pattern and places it in the center of the canvas;
[0086] Text input: The user enters their name (e.g., "Hello"), selects a font (Arial, 12pt), and places it below the QR code;
[0087] Graffiti processing: Users use a stylus to draw decorative patterns around the QR code, and the app converts the graffiti into vector paths and smooths the curves.
[0088] (3) Processing mode: Use the "hybrid engraving" mode, engraving: for QR codes, ensuring high contrast (laser power 60%, speed 600mm / s); vector engraving: for text and graffiti, generating clear lines (laser power 40%, speed 1000mm / s); parameter storage: the metal engraving parameters (high power, slow speed) are preset in the device memory and can be fine-tuned by the user;
[0089] (4) Output file style: The processing file is in G-code format, containing dot matrix and vector paths; Style: Modern and simple style, the QR code has strong functionality, and text and graffiti add personalized decoration, suitable for deep engraving of metal plates, and the pattern is durable and beautiful; Result: The engraving machine executes the rd file and generates a scannable QR code on the metal plate, surrounded by decorative graffiti and text, and the overall style is professional and personalized.
[0090] Optionally, see Figure 3 , obtaining a machine station photo taken by a fisheye camera, and performing correction processing on the machine station photo to obtain a background image, including:
[0091] S20: within the field of view of the fisheye camera, using a moving checkerboard calibration plate to completely cover the field of view, and obtaining a plurality of checkerboard images captured by the fisheye camera;
[0092] S21: Preprocessing, corner point extraction, and sorting the multiple checkerboard images to obtain a set of coordinate points to be corrected for the checkerboard images;
[0093] S22: constructing a set of actual physical coordinate points of the checkerboard image based on parameter information of a preset checkerboard calibration plate;
[0094] S23: performing a low-level rotation and translation transformation on the actual physical coordinates of the checkerboard images according to the rotation and translation matrices corresponding to the multiple checkerboard images to obtain a rotation and translation transformation coordinate point set;
[0095] S24: performing a refraction transformation on the rotation and translation transformation coordinate point set to obtain a refraction transformation coordinate point set, and distributing residuals of pixel coordinate points on the checkerboard image based on the refraction transformation coordinate point set and the coordinate point set to be corrected.
[0096] In this embodiment, the total residual value corresponding to the multiple checkerboard images is calculated based on the residuals of the pixel coordinate points, and the optimal refraction parameters corresponding to the fisheye camera and the optimal rotation and translation matrix corresponding to the checkerboard images are minimized. Based on the optimal rotation and translation matrices corresponding to the multiple checkerboard images, an actual physical pixel rotation and translation mapping matrix is constructed, and a pixel difference algorithm is used to correct the machine workstation photo according to the actual physical pixel rotation and translation mapping matrix to obtain the background image.
[0097] It should be noted that the checkerboard calibration plate is placed in the center of the fisheye camera's field of view, and the checkerboard calibration plate is photographed to obtain a first checkerboard image. Within the fisheye camera's field of view, the checkerboard is moved N times, and the camera is photographed synchronously. After N shots, it is ensured that all corners within the field of view are basically covered by the checkerboard calibration plate, and other checkerboard images are obtained; the first checkerboard image and the other checkerboard images are denoised and equalized, and the checkerboard corner recognition algorithm is used to identify the corners of the first checkerboard image and the other checkerboard images, and the identified checkerboard images are compared. The grid corner points are sorted from left to right and from top to bottom to obtain the coordinate point set of the checkerboard image to be corrected; the parameter information of the checkerboard calibration plate input by the user is obtained, which is the number of checkerboard rows, the number of columns and the side length of the checkerboard, to construct the actual physical coordinate point set of the checkerboard image, and the actual physical coordinate points of multiple checkerboard images are calculated in the x, y and z directions of the three-dimensional coordinate system. Different checkerboard images have different rotation and translation matrices, and the refraction transformation related parameters used in the refraction transformation are the camera intrinsic parameters. The refraction transformation related parameters corresponding to different checkerboard images are the same.
[0098] In all examples shown and described herein, any specific values should be interpreted as merely exemplary and not limiting, and thus other examples of the exemplary embodiments may have different values.
[0099] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.
[0100] The above-described embodiments merely illustrate several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that variations and modifications are possible without departing from the scope of the present invention, and such variations and modifications are fully within the scope of protection of the present invention.
Claims
1. A method for processing images and texts in a laser control system, characterized in that: The following steps are involved: Obtaining a photo of a machine station taken by a fisheye camera, and performing correction processing on the photo of the machine station to obtain a background image; Importing graphics and texts to the server and obtaining the file format of the graphics and texts, and performing image processing on the graphics and texts according to the file format to obtain a design drawing; Constructing a canvas according to the background image, and performing a first graphic matching between the background image and the canvas to obtain a canvas background image; Performing a second graphic matching between the design drawing and the canvas background image to obtain a canvas design file, and determining a graphic path and graphic processing parameters of the canvas design file; Classifying the canvas design file by layers based on the graphic path and the graphic processing parameters to obtain a file to be processed, wherein the file to be processed includes a bitmap and a vector map; Importing graphics and texts to the server and obtaining the file format of the graphics and texts, and performing image processing on the graphics and texts according to the file format to obtain a design drawing, including: Obtain images and text uploaded by the client using a preset import method, wherein the preset import method includes album import, photo upload, or file addition; Extracting text information or image information of the image and text, and loading the image and text into a first canvas; Adjusting a first resolution of the first canvas according to the image information, and performing image processing on the image and text according to the first resolution of the first canvas to obtain the design drawing, wherein the image processing includes setting a DPI value and setting an image color, the DPI value is the number of pixels per inch of the image, and the image color is a positive color or grayscale.
2. The image and text processing method of the laser control system according to claim 1, characterized in that: Adjusting a first resolution of the first canvas according to the image information, and performing image processing on the image and text according to the first resolution of the first canvas to obtain the design drawing includes: When it is detected that the average brightness of the image information of the image is not within a preset brightness range, the image in the image is subjected to an inversion process, wherein the inversion process includes RGB channel inversion, brightness compensation, and contrast fine-tuning; Extracting the text information using an OCR analysis algorithm to obtain the text information, wherein the OCR analysis algorithm extraction process includes grayscale conversion, halftone dot generation, and CMYK color shift, and the text information belongs to a dense area of the image containing text; When it is detected that the color variance of the picture in the picture information is lower than a preset variance threshold, the picture in the picture information is converted to black and white.
3. The image and text processing method of the laser control system according to claim 1, characterized in that: Constructing a canvas according to the background image, and performing a first graphic matching between the background image and the canvas to obtain a canvas background image, including: Extracting contour features of the background image, and identifying preset image information of the background image based on the contour features, wherein the preset image information includes a picture size and a second resolution of a machine workstation photo; A second canvas is constructed based on the preset image information, and a first graphic matching is performed between the second canvas and the background image to obtain the canvas background image.
4. The image and text processing method of the laser control system according to claim 3, characterized in that: Performing a second graphic matching between the design drawing and the canvas background image to obtain a canvas design file includes: Obtaining a processing material corresponding to the canvas background image, and adjusting the canvas size of the canvas background image according to the processing material; The design drawing is resized according to the canvas size, and the aspect ratio of the design drawing is maintained to fill the canvas background image to obtain a canvas design file.
5. The image and text processing method of the laser control system according to claim 4, characterized in that: Classifying the canvas design file by layers based on the graphic path and the graphic processing parameters to obtain a file to be processed includes: Performing color adjustment, cropping, and artistic processing on the design drawing on the canvas design file to obtain a processed canvas design file; According to the processed canvas design file, the corresponding laser engraving mode and graphic processing parameters are set and a corresponding two-dimensional code image is generated. Text is added below the two-dimensional code image to generate the file to be processed.
6. The image and text processing method of the laser control system according to claim 5, characterized in that: The graphics processing parameters include laser power, vector path and engraving speed, and the file to be processed is a rd format file.
7. The image and text processing method of the laser control system according to claim 5, characterized in that: Setting the corresponding laser engraving mode and processing parameters according to the processed canvas design file to obtain the file to be processed includes: When the laser engraving mode is the basic processing mode, the image in the to-be-processed file is vector-converted to obtain an engraving path; Performing grayscale layering on the image in the to-be-processed file to control the engraving depth corresponding to the engraving path, and extracting a cutting line of the image of the to-be-processed file based on the engraving path and the engraving depth; When the laser engraving mode is the creation enhancement mode, topology optimization is performed on the image in the to-be-processed file to obtain a simplified graphic; The texture features of the simplified graphics are extracted and the dithering efficiency of the texture features is converted into a physical texture.
8. The image and text processing method of the laser control system according to claim 1, characterized in that: Obtaining a photo of a machine station taken by a fisheye camera and correcting the photo of the machine station to obtain a background image, including: Within the field of view of the fisheye camera, a moving checkerboard calibration plate is used to completely cover the field of view, and a plurality of checkerboard images captured by the fisheye camera are obtained; Preprocessing, corner point extraction and sorting of the multiple checkerboard images are performed to obtain a set of coordinate points to be corrected of the checkerboard images; Constructing a set of actual physical coordinate points of the checkerboard image based on parameter information of a preset checkerboard calibration plate; According to the rotation and translation matrices corresponding to the plurality of checkerboard images, a low-level rotation and translation transformation is performed on the actual physical coordinates of the checkerboard images to obtain a rotation and translation transformation coordinate point set; A refraction transformation is performed on the rotation and translation transformation coordinate point set to obtain a refraction transformation coordinate point set, and residuals of pixel coordinate points on the checkerboard image are obtained based on the refraction transformation coordinate point set and the coordinate point set to be corrected.
9. The image and text processing method of the laser control system according to claim 8, characterized in that: Also includes: Calculating a total residual value corresponding to the plurality of checkerboard images according to the residuals of the pixel coordinate points, and minimizing the total residual value to obtain an optimal refraction parameter corresponding to the fisheye camera and an optimal rotation and translation matrix corresponding to the checkerboard image; An actual physical pixel rotation and translation mapping matrix is constructed based on the optimal rotation and translation matrices corresponding to the multiple checkerboard images, and a pixel difference algorithm is used to correct the machine workstation photo according to the actual physical pixel rotation and translation mapping matrix to obtain the background image.
Citation Information
Patent Citations
Image generation method, machine, system and medium for laser processing
CN119772361A
Laser machining system
US20200387131A1