Image processing methods, processing equipment, processing systems, media, and program products for laser processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-06
- Publication Date
- 2026-08-14
AI Technical Summary
[0003]目前,浮雕参考图主要是由具有专业经验的技术人员通过复杂的建模软件工具生成的,这对技术人员的专业技能要求较高,且整个生成的过程耗时较长
[0020] In some embodiments of this application, in response to an image generation request, an input image is acquired, which includes image elements to be laser-processed. Depth calculation is performed on the input image to obtain a depth image corresponding to the input image. Contour extraction is then performed on the input image to obtain a line drawing image corresponding to the input image. Subsequently, a target relief processing image is generated based on the depth image and the line drawing image. This target relief processing image is used for laser processing and contains image elements corresponding to the input image. Finally, the target relief processing image is imported into the laser processing process. Therefore, during laser processing, the image required for relief processing can be generated based on the input image. Compared to users drawing target relief processing images using complex modeling software, this eliminates the need for users to learn modeling software, lowering the barrier to generating target relief processing images and making the generation simpler and more convenient. This also improves the generation speed and efficiency of target relief processing images, enhancing their applicability and the suitability of laser processing.
Smart Images

Figure CN122559495A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to an image processing method, processing equipment, processing system, computer-readable medium, and computer program product for laser processing. Background Technology
[0002] With the continuous development of modern carving techniques, relief carving has become a popular art form. Relief carving refers to the process of using equipment to carve three-dimensional patterns on the surface of a material. The relief reference image serves as a crucial guide for the equipment to carve at varying depths, and its accuracy and precision directly affect the final effect of the relief pattern.
[0003] Currently, relief reference images are mainly generated by experienced technicians using complex modeling software tools. This requires a high level of expertise from the technicians, and the entire generation process is time-consuming. Especially for relief works with complex designs and numerous details, generating a single compliant relief reference image can typically take several hours or even days, making the generation speed slow and inefficient. Summary of the Invention
[0004] This application provides an image processing method, processing equipment, processing system, computer-readable medium, and computer program product for laser processing. It can generate images required for relief processing by inputting images during the laser processing process, which helps to improve the generation speed and efficiency of target relief processing images, lowers the threshold for generating target relief processing images, and also lowers the threshold for laser processing.
[0005] In a first aspect, embodiments of this application provide an image processing method for laser processing, the method comprising:
[0006] In response to an image generation request, the input image is acquired; the input image includes image elements to be laser-processed.
[0007] Depth calculation is performed on the input image to obtain a depth image corresponding to the input image, and contour extraction is performed on the input image to obtain a line drawing image corresponding to the input image;
[0008] A target relief processing image is generated based on the depth image and the line drawing image; wherein, the target relief processing image is used for laser processing, and the target relief processing image contains image elements corresponding to the input image;
[0009] The target relief image is imported into the laser processing process.
[0010] Secondly, embodiments of this application provide an image processing apparatus for laser processing, the apparatus comprising:
[0011] An acquisition unit is configured to acquire the input image in response to an image generation request; the input image includes image elements to be laser-processed.
[0012] The processing unit is configured to perform depth calculation processing based on the input image to obtain a depth image corresponding to the input image, and perform contour extraction processing based on the input image to obtain a line drawing image corresponding to the input image;
[0013] A generation unit is configured to generate a target relief processing image based on the depth image and the line drawing image; wherein the target relief processing image is used for laser processing, and the target relief processing image contains image elements corresponding to the input image;
[0014] The import unit is used to import the target relief processing image into the laser processing process.
[0015] Thirdly, embodiments of this application provide a processing device, including: a slide rail; a processing head slidably disposed on the slide rail; a communication component for receiving a target relief processing image obtained according to the steps of the image processing method for laser processing described above; and a controller for controlling the processing head to move on the slide rail to perform processing based on the obtained target relief processing image.
[0016] Fourthly, embodiments of this application provide a processing system, including: a processing device, the processing device comprising a communication component, a controller, a slide rail and a movable head, the movable head being slidably disposed on the slide rail; and a terminal device communicating with the processing device, the terminal device being used to execute the image processing method for laser processing as described above.
[0017] Fifthly, embodiments of this application provide an electronic device, including: one or more processors; and a memory for storing one or more computer programs, which, when executed by the one or more processors, cause the electronic device to implement the image processing method for laser processing as described above.
[0018] Sixthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the image processing method for laser processing as described above.
[0019] In a seventh aspect, embodiments of this application provide a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of an electronic device reads from and executes the computer program from the computer-readable storage medium, causing the electronic device to perform the image processing method for laser processing as described above.
[0020] In some embodiments of this application, in response to an image generation request, an input image is acquired, which includes image elements to be laser-processed. Depth calculation is performed on the input image to obtain a depth image corresponding to the input image. Contour extraction is then performed on the input image to obtain a line drawing image corresponding to the input image. Subsequently, a target relief processing image is generated based on the depth image and the line drawing image. This target relief processing image is used for laser processing and contains image elements corresponding to the input image. Finally, the target relief processing image is imported into the laser processing process. Therefore, during laser processing, the image required for relief processing can be generated based on the input image. Compared to users drawing target relief processing images using complex modeling software, this eliminates the need for users to learn modeling software, lowering the barrier to generating target relief processing images and making the generation simpler and more convenient. This also improves the generation speed and efficiency of target relief processing images, enhancing their applicability and the suitability of laser processing. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram of an exemplary implementation environment of this application;
[0023] Figure 2 This is a schematic diagram of a processing system provided in an embodiment of this application;
[0024] Figure 3 This is a schematic diagram of the structure of a laser processing device provided in an embodiment of this application;
[0025] Figure 4 This is a schematic flowchart illustrating an exemplary embodiment of the image processing method for laser processing according to this application;
[0026] Figure 5This is a schematic diagram illustrating an image generation interface in an exemplary embodiment of this application;
[0027] Figure 6 This is a schematic diagram illustrating exposure histograms corresponding to multiple depth images, as shown in an exemplary embodiment of this application;
[0028] Figure 7 This is a schematic diagram illustrating the generation of a depth image based on an input image, as shown in an exemplary embodiment of this application.
[0029] Figure 8 This is a schematic diagram illustrating the generation of a line drawing image based on an input image, as shown in an exemplary embodiment of this application.
[0030] Figure 9 This is a schematic diagram illustrating the input and output images of an exemplary embodiment of this application;
[0031] Figure 10 This is yet another schematic diagram illustrating an image generation interface as an exemplary embodiment of this application;
[0032] Figure 11 This is another schematic diagram illustrating an image generation interface as shown in an exemplary embodiment of this application;
[0033] Figure 12 This is another schematic diagram illustrating an image generation interface as shown in an exemplary embodiment of this application;
[0034] Figure 13 This is a schematic diagram illustrating an image generation interface filled with input content, as shown in an exemplary embodiment of this application;
[0035] Figure 14 This is a schematic diagram illustrating an image generation interface for displaying a target relief processing image, as shown in an exemplary embodiment of this application;
[0036] Figure 15 This is a timing diagram illustrating an image processing method for laser processing, as shown in an exemplary embodiment of this application.
[0037] Figure 16 This is another timing diagram illustrating an image processing method for laser processing, as shown in an exemplary embodiment of this application;
[0038] Figure 17 This is a schematic diagram illustrating a relief sculpture obtained by a processing device carving a carving material, as shown in an exemplary embodiment of this application.
[0039] Figure 18 This is a schematic diagram of the structure of an image processing apparatus for laser processing, as shown in an exemplary embodiment of this application;
[0040] Figure 19 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown. Detailed Implementation
[0041] It should be noted in advance that, in order to enable those skilled in the art to better understand the technical solutions proposed in the embodiments of this application, the embodiments of this application will be described clearly and completely in conjunction with one or more accompanying drawings. Furthermore, the various drawings shown in the embodiments of this application are merely illustrative examples; for example, the execution order of each step in the drawings can be adaptively adjusted according to the actual application scenario. In addition, in the embodiments of this application, the block diagrams shown in the various drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0042] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0043] It should be noted that "multiple" in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0044] During the relief carving process, it was found that the processing equipment typically requires an image containing relief elements as a reference before carving on the surface of the material. This reference image guides the processing equipment in applying laser processing of varying depths to the surface of the material. Currently, the reference images required for relief carving are usually generated by personnel with professional modeling experience using 3D modeling software or other complex software tools to create a 3D relief model.
[0045] This method presents a high learning curve and complex operation for users, especially those without modeling experience, making it difficult to quickly create images that meet their needs. Furthermore, manually operating modeling software or using complex tools to create reference images for relief carving requires significant manpower and time, especially for complex relief designs, which can take hours or even days. This results in high generation costs and long processing times for reference images, leading to low efficiency, particularly in scenarios requiring a large number of complex reference images. Moreover, because the reference images are created manually, it may be difficult to achieve consistently high precision when processing intricate relief patterns, thus affecting the quality of the relief carving produced by the equipment.
[0046] Based on this, this application provides an image processing scheme for laser processing. Users can obtain a target relief processing image—the reference image required for relief processing—by providing only one image. This image generation method can quickly generate the target relief processing image, improving the generation speed and efficiency of the reference image required for relief processing, thus providing users with greater convenience and controllability. Furthermore, the image processing scheme for laser processing provided in this application first generates a corresponding depth image and line drawing image based on the input image, and then generates the target relief processing image based on the depth image and line drawing image. Compared to users generating the reference image required for relief processing through related software tools, this can improve the accuracy and image quality of the reference image required for relief processing to a certain extent, thereby improving the quality of the processed relief artwork.
[0047] Based on the above description, please refer to Figure 1 , Figure 1 This is a schematic diagram illustrating an implementation environment of an exemplary embodiment of this application. The implementation environment includes an image generating device 101, a user terminal device 102, and a processing device 103. The user terminal device 102 can be directly or indirectly connected to the image generating device 101 via wired or wireless means, and can also be directly or indirectly connected to the processing device 103 via wired or wireless means. The user terminal device 102 may have host computer software for the processing device 103 installed. This host computer software provides a device control interface, allowing the user to perform relevant trigger operations on the device control interface to use the processing device to perform relief carving on the carving material.
[0048] It should be noted that, Figure 1The number and form of the devices shown are for illustrative purposes only and do not constitute a limitation on the embodiments of this application. In some embodiments, there may be multiple image generation devices 101, and different image generation devices may be used to process different image processing tasks in different target relief processing images. For example, different image generation devices may be used to perform tasks such as depth calculation processing, contour extraction processing, and fusion processing. In some embodiments, there may be multiple user terminal devices 102, and the image generation device 101 may receive image generation requests sent by multiple user terminal devices 102. In some embodiments, the image generation device 101 and the user terminal device 102 may be the same electronic device. This application embodiment uses the example of the image generation device 101 and the user terminal device 102 being the same electronic device for explanation.
[0049] The image generation device 101 and the user terminal device 102 can be terminal devices, which may include, but are not limited to: smartphones (such as Android phones, iOS phones, etc.), tablet computers, portable personal computers, mobile internet devices (MIDs), smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, wearable devices, etc. This application embodiment does not limit them.
[0050] The image generation device 101 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence (AI) platforms. This application embodiment does not limit this.
[0051] The processing equipment 103 may be an electronic device for laser engraving based on a target relief image. For example, it may be a laser processing device, which is a device that uses a laser beam for processing and can engrave various materials such as metal, plastic, wood, glass, textiles, leather, stickers, etc. The processing equipment 103 may include, but is not limited to, a laser engraving machine, a laser cutting machine, a laser printer, etc.
[0052] In some embodiments, the user terminal device 102 may be equipped with an output device, such as a display screen, which can be used to output an image generation interface. The user can input corresponding types of information based on input controls in the image generation interface, such as model processing parameter processing controls, prompt input controls, and image upload controls, and trigger the user terminal device 102 to generate an image generation request. Furthermore, the output device (such as the display screen) can be used to display the target relief processing image generated by the image generation device 101 based on the user-input image (input image), input prompts, and model processing parameters.
[0053] The general flow of the image processing method for laser processing provided in this application is as follows:
[0054] In response to an image generation request, the image generation device 101 acquires an input image, which may be sent by a user to the image generation device 101 via a user terminal device 102. This input image includes image elements to be laser-processed. The image generation device 101 can perform depth calculation processing based on the input image to obtain a depth image corresponding to the input image. The image generation device 101 can also perform contour extraction processing based on the input image to obtain a line drawing image corresponding to the input image. Then, the image generation device 101 can generate a target relief processing image based on the depth image and the line drawing image. The target relief processing image generated by the image generation device 101 can be used for laser processing, and this target relief processing image contains relief elements for processing onto the carving material, i.e., the image elements corresponding to the input image. Afterwards, the image generation device 101 can import the target relief processing image into the laser processing process.
[0055] It is understood that in the specific implementation of this application, user-related data is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0056] It is understood that the implementation environment described in the embodiments of this application is for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and does not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0057] Based on the above implementation environment, please refer to Figure 2 , Figure 2 This is a schematic diagram of a processing system provided in an embodiment of this application, such as... Figure 2As shown, the processing system may include a processing control device 201 and a laser processing device 202. The processing control device 201 can establish a communication connection with the laser processing device 202 and communicate with it. The laser processing device 202 may include a communication component, a controller, a slide rail, and a movable head, wherein the movable head is slidably mounted on the slide rail. Figure 2 The processing control equipment 201 shown may refer to Figure 1 The user terminal device 102 shown is... Figure 2 The laser processing equipment 202 shown can refer to Figure 1 The processing equipment 103 shown.
[0058] The processing control device 201 can be a host computer device for the laser processing equipment 202. It can have the host computer software of the laser processing equipment 202 installed inside. The host computer software can be used to send images (such as target relief processing images) or related processing instructions to the lower computer (i.e., the laser processing equipment 202) to control the laser processing equipment 202 to respond to the processing instructions and perform laser processing on the processing material based on the target relief processing image.
[0059] Among them, the laser processing equipment 202 can be a device that uses a laser beam for processing, and can engrave various processing materials such as metal, plastic, wood, glass, textiles, leather, plastic, stickers, etc. The laser processing equipment 202 can include, but is not limited to, laser engraving machines, laser cutting machines, laser printers, etc., and this application does not limit it.
[0060] Based on the above implementation environment and processing system, please refer to the following: Figure 3 , Figure 3 This is a schematic diagram of the structure of a laser processing device provided in an embodiment of this application. Figure 3 In a specific embodiment, the laser processing equipment includes a processing equipment base plate and a processing head. The processing equipment base plate includes a processing area for placing materials, and the processing head is used to move on the processing area to achieve laser processing. The processing equipment is connected to a processing control device (such as...). Figure 2 The processing control device communicates with one or more devices marked with 201, and is used to execute a data processing method based on the processing device (e.g., the image processing method for laser processing of this application). A schematic diagram of the hardware structure of the laser processing device is shown below. Figure 3As shown, the laser processing equipment includes a housing, a processing equipment base plate 40, a processing head 50, a laser tube 30, a slide rail 80, a communication component 20, and a controller 60. The processing equipment base plate 40 includes a processing area 41 for placing materials. The housing includes an upper shell 90 and a lower shell 70. The processing head 50 is slidably mounted on the slide rail 80. The communication component 20 is used to receive the target relief processing image obtained from the steps of the method provided in the above embodiments. Based on the target relief processing image, the controller 60 controls the movement of the processing head 50 on the slide rail 80 to process the surface of the processing material. The communication component 20 and the controller 60 are installed inside the back plate of the laser tube 30. Figure 3 It is not visible from a mid-range perspective, so it is shown by connecting the boxes with dashed lines.
[0061] In one embodiment, a reflector 11 is provided between the processing head 50 and the laser tube 30. The light beam generated by the laser tube 30 is reflected by the reflector 11 to the processing head 50 and then emitted after reflection, focusing and other processes to process the workpiece.
[0062] In one embodiment, the processing head 50 can generate a light spot. In another embodiment, the light spot can be generated by other components, such as the laser tube 30 of a carbon dioxide laser tube, and enter the beam emitting device through the reflector 11, etc., and finally exit through the processing head 50 to process the workpiece. The processing head can emit laser light, but it can do more than just emit laser light.
[0063] In one embodiment, the housing of the computer numerical control machine, i.e., Figure 3 The upper shell 90 and the bottom shell 70, as shown, together enclose an internal space for accommodating processed materials. The upper shell 90 and the bottom shell 70 can be detachably or fixedly connected, or they can be a single integral structure. In one embodiment, the upper shell 90 is also provided with a rotatable cover plate, which the operator can open or close to access the internal space for inserting or removing processed materials. Through the blocking and / or filtering effect of the upper shell 90 and the bottom shell 70, laser leakage from the processing head 50 during operation can be prevented from causing personal injury to the operator.
[0064] like Figure 3 In the example shown, the slide rail 80 is disposed in the aforementioned internal space, and the processing head 50 is mounted on the slide rail 80. The slide rail 80 can be an X-axis or Y-axis guide rail, which can be a linear guide rail or a guide rail in which an optical axis and a roller slide together, etc., as long as it can drive the processing head 50 to move and process on the X and Y axes. The processing head 50 can also be provided with a Z-axis moving track for focusing by moving in the Z-axis direction before and / or during processing.
[0065] Based on the above description, please refer to Figure 4 , Figure 4This application provides a schematic flowchart of an image processing method for laser processing, which can be implemented by an image generating device. The image generating device can be... Figure 1 The image generating device 101 shown can also be Figure 2 The processing control device 201 shown may include the following steps S401-S404:
[0066] S401. In response to the image generation request, obtain the input image.
[0067] In this embodiment, the image generation request can be a request to trigger the image generation device to generate a target relief processing image. The target relief processing image refers to the image that the laser processing equipment needs to reference when performing laser processing (such as carving a relief). The image elements (relief elements) in the target relief processing image will be carved onto the surface of the carving material to obtain the corresponding relief work. It can be presented in grayscale mode, so the target relief processing image can also be called a grayscale image. The input image refers to a planar image (two-dimensional image), which is the image that the user wants to use to generate the corresponding relief, that is, the image that needs to be referenced during relief processing. The input image includes the image elements to be laser processed. These image elements can refer to the pattern elements processed into the processing material by the laser processing equipment. The target relief processing image also includes these image elements as a reference to guide the laser processing equipment in processing.
[0068] It should be noted that the input image can also be a line drawing image, i.e., an image consisting only of lines. Since many users cannot directly provide line drawing images, the input image can be a color 2D image to control image details.
[0069] The image generation request can be generated (created) by an image generation device. This device can provide a user interface for user interaction; for example, it can display an image generation interface that includes an image upload control. The user can input an action based on this control, i.e., upload an input image. Correspondingly, upon receiving the input action, the image generation device can generate (create) an image generation request and obtain the corresponding image—the user-uploaded image—as the input image. Generating (creating) an image generation request can be understood as the image generation device generating information in a specific format based on the obtained input image. This specific format information can be understood as an image generation instruction. This instruction can be parsed by the image generation device to execute the corresponding response processing, i.e., generating the target relief processing image corresponding to the input image.
[0070] Please refer to the following: Figure 5 , Figure 5 This is a schematic diagram illustrating an image generation interface in an exemplary embodiment of this application. Figure 5 The image generation interface shown is divided into two areas: the left area is the user operation area, and the right area is the result display area. The user operation area includes an image upload control and a generation control. The image upload control is used to upload an input image based on the user's input. This control can also display corresponding prompts, such as... Figure 5 The text indicates "Drag and drop the image here, or click Upload." After the user uploads the input image, the image upload control can preview the uploaded image, such as... Figure 5 The image generation interface is shown below. The generation control can be used to trigger a user terminal device or an image generation device to generate (create) an image generation request based on the user's trigger operation, and display the user-uploaded input image in the display area of the image upload control. This generation control can include prompts such as "Start Generation," or it can include English prompts such as "start." Figure 5 The results display area shown includes a region for displaying the generated target relief processing image. The results display area may include an image display control, which may include the prompt message "The image generation result will be displayed here".
[0071] S402. Perform depth calculation processing based on the above input image to obtain the depth image corresponding to the above input image, and perform contour extraction processing based on the above input image to obtain the line drawing image corresponding to the above input image.
[0072] In this embodiment, after acquiring the input image, the image generation device can perform depth calculation processing based on the input image to obtain a corresponding depth image. A depth map, also known as a range image, is a commonly used image representation method in computer vision. Each pixel value in a depth map represents the distance between the corresponding pixel and the viewpoint, and the pixel value and distance are usually inversely proportional. It is typically presented in grayscale. This depth image reflects the image of each point in the image from the observer and can be used to provide depth features for subsequent generation of the target relief processing image. Depth calculation processing refers to the process of calculating the distance between the spatial position of each pixel value in the input image and the observer (viewpoint) based on the objects and scene in the input image.
[0073] In some embodiments, depth calculation based on the input image can be performed by a skilled technician using prior knowledge to infer the distance between each pixel and the viewpoint, and then manually annotating the input image. The image generation device can then convert the annotated distances into pixel values (grayscale values) to obtain the depth image corresponding to the input image.
[0074] In one possible implementation, depth computation based on the input image can be achieved using a pre-trained depth image generation model. Specifically, the image generation device can perform depth computation on the input image based on the depth image generation model to obtain the depth image output by the depth image generation model, i.e., the depth image corresponding to the input image. This depth image generation model can refer to a depth estimation model used for monocular depth estimation to generate the depth image corresponding to the input image. For example, this depth image generation model could be the Marigold depth estimation model, which is a monocular depth estimation model based on a diffusion model. It generates depth images by fine-tuning an image generation model (such as the Stable Diffusion model) and applying it to monocular depth estimation.
[0075] Specifically, performing depth calculation processing on the input image based on the depth image generation model can be understood as inputting the input image into the Marigold depth estimation model, converting the input image into a latent representation through the Marigold depth estimation model, adding a certain amount of noise to the latent representation, and generating a depth image by gradually removing the noise.
[0076] In some embodiments, the image generation device may deploy the AI drawing tool ComfyUI, and the ComfyUI-Marigold node may be installed in the ComfyUI tool. This node can call the Marigold depth estimation model to perform depth estimation (depth calculation processing) on the input image. After installation, the image generation device can conveniently use the ComfyUI-Marigold node in ComfyUI to perform depth estimation of the image.
[0077] In one possible implementation, since the quality of the algorithms involved in depth calculation directly affects the generation effect of the depth image, it also affects the generation effect of the target relief processing image. Therefore, the image generation device can generate multiple depth images corresponding to the input image based on different depth calculation algorithms, and select the optimal one. Specifically, the image generation device can perform depth calculation processing on the input image based on multiple depth image generation models, obtaining depth images output by each of the multiple depth image generation models. Then, the image generation device can select the target depth image from the multiple depth images as the depth image corresponding to the input image.
[0078] The multiple depth image generation models each have different depth calculation parameters, which may include parameters such as the number of denoising steps. The number of denoising steps refers to the number of denoising operations performed, determining the level of detail in the depth map denoising. It can be understood that depth image generation models with different depth calculation parameters can be considered as different depth image generation models, and different depth image generation models will output different depth images for the same input image. Therefore, the image generation device can acquire the depth images output by multiple depth image generation models and select one.
[0079] In some embodiments, the depth calculation processing parameters can be configured by the user through ComfyUI. The image generation device can configure the parameters of the ComfyUI-Marigold node based on the user's operation, thereby triggering depth calculation processing of the input image based on the depth image generation model configured with different depth calculation processing parameters, and obtaining multiple depth images corresponding to the input image.
[0080] In one possible implementation, after acquiring multiple depth images, the image generation device can specifically acquire the exposure histograms corresponding to each depth image. Then, based on the correlations in the exposure histograms of each depth image, a target depth image is selected from the multiple depth images to obtain the depth image corresponding to the input image. Here, the exposure histogram is a display format based on the brightness distribution of an image. The horizontal axis of the exposure histogram represents the brightness of pixels in the image, from left to right representing the brightness range from extremely dark (pure black) to extremely bright (pure white), i.e., from 0 to 255. The vertical axis represents the number of pixels at the corresponding brightness level. In other words, the exposure histograms corresponding to each depth image include the correlation between the brightness values and the number of pixels in the corresponding depth image. The target depth image is the depth image selected by the image generation device.
[0081] It should be noted that when performing depth calculation (depth estimation) on the input image using a depth image generation model configured with different depth calculation parameters, the generated depth image may be overexposed or underexposed. Depth images exhibiting these two conditions may affect the quality of the subsequently generated target relief processing image. Therefore, the image generation device can select a target depth image with relatively normal exposure from multiple depth images based on the correlation between the exposure histograms corresponding to each depth image.
[0082] In one possible implementation, the image generation device can traverse the exposure histograms corresponding to multiple depth images. If the number of pixels within a specified brightness value range in the currently traversed exposure histogram is within a set threshold range, then the depth image corresponding to the currently traversed exposure histogram is determined as the target depth image, thus obtaining the depth image corresponding to the input image. It is understood that the horizontal axis of the exposure histogram represents brightness values (brightness levels) from 0 to 255. Therefore, as long as the number of pixels within a specified brightness value range (e.g., 150-200) is within the set threshold range, the current depth image is considered to have normal exposure. This number of pixels can be the sum of the number of pixels corresponding to each pixel value within the pixel value range. Thus, by selecting depth images based on the number of pixels within a specified brightness value range, a depth image with better exposure can be selected from multiple depth images to obtain the target depth image. Both the specified brightness value range and the set threshold range can be configured by the user based on the actual scene and depth images; this application does not limit their configuration.
[0083] In another possible implementation, the image generating device can traverse the exposure histograms corresponding to multiple depth images. If the ratio between the number of pixels in a specified brightness value range in the currently traversed exposure histogram and the number of pixels in another specified brightness value range is within a set ratio range, then the depth image corresponding to the currently traversed exposure histogram is determined as the target depth image, thus obtaining the depth image corresponding to the input image. The specified brightness value range can be a small brightness value range, such as 150-200, and the other specified brightness value range can be a large brightness value range, such as 50-200. If the ratio is larger, the image generating device can determine that there are more pixels in the midtones, indicating a higher probability of normal exposure for the depth image. If the ratio is smaller, the image generating device can determine that there are fewer pixels in the midtones, indicating that the depth image is either underexposed or overexposed.
[0084] Please refer to the following: Figure 6 , Figure 6 This is a schematic diagram illustrating exposure histograms corresponding to multiple depth images, as shown in an exemplary embodiment of this application. Figure 6Taking three depth images corresponding to the input image as an example, these can be generated by three depth image generation models configured with different depth calculation and processing parameters. This application does not limit the number of depth image generation models. The right side of each of the three depth images represents the exposure histogram corresponding to that depth image. The horizontal axis of the exposure histogram ranges from 0 to 255, and the image generation device can iterate through the histograms as follows: Figure 6 The three exposure histograms shown determine whether the number of pixels within a specified brightness value range is within a set threshold range, or whether the ratio between the number of pixels in one specified brightness value range and the number of pixels in another specified brightness value range is within a set ratio range. If so, the image generation device can select the corresponding depth image to obtain the target depth image.
[0085] Therefore, it can be seen that in the exposure histogram corresponding to the top depth image, the number of pixels on the right side is relatively large, which may indicate overexposure. In the exposure histogram corresponding to the middle depth image, the number of pixels on the left side is relatively large (e.g., a large number of pixels less than 150), which may indicate underexposure. In the exposure histogram corresponding to the bottom depth image, the number of pixels is relatively evenly distributed in both bright and dark areas, and the number of pixels in the brightness value range such as 150-200 is relatively large. Therefore, the image generation device can select the bottom depth image as the target depth image from these three depth images to obtain the depth image corresponding to the input image.
[0086] Please refer to the following: Figure 7 , Figure 7 This is a schematic diagram illustrating the generation of a depth image based on an input image, as shown in an exemplary embodiment of this application. Figure 7 As shown, the left side is the input image, and the right side is the corresponding depth image. The image generation device can directly generate the corresponding depth image based on the input image, or it can generate a depth image based on the input image... Figure 6 The image generator generates multiple depth images and selects a target depth image based on the exposure histogram corresponding to each depth image. Furthermore, after obtaining the depth image corresponding to the input image, the image generation device can generate a target relief processing image corresponding to the input image based on that depth image.
[0087] In some embodiments, the image generation device can further process the depth image corresponding to the input image to generate a higher resolution depth image. Specifically, the image generation device can input the depth image into a machine learning model for improving resolution, so that the machine learning model can generate a higher resolution depth image corresponding to the depth image. This machine learning model can be, for example, the ZoeDepth model, which is a multimodal monocular depth estimation network that combines relative and absolute depth, and can be used to generate higher resolution depth images.
[0088] The methods described above for improving the resolution of depth images are merely examples, and this application does not limit them. For instance, the image generation device can also perform interpolation processing on the depth image to obtain a higher resolution depth image.
[0089] In this embodiment, the image generation device can generate a corresponding depth image based on the input image, and simultaneously generate a corresponding line drawing image based on the input image. Contour extraction processing, also known as edge detection processing, refers to the process of extracting edge variations in an image (input image). A line drawing image is a rendering composed of lines; it can also be called a line drawing diagram, referring to an uncolored draft that uses lines to outline the contours, structure, and details of an object. The lines in a line drawing image can vary in length, density, and shade to depict the image of the corresponding object.
[0090] In one possible implementation, the image generation device performs contour extraction processing on the input image to obtain a line drawing image corresponding to the input image. Specifically, this can refer to performing contour extraction processing on the input image based on a line drawing image generation model to obtain a line drawing image corresponding to the input image. This line drawing image generation model can refer to a machine learning model for line detection, capable of extracting sharp edges and details from an image. For example, this line drawing image generation model could be an Anyline model, which can also be called a line detection preprocessor, capable of quickly extracting high-precision line drawings from an image.
[0091] Specifically, the contour extraction process of the input image based on the line drawing image generation model can be understood as analyzing each pixel in the image using the Anyline model, and identifying and extracting line information based on the relationships and features between pixels. Then, the Anyline model can synthesize a line drawing image based on the extracted line information. This line drawing image retains the important contours and details of the input image while removing color and texture information. Therefore, the image generation device can further generate the target relief processing image based on this line drawing image.
[0092] In some embodiments, the image generation device can integrate the Anyline model into the deployed ComfyUI tool. The image generation device can install the Anyline model as a plugin (node) of ComfyUI. After installation, the image generation device can perform contour extraction processing on the input image based on the user's operation through the Anyline plugin (node) in ComfyUI to obtain the line drawing image corresponding to the input image.
[0093] Please refer to the following: Figure 8 , Figure 8This is a schematic diagram illustrating the generation of a line drawing image based on an input image, as shown in an exemplary embodiment of this application. Figure 8 As shown, the left side is the input image, and the right side is the corresponding line drawing image. The image generation device can perform contour extraction processing on the input image based on the line drawing image generation model to obtain the line drawing image. It should be noted that the line drawing image generated by the line drawing image generation model typically uses a black background and white lines to outline the contours, structure, and details of objects, such as... Figure 8 As shown on the right.
[0094] S403. Generate a target relief processing image based on the aforementioned depth image and the aforementioned line drawing image.
[0095] In this embodiment, the image generation device's process of generating a target relief processing image based on a depth image and a line drawing image can refer to a fusion process performed by the image generation device based on the depth image and the line drawing image. This fusion process can involve combining the depth in the depth image and the line drawing features in the line drawing image into a single image. The resulting image is the target relief processing image. This target relief processing image can be used to guide the processing equipment to process the surface of the material according to the lines (carving positions) indicated by the line drawing image and the depth (carving depth) indicated by the depth image, thereby obtaining a relief artwork.
[0096] In one possible implementation, the image generation device performs a fusion process based on a depth image and a line drawing image. Specifically, this can be done by fusing the depth image and the line drawing image based on a target image generation model to obtain the target relief processing image corresponding to the input image. Here, the target image generation model can be a machine learning model for generating images, specifically a machine learning model for generating target relief processing images.
[0097] Specifically, taking the target image generation model, which includes a line drawing processing network, a depth processing network, and an image generation network, as an example, the image generation device can perform line drawing feature extraction processing on the line drawing image based on the line drawing processing network, and the image generation device can perform depth feature extraction processing on the depth image based on the depth processing network; then, the image generation device can perform image generation processing based on the line drawing features extracted by the line drawing processing network and the depth features extracted by the depth processing network, to obtain the target relief processing image.
[0098] The line art processing network can be a machine learning model (network) for extracting line art features from line art images, the depth processing network can be a machine learning model (network) for extracting depth features from depth images, and the image generation network can be a machine learning model (network) for generating images. In this embodiment, the line art processing network is the ControlNet line art model, the depth processing network is the ControlNet depth map model, and the image generation network is the Stable Diffusion model, as an example for explanation.
[0099] It is understandable that with the development of AI technology, more advanced and superior algorithms or network models will inevitably emerge in the field of AI-generated images. This application only uses the aforementioned model as an example for explanation and does not limit the type of model network. In the embodiments of this application, target relief processing images can be quickly generated based on Artificial Intelligence Generated Content (AIGC), enabling AI technology to better serve users.
[0100] Stable Diffusion is a deep learning-based image generation model capable of generating images from noise. The process of generating images using Stable Diffusion can be understood as a reverse diffusion process. By progressively (iterically) denoising the noisy image (feature representation), it can generate the image desired by the user, i.e., the target relief processing image. ControlNet is a neural network architecture model used to control the Stable Diffusion model by adding additional conditions. ControlNet can take additional input images, such as the line drawing image and depth image mentioned above, and convert them into control maps (feature representations) through different preprocessors. These control maps then serve as additional conditions for the stable diffusion model, guiding the diffusion process and obtaining an image that meets the user's requirements.
[0101] In other words, the image generation device can extract the depth features corresponding to the depth image based on the ControlNet depth map model. These depth features can refer to the feature representation information in the depth image used to characterize the distance and three-dimensionality of objects. Furthermore, the image generation device can extract the line art features corresponding to the line art image based on the ControlNet line art model. These line art features can refer to the feature representation information used to represent the contours and line directions in the line art image. Subsequently, the image generation device can perform image generation processing on the line art features and depth features based on a stable diffusion model. Specifically, the image generation device can perform image generation processing on the fusion features between the line art features and depth features based on a stable diffusion model to obtain the target relief processing image. Here, the fusion features can be the features obtained by stitching together the depth features and the line art features.
[0102] In some embodiments, the image generation network performs image generation processing on fused features. Specifically, this refers to the image generation network performing iterative denoising processing on the feature representation information of an initialized noisy image based on the fused features. A seed can be input into the image generation network. This seed can be used to initialize the feature representation information of a noisy image to facilitate subsequent iterative denoising processing. The seed represents a numerical value, which is a sequence of random numbers used to determine the generated noisy image (feature representation information).
[0103] For example, the image generation network (steady diffusion model) can generate a series of random numbers based on a seed. These random numbers conform to a preset distribution (such as a Gaussian distribution). The generated random numbers are then filled into a matrix of a preset size to obtain the feature representation information of the noisy image. Furthermore, the denoising network in the steady diffusion model can iteratively denoise this noisy image (feature representation information) to gradually generate the target relief processing image. This denoising network can consist of a U-net and a scheduling algorithm. The U-net can perform prediction processing based on the fused feature representation to output the predicted noise features (the residual of the image noise).
[0104] Furthermore, this image generation network can use a scheduling algorithm to calculate the denoised image representation based on the residual of the image noise and the noisy image (feature representation information). The scheduling algorithm can be understood as removing the residual of the image noise from the noisy image (feature representation information). The above process can be understood as a denoising process, which needs to be repeated N times, such as 50-100 times, to gradually remove the noise from the noisy image. When the number of denoising processes reaches a threshold, the image generation network can then decode the feature representation information obtained after the last iteration to convert the feature representation information into a real image, thus obtaining the target relief processing image.
[0105] In one possible implementation, the image generation network may further include a Low-Rank Adaptation (LoRA) module, also known as a fine-tuning module. This LoRA module aims to capture task-specific parameters by adding additional layers to quickly adapt to a specific image generation task or style, such as the style of the target relief image in this embodiment. In this embodiment, the LoRA module can be used to adapt to the generation task of the target relief image, which presents a grayscale style; therefore, the LoRA module can be called Grayscale LoRA.
[0106] Specifically, during the image generation process of an image generation network (such as a stable diffusion model) based on fused features, the LoRA module can receive intermediate feature representations from the stable diffusion model. After processing by the LoRA module, an adjusted intermediate feature representation is obtained, which can adapt to the requirements of grayscale style (target embossed image). This adjusted intermediate feature representation can then be used in subsequent generation steps of the model, ultimately producing an output image that meets the constraints, i.e., the target embossed image.
[0107] Please refer to the following: Figure 9 , Figure 9 This is a schematic diagram illustrating the input and output images of an exemplary embodiment of this application, as shown below. Figure 9 As shown, the left side is the input image, which can be... Figure 5 The image generation interface shown shows the user-uploaded image. The middle part shows the process of generating the target relief processing image. It can generate corresponding depth images and line art images based on the input image, and then generate the target relief processing image, which is the output image, based on the depth image and line art image. The specific generation process can be found in the above description, and will not be repeated here.
[0108] In one possible implementation, some model processing parameters in the image generation network (stable diffusion model) can be configured by the user. Then, the target image generation model can perform image generation processing on the depth image and line drawing image based on these user-configured parameters to output the target relief image. Please refer to [further details omitted]. Figure 10 , Figure 10 This is another schematic diagram illustrating an image generation interface as shown in an exemplary embodiment of this application, such as... Figure 10 As shown, the image generation interface displayed by the image generation device may include, in addition to, Figure 3 The image upload control shown may also include parameter configuration controls, such as... Figure 10 The parameter configuration area shown can be used to configure model processing parameters. Figure 10The drawing is based on the example of model processing parameters, which include image parameters and model parameters.
[0109] Please refer to the following: Figure 11 , Figure 11 This is another schematic diagram of an image generation interface shown in an exemplary embodiment of this application, as follows: Figure 11 As shown, Figure 11 The following example illustrates the drawing and explanation of an image generation interface that includes five model processing parameter input controls. These controls can be text input boxes or drop-down selection boxes. Model processing parameters can include model selection, number of model iterations (Samples), seed, LoRA weights, and number of denoising steps.
[0110] Here, model selection refers to choosing the processing model used to generate the target relief image. It should be noted that different models can be deployed in the image generation device, each suitable for different processing scenarios. The number of model iterations can also be understood as the number of model samplings, referring to the number of times the model samples (or iterates) during image generation. The seed can be a numerical value used to initialize the feature representation information of the noisy image. LoRA weights are parameters related to the LoRA module and can be used to indicate the strength of the influence of changing the LoRA model on the style or content of the original image. The number of denoising steps can refer to the number of steps required to progressively generate the target relief image from the feature representation information of the noisy image, which is also the number of denoising processes in the scheduling algorithm described above.
[0111] like Figure 11 As shown, users can input parameters for each model in the image generation interface, such as selecting the model as image embossing (photo2relief), with 1 iteration, 0 seed, 1 LoRA weight, and 30 denoising iterations. Correspondingly, the image generation device can respond to the input operation received for the model processing parameter input control, generating (creating) an image generation request based on the model processing parameters carried in the input operation. After generating the image generation request, the image generation device can perform response processing based on the generated image generation request.
[0112] Therefore, when the user configures the model processing parameters, the image generation device can perform image generation processing on the depth image and line drawing image based on the target image generation model and the model processing parameters. The image processing process using the target image generation model is described above and will not be repeated here. It should be noted that the image generation processing is specifically based on the model processing parameters configured by the user.
[0113] In one possible implementation, to improve the quality of the generated relief image, text information can be incorporated for multimodal processing. Specifically, after acquiring the input image, the image generation device can obtain target cue words corresponding to the input image. These target cue words can be text information describing the content contained in the input image, for example... Figure 5 In the input image shown, the target prompt can be "a girl" (or the English prompt: a girl). Since the final target relief image is presented as a grayscale image, the prompt can also be called a grayscale prompt. Therefore, the image generation device can generate the target relief image specifically based on the target prompt, the depth image, and the line drawing image during the image generation process based on the depth image and the line drawing image.
[0114] In one possible implementation, the image generation device can specifically perform label generation processing on the input image based on a label generation model to obtain a set of labels corresponding to the input image. This label generation model can be a model that infers cue words from the image; for example, it could be a label generator based on a Vision Transformer (VIT) architecture, used to extract tags from the image. This label generator can automatically understand the image content and output descriptive labels. The label generator can output one or more labels, meaning the label set can include one or more labels. Since the process of generating labels based on an image can be understood as inferring cue words from the image, this label generation model can also be called a cue word inference model.
[0115] Furthermore, after obtaining the tag set output by the tag generation model (such as the tag generator mentioned above), the image generation device can determine the target prompt word based on the tags in the tag set, for example, by identifying all tags in the tag set as the target prompt word. The image generation device can also further filter the tags in the tag set, for example, by removing some tags with high similarity, thereby obtaining the target prompt word corresponding to the input image.
[0116] Taking the VIT architecture label generator as an example, the image generation device performs label generation processing on the input image based on the label generation model. This can mean that the image generation device performs image segmentation processing on the input image based on the label generator, extracts the image features corresponding to the segmented image blocks respectively, and generates one or more text labels for the extracted image features to output a label set.
[0117] Therefore, after obtaining the target prompt word, the image generation device performs image generation processing on the target prompt word, depth image and line drawing image based on the target image generation model to obtain the target relief processing image corresponding to the input image.
[0118] The target image generation model includes an image generation network (such as a stable diffusion model) that can include a text encoder to extract text features corresponding to the text information. Specifically, the target prompt word can be input into the image generation network, specifically into the text encoder, which extracts the text feature representation corresponding to the target prompt word. Then, the denoising network in the stable diffusion model can denoise the feature representation information of the noisy image based on this text feature representation, obtaining the target relief image. Thus, through the grayscale prompt word (target prompt word), the ControlNet depth map model (depth processing network), the ControlNet line art model (line art processing network), and the grayscale LoRA (LoRA) module, the final target relief image, also known as a grayscale image, is obtained.
[0119] In one possible implementation, to improve the quality of the generated relief image, the added text information can be user-inputted target prompts determined by tags, which, along with the user-inputted text, are jointly added to the target image generation model for processing. Specifically, the image generation interface displayed by the image generation device can include a prompt input control. The user can input commands to the prompt input control, and the image generation device can receive these input commands to obtain the corresponding text characters. The image generation device can then use the obtained text characters as target prompts, or determine target prompts based on tags in a tag set, or combine the obtained text characters and tag-determined prompts as target prompts to perform image generation processing on the depth image and line drawing image to obtain the target relief image.
[0120] Please refer to the following: Figure 12 , Figure 12 This is another schematic diagram illustrating an image generation interface as shown in an exemplary embodiment of this application. Figure 12 The image generation interface shown is compared to Figure 11 The image generation interface shown also includes a prompt word input control, which can be one or more, and all of them can be text input boxes. Figure 12 The two prompt input controls shown correspond to the text input boxes for positive and negative prompts, respectively. Positive prompts are the text information used to generate the image, while negative prompts are the text information to avoid generating the image.
[0121] Please refer to the following: Figure 13 , Figure 13 This is a schematic diagram illustrating an image generation interface filled with input content, as shown in an exemplary embodiment of this application. Figure 13 As shown, users can input prompts into the prompt input control, such as "a girl," or negative prompts such as "low quality." It is understood that the above prompts are merely examples, and this application does not limit their scope.
[0122] Please refer to the following: Figure 14 , Figure 14 This is a schematic diagram illustrating an image generation interface for displaying a target relief processing image, as shown in an exemplary embodiment of this application. Figure 14 As shown, the result display area of the image generation interface can be used to output the target relief processing image corresponding to the input image.
[0123] Please refer to the following: Figure 15 and Figure 16 , Figure 15 and Figure 16 These are all timing diagrams illustrating an exemplary embodiment of the image processing method for laser processing, such as... Figure 15 As shown, the image generation device can generate corresponding depth images, line art images, and image labels (label sets) based on the input image. Then, the image generation device can perform image generation processing based on the target image generation model, which includes a depth processing network, a line art processing network, an image generation network, and a fine-tuning module (LoRA module), to obtain the target relief processing image. For example... Figure 16 As shown, the input image is used to generate a depth image, a line drawing image, and target prompts, and then the corresponding target relief processing image is generated.
[0124] Therefore, users can quickly generate detailed target relief images by providing only one image, utilizing generative AI technology. Users can also generate multiple target relief images in batches for selection, meeting their personalized needs. Specifically, during the process of generating the target relief image based on the depth image and line drawing image, the image generation device can generate and display at least two candidate relief images based on the depth image and line drawing image. Then, in response to a selection operation for the candidate relief image, the selected candidate relief image is determined as the target relief image.
[0125] Different candidate relief images correspond to different image styles. Different image styles can refer to relief images with different depth information or different line drawing information. For example... Figure 14The image display control in the image generation interface shown can display at least two candidate relief processing images with different image styles. Then, after receiving a selection operation for one of the candidate relief processing images, the selected candidate relief processing image can be determined as the target relief processing image in response to the selection operation.
[0126] In this embodiment, the entire process of generating the target relief image does not require users to have professional 2D or 3D design skills, making it easy to learn and highly adaptable. The generative AI model can process and generate complex target relief images within minutes (e.g., 2 minutes) from the input image, which helps reduce the time required to generate the target relief image and improves generation efficiency. Furthermore, AI technology can reduce the manual time required to generate the target relief image, and it does not require users to learn professional skills, resulting in lower costs. A single development and training of the AI model allows for large-scale application, saving manpower and time to a certain extent. Moreover, the AI model can meticulously analyze various details in the input image and accurately generate high-quality target relief images. For example, it can identify and reproduce complex textures and shapes using a stable diffusion model to ensure that the output relief image has high detail and accuracy.
[0127] Furthermore, after the image generation device outputs the target relief processing image, it can import the target relief processing image into the laser processing process so that laser processing can be performed based on the target relief processing image.
[0128] S404. Import the above target relief processing image into the laser processing process.
[0129] In this embodiment, the laser processing process can refer to the process of performing laser processing based on the target relief image. This process can be used to control the laser processing equipment to perform laser processing only based on the target relief image. Alternatively, the laser processing process can refer to the process by which the host computer software of the laser processing equipment performs a series of processes to generate laser processing instructions. This process can be used to send the processing instructions to the laser processing equipment after generating them based on the target relief image, instructing the equipment to schedule the corresponding functions for laser processing.
[0130] Specifically, importing the target relief image into the laser processing process can mean that the image generation device can display the target relief image in an editable interface of the laser processing process and generate processing instructions based on the target relief image. Then, the image generation device can send the processing instructions to the laser processing equipment, enabling the laser processing equipment to perform laser processing on the material to be processed based on the processing instructions.
[0131] The editable interface may include image parameter adjustment controls and laser processing parameter adjustment controls. During the generation of processing instructions based on the target relief image, the image generation device can respond to trigger operations on the image parameter adjustment controls to adjust the image parameters of the target relief image and use the adjusted image parameters as the target image parameters. Similarly, responding to trigger operations on the laser processing parameter adjustment controls, the device can adjust the laser processing parameters corresponding to the target relief image and use the adjusted laser processing parameters as the target laser processing parameters. Finally, the image generation device can generate processing instructions containing both the target image parameters and the target laser processing parameters.
[0132] In some embodiments, the image parameter adjustment control described above can be a control for adjusting the image parameters of the target relief processing image, such as a text input box control or a drop-down option box control. Image parameters may refer to the size of the target relief processing image, specifically including the length, width, or pixel size of the target relief processing image, and may also include the shape parameters, sharpness parameters, grayscale parameters, etc. of the target relief processing image, which are not limited in this application.
[0133] In some embodiments, the laser processing parameter adjustment control can be a control for adjusting parameters of the laser processing equipment, or it can be a text input box control, a drop-down option control, etc. Laser processing parameters can be, for example, the power of the laser processing equipment, the moving speed of the processing head, the processing density, etc., and this application does not limit this to any particular parameter.
[0134] Please refer to the following: Figure 17 , Figure 17 This is a schematic diagram illustrating a relief sculpture obtained by a processing device carving a carving material, as shown in an exemplary embodiment of this application. Figure 17 As shown, the processing equipment is used to carve relief works from stone slabs. It can be seen that the relief works include image elements in the target relief processing image, that is, image elements corresponding to the input image, such as the girl in the input image.
[0135] In some embodiments of this application, in response to an image generation request, an input image is acquired, which includes image elements to be laser-processed. Depth calculation is performed on the input image to obtain a depth image corresponding to the input image. Contour extraction is then performed on the input image to obtain a line drawing image corresponding to the input image. Subsequently, a target relief processing image is generated based on the depth image and the line drawing image. This target relief processing image is used for laser processing and contains image elements corresponding to the input image. Finally, the target relief processing image is imported into the laser processing process. Therefore, during laser processing, the image required for relief processing can be generated based on the input image. Compared to users drawing target relief processing images using complex modeling software, this eliminates the need for users to learn modeling software, lowering the barrier to generating target relief processing images and making the generation simpler and more convenient. This also improves the generation speed and efficiency of target relief processing images, enhancing their applicability and the suitability of laser processing.
[0136] Combination Figure 18 As shown, an exemplary embodiment of this application also provides an image processing apparatus for laser processing, the apparatus 180 comprising:
[0137] Acquisition unit 1801 is configured to acquire the input image in response to an image generation request; the input image includes image elements to be laser-processed;
[0138] The processing unit 1802 is used to perform depth calculation processing based on the input image to obtain a depth image corresponding to the input image, and to perform contour extraction processing based on the input image to obtain a line drawing image corresponding to the input image;
[0139] The generation unit 1803 is used to generate a target relief processing image based on the depth image and the line drawing image, wherein the target relief processing image is used for laser processing and contains image elements corresponding to the input image;
[0140] Import unit 1804 is used to import the target relief processing image into the laser processing process.
[0141] In one possible implementation, the generation unit 1804 is used to generate a target relief processing image based on the depth image and the line drawing image, specifically for:
[0142] At least two candidate relief processing images are generated and displayed based on the depth image and the line drawing image; different candidate relief processing images correspond to different image styles;
[0143] In response to the selection operation for the candidate relief processing image, the selected candidate relief processing image is determined as the target relief processing image.
[0144] In one possible implementation, the import unit 1804 is used to import the target relief processing image into the laser processing process, specifically for:
[0145] The target relief processing image is displayed in the editable interface of the laser processing process, and processing instructions are generated based on the target relief processing image;
[0146] The processing instructions are sent to the processing equipment so that the processing equipment performs laser processing on the material to be processed based on the processing instructions.
[0147] In one possible implementation, the editable interface includes image parameter adjustment controls and laser processing parameter adjustment controls; the import unit 1804 is used to generate processing instructions based on the target relief processing image, specifically for:
[0148] In response to a trigger operation on the image parameter adjustment control, the image parameters of the target relief processing image are adjusted, and the adjusted image parameters are used as the target image parameters;
[0149] In response to a trigger operation on the laser processing parameter adjustment control, the laser processing parameters corresponding to the target relief processing image are adjusted, and the adjusted laser processing parameters are used as the target laser processing parameters;
[0150] Generate processing instructions that include the target image parameters and the target laser processing parameters.
[0151] In one possible implementation, the acquisition unit 1801 is configured to acquire the input image in response to an image generation request carrying the input image, specifically for:
[0152] Display an image generation interface, which includes an image upload control;
[0153] In response to an input operation to the image upload control, an image generation request is created, the image corresponding to the input operation is obtained, and the image is used as the input image.
[0154] In one possible implementation, the acquisition unit 1801 is further configured to acquire the target prompt word corresponding to the input image;
[0155] The generation unit 1803 is used to generate a target relief processing image based on the depth image and the line drawing image, including:
[0156] The target relief image is generated based on the target prompt, the depth image, and the line drawing image.
[0157] In one possible implementation, the acquisition unit 1801 is used to acquire the target prompt word corresponding to the input image, specifically for:
[0158] Display an image generation interface, which includes a prompt input control;
[0159] In response to an input operation to the prompt word input control, the text character corresponding to the input operation is obtained, and the text character is used as the target prompt word.
[0160] In one possible implementation, the acquisition unit 1801 is used to acquire the target prompt word corresponding to the input image, specifically for:
[0161] The input image is processed by a label generation model to generate labels, thereby obtaining a set of labels corresponding to the input image.
[0162] The target prompt word is determined based on the tags in the tag set.
[0163] In one possible implementation, the generation unit 1803 is used to generate a target relief processing image based on the depth image and the line drawing image, specifically for:
[0164] The line art image is processed by a line art processing network to extract line art features, thereby obtaining the line art features corresponding to the line art image.
[0165] The depth image is processed by a deep processing network to extract depth features, thereby obtaining the depth features corresponding to the depth image.
[0166] The target relief processing image is obtained by performing image generation processing on the line drawing features and the depth features based on the image generation network.
[0167] In one possible implementation, the processing unit 1801 performs depth calculation processing based on the input image to obtain a depth image corresponding to the input image, specifically for:
[0168] The input image is processed by performing depth calculation on multiple depth image generation models to obtain depth images output by the multiple depth image generation models respectively. The depth calculation processing parameters corresponding to the multiple depth image generation models are different.
[0169] Select a target depth image from the plurality of depth images and use it as the depth image corresponding to the input image.
[0170] In one possible implementation, the processing unit 1801 is configured to select a target depth image from the plurality of depth images as the depth image corresponding to the input image, specifically for:
[0171] Obtain the exposure histograms corresponding to the multiple depth images respectively, wherein the exposure histograms include the correlation between the brightness value and the number of pixels in the corresponding depth images;
[0172] Based on the correlation in the exposure histograms corresponding to each depth image, a target depth image is selected from the multiple depth images to obtain the depth image corresponding to the input image.
[0173] In one possible implementation, the processing unit 1801 is configured to select a target depth image from the plurality of depth images based on the correlation relationships in the exposure histograms corresponding to each depth image, thereby obtaining the depth image corresponding to the input image, specifically for:
[0174] The exposure histograms corresponding to the multiple depth images are traversed. If the number of pixels within the specified brightness value range in the currently traversed exposure histogram is within a set threshold range, then the depth image corresponding to the currently traversed exposure histogram is determined as the target depth image, so as to obtain the depth image corresponding to the input image.
[0175] It should be noted that the image processing apparatus 180 for laser processing provided in the above embodiments and the image processing method for laser processing provided in the above embodiments belong to the same concept. The specific ways in which each module and unit performs operations have been described in detail in the method embodiments, and will not be repeated here. In practical applications, the image processing apparatus 180 for laser processing provided in the above embodiments can be assigned to different functional modules as needed, that is, the internal structure of the apparatus can be divided into different functional modules to complete all or part of the functions described above, and this is not a limitation here.
[0176] Embodiments of this application also provide an electronic device, including: one or more processors; and a memory for storing one or more programs, which, when executed by one or more processors, cause the electronic device to implement the image processing method for laser processing provided in the above embodiments.
[0177] Figure 19 A schematic diagram of a computer system suitable for implementing the embodiments of this application is shown. It should be noted that... Figure 19 The computer system 1900 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0178] like Figure 19 As shown, the computer system 1900 includes a Central Processing Unit (CPU) 1901, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 1902 or programs loaded from storage portion 1908 into Random Access Memory (RAM) 1903, such as performing the methods described in the above embodiments. Various programs and data required for system operation are also stored in RAM 1903. The CPU 1901, ROM 1902, and RAM 1903 are interconnected via bus 1904. An Input / Output (I / O) interface 1905 is also connected to bus 1904.
[0179] The following components are connected to I / O interface 1905: input section 1906 including keyboard, mouse, etc.; output section 1907 including cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; storage section 1908 including hard disk, etc.; and communication section 1909 including network interface card, modem, etc. Communication section 1909 performs communication processing via a network such as the Internet. Drive 1910 is also connected to I / O interface 1905 as needed. Removable media 1911, such as disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1910 as needed so that computer programs read from them can be installed into storage section 1908 as needed.
[0180] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1909, and / or installed from removable medium 1911. When the computer program is executed by central processing unit (CPU) 1901, it performs various functions defined in the system of this application.
[0181] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0182] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0183] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0184] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method for detecting the wear degree of a cutting component as described above. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not assembled into the electronic device.
[0185] The above description is merely a preferred exemplary embodiment of this application and is not intended to limit the implementation of this application. Those skilled in the art can easily make corresponding modifications or alterations based on the main concept and spirit of this application. Therefore, the scope of protection of this application should be determined by the scope of protection claimed in the claims.
Claims
1. An image processing method for laser processing, characterized in that, include: In response to an image generation request, the input image is acquired; The input image includes image elements to be laser processed; Based on the input image, depth calculation processing is performed to obtain the depth image corresponding to the input image, and based on the input image, contour extraction processing is performed to obtain the line drawing image corresponding to the input image; A target relief processing image is generated based on the depth image and the line drawing image; wherein, the target relief processing image is used for laser processing, and the target relief processing image contains image elements corresponding to the input image; The target relief image is imported into the laser processing process.
2. The method according to claim 1, characterized in that, The process of generating the target relief processing image based on the depth image and the line drawing image includes: At least two candidate relief processing images are generated and displayed based on the depth image and the line drawing image; different candidate relief processing images correspond to different image styles; In response to the selection operation for the candidate relief processing image, the selected candidate relief processing image is determined as the target relief processing image.
3. The method according to claim 1, characterized in that, The step of importing the target relief image into the laser processing process includes: The target relief processing image is displayed in the editable interface of the laser processing process, and processing instructions are generated based on the target relief processing image; The processing instructions are sent to the processing equipment so that the processing equipment performs laser processing on the material to be processed based on the processing instructions.
4. The method according to claim 3, characterized in that, The editable interface includes image parameter adjustment controls and laser processing parameter adjustment controls; the generation of processing instructions based on the target relief processing image includes: In response to a trigger operation on the image parameter adjustment control, the image parameters of the target relief processing image are adjusted, and the adjusted image parameters are used as the target image parameters; In response to a trigger operation on the laser processing parameter adjustment control, the laser processing parameters corresponding to the target relief processing image are adjusted, and the adjusted laser processing parameters are used as the target laser processing parameters; Generate processing instructions that include the target image parameters and the target laser processing parameters.
5. The method according to claim 1, characterized in that, The step of obtaining the input image in response to an image generation request carrying an input image includes: Display an image generation interface, which includes an image upload control; In response to an input operation to the image upload control, an image generation request is created, the image corresponding to the input operation is obtained, and the image is used as the input image.
6. The method according to claim 1, characterized in that, After acquiring the input image in response to an image generation request carrying the input image, the method further includes: Obtain the target prompt word corresponding to the input image; The process of generating the target relief processing image based on the depth image and the line drawing image includes: The target relief image is generated based on the target prompt, the depth image, and the line drawing image.
7. The method according to claim 6, characterized in that, The step of obtaining the target prompt word corresponding to the input image includes: Display an image generation interface, which includes a prompt input control; In response to an input operation to the prompt word input control, the text character corresponding to the input operation is obtained, and the text character is used as the target prompt word.
8. The method according to claim 6, characterized in that, The step of obtaining the target prompt word corresponding to the input image includes: The input image is processed by a label generation model to generate labels, thereby obtaining a set of labels corresponding to the input image. The target prompt word is determined based on the tags in the tag set.
9. The method according to claim 1, characterized in that, The process of generating the target relief processing image based on the depth image and the line drawing image includes: The line art image is processed by a line art processing network to extract line art features, thereby obtaining the line art features corresponding to the line art image. The depth image is processed by a deep processing network to extract depth features, thereby obtaining the depth features corresponding to the depth image. The target relief processing image is obtained by performing image generation processing on the line drawing features and the depth features based on the image generation network.
10. The method according to claim 1, characterized in that, The step of performing depth calculation processing based on the input image to obtain a depth image corresponding to the input image includes: The input image is processed by performing depth calculation on multiple depth image generation models to obtain depth images output by the multiple depth image generation models respectively. The depth calculation processing parameters corresponding to the multiple depth image generation models are different. Select a target depth image from the plurality of depth images and use it as the depth image corresponding to the input image.
11. The method according to claim 10, characterized in that, The step of selecting a target depth image from the plurality of depth images to obtain the depth image corresponding to the input image includes: Obtain the exposure histograms corresponding to the multiple depth images respectively, wherein the exposure histograms include the correlation between the brightness value and the number of pixels in the corresponding depth images; Based on the correlation in the exposure histograms corresponding to each depth image, a target depth image is selected from the multiple depth images to obtain the depth image corresponding to the input image.
12. The method according to claim 11, characterized in that, The step of selecting a target depth image from the plurality of depth images based on the correlation relationships in the exposure histograms corresponding to each depth image to obtain the depth image corresponding to the input image includes: The exposure histograms corresponding to the multiple depth images are traversed. If the number of pixels within the specified brightness value range in the currently traversed exposure histogram is within a set threshold range, then the depth image corresponding to the currently traversed exposure histogram is determined as the target depth image, so as to obtain the depth image corresponding to the input image.
13. A processing equipment, characterized in that, include: slide rail; A processing head, which is slidably mounted on the slide rail; A communication component, the communication component being configured to receive the target relief processing image obtained by the steps of the method according to any one of claims 1 to 12; A controller, based on the acquired target relief processing image, controls the processing head to move on the slide rail for processing.
14. A processing system, characterized in that, include: Processing equipment, the processing equipment comprising a communication component, a controller, a slide rail, and a movable head, the movable head being slidably disposed on the slide rail; and A terminal device that communicates with the processing equipment, the terminal device being used to execute the image processing method for laser processing according to any one of claims 1 to 12.
15. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the image processing method for laser processing as described in any one of claims 1-12.
16. A computer program product, characterized in that, The computer program product includes a computer program stored in a computer-readable storage medium, and the processor of the electronic device reads from and executes the computer program, causing the electronic device to perform the image processing method for laser processing according to any one of claims 1-12.