Image processing method for laser machining, machining device, machining system, medium, and program product

WO2026166531A1PCT designated stage Publication Date: 2026-08-13MAKEBLOCK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2026-02-06
Publication Date
2026-08-13

Smart Images

  • Figure CN2026077679_13082026_PF_FP_ABST
    Figure CN2026077679_13082026_PF_FP_ABST
Patent Text Reader

Abstract

An image processing method for laser machining, the method comprising: in response to an image generation request, acquiring from the image generation request a line art image for machining; on the basis of the line art image, performing 3D style processing to obtain a 3D style image, and performing depth image extraction on the 3D style image to obtain a depth image corresponding to the 3D style image; and finally, on the basis of the line art image and the depth image, generating a target relief machining image, and importing the target relief machining image into a laser machining process to perform laser machining processing. The method can not only realize the automation of laser relief machining, but also improve the relief machining efficiency and the relief machining quality. The present invention further relates to a machining device (104), a machining system, a computer-readable medium, and a program product.
Need to check novelty before this filing date? Find Prior Art

Description

Image processing methods, processing equipment, processing systems, media, and program products for laser processing.

[0001] Related applications

[0002] This application claims priority to Chinese patent applications filed on February 6, 2025, with application number 202510132965.4, 202510134057.9, 202510134083.1, 202510134083.1, and 202510155285.4, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application relates to image processing technology, and more particularly to an image processing method, processing equipment, processing system, medium, and program product for laser processing. Background Technology

[0004] Target relief images are crucial reference images in the field of relief carving, and the efficiency of relief carving is closely related to the efficiency of generating target relief images that meet the processing requirements. Currently, generating target relief images that meet processing requirements usually requires manual intervention by professional technicians, making the generation of target relief images difficult and inefficient. Therefore, it is necessary to propose an image processing scheme for laser processing to efficiently generate target relief images that meet processing requirements. Summary of the Invention

[0005] This application provides an image processing method, processing equipment, processing system, medium, and program product for laser processing. It can quickly generate high-quality relief processing images based on image prompts during the laser processing process, which helps to improve the efficiency of generating relief processing materials that meet user needs and also improves the processing quality of laser processing to a certain extent.

[0006] In a first aspect, embodiments of this application provide an image processing method for laser processing, the method comprising:

[0007] In response to an image generation request, retrieve the line art image;

[0008] Obtain the depth image corresponding to the line drawing image;

[0009] A target relief processing image is generated based on the line drawing image and the depth image, and the target relief processing image is imported into the laser processing process; wherein, the target relief processing image is used for laser processing, and the target relief processing image contains the image elements indicated by the line drawing image.

[0010] In one embodiment, the step of acquiring a line drawing image in response to an image generation request, and acquiring a depth image corresponding to the line drawing image, includes:

[0011] In response to an image generation request, a line drawing image to be laser-processed is obtained from the image generation request;

[0012] Based on the line drawing image, 3D style processing is performed to obtain a 3D style image, and depth map extraction is performed on the 3D style image to obtain the depth image corresponding to the 3D style image.

[0013] In one embodiment, the step of acquiring a line drawing image in response to an image generation request, and acquiring a depth image corresponding to the line drawing image, includes:

[0014] In response to an image generation request, an image prompt is obtained, which describes the image elements to be laser-processed;

[0015] Generate a 3D image containing the image elements based on the image prompts;

[0016] The three-dimensional image is processed by line drawing to obtain the line drawing image corresponding to the three-dimensional image, and the three-dimensional image is processed by depth map extraction to obtain the depth image corresponding to the three-dimensional image.

[0017] In one embodiment, the step of acquiring a line drawing image in response to an image generation request, and acquiring a depth image corresponding to the line drawing image, includes:

[0018] In response to an image generation request, the input image is acquired; the input image includes image elements to be laser-processed.

[0019] Contour extraction is performed on the input image to obtain a line drawing image corresponding to the input image, and depth calculation is performed on the input image to obtain a depth image corresponding to the input image.

[0020] Secondly, embodiments of this application provide an image processing apparatus for laser processing, the apparatus comprising:

[0021] An acquisition unit is configured to acquire image prompts in response to an image generation request; wherein the image prompts are used to describe image elements to be laser-processed;

[0022] The acquisition unit is also used to acquire an initial noise image;

[0023] The processing unit is configured to perform denoising processing on the initial noisy image based on the image prompt word to obtain a target relief processing image; wherein, the target relief processing image is used for laser processing, and the target relief processing image contains image elements corresponding to the image prompt word;

[0024] The import unit is used to import the target relief processing image into the laser processing process.

[0025] 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 method 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.

[0026] 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.

[0027] 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.

[0028] 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.

[0029] In a seventh aspect, embodiments of this application provide a computer program product, which includes a computer program or computer instructions. The computer program is stored in a computer-readable storage medium, and 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.

[0030] In some embodiments of this application, in response to an image generation request, an image prompt is obtained, which describes the image elements to be laser-processed, and an initial noisy image is obtained. Then, based on the image prompt, the initial noisy image is denoised to obtain a target relief processing image. This target relief processing image is used for laser processing and contains the image elements corresponding to the image prompt. The target relief processing image is then imported into the laser processing process. Therefore, during laser processing, the rapid generation of high-quality relief images based on image prompts obtained from the user's request improves the efficiency of generating relief processing materials that meet user needs. Furthermore, since the image prompts describe the image elements to be laser-processed, they are prompts related to laser processing, making the generated relief processing materials more suitable for laser processing scenarios, thereby improving laser processing efficiency and quality to a certain extent.

[0031] In this embodiment, based on the image prompts carried (or contained) in the image generation request, a 3D image containing the image elements described by the image prompts is generated. Then, by drawing line art on the 3D image, a line art image indicating the texture features of the image elements is obtained. Furthermore, by extracting a depth map from the 3D image, a depth image indicating the depth features of the image elements is obtained. Finally, a target relief processing image is generated based on the line art image and the depth image. This allows business users to obtain a target relief processing image that meets their needs simply by providing the image prompts, without relying on manual modeling or image drawing by professional technicians. This reduces the generation threshold and cost of the target relief processing image and eliminates the impact of human factors on image generation efficiency and image quality. Importing the image into the laser processing process can improve the processing efficiency of laser processing and the quality of the resulting relief, thereby ensuring the satisfaction of business users with the target relief processing image to a certain extent.

[0032] In this embodiment, a line drawing image is carried (or included) in the image generation request to express the image elements to be processed into a relief. 3D style processing is then performed on the line drawing image to obtain a 3D style image containing the image elements contained in the line drawing image. Depth map extraction is then performed on the 3D style image to obtain a depth image indicating the depth features of the 3D style image. Finally, the target relief processing image is generated based on the line drawing image and the depth image. This allows business users to quickly obtain the target relief processing image simply by providing a line drawing image to indicate processing requirements, without relying on manual modeling or image drawing by professional technicians. This lowers the technical threshold for image processing in laser processing scenarios and helps save costs in laser processing operations. Furthermore, since line art images can accurately represent the texture features of image elements, generating a target relief processing image based on the line art image provided by the business object ensures that the generated target relief processing image contains image elements that best meet the needs of the business object. On this basis, combining the image depth features indicated by the depth image can guarantee the exquisite quality of each image element in the generated target relief processing image. Based on this, the target relief processing image is imported into the laser processing process to obtain the corresponding relief through laser processing. This not only automates laser relief engraving but also improves relief processing efficiency and quality.

[0033] 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

[0034] 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.

[0035] Figure 1 is a schematic diagram illustrating the relationship between a line drawing image and a target relief processing image provided in an embodiment of this application;

[0036] Figure 2 is a schematic diagram of the structure of an image processing system for laser processing provided in an embodiment of this application;

[0037] Figure 3 is a schematic flowchart of an image processing method for laser processing provided in an embodiment of this application;

[0038] Figure 4 is a schematic diagram of an input process for a line drawing image provided in an embodiment of this application;

[0039] Figure 5 is a schematic diagram of another line drawing image input process provided in an embodiment of this application;

[0040] Figure 6 is a schematic diagram of a 3D style image provided in an embodiment of this application;

[0041] Figure 7 is a schematic diagram of a depth image provided in an embodiment of this application;

[0042] Figure 8 is a schematic diagram of a relief sculpture provided in an embodiment of this application;

[0043] Figure 9 is a schematic diagram of an image generation process provided in an embodiment of this application;

[0044] Figure 10 is a schematic diagram of an image processing device for laser processing provided in an embodiment of this application;

[0045] Figure 11 is a schematic diagram of a processing device provided in an embodiment of this application;

[0046] Figure 12 is a schematic diagram illustrating the relationship between an image prompt and a target relief processing image provided in an embodiment of this application;

[0047] Figure 13 is a schematic flowchart of an image processing method for laser processing provided in an embodiment of this application;

[0048] Figure 14 is a schematic diagram of an image prompt input process provided in an embodiment of this application;

[0049] Figure 15 is a schematic diagram of a three-dimensional image provided in an embodiment of this application;

[0050] Figure 16 is a schematic diagram of a line drawing image provided in an embodiment of this application;

[0051] Figure 17 is a schematic diagram of a depth image provided in an embodiment of this application;

[0052] Figure 18 is a schematic diagram of a relief sculpture provided in an embodiment of this application;

[0053] Figure 19 is a schematic diagram of an image generation process provided in an embodiment of this application;

[0054] Figure 20 is a schematic diagram of an image processing device for laser processing provided in an embodiment of this application;

[0055] Figure 21 is a schematic diagram of an exemplary implementation environment of this application;

[0056] Figure 22 is a schematic flowchart illustrating an image processing method for laser processing according to an embodiment of this application;

[0057] Figure 23 is a schematic diagram of an image generation interface shown in an embodiment of this application;

[0058] Figure 24 is a schematic diagram showing the exposure histograms corresponding to multiple depth images in an embodiment of this application;

[0059] Figure 25 is a schematic diagram illustrating the generation of a depth image based on an input image according to an embodiment of this application;

[0060] Figure 26 is a schematic diagram illustrating the generation of a line drawing image based on an input image according to an embodiment of this application;

[0061] Figure 27 is a schematic diagram illustrating the input and output images according to an embodiment of this application;

[0062] Figure 28 is another schematic diagram of an image generation interface shown in an embodiment of this application;

[0063] Figure 29 is another schematic diagram of an image generation interface shown in an embodiment of this application;

[0064] Figure 30 is another schematic diagram of an image generation interface shown in an embodiment of this application;

[0065] Figure 31 is a schematic diagram of an image generation interface filled with input content, according to an embodiment of this application;

[0066] Figure 32 is a schematic diagram of an image generation interface showing a target relief processing image, according to an embodiment of this application;

[0067] Figure 33 is a timing diagram illustrating an image processing method for laser processing according to an embodiment of this application;

[0068] Figure 34 is another timing diagram illustrating an image processing method for laser processing according to an embodiment of this application;

[0069] Figure 35 is a schematic diagram of a relief sculpture obtained by a processing device for carving materials according to an embodiment of this application;

[0070] Figure 36 is a schematic diagram of the structure of an image processing apparatus for laser processing according to an embodiment of this application;

[0071] Figure 37 shows a schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application;

[0072] Figure 38 is a schematic diagram of an exemplary implementation environment of this application;

[0073] Figure 39 is a schematic flowchart illustrating an image processing method for laser processing according to an embodiment of this application;

[0074] Figure 40 is a schematic diagram of the architecture of the server receiving the generation request according to an embodiment of this application;

[0075] Figure 41 is a schematic diagram illustrating the principle of image prompt word processing by a text encoder according to an embodiment of this application;

[0076] Figure 42 is a schematic diagram illustrating the principle of noise reduction processing of an image information creator according to an embodiment of this application;

[0077] Figure 43 is a schematic diagram illustrating the principle of a decoder processing a potential image representation according to an embodiment of this application;

[0078] Figure 44 is a schematic diagram of an image generation interface shown in an embodiment of this application;

[0079] Figure 45 is a schematic diagram of another image generation interface shown in an embodiment of this application;

[0080] Figure 46 is a schematic diagram of a user interface for selecting a target relief image according to an embodiment of this application;

[0081] Figure 47 is a schematic diagram of an editable interface shown in one embodiment of this application;

[0082] Figure 48 is a timing diagram illustrating a method for generating relief images for processing according to an embodiment of this application;

[0083] Figure 49 is a schematic diagram of an image processing apparatus for laser processing according to an embodiment of this application. Detailed Implementation

[0084] 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 accompanying drawings shown in the embodiments of this application are merely illustrative examples; for instance, the execution order of each step in the drawings can be adaptively adjusted according to the actual application scenario.

[0085] Furthermore, in the embodiments of this application, the block diagrams, modules, and units shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. Each module or unit can be part of a larger module or unit that includes the functionality of that module or unit. That is, the terms "module" or "unit" mentioned in the embodiments of this application refer to a computer program or part of a computer program with a predetermined function, which can work together with other related parts to achieve a predetermined goal. It can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof, or implemented in different network and / or processor devices and / or microcontroller devices. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units.

[0086] This application provides an image processing solution for laser processing of relief sculptures. This solution aims to generate a reference image (i.e., a target relief processing image) required for relief processing from a line drawing image provided by a business client. The line drawing image at least contains the image elements that the business client expects to transform into a relief sculpture through laser processing. The line drawing image refers to an effect diagram composed of lines. The lines in the line drawing image can vary in length, density, and shade to delineate the image of the corresponding object. In other words, the image elements in the line drawing image refer to patterns drawn by lines, and the line drawing image typically does not have color fill.

[0087] For example, the image marked with 101 in Figure 1 is a line drawing image. If the line drawing image provided by the business client is the one marked with 101 in Figure 1, it indicates that the business client expects a relief to depict "an eagle with outstretched wings." Therefore, the target relief image generated by the image processing device based on this line drawing image must at least contain the image of an eagle (as shown in the image marked with 102 in Figure 1). It should be noted that the target relief image in Figure 1 is merely an illustrative example and does not imply that the target relief image generated in this application must be a grayscale 3D style image or must contain an image as a single image element.

[0088] In the specific implementation principle of this application, the line drawing image can be carried (or contained) by an image generation request, so as to transmit the line drawing image to the image processing device by transmitting the image generation request. After obtaining the line drawing image from the image generation request, the image processing device can perform 3D style processing based on the line drawing image to obtain a 3D style image, and further extract a depth map based on the 3D style image to obtain a depth image corresponding to the 3D style image, which is used to indicate the depth features of the 3D style image. Finally, the image processing device can perform image generation based on the image depth features indicated by the line drawing image and the 3D style image to obtain a target relief processing image containing the corresponding image elements, and then import the target relief processing image into the laser processing process for laser processing to obtain the corresponding relief.

[0089] Image elements in the target relief processing image can be presented in a style suitable for relief processing (such as a simulated relief style). Since the target relief processing image is automatically generated based on the line drawing image input by the business object, there is no need for manual modeling or image drawing by the business object. This reduces the generation threshold and cost of the target relief processing image, and also eliminates the impact of human factors on image generation efficiency or quality, thereby improving image generation efficiency and image quality to a certain extent. Furthermore, the line drawing image can accurately express the texture features of image elements. Generating the target relief processing image based on the line drawing image ensures that the generated target relief processing image contains image elements that meet the needs of the business object. Combined with the image depth features indicated by the depth image, the refinement of each image element in the target relief processing image can be ensured. Based on this, the target relief processing image is imported into the laser processing process to obtain the corresponding relief through laser processing. This not only automates laser relief engraving but also improves relief processing efficiency and quality.

[0090] In one embodiment, the laser processing process can run within an image processing device or a laser processing device, which at least possesses laser generation and laser movement functions. Specifically, the laser processing process can be used to control the laser processing device to perform laser processing based on a target relief processing image, and / or, after creating a processing instruction based on the target relief processing image, to send the processing instruction to the laser processing device to instruct the laser processing device to schedule the corresponding functions for laser processing. Furthermore, the image processing device used to implement the embodiments of this application can include one or both of a terminal device and a server. When the image processing device includes a terminal device, an application for implementing image processing (such as image generation) can run within the terminal device. This application is developed based on the image processing method for laser processing provided in the embodiments of this application and can be simply referred to as an image processing program. The image processing program can be used to create a laser processing process or to interact with the laser processing process (such as sending processing instructions). Moreover, the type of terminal device can specifically include, but is not limited to, smartphones, tablets, laptops, desktop computers, in-vehicle terminals, smart TVs, and smart wearable devices (such as wristbands and watches).

[0091] When the image processing device includes a server, the server can be used to provide support services such as data computing and data storage services for the image processing program. In other words, the server establishes a communication connection with the image processing program to generate a target relief image that meets the user's needs through interaction with the program. Furthermore, the type of server can specifically include, but is not limited to, one or more of the following: a standalone physical server, a server cluster consisting of multiple physical servers, and a cloud server providing cloud services; no specific limitations are imposed here.

[0092] In another embodiment, the image processing device of this application can establish a communication connection with a laser processing device (hereinafter referred to as the processing device), and implement the relevant technical solution through an image processing system including the image processing device and the laser processing device. Exemplarily, the structure of the image processing system for laser processing can be as shown in Figure 2. Based on Figure 2, the image processing system can include n image processing devices (one or more devices marked with 103 in Figure 2), and at least one laser processing device (a device marked with 104 in Figure 2), where n is a positive integer. In practical applications of this system, the laser processing process can run as a host computer within the image processing device. The host computer sends processing instructions carrying the target relief processing image to a slave computer (such as the laser processing device) to instruct (or control) the laser processing device to perform corresponding laser processing, thereby obtaining the relief corresponding to the target relief processing image. Of course, the host computer can also be used to generate the target relief processing image based on image prompts; this is not limited here.

[0093] Based on the above implementation environment, please refer to Figure 2. Figure 2 is a schematic diagram of a processing system provided in an embodiment of this application. As shown in Figure 2, the processing system may include a client device 103 and a processing device 104. The client device 103 can establish a communication connection with the processing device 104 and communicate with it. The processing device 104 may include a communication component, a controller, a slide rail, and a movable head, the movable head being slidably mounted on the slide rail. The client device 103 shown in Figure 2 may refer to the client device 302 shown in Figure 21, and the processing device 104 shown in Figure 2 may refer to the processing device 303 shown in Figure 21.

[0094] The client device 103 may be the host computer of the processing equipment 104, which may have the host computer software of the processing equipment 104 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., processing equipment 104) to control the processing equipment 104 to respond to the processing instructions and perform laser processing on the processing material based on the target relief processing image.

[0095] Based on the above implementation environment and processing system, please refer to Figure 11. Figure 11 is a structural schematic diagram of a processing device provided in an embodiment of this application. As shown in Figure 11, the processing device includes a housing, a processing device 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 device 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 disposed on the slide rail 80 and is used to move on the processing area to achieve laser processing. The communication component 20 is used to receive the target relief processing image obtained from the steps of the method provided in the above embodiment. Based on the target relief processing image, the controller 60 controls the processing head 50 to move 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 and are not visible from the perspective in Figure 11, so they are shown by a dashed line connecting the two. The processing equipment communicates with a client device (one or more devices marked with 201 in Figure 2), the client device being used to execute a data processing method based on the processing equipment (e.g., the image processing method for laser processing of this application).

[0096] 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.

[0097] 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.

[0098] In one embodiment, the housing of the computer numerical control machine, namely the upper shell 90 and the bottom shell 70 as shown in Figure 11, together enclose an internal space for accommodating processing materials. The upper shell 90 and the bottom shell 70 can be detachably connected or fixedly connected, or the upper shell 90 and the bottom shell 70 can be integrally formed. 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 to insert or remove processing 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.

[0099] As shown in the example in Figure 11, 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.

[0100] Based on the above principles, this application specifically proposes an image processing method for laser processing. A schematic flowchart of this method can be seen in Figure 3, and it can still be executed by the aforementioned image processing device. As shown in Figure 3, the method may include steps S101-S103, wherein:

[0101] S101. In response to the image generation request, obtain the line drawing image to be laser processed from the image generation request.

[0102] In a specific embodiment, a business object can trigger an image generation request by interacting with the image processing device. To facilitate the business object initiating an image generation request quickly, the image processing device can run an image processing program and display an image generation interface containing an image input area during the process. This allows the image processing device to detect a line drawing image displayed within the image input area and then create an image generation request based on the displayed line drawing image.

[0103] In one embodiment, a business object can display a line drawing image shown in an image processing device in an image input area by moving the line drawing image to that area, thereby triggering the image processing device to create an image generation request. Specifically, in response to a business object's movement operation on the line drawing image in the image generation interface, the image processing device can move the line drawing image in the image generation interface according to the movement trajectory of the movement operation, and after the line drawing image is moved to the image input area, display the line drawing image in the image input area, and then create an image generation request based on the displayed line drawing image.

[0104] As an example, the process of a business object inputting a line art image according to this implementation method can be seen in Figure 4. As shown in Figure 4, the image input area can be represented by the area marked 105, and the line art image to be input can be represented by the image marked 106. Then, after selecting the line art image marked 106, the business object can move the line art image to the image input area marked 105 according to the trajectory marked 107, thus obtaining the image input area marked 108 where the line art image is displayed.

[0105] It is understood that the image generation interface and image movement trajectory shown in Figure 4 are illustrative and do not represent a limitation on the implementation of this application. Furthermore, before movement, the line drawing image can be displayed in the image generation interface or in other interfaces. The interface displaying the line drawing image can be triggered by a corresponding function in a running image generation program or by triggering a corresponding function in another application. Moreover, this interface can be displayed in the form of a floating window, a fixed window, a sliding window, etc., without limitation.

[0106] In another embodiment, the business object can also upload the line drawing image from the storage device to the image input area for display via file transfer, thereby triggering the image processing device to create a corresponding image generation request. The storage device can be a mobile terminal with storage components (such as a mobile phone, laptop, watch, etc.), or a readable storage device such as a hard drive, USB flash drive, or disk; there are no limitations here.

[0107] As an example, an image processing device can respond to a business object's selection operation on an image upload control by displaying an image selection interface. This interface displays at least one line drawing image from a storage device. If the image processing device detects a business object's selection operation on any line drawing image, it displays the selected line drawing image in the image input area and then creates an image generation request based on the displayed line drawing image. The image generation control can be a button component fixed in a preset position, or other dynamically changing or movable components (such as graphics or text) floating on the image generation interface to increase the fun of the image generation process.

[0108] For example, the process of a business object inputting a line drawing image according to this implementation can be seen in Figure 5. As shown in Figure 5, the image upload control can be represented by the component marked 109 in Figure 5 (i.e., the words "Click here"), and the image selection interface can be represented by the area marked 110 in Figure 5. In this case, the business object can perform a selection operation (such as single click, double click, long press, etc.) on the image upload control marked 109 in the image generation interface to trigger the display of the image selection interface marked 110 in Figure 5. Then, the business object can select the desired line drawing image from the various line drawing images displayed in the image selection interface, so that the image processing device displays the selected line drawing image in the image input area, thereby obtaining the image input area marked 111 in Figure 5 that displays the line drawing image.

[0109] In another embodiment, the business object can also draw a line drawing image within the image input area. After the line drawing image is completed, the image processing device is triggered to create a corresponding image generation request based on the line drawing image displayed in the image input area. In this case, an end control can be displayed in the image generation interface. The business object can notify the image processing device that the drawing of the line drawing image is now complete by selecting the end control.

[0110] It should be specifically noted that the image generation interface in this application embodiment may also include one or more of a result display area and a parameter configuration area. The result display area can be used to display the target relief processing image generated based on the line drawing image provided by the business object, and / or a schematic diagram of the relief artwork obtained after relief processing based on the target relief processing image; the parameter configuration area can be used to display various configurable parameters during the image generation process. Specifically, configurable parameters may include, but are not limited to, image parameters such as the number, size, color, and shape of the target relief processing image, as well as model parameters such as the neural network model used to generate the target relief processing image, the model combination method, and weight parameters. This application embodiment does not limit the display method or positional relationship of each area in the image generation interface.

[0111] S102. Perform 3D style processing on the line drawing image to obtain a 3D style image, and extract the depth map from the 3D style image to obtain the depth image corresponding to the 3D style image.

[0112] In specific embodiments, a 3D style image refers to an image that simulates depth and three-dimensionality (i.e., a 3D effect) on a two-dimensional plane by adding shadows, perspective, and textures. Image elements in this 3D style image present a stereoscopic visual effect. For example, a 3D style image containing the image element "an eagle with outstretched wings" can be shown in Figure 6. A depth map is a commonly used image representation method in computer vision, where each pixel value is used to express the distance between the corresponding pixel and the viewpoint, and the pixel value is usually inversely proportional to the distance. For example, the image shown in Figure 7 is a depth map, where brighter pixels indicate that the corresponding element is closer to the viewpoint, and darker pixels indicate that the corresponding element is farther away from the viewpoint. It should be noted that the black background in Figure 7 is set to clearly present the image effect to those skilled in the art, and can be replaced by other backgrounds in actual application scenarios, and therefore should not be regarded as a limitation on the embodiments of this application.

[0113] In one embodiment of generating 3D style images, the image processing device can perform 3D style processing based on the texture features of the line drawing image. Specifically, to balance image generation quality and efficiency, the image processing device can call a line drawing image processing model to extract texture features from the line drawing image, and then perform 3D style processing based on the extracted texture features to obtain a 3D style image. Here, the line drawing image processing model refers to a neural network model capable of processing line drawing images. The line drawing image processing model can be obtained by fine-tuning the parameters of a pre-trained graph processing model using several line drawing images, or it can be obtained by adding a specific network structure (such as a network with 3D style processing capabilities) to a pre-trained graph processing model; no limitation is imposed here.

[0114] In another embodiment of generating 3D style images, the image processing device can predict image cues based on a line drawing image, and then combine the image cues with the line drawing image to draw a 3D style image, thereby enriching the reference information in the image drawing process and generating a more accurate and exquisite 3D style image. The image cues predicted based on the line drawing image are used to describe the image elements present in the line drawing image, and the prediction process of these image cues may include image recognition and image understanding of the line drawing image.

[0115] Specifically, the image processing device can first predict the image prompts corresponding to the line drawing image, and then optimize the image prompts to obtain optimized prompts. These optimized prompts mainly describe the 3D features (such as shadow features, perspective features, etc.) required for the generated 3D style image. This allows the image processing device to perform 3D style processing based on the 3D features described by the optimized prompts and the texture features of the line drawing image, thus obtaining the 3D style image. In the method of generating depth images, since the effect of the depth image is closely related to the grayscale range, the image processing device can generate different depth images based on different grayscale ranges, and then select the highest quality depth image as the final depth image corresponding to the 3D style image. Specifically, the image processing device can first obtain multiple candidate grayscale ranges, and then extract the depth map of the 3D style image under each candidate grayscale range to obtain candidate depth images under each candidate grayscale range. Finally, the candidate depth image whose image quality meets the quality requirements is used as the depth image corresponding to the 3D style image. Each candidate grayscale range is used to indicate a set of minimum and maximum grayscale values, and the grayscale value of each pixel in the depth image generated under the candidate grayscale range is within that range.

[0116] Image quality is positively correlated with the ratio. The second preset pixel value range is a sub-range of the first preset pixel value range, and the difference in the number of pixels within the second preset pixel value range can cause a difference in image exposure. For example, the first preset pixel value range can be [50, 200], and the second preset pixel value range can be [190, 200], or only 200; there is no limitation here.

[0117] S103. Generate a target relief processing image based on the line drawing image and the depth image, and import the target relief processing image into the laser processing process; wherein, the target relief processing image is used for laser processing, and the target relief processing image contains the image elements indicated by the line drawing image.

[0118] In a specific embodiment, the target relief processing image refers to the reference image required during relief processing (such as laser engraving). The image elements in this image are laser-processed onto the material to be processed to obtain the corresponding relief. For example, based on the target relief processing image shown in Figure 1, carving can be performed on a stone slab to create the relief shown in Figure 8. Since the relief processing process is generally independent of color, the target relief processing image in this application can be a grayscale image to omit the image coloring process, thereby reducing the complexity of generating the target relief processing image and improving image generation efficiency.

[0119] In one embodiment, when generating a target relief processing image, the image processing device can first perform cue word reasoning based on the line drawing image to obtain image cue words. The image cue words are used to describe the image elements contained in the line drawing image. Then, the target relief processing image is generated based on the image cue words, the line drawing image, and the depth image. The target relief processing image contains at least the image elements described by the image cue words.

[0120] When performing cue word inference, image element recognition can be performed on the line drawing image to obtain the image elements contained in the line drawing image. Then, cue word prediction can be performed based on the recognized elements to obtain the image cue word. It is worth mentioning that the cue word inference process here can also be applied to the image cue word prediction in the aforementioned S102, which will not be described in more detail here.

[0121] When generating a target relief image based on image prompts, line art images, and depth images, preset grayscale prompts can be obtained first. Then, image grayscale prompts can be generated based on the image prompts and grayscale prompts. Finally, the target relief image can be generated based on the image grayscale prompts, line art images, and depth images. Here, grayscale prompts describe pre-configured grayscale information, such as grayscale levels and grayscale value ranges. Image grayscale prompts describe the grayscale features required for the generated target relief image, and these grayscale features must at least include the grayscale features required for the image elements contained in the line art image in the target relief image.

[0122] In another embodiment, when generating the target relief processing image, the image processing device can also leverage the powerful capabilities of neural network models to extract the image texture features of the line drawing image and the image depth features of the depth image, and then automatically generate the image based on the extracted features. Specifically, the image processing device can call a line drawing processing network to extract texture features from the line drawing image, and call a depth image processing network to extract depth features from the depth image, and finally, based on the image texture features and image depth features, call an image generation network to perform image generation processing to obtain the target relief processing image. Each processing network can be trained using relevant training data based on the expected processing target.

[0123] Image texture features are used to indicate the outlines of image elements in the line drawing image, while image depth features are used to indicate the distance information between each pixel in the image element and the viewpoint. Based on image depth features, the required three-dimensional structure of the target relief processing image can be determined, thereby assisting the image processing device in accurately understanding the relationships (positional relationships, height differences, etc.) of each image element in the three-dimensional scene. Therefore, combining image texture features and image depth features for image generation is beneficial for obtaining exquisite and accurate target relief processing images. Furthermore, calling a neural network model to generate target relief processing images can also leverage the trainable nature of neural networks to enhance the diversity of application scenarios in the embodiments of this application.

[0124] It is worth mentioning that in step S103, the image processing device can generate at least two candidate relief processing images with different image styles (such as different sharpness, different colors, different sizes, etc.) based on the line drawing image and the depth image, according to different image generation parameters (such as gray level, size, and the neural network invoked). The image generation parameters can be quickly configured by the business user through convenient methods such as mouse clicks or keyboard input, or dynamically selected by the image processing device based on real-time device performance or business needs.

[0125] The generated candidate relief processing images can be displayed on an image processing device or a designated terminal device, allowing business users to intuitively evaluate the quality of each candidate relief processing image (e.g., whether it accurately contains image elements from the line drawing image), thereby quickly selecting the candidate relief processing image that meets the expected effect as the target relief processing image for laser processing. Specifically, the image processing device can display one or more candidate relief processing images at a time. When multiple candidate relief processing images are displayed, business users can select the target relief processing image for laser processing by performing a selection operation on the corresponding candidate relief processing images. When only one candidate relief processing image is displayed, that candidate relief processing image is the target relief processing image, and business users can choose whether to trigger the corresponding relief laser processing based on the target relief processing image in the image processing device. The display size of each candidate relief processing image can be flexibly scaled, facilitating the viewing of image details by business users.

[0126] In a specific relief carving scenario, after obtaining the target relief carving image, the image processing device can import the target relief carving image into the laser processing process and display it on an editable interface (or other interface, such as the aforementioned image generation interface) created in the laser processing process. Then, based on the displayed target relief carving image, a processing instruction is generated. This instruction is then sent to the processing equipment, instructing it to process the material to be processed in response to the instruction, thereby obtaining a relief carving that presents the target relief carving image. The processing instruction can be triggered after detecting a confirmation operation from a business object regarding the displayed target relief carving image. This confirmation operation indicates that the business object allows relief laser engraving (a specific laser processing method) based on the target relief carving image. When the image device generates at least one target relief carving image, the target relief carving image used to generate the processing instruction can be one of the target relief carving images selected by the business object from among the target relief carving images.

[0127] In one embodiment, the processing instructions may further include target image parameters and laser processing parameters required for laser processing. For example, the editable interface created by the laser processing process may include image parameter adjustment controls and laser processing parameter adjustment controls. In this case, the business object can adjust the image parameters (such as size, shape, color, sharpness, resolution, etc.) of the target relief processing image using the image parameter adjustment controls, and can also adjust the laser processing parameters (such as light emission rate, power, density, etc.) used during laser processing using the laser processing parameter adjustment controls. Specifically, the image processing device can respond to the adjustment operation of the image parameter adjustment controls to obtain the target image parameters obtained after adjusting the image parameters of the target relief processing image. Furthermore, it can also respond to the adjustment operation of the laser processing parameter adjustment controls to obtain the target laser processing parameters obtained after adjusting the laser processing parameters corresponding to the target relief processing image, and then generate a processing instruction containing the target image parameters and the target laser processing parameters.

[0128] In this embodiment, a line drawing image is carried (or included) in the image generation request to express the image elements to be processed into a relief. 3D style processing is then performed on the line drawing image to obtain a 3D style image containing the image elements contained in the line drawing image. Depth map extraction is then performed on the 3D style image to obtain a depth image indicating the depth features of the 3D style image. Finally, the target relief processing image is generated based on the line drawing image and the depth image. This allows business users to quickly obtain the target relief processing image simply by providing a line drawing image to indicate processing requirements, without relying on manual modeling or image drawing by professional technicians. This lowers the technical threshold for image processing in laser processing scenarios and helps save costs in laser processing operations. Furthermore, since line art images can accurately represent the texture features of image elements, generating a target relief processing image based on the line art image provided by the business object ensures that the generated target relief processing image contains image elements that best meet the needs of the business object. On this basis, combining the image depth features indicated by the depth image can guarantee the exquisite quality of each image element in the generated target relief processing image. Based on this, the target relief processing image is imported into the laser processing process to obtain the corresponding relief through laser processing. This not only automates laser relief engraving but also improves relief processing efficiency and quality.

[0129] To facilitate the rapid application of the method embodiments provided in this application, the following describes an image generation process of this application in conjunction with the image generation process and specific examples shown in Figure 9.

[0130] As shown in Figure 9, in one exemplary approach, the business user can input a line drawing image into the image generation interface. The image processing device extracts and optimizes prompts based on the line drawing image to obtain 3D prompts (i.e., the aforementioned optimized prompts). Furthermore, it performs grayscale processing on the extracted image prompts to obtain grayscale image prompts. The image processing device can optimize the image prompts based on prompt templates. For example, one or more prompt templates can be pre-configured. Each prompt template contains keywords related to 3D style image generation and one or more prompts to be filled in. After obtaining the image prompts, the image processing device fills them into the corresponding fields, thus using the completed prompt template as a whole as the 3D prompt. Similarly, the image processing device can also perform grayscale processing on the image prompts in a similar manner, which will not be detailed here.

[0131] After obtaining the 3D cue words, a 3D LoRA (Low-Rank Adaptation) model can be used to generate a 3D-style image based on the cue words. Then, a depth map processing network (or model) is used to extract the depth map from this 3D-style image, resulting in a depth image. Furthermore, a line art processing network (or model) can be used to extract features from the line art image, obtaining its texture features. Finally, a grayscale LoRA model is used to generate the target relief processing image based on the line art image's texture features, the depth image, and the grayscale cue words.

[0132] Both the depth map processing network and the line art processing network can be artificial neural networks incorporating ControlNet. ControlNet aims to increase control over the generated content without altering the core structure of the original neural network, allowing business applications to generate high-quality images that meet expectations by providing specific control signals (such as line art images). In other words, assuming the neural network with depth map extraction capabilities is called the first neural network, the depth map processing network can consist of a ControlNet network and the first neural network. ControlNet can specifically be used to fuse the control signals with the features extracted by the first neural network and instruct the first neural network to perform corresponding image processing based on the fused features. The same logic applies to the line art processing network, which will not be elaborated upon here.

[0133] Furthermore, a 3D LoRA model refers to a 3D-style image generation model that includes LoRA modules, while a grayscale LoRA model refers to a grayscale image generation model that includes LoRA modules. The LoRA module can be viewed as a new network structure added to the original model (such as a 3D-style image generation model or a grayscale image generation model), which interacts with one or more networks in the original model. LoRA is essentially a functional module for optimizing deep learning, possessing low-rank adaptation characteristics. Adding a LoRA module to the original model aims to achieve rapid adjustment and customization of the original model's functionality or performance by training the low-rank matrix within the LoRA module.

[0134] For example, by optimizing the 3D-style image generation model through the low-rank adaptation characteristics of LoRa, the model can generate 3D-style images based on line art images. This allows for the rapid application of existing image generation models, saving time and cost associated with model building. It's worth noting that in the grayscale LoRa model, the LoRa module can use a low-rank matrix to adjust the image features extracted by the grayscale image generation model and the grayscale cue words, providing the adjusted features to the grayscale image generation model so that it can generate the target relief processing image based on these features.

[0135] In this embodiment, deep learning, a technology in artificial intelligence, is primarily used to generate the target relief processing image. This allows business users to generate a target relief processing image that meets their specific business needs simply by inputting a line drawing image, without requiring professional 2D or 3D design skills. This achieves low-barrier and rapid image generation. Furthermore, by generating a 3D-style image from the line drawing image, and then generating a depth image based on the 3D-style image, the target relief processing image can be generated using both the depth image and the line drawing image. This enables the recognition and reproduction of complex textures and shapes, ensuring that the output target relief processing image possesses high detail and accuracy.

[0136] Based on the aforementioned method embodiments, this application also provides a corresponding apparatus, as shown in Figure 10. Figure 10 is a schematic diagram of an image processing apparatus for laser processing provided in this application. This apparatus can be mounted on a client device, a server device, or a processing device, and is used to implement some or all of the functions described in the method embodiments of Figure 3 above. As shown in Figure 10, the apparatus may include a request response unit 1001, an image processing unit 1002, and an image generation unit 1003, wherein:

[0137] A request response unit is used to obtain a line drawing image from an image generation request in response to the image generation request;

[0138] An image processing unit is configured to perform 3D style processing on the line drawing image to obtain a 3D style image, and to extract a depth map from the 3D style image to obtain a depth image corresponding to the 3D style image.

[0139] An image generation unit is configured to generate a target relief processing image based on the line drawing image and the depth image, and to import the target relief processing image into the laser processing process; wherein the target relief processing image is used for laser processing, and the target relief processing image contains the image elements indicated by the line drawing image.

[0140] In one embodiment, the apparatus shown in FIG10 may further include a display unit 1004, which, after the target relief processing image is imported into the laser processing process, may also be used to perform:

[0141] The target relief processing image is displayed in the editable interface created in the laser processing process, and processing instructions are generated based on the target relief processing image;

[0142] 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.

[0143] In another embodiment, the editable interface includes image parameter adjustment controls and laser processing parameter adjustment controls; when the display unit 1004 generates processing instructions based on the target relief processing image, it can specifically execute the following:

[0144] In response to the adjustment operation of the image parameter adjustment control, the target image parameters obtained after adjusting the image parameters of the target relief processing image are acquired;

[0145] In response to the adjustment operation of the laser processing parameter adjustment control, the target laser processing parameters obtained after adjusting the laser processing parameters corresponding to the target relief processing image are acquired;

[0146] Generate processing instructions that include the target image parameters and the target laser processing parameters.

[0147] In another embodiment, when the image generation unit 1003 generates a target relief processing image based on the line drawing image and the depth image, it specifically performs the following:

[0148] At least two candidate relief processing images are generated and displayed based on the line drawing image and the depth image, with different candidate relief processing images corresponding to different image styles;

[0149] 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.

[0150] In another embodiment, the aforementioned display unit 1004 may further perform the following specific actions before acquiring the image prompt in response to the image generation request:

[0151] Display an image generation interface, which includes an image input area;

[0152] If a line drawing image is displayed in the image input area, then the image generation request is created based on the line drawing image displayed in the image input area.

[0153] In another embodiment, the aforementioned display unit 1004 can also be used to perform:

[0154] In response to a movement operation on the line drawing image in the image generation interface, the line drawing image is moved in the image generation interface according to the movement trajectory of the movement operation;

[0155] If the line art image is moved to the image input area, the line art image is displayed in the image input area.

[0156] In another embodiment, the image generation interface further includes an image upload control, and the aforementioned display unit 1004 can also be used to perform:

[0157] In response to a selection operation on the image upload control, an image selection interface is displayed, the image selection interface containing at least one line drawing image;

[0158] If a selection operation on any line art image is detected, then that line art image is displayed in the image input area.

[0159] In another embodiment, when generating a target relief processing image based on the line drawing image and the depth image, the image generation unit 1003 may specifically perform the following:

[0160] Based on the line drawing image, prompt words are inferred to obtain image prompt words, which are used to describe the image elements contained in the line drawing image;

[0161] Based on the image prompt, the line drawing image, and the depth image, the target relief image is generated, and the target relief image contains the image elements described by the image prompt.

[0162] In another embodiment, when the image generation unit 1003 performs cue word reasoning on the line drawing image and obtains image cue words, it can be specifically used to perform:

[0163] Image element recognition is performed on the line drawing image to obtain the image elements contained in the line drawing image;

[0164] Based on the identified image elements, the prompt words are predicted to obtain the image prompt words.

[0165] In another embodiment, when the image generation unit 1003 generates the target relief processing image based on the image prompt, the line drawing image, and the depth image, it can specifically perform the following:

[0166] Retrieve preset grayscale prompt words;

[0167] Based on the image prompts and the grayscale prompts, image grayscale prompts are generated, wherein the image grayscale prompts are used to describe the grayscale features required for the target relief processing image to be generated;

[0168] The target relief processing image is generated based on the image grayscale prompt, the line drawing image, and the depth image.

[0169] In another embodiment, when generating a target relief processing image based on the line drawing image and the depth image, the image generation unit 1003 may specifically perform the following:

[0170] The line art image processing network is invoked to extract texture features from the line art image, thereby obtaining image texture features;

[0171] The depth image is processed by a depth map processing network to extract depth features, thus obtaining the image depth features.

[0172] Based on the image texture features and the image depth features, an image generation network is invoked to perform image generation processing to obtain the target relief processing image.

[0173] In another embodiment, when the image processing unit 1002 extracts a depth map from the 3D style image to obtain a depth image corresponding to the 3D style image, it may specifically perform the following:

[0174] Obtain multiple candidate grayscale ranges;

[0175] Depth maps are extracted from the 3D style image under each candidate grayscale range to obtain candidate depth images under each candidate grayscale range;

[0176] The candidate depth image whose image quality meets the quality requirements is taken as the depth image corresponding to the 3D style image.

[0177] In another embodiment, when the image processing unit 1002 performs 3D style processing based on the line drawing image to obtain a 3D style image, it may specifically perform the following:

[0178] The line art processing model is invoked to extract the texture features of the line art image;

[0179] The 3D style image is obtained by performing 3D style processing based on the texture features of the line drawing image.

[0180] In yet another embodiment, the request response unit 1001 can also be used to perform:

[0181] Obtain the image prompts corresponding to the line art image;

[0182] The image prompts are optimized to obtain optimized prompts, which are used to describe the 3D features required for the 3D style image to be generated;

[0183] When the image processing unit 1002 performs 3D style processing based on the texture features of the line drawing image to obtain the 3D style image, it specifically performs the following:

[0184] Based on the 3D features described by the optimized prompt words and the texture features of the line drawing image, 3D style processing is performed to obtain the 3D style image.

[0185] This application provides an image processing solution for laser processing of relief sculptures. This solution aims to generate a reference image (i.e., a target relief processing image) required for relief processing based on image prompts provided by the user. These image prompts are provided by the user according to their processing needs and mainly describe the image elements to be processed into a relief sculpture. For example, the image prompts can describe the type of specific image element, while the target relief processing image contains a pattern corresponding to that type of object. Taking Figure 12 as an example, the image prompt could be "a long-haired girl," and the target relief processing image would contain a pattern representing a long-haired girl. It should be noted that the target relief processing image in Figure 12 is only an illustrative example and does not mean that the target relief processing image generated by this application must be a grayscale 3D image or must contain an image of a single image element.

[0186] Specifically, image prompts can be transmitted to the image processing device via an image generation request. The image processing device responds to the request by parsing the image prompt, generating a 3D image containing the image element described by the prompt, and then drawing a line drawing of the 3D image to obtain a line drawing image containing the image element. The line drawing image indicates the texture features of the image element. In addition to drawing the line drawing, a depth map can be extracted from the 3D image to obtain a depth image, which indicates the depth features the image element should possess in 3D space. Based on the line drawing image and the depth image, a target relief processing image containing the image element can be generated. The image element is presented in a style suitable for relief processing within the target relief processing image. This target relief processing image is then imported into the laser processing process for laser processing, ultimately resulting in the corresponding relief. Since the target relief processing image is automatically generated based on the image prompts input by the business object, there is no need for the business object to manually model or draw images. This reduces the threshold and cost of generating the target relief processing image, and also eliminates the impact of human factors on the image generation efficiency. This improves the generation efficiency and image quality of the target relief processing image to a certain extent. Importing the image into the laser processing process for laser processing can further produce a high-quality relief.

[0187] Based on the above principles, this application specifically proposes an image processing method for laser processing. A schematic flowchart of this method can be seen in Figure 13, and it can still be executed by the aforementioned image processing device. As shown in Figure 13, the method may include steps S201-S204, wherein:

[0188] S201. In response to the image generation request, obtain image prompts from the image generation request. The image prompts are used to describe the image elements to be laser-processed.

[0189] In a specific embodiment, the image generation request can be triggered through human-computer interaction between the business object and the image processing device. As an example, the image processing device can display an image generation interface, which at least includes a prompt input area. The business object can input text characters expressing its image generation needs in the prompt input area. The image processing device, in response to the input operation detected in the prompt input area, retrieves the corresponding text characters from the prompt input area, uses these text characters as image prompts, and triggers the creation of an image generation request containing the image prompt. The text characters input by the business object can describe the image elements that the business object wants to laser-process into reliefs. Specific descriptive dimensions can include element type (e.g., line-based, painted, simulated, artistic font-based), shape (or image, such as large, tall, dark), quantity, and position, etc., without limitation. Furthermore, the image elements can include characters, graphics, lines, etc.

[0190] For example, the input process for image prompts can be shown in Figure 14. In Figure 14, the area marked by 201 can be regarded as the image generation interface for the image prompt to be input, and the area marked by 202 can be regarded as the prompt input area. After the business object inputs specific text characters in the prompt input area, the image generation interface can be shown as the area marked by 203 in Figure 14. The method of inputting text characters can include voice input, keyboard input, and gesture input, etc., and is not limited here.

[0191] It is worth mentioning that, in one embodiment, to avoid the image processing device creating an image generation request before the image prompt entered by the business object is complete, the image processing device can determine that the business object has entered an image prompt that fully expresses its image generation needs when it detects that the text characters in the prompt input area have not been updated within the target duration, thereby triggering the creation of an image generation request. In another embodiment, the image generation interface may also include a trigger component (the component marked 204 in Figure 14), so that after the business object enters a complete image prompt, it can trigger the image processing device to create an image generation request by performing a selection operation on the trigger component in the image generation interface. The selection operation may include a single click, a double click, a long press, or a voice command input operation, etc.

[0192] In addition, the image generation interface may include one or more of a result display area and a parameter configuration area. The result display area can be used to display the target relief processing image generated based on image prompts, and the parameter configuration area can be used to display configurable parameter information during the image generation process, such as image parameters like the number, size, color, and shape of the generated target relief processing images, as well as model parameters like the neural network model used to generate the target relief processing images, the model combination method, and weight parameters. This application embodiment does not limit the display method and positional relationship of the various areas in the image generation interface; that is, Figure 14 is merely an illustrative example.

[0193] S202. Generate a 3D image containing image elements based on image prompts.

[0194] In a specific embodiment, a three-dimensional image, also known as a 3D image, refers to an image that presents a stereoscopic visual effect. Image elements in the 3D image exhibit a stereoscopic visual effect. For example, a 3D image containing the image element "a long-haired girl" can be shown in Figure 15. When generating a 3D image, the image processing device can first optimize the image prompts to obtain optimized prompts. These optimized prompts describe the three-dimensional features that the image elements should possess in the 3D image. Based on these optimized prompts, the 3D image is generated, ensuring that the generated 3D image contains accurate and aesthetically pleasing 3D image elements.

[0195] In this context, cue word optimization refers to enriching the semantic expression of cue words in 3D scenes. For example, adding keywords to express 3D features based on existing image cue words. These keywords can include, but are not limited to, image background color, image size, etc. Keywords that trigger 3D effects can also be added to existing image cue words, thereby conveying accurate and clear processing instructions to the image processing device to ensure that the device can accurately generate 3D images.

[0196] S203. Perform line drawing processing on the 3D image to obtain the line drawing image corresponding to the 3D image, and extract the depth map from the 3D image to obtain the depth image corresponding to the 3D image.

[0197] For example, the image shown in Figure 16 is a line drawing image, and the figure in Figure 16 can be regarded as an image element in this line drawing image.

[0198] In one embodiment, when the image processing device performs line drawing processing on a three-dimensional image, it can first extract the texture features of the three-dimensional image, and then perform edge extraction on the three-dimensional image based on the extracted texture features, thereby obtaining the line drawing image corresponding to the three-dimensional image.

[0199] In another embodiment, the image processing device may also employ a neural network model to depict the line drawing of a 3D image. This neural network model used for line drawing can be called a line drawing image generation model. Specifically, when processing the 3D image for line drawing, the image processing device can call the line drawing image generation model to extract the texture features of the 3D image, and then perform line drawing processing based on these texture features, ultimately outputting a line drawing image. The image processing device can acquire the line drawing image output by the line drawing image generation model and use this line drawing image as the line drawing image corresponding to the 3D image.

[0200] For example, the image shown in Figure 17 is a depth image. In Figure 17, brighter pixels indicate that the corresponding element is closer to the viewpoint (as shown in the hair tips on the right side of Figure 17), while darker pixels indicate that the corresponding element is farther from the viewpoint (as shown in the neck of the person on the upper side of Figure 17).

[0201] Since the quality of grayscale images is closely related to grayscale levels and grayscale value ranges, this application proposes, in order to obtain high-quality depth images, that when acquiring the depth image corresponding to a 3D image, multiple candidate grayscale ranges are first acquired, and a depth map is extracted from the 3D image under each candidate grayscale range to obtain a candidate depth image under each candidate grayscale range. Then, the candidate depth image whose image quality meets the quality requirements among the candidate depth images is taken as the depth image corresponding to the 3D image.

[0202] As an example, after obtaining each candidate depth image, the image processing device can perform image quality evaluation on each candidate depth image in the following manner to determine the candidate depth image whose image quality meets the quality requirements: First, determine the pixel value of each pixel in the candidate depth image; then count the number of pixels in the candidate depth image whose pixel value is within a first preset pixel value range (hereinafter referred to as the number of first pixels); and count the number of pixels in the candidate depth image whose pixel value is within a second preset pixel value range (hereinafter referred to as the number of second pixels); finally, predict the image quality of the candidate depth image based on the ratio between the number of second pixels and the number of first pixels.

[0203] S204. Generate a target relief processing image based on the line drawing image and the depth image, and import the target relief processing image into the laser processing process; wherein, the target relief processing image is used for laser processing, and the target relief processing image contains image elements corresponding to the image prompt words.

[0204] Image processing equipment can set different image generation parameters (such as grayscale level, size, etc.) to generate at least two candidate relief processing images with different image styles (or effects, such as sharpness, size, color, etc.) based on line drawing images and depth images. The image generation parameters can be quickly configured by the business object through convenient methods such as mouse clicks or keyboard input, or dynamically selected by the image processing equipment based on real-time equipment performance or business needs. There are no restrictions here.

[0205] In a relief carving scenario, after obtaining a target relief carving image, the image processing device can import the target relief carving image into the laser processing process and display it on an editable interface (or other interface, such as an image generation interface) created by the laser processing process. Based on the displayed target relief carving image, the device generates processing instructions and sends these instructions to the processing equipment. The equipment then processes the corresponding material based on these instructions, ultimately producing a relief carving that represents the target relief carving image. The processing instructions can be triggered after detecting a confirmation operation from a business object regarding the displayed target relief carving image. This confirmation operation indicates that the business object allows relief laser engraving (a specific laser processing method) based on the target relief carving image. It should be noted that the image processing device can generate at least one target relief carving image, and the target relief carving image used to generate the processing instructions can be one of the target relief carving images selected by the business object from among the various target relief carving images.

[0206] In one embodiment, the target relief processing image can be generated based on the image texture features of the line drawing image and the image depth features of the depth image. Specifically, the image processing device can call a line drawing image processing network to extract texture features from the line drawing image to obtain image texture features, and call a depth image processing network to extract depth features from the depth image to obtain image depth features. Then, based on the image texture features and image depth features, an image generation network is called to perform image generation processing to obtain the target relief processing image. The image texture features are used to indicate the contours of image elements in the line drawing image, enabling the image processing device to accurately generate the image elements required by the business object. The image depth features are used to indicate the distance information between each pixel in the image element and the viewpoint, thereby describing the three-dimensional structure required for the target relief processing image, so that the image processing device can accurately understand the relationships (positional relationships, height differences, etc.) of each image element in the three-dimensional scene. Therefore, combining image texture features and image depth features for image generation is beneficial for obtaining a beautiful and accurate target relief processing image.

[0207] By using neural networks to generate target relief processing images, the trainable nature of neural networks can be leveraged to enhance the versatility of application scenarios in this application embodiment. It is worth noting that each neural network used in the generation of the target relief processing image in this application embodiment can be specified by the business object, or dynamically selected by the image processing device based on real-time device performance or business needs. Furthermore, the image generation interface can display one or more available neural networks, allowing the business object to quickly select its desired neural network through convenient methods such as mouse clicks or keyboard input.

[0208] In another embodiment, the image processing device can further generate a target relief image based on image texture features and image depth features, combined with image prompts provided by the business object. This enriches the reference information during image generation, allowing image generation to proceed under multi-dimensional image description, thereby obtaining a target relief image that better meets the image generation needs of the business object. Specifically, the image processing device can generate image grayscale prompts based on image prompts and preset grayscale prompts, and then generate the target relief image based on the image grayscale prompts, line drawing image, and depth image. The grayscale prompts describe pre-configured grayscale information, such as grayscale level and grayscale value range; the image grayscale prompts describe the grayscale features required for the generated target relief image, and these grayscale features at least include the grayscale features of the image elements described by the image prompts.

[0209] In this embodiment, based on the image prompts carried (or contained) in the image generation request, a 3D image containing the image elements described by the image prompts is generated. Then, by drawing line art on the 3D image, a line art image indicating the texture features of the image elements is obtained. Furthermore, by extracting a depth map from the 3D image, a depth image indicating the depth features of the image elements is obtained. Finally, a target relief processing image is generated based on the line art image and the depth image. This allows business users to obtain a target relief processing image that meets their requirements simply by providing image prompts, without relying on manual modeling or image drawing by professional technicians. This reduces the generation threshold and cost of target relief processing images and eliminates the impact of human factors on image generation efficiency and image quality, thereby ensuring business users' satisfaction with the target relief processing image to a certain extent.

[0210] To facilitate the rapid application of the method embodiments provided in this application, the following describes an image generation process of this application in conjunction with the image generation process and specific examples shown in Figure 19.

[0211] As shown in Figure 19, in one exemplary manner, the business user can input image prompts on the image generation interface. The image processing device performs 3D optimization on the image prompts to obtain 3D prompts, and performs grayscale processing on the image prompts to obtain grayscale image prompts. The image processing device can optimize the image prompts based on a prompt template.

[0212] Based on the aforementioned method embodiments, this application also provides a corresponding apparatus, as shown in Figure 20. Figure 20 is a schematic diagram of the structure of an image processing apparatus for laser processing provided in this application. This apparatus can be mounted on a client device, a server device, or a processing device, and is used to implement some or all of the functions described in the method embodiments of Figure 2. As shown in Figure 20, the apparatus may include a request response unit 1001, a first image generation unit 1002, an image processing unit 1003, and a second image generation unit 1004, wherein:

[0213] The request response unit 1001 is configured to, in response to an image generation request, obtain an image prompt word from the image generation request, the image prompt word being used to describe the image element to be laser-processed;

[0214] The first image generation unit 1002 is used to generate a three-dimensional image containing the image elements based on the image prompt words;

[0215] The image processing unit 1003 is used to perform line drawing processing on the three-dimensional image to obtain a line drawing image corresponding to the three-dimensional image, and to extract a depth map from the three-dimensional image to obtain a depth image corresponding to the three-dimensional image.

[0216] The second image generation unit 1004 is used to generate a target relief processing image based on the line drawing image and the depth image, and to import the target relief processing image into the laser processing process; wherein, the target relief processing image is used for laser processing, and the target relief processing image contains image elements corresponding to the image prompt words.

[0217] In one embodiment, the apparatus shown in FIG20 may further include a display unit 1005, which, after the target relief processing image is imported into the laser processing process, may also be used to perform:

[0218] The target relief processing image is displayed in the editable interface created in the laser processing process, and processing instructions are generated based on the target relief processing image;

[0219] 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.

[0220] In another embodiment, the editable interface includes image parameter adjustment controls and laser processing parameter adjustment controls; the display unit 1005 can specifically execute the processing instructions generated based on the target relief processing image:

[0221] In response to the adjustment operation of the image parameter adjustment control, the target image parameters obtained after adjusting the image parameters of the target relief processing image are acquired;

[0222] In response to the adjustment operation of the laser processing parameter adjustment control, the target laser processing parameters obtained after adjusting the laser processing parameters corresponding to the target relief processing image are acquired;

[0223] Generate processing instructions that include the target image parameters and the target laser processing parameters.

[0224] In yet another embodiment, when the second image generation unit 1004 generates a target relief processing image based on the line drawing image and the depth image, it specifically performs the following:

[0225] At least two candidate relief processing images are generated and displayed based on the line drawing image and the depth image, with different candidate relief processing images corresponding to different image styles;

[0226] 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.

[0227] In another embodiment, before the request response unit 1001 receives the image prompt in response to the image generation request, it may further perform the following specific actions:

[0228] Display an image generation interface, which includes a prompt input area;

[0229] In response to an input operation in the prompt input area, obtain the text character corresponding to the input operation;

[0230] Use the text characters as image prompts and create an image generation request that includes the image prompts.

[0231] In another embodiment, when the first image generation unit 1002 generates a three-dimensional image containing the image elements based on the image prompt, it may specifically perform the following:

[0232] The image prompts are optimized to obtain optimized prompts, which are used to describe the three-dimensional features that the image elements need to possess in the three-dimensional image.

[0233] Based on the three-dimensional features described by the optimized prompt words, a three-dimensional image containing the image elements is generated.

[0234] In another embodiment, when the image processing unit 1003 performs line drawing processing on the three-dimensional image to obtain the line drawing image corresponding to the three-dimensional image, it can specifically be used to perform:

[0235] The process involves calling a line art image generation model to extract the texture features of the 3D image, and then performing line art drawing processing based on the texture features.

[0236] The line drawing image output by the line drawing image generation model after line drawing processing is obtained, and the output line drawing image is used as the line drawing image corresponding to the three-dimensional image.

[0237] In yet another embodiment, the second image generation unit 1004 can also be used to perform:

[0238] Retrieve preset grayscale prompt words;

[0239] Based on the image prompt and the grayscale prompt, an image grayscale prompt is generated, wherein the image grayscale prompt is used to describe the grayscale features required for the target relief processing image;

[0240] When generating the target relief processing image based on the line drawing image and the depth image, it is specifically used to perform:

[0241] The target relief processing image is generated based on the image grayscale prompt, the line drawing image, and the depth image.

[0242] In another embodiment, when the second image generation unit 1004 generates a target relief processing image based on the line drawing image and the depth image, it may specifically perform the following:

[0243] The line art image processing network is invoked to extract texture features from the line art image, thereby obtaining image texture features;

[0244] The depth image is processed by a depth map processing network to extract depth features, thus obtaining the image depth features.

[0245] Based on the image texture features and the image depth features, an image generation network is invoked to perform image generation processing to obtain the target relief processing image.

[0246] In another embodiment, the image processing unit 1003 extracts a depth map from the three-dimensional image to obtain a depth image corresponding to the three-dimensional image, which can be specifically used to perform:

[0247] Obtain multiple candidate grayscale ranges;

[0248] Depth maps are extracted from the three-dimensional image under each candidate grayscale range to obtain candidate depth images under each candidate grayscale range;

[0249] The candidate depth image whose image quality meets the quality requirements is taken as the depth image corresponding to the three-dimensional image.

[0250] 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.

[0251] 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.

[0252] 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.

[0253] Based on the above description, please refer to Figure 21, which is a schematic diagram of an implementation environment shown in an embodiment of this application. This implementation environment includes a server device 301, a client device 302, and a processing device 303.

[0254] It should be noted that the number and form of the devices shown in Figure 21 are for illustrative purposes only and do not constitute a limitation on the embodiments of this application. In some embodiments, the number of server devices 301 can be multiple, and different server devices can be used to process different image processing tasks in different generated target relief processing images. For example, different server devices can be used to perform tasks such as depth calculation processing, contour extraction processing, and fusion processing. In some embodiments, the number of client devices 302 can be multiple, and server device 301 can receive image generation requests sent by multiple client devices 302. In some embodiments, server device 301 and client device 302 can be the same electronic device. This application embodiment uses the example of server device 301 and client device 302 being the same electronic device for explanation.

[0255] Among them, the server device 301 and the client device 302 can be terminal devices, which can 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.

[0256] Among them, the server device 301 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 network (CDN), and big data and artificial intelligence (AI) platforms. This application embodiment does not limit this.

[0257] The processing equipment 303, 104, or 403 can be an electronic device for laser engraving based on a target relief image. For example, it can 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. Processing equipment 303 can include, but is not limited to, laser engraving machines, laser cutting machines, laser printers, etc.

[0258] In some embodiments, the client device 302 may be equipped with an output device, such as a display screen, which can be used to output an image generation interface. Users 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, triggering the client device 302 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 server device 301 based on the user-input image (input image), input prompts, and model processing parameters.

[0259] The general flow of the image processing method for laser processing provided in this application is as follows:

[0260] In response to an image generation request, server device 301 acquires an input image, which may be sent by a user to server device 301 via client device 302. This input image includes image elements to be laser-processed. Server device 301 can perform depth calculation processing based on the input image to obtain a depth image corresponding to the input image. Server device 301 can also perform contour extraction processing based on the input image to obtain a line drawing image corresponding to the input image. Then, server device 301 can generate a target relief processing image based on the depth image and the line drawing image. The target relief processing image generated by server device 301 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. Finally, server device 301 can import the target relief processing image into the laser processing process.

[0261] 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.

[0262] 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.

[0263] Based on the above description, please refer to Figure 22. Figure 22 is a flowchart illustrating an image processing method for laser processing provided in an embodiment of this application. This image processing method for laser processing can be implemented by a server-side device. The server-side device can be the server-side device 301 shown in Figure 21, or the client-side device 103 shown in Figure 2. The image processing method for laser processing can include the following steps S301-S304, wherein:

[0264] S301. In response to the image generation request, obtain the input image.

[0265] In this embodiment, the image generation request can be a request to trigger the server device to generate a target relief processing image. The target relief processing image refers to the image that the 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 artwork. 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 aforementioned processing equipment. The target relief processing image also includes these image elements as a reference to guide the processing equipment.

[0266] 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 in order to control the image details.

[0267] The image generation request can be generated (created) by the server-side device. The server-side device can provide a user interface for interaction with the user; for example, it can display an image generation interface, which may include 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 server-side device can generate (create) an image generation request based on the input action and obtain the corresponding image, i.e., the image uploaded by the user, using it as the input image. Generating (creating) an image generation request can be understood as the server-side 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. The image generation instruction can be parsed by the server-side device to execute the corresponding response processing, i.e., generating the target relief processing image corresponding to the input image.

[0268] Please refer to Figure 23, which is a schematic diagram of an image generation interface according to an embodiment of this application. The image generation interface shown in Figure 23 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 operation. The image upload control can also display corresponding prompts, such as "Drag and drop the image here, or click upload" as shown in Figure 23. After the user uploads the input image, the image upload control can preview the uploaded input image, as shown in the image generation interface at the bottom of Figure 23. The generation control can be used to trigger a client device or server 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. The generation control may include prompts such as "Start generation" or English prompts such as "start". The result display area shown in Figure 23 includes an area for displaying the generated target relief processing image. The result display area may include an image display control, which may include the prompt "The image generation result will be displayed here".

[0269] S302. 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.

[0270] In this embodiment, after acquiring the input image, the server device can perform depth calculation processing based on the input image to obtain a corresponding depth image. 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 position of each pixel value in the input image in space and the observer (viewpoint) based on the objects and scene in the input image.

[0271] In some embodiments, depth calculation based on the input image can be performed by skilled technicians using prior knowledge to infer the distance between each pixel and the viewpoint, and then manually annotating the input image. The server device can then convert the annotated distances into pixel values ​​(grayscale values) to obtain the depth image corresponding to the input image.

[0272] In one embodiment, depth calculation based on the input image can be achieved using a pre-trained depth image generation model. Specifically, the server device can perform depth calculation 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 can 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.

[0273] 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.

[0274] In some embodiments, the server device may deploy the AI ​​drawing tool ComfyUI, which may include a ComfyUI-Marigold node. This node can call the Marigold depth estimation model to perform depth estimation (depth calculation processing) on ​​the input image. After installation, the server device can conveniently use the ComfyUI-Marigold node within ComfyUI to perform depth estimation on the image.

[0275] In one embodiment, since the quality of the algorithm involved in depth calculation directly affects the generation effect of the depth image, it will affect the generation effect of the target relief processing image. Therefore, the server device can generate multiple depth images corresponding to the input image based on different depth calculation algorithms, and select the optimal one. Specifically, the server device can perform depth calculation processing on the input image based on multiple depth image generation models respectively, obtaining depth images output by the multiple depth image generation models. Then, the server device can select the target depth image from the multiple depth images as the depth image corresponding to the input image.

[0276] The multiple depth image generation models each have different depth calculation parameters, which may include parameters such as the number of denoising steps (denoise_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 server device can obtain the depth images output by multiple depth image generation models and select one.

[0277] In some embodiments, the depth calculation processing parameters can be configured by the user through ComfyUI. The server 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.

[0278] In one embodiment, after acquiring multiple depth images, the server device can specifically acquire the exposure histograms corresponding to each depth image. Then, based on the correlation between the exposure histograms of each depth image, it selects a target depth image 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 of the multiple depth images include the correlation between the brightness value and the number of pixels in the corresponding depth image. The target depth image is the depth image selected by the server device.

[0279] 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 server-side 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.

[0280] In one embodiment, the server 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, 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 image; this application does not limit their configuration.

[0281] In another embodiment, the server device can specifically 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 server 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 server device can determine that there are fewer pixels in the midtones, indicating that the depth image is either underexposed or overexposed.

[0282] Please refer to Figure 24, which is a schematic diagram illustrating the exposure histograms corresponding to multiple depth images in an embodiment of this application. Figure 24 uses three depth images corresponding to the input image as an example for explanation. These images can be generated by three depth image generation models configured with different depth calculation 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 its corresponding exposure histogram. The horizontal axis of the exposure histogram ranges from 0 to 255. The server device can iterate through the three exposure histograms shown in Figure 24 to 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 within a specified brightness value range and the number of pixels within another specified brightness value range is within a set ratio range. If so, the server device can select the corresponding depth image to obtain the target depth image.

[0283] 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 server 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.

[0284] Please also refer to Figure 25, which is a schematic diagram illustrating the generation of a depth image based on an input image according to an embodiment of this application. As shown in Figure 25, the left side is the input image, and the right side is the depth image corresponding to the input image. The server device can directly generate the corresponding depth image based on the input image, or the server device can generate multiple depth images as shown in Figure 24 based on the input image, and select the 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 server device can generate the target relief processing image corresponding to the input image based on the depth image.

[0285] In some embodiments, the server device can further process the depth image corresponding to the input image to generate a higher resolution depth image. Specifically, the server 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.

[0286] The methods described above for improving the resolution of depth images are merely examples, and this application does not limit them. For instance, the server device can also perform interpolation processing on the depth image to obtain a higher resolution depth image.

[0287] In this embodiment, the server device can generate a corresponding depth image and 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 changes in an image (input image).

[0288] In one embodiment, the server 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 be a machine learning model for line detection, capable of extracting clear edges and details from an image. For example, the line drawing image generation model can be an Anyline model, which can also be called a line detection preprocessor, capable of quickly extracting high-precision line drawings from an image.

[0289] 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 server-side device can further generate the target relief processing image based on this line drawing image.

[0290] In some embodiments, the server device can integrate the Anyline model into the deployed ComfyUI tool. The server device can install the Anyline model as a plugin (node) of ComfyUI. After installation, the server 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.

[0291] Please also refer to Figure 26, which is a schematic diagram illustrating the generation of a line drawing image based on an input image according to an embodiment of this application. As shown in Figure 26, the left side is the input image, and the right side is the line drawing image corresponding to the input image. The server 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 usually uses black as the background image and white lines to outline the contours, structures, and details of objects, as shown on the right side of Figure 26.

[0292] S303. Generate a target relief processing image based on the aforementioned depth image and the aforementioned line drawing image.

[0293] In this embodiment, the processing by which the server-side device generates the target relief processing image based on the depth image and the line drawing image can refer to a fusion processing performed by the server-side device based on the depth image and the line drawing image. This fusion processing 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.

[0294] In one embodiment, the server device performs fusion processing based on the depth image and the line drawing image. Specifically, it can perform fusion processing on 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. 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.

[0295] Specifically, taking the target image generation model, which includes a line art processing network, a depth processing network, and an image generation network, as an example, the server device can perform line art feature extraction processing on the line art image based on the line art processing network, and the server device can perform depth feature extraction processing on the depth image based on the depth processing network; then, the server device can perform image generation processing based on the line art features extracted by the line art processing network and the depth features extracted by the depth processing network, to obtain the target relief processing image.

[0296] 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.

[0297] 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.

[0298] 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.

[0299] In other words, the server-side 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 server-side 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 server-side device can perform image generation processing on the line art features and depth features based on a stable diffusion model. Specifically, the server-side 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. The fusion features can be the features obtained by stitching together the depth features and the line art features.

[0300] 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).

[0301] 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).

[0302] 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.

[0303] In one embodiment, 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.

[0304] 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.

[0305] Please refer to Figure 27. Figure 27 is a schematic diagram of the input and output images shown in an embodiment of this application. As shown in Figure 27, the left side is the input image, which can be the image uploaded by the user in the image generation interface shown in Figure 23. The middle part is the process of generating the target relief processing image. The corresponding depth image and line drawing image can be generated based on the input image, and then the target relief processing image, that is, the output image, can be generated based on the depth image and line drawing image. The specific generation process can be found in the above description, which will not be repeated here.

[0306] In one embodiment, some model processing parameters in the image generation network (stable diffusion model) can be configured by the user. Therefore, the target image generation model can perform image generation processing on the depth image and line drawing image based on the user-configured model processing parameters to output the target relief processing image. Please also refer to Figure 28, which is another schematic diagram of an image generation interface shown in one embodiment of this application. As shown in Figure 28, the image generation interface displayed on the server device may include not only the image upload control shown in Figure 29, but also parameter configuration controls, as shown in the parameter configuration area in Figure 28. This parameter configuration area can be used to configure model processing parameters. Figure 28 is illustrated using the example of model processing parameters including image parameters and model parameters.

[0307] Please also refer to Figure 29, which is another schematic diagram of an image generation interface according to an embodiment of this application. As shown in Figure 29, the image generation interface includes five model processing parameter input controls as an example for illustration and explanation. These model processing parameter input controls can be text input boxes or drop-down selection boxes. The model processing parameters can include model selection, number of model iterations (Samples), seed, LoRA weight, and number of denoising steps (Inference Steps).

[0308] Model selection refers to choosing the processing model used to generate the target relief image. It's important to note that different models can be deployed on the server-side 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.

[0309] As shown in Figure 29, users can input parameters for each model in the image generation interface, such as selecting the model as image relief (photo2relief), with 1 iteration, 0 seed, 1 LoRA weight, and 30 denoising iterations. Correspondingly, the server 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 server device can perform response processing based on the generated image generation request.

[0310] Therefore, given that the user has configured the model processing parameters, the server device can perform image generation processing on the depth image and line drawing image based on the target image generation model and according to 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.

[0311] In one embodiment, to improve the effect of the generated relief reference image, text information can be added for multimodal processing. Specifically, after acquiring the input image, the server device can obtain the target prompt word corresponding to the input image. This target prompt word can be text information describing the content contained in the input image. For example, in the input image shown in Figure 23, the target prompt word could be "a girl" (or the English prompt word: a girl). Since the final target relief image is presented as a grayscale image, this prompt word can also be called a grayscale prompt word. Therefore, during the image generation process based on the depth image and line drawing image, the server device can specifically generate the target relief image based on the target prompt word, the depth image, and the line drawing image.

[0312] In one embodiment, the server device can specifically perform tag generation processing on the input image based on a tag generation model to obtain a tag set corresponding to the input image. This tag generation model can be a model that infers prompt words from the image. For example, the tag generation model can be a tag generator based on a Vision Transformer (VIT) architecture, used to extract tags from the image. This tag generator can automatically understand the image content and output descriptive tags. The tag generator can output one or more tags; that is, the tag set can include one or more tags. Since the process of generating tags based on an image can be understood as the process of inferring prompt words from the image, this tag generation model can also be called a prompt word inference model.

[0313] Furthermore, after obtaining the tag set output by the tag generation model (such as the tag generator mentioned above), the server-side 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 server-side device can also further filter the tags in the tag set, such as removing some tags with high similarity, thereby obtaining the target prompt word corresponding to the input image.

[0314] Taking the VIT architecture's tag generator as an example, the server device performs tag generation processing on the input image based on the tag generation model. This can mean that the server device performs image segmentation processing on the input image based on the tag generator, extracts the image features corresponding to the segmented image blocks, and generates one or more text tags for the extracted image features to output a tag set.

[0315] Therefore, after obtaining the target prompt word, the server 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.

[0316] 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.

[0317] In one embodiment, to improve the effect of the generated relief reference image, the added text information can be user-inputted target prompt words determined by tags, which, along with the user-inputted text information, are jointly added to the target image generation model for processing. Specifically, the image generation interface displayed on the server device may include a prompt word input control. The user can input operations on the prompt word input control, and the server device can receive the input operations and obtain the text characters corresponding to the input operations. Furthermore, the server device can use the obtained text characters as target prompt words, or determine target prompt words based on tags in the tag set, or use both the obtained text characters and the tag-determined prompt words as target prompt words to perform image generation processing on the depth image and line drawing image to obtain the target relief processing image.

[0318] Please also refer to Figure 30, which is another schematic diagram of an image generation interface according to an embodiment of this application. Compared with the image generation interface shown in Figure 29, the image generation interface shown in Figure 30 also includes a prompt word input control. This prompt word input control can be one or more, and all can be text input boxes. The two prompt word input controls shown in Figure 30 correspond to the text input boxes for positive and negative prompt words, respectively. Positive prompt words refer to the text information corresponding to the generated image, while negative prompt words refer to the text information corresponding to the image to be avoided.

[0319] Please also refer to Figure 31, which is a schematic diagram of an image generation interface filled with input content according to an embodiment of this application. As shown in Figure 31, the user can input prompt words, such as "a girl," into the prompt word input control, or input negative prompt words such as "low quality." It is understood that the above prompt words are merely examples, and this application does not limit them.

[0320] Please also refer to Figure 32, which is a schematic diagram of an image generation interface for displaying a target relief processing image according to an embodiment of this application. As shown in Figure 32, the result display area of ​​the image generation interface can be used to output the target relief processing image corresponding to the input image.

[0321] Please refer to Figures 33 and 34 together. Figures 33 and 34 are both timing diagrams illustrating an embodiment of the image processing method for laser processing according to this application. As shown in Figure 33, the server device can generate corresponding depth images, line art images, and image tags (tag sets) based on the input image. Then, the server device can perform image generation processing based on the depth processing network, line art processing network, and image generation network included in the target image generation model, as well as the fine-tuning module (LoRA module), to obtain the target relief processing image. As shown in Figure 34, after the input image is used to generate the depth image, line art image, and target prompt words, the corresponding target relief processing image is generated.

[0322] 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 generation of the target relief image based on the depth image and line drawing image, the server-side 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 a candidate relief image, the selected candidate relief image is determined as the target relief image.

[0323] 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, the image display control of the image generation interface shown in Figure 32 can display at least two candidate relief images with different image styles. Then, after receiving a selection operation for one of the candidate relief images, in response to the selection operation, the selected candidate relief image can be determined as the target relief image.

[0324] 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.

[0325] Furthermore, after the server-side 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.

[0326] S304. Import the above target relief processing image into the laser processing process.

[0327] 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.

[0328] Specifically, importing the target relief image into the laser processing process can mean that the server-side 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 server-side 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.

[0329] 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 server 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 server 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 server device can generate processing instructions that include both the target image parameters and the target laser processing parameters.

[0330] 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.

[0331] 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.

[0332] Please also refer to Figure 35. Figure 35 is a schematic diagram of a relief work obtained by a processing device for carving a carving material according to an embodiment of this application. As shown in Figure 35, the processing device is used to carve a stone slab to obtain a relief work. It can be seen that the relief work includes 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.

[0333] 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.

[0334] Referring to Figure 36, an exemplary embodiment of this application also provides an image processing apparatus for laser processing, the apparatus 180 comprising:

[0335] 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;

[0336] 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;

[0337] 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;

[0338] Import unit 1804 is used to import the target relief processing image into the laser processing process.

[0339] In one embodiment, 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:

[0340] 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;

[0341] 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.

[0342] In one embodiment, the import unit 1804 is used to import the target relief processing image into the laser processing process, specifically for:

[0343] 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;

[0344] 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.

[0345] In one embodiment, 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:

[0346] 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;

[0347] 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;

[0348] Generate processing instructions that include the target image parameters and the target laser processing parameters.

[0349] In one embodiment, the acquisition unit 1801 is configured to acquire the input image in response to an image generation request carrying the input image, specifically for:

[0350] Display an image generation interface, which includes an image upload control;

[0351] 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.

[0352] In one embodiment, the acquisition unit 1801 is further configured to acquire the target prompt word corresponding to the input image;

[0353] The generation unit 1803 is used to generate a target relief processing image based on the depth image and the line drawing image, including:

[0354] The target relief image is generated based on the target prompt, the depth image, and the line drawing image.

[0355] In one embodiment, the acquisition unit 1801 is used to acquire the target prompt word corresponding to the input image, specifically for:

[0356] Display an image generation interface, which includes a prompt input control;

[0357] 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.

[0358] In one embodiment, the acquisition unit 1801 is used to acquire the target prompt word corresponding to the input image, specifically for:

[0359] The input image is processed by a label generation model to generate labels, thereby obtaining a set of labels corresponding to the input image.

[0360] The target prompt word is determined based on the tags in the tag set.

[0361] In one embodiment, 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:

[0362] 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.

[0363] The depth image is processed by a deep processing network to extract depth features, thereby obtaining the depth features corresponding to the depth image.

[0364] 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.

[0365] In one embodiment, 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:

[0366] 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.

[0367] Select a target depth image from the plurality of depth images and use it as the depth image corresponding to the input image.

[0368] In one embodiment, 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:

[0369] 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;

[0370] 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.

[0371] In one embodiment, 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:

[0372] 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.

[0373] 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.

[0374] With the increasing popularity of laser engraving technology, laser engraving, also known as laser printing, refers to the use of high-energy laser beams to precisely engrave on the surface of various materials, leaving delicate and accurate patterns. It is a precise and diverse art form that can transform personal imagination and creativity into actual works of art. Because laser-engraved reliefs (laser-engraved works) have a greater sense of three-dimensionality and depth compared to two-dimensional images (ordinary images), relief works are increasingly widely used in crafts, advertising design, home decoration, and other fields, bringing people a richer and more unique visual experience. Before laser engraving using processing equipment such as laser printers, it is usually necessary to obtain relief materials. These materials contain relief elements, and the processing equipment can use them as a reference to engrave at varying depths to obtain the relief artwork.

[0375] Currently, users typically obtain relief carving material images in two ways: First, users search for relevant material images on web search engines, specifically searching for shallow relief carving materials, which refers to relief images with a shallow carving depth. Second, users can create their own relief carving material images using modeling software. With the first method, users may find relief carving material images with low resolution, unsuitable for carving, or subject to copyright restrictions. This not only fails to meet user needs but may also result in low clarity and precision in the processed relief artwork, leading to a poor finished product. With the second method, creating relief carving material images using complex modeling software has a high barrier to entry and limited applicability. If high accuracy and detail are required, it takes a significant amount of time, resulting in low efficiency in generating relief images, thus affecting laser processing efficiency and quality.

[0376] Based on this, this application provides an image processing solution for laser processing, which can quickly generate corresponding high-quality relief images based on image prompts obtained from user requests. This generation method improves the efficiency of generating relief processing materials, as it is based on user requests and also helps to meet users' personalized and customized needs. Furthermore, the image prompts are used to describe the relief elements to be laser-processed, and the generated relief processing materials are more suitable for laser processing scenarios, which can improve laser processing efficiency and quality to a certain extent, thereby bringing more possibilities to laser engraving and enabling users to create laser engraved works more efficiently, creatively, and with higher satisfaction.

[0377] Based on the above description, please refer to Figure 38, which is a schematic diagram of an implementation environment shown in an embodiment of this application. This implementation environment includes a server device 401, multiple client devices (client devices 402a, 402b, and 402c as shown in Figure 38), and a processing device 403.

[0378] It should be noted that the number and configuration of devices shown in Figure 38 are for illustrative purposes only and do not constitute a limitation on the embodiments of this application. In some embodiments, there may be multiple server devices. In some embodiments, there may be only one client device.

[0379] Among them, the client devices (such as client devices 402a, 402b and 402c) can be terminal devices.

[0380] In some embodiments, the client devices (such as client devices 402a, 402b, and 402c) may be equipped with a display screen for outputting an image generation interface. Furthermore, this display screen may be used to display the target relief processing image generated by the server device 401 based on image prompts.

[0381] The general flow of the image processing method for laser processing provided in this application is as follows:

[0382] The server device 401 can respond to an image generation request by obtaining image prompts describing the image elements to be laser-processed. The server device 401 can also obtain an initial noisy image. Furthermore, the server device 401 can perform denoising processing on the initial noisy image based on the image prompts to obtain a target relief processing image. This target relief processing image is used for laser processing, and it contains image elements corresponding to the image prompt information. Afterward, the server device 401 can import the target relief processing image into the laser processing process.

[0383] The image generation request can be received by the server device 401 from a client device (such as client device 402c). This image generation request describes the image elements to be laser-processed and can be generated based on image prompts input by the user. The server device 401 importing the target relief processing image into the laser processing process can mean that the server device 401 returns the target relief processing image to the client device 402c. The client device 402c can then control the processing equipment 403 to process the carving material based on the target relief processing image, resulting in carving material filled with the image elements described by the image prompts.

[0384] In some embodiments, the client device 402c can perform output processing based on the received target relief processing image, such as displaying the target relief processing image and receiving adjustment operations from the user for the target relief processing image, thereby controlling the processing device 403 to process the carving material based on the adjusted target relief processing image.

[0385] Based on the above description, please refer to Figure 39. Figure 39 is a schematic flowchart of an image processing method for laser processing proposed in an embodiment of this application. This image processing method for laser processing can be implemented by a server-side device. The server-side device can be the server-side device 401 shown in Figure 38, or the client-side device 404 shown in Figure 2. The image processing method for laser processing can include the following steps S401-S404, wherein:

[0386] S401. In response to the image generation request, obtain the image prompt.

[0387] In this embodiment, the image generation request can be a request to trigger the server to generate a target relief processing image. The target relief processing image refers to the image required by the laser processing equipment 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 artwork. The server refers to the software component responsible for processing client requests and providing data and services, typically running on a server, as shown in Figure 38. The client can refer to the software component used for direct interaction, typically installed on the user's electronic device, as shown in any of the client devices in Figure 38. The main function of the client is to provide a user interface, enabling users to easily access and use the data and services provided by the server.

[0388] In some embodiments, the client and server can communicate via wired or wireless means. The user can send a request to the server through the client, such as the image generation request mentioned above. The server will receive and process the image generation request, and then use the processing result (such as the generated target relief processing image) as a reference to guide the laser processing equipment to process.

[0389] The target relief image refers to an image that guides laser processing equipment to process the engraving material at varying depths. Its level of detail determines the effect of subsequent processing. Image prompts are descriptive terms used to describe the image elements to be laser-processed. These image elements are the elements the user wants to present in the target relief image. For example, if the user wants a flower image in the target relief image, the image prompt would describe that flower, such as "a flower pattern." In English, the image prompt could be "Very simple easy flower patterns."

[0390] In some embodiments, the image generation request can be generated (created) by the server, which can provide a user interface for user interaction. For example, the server can display an image generation interface, which may include text input controls, such as text input boxes, drop-down menus, or text selection boxes. Users can input text characters based on these text input controls. Correspondingly, upon receiving an input operation for the text input control, the server can generate (create) an image generation request based on the input operation and obtain the text characters corresponding to the input operation, using them as image prompts.

[0391] In one embodiment, the image generation request can be generated (created) by the client. The client can provide a user interface to interact with the user and send the generated image generation request to the server for processing. The server can parse the image generation request to obtain the image prompt. Specifically, the client can display an image generation interface including a text input control. The user can input text characters into the text input control. In response to receiving the input operation on the text input control, the client creates an image generation request based on the input operation, obtains the text character corresponding to the input operation, and determines the text character as the image prompt.

[0392] The image generation interface can be a user interface found in software such as laser engraving, text generation, image creation, and relief image generation, including a text input control for inputting image prompts. Upon receiving an input operation, the client or server can determine the image prompt from the corresponding text character. Alternatively, the client or server can first process the text information corresponding to the input operation and then use the processed text as the image prompt.

[0393] In some embodiments, generating (creating) an image generation request can be understood as the client or server generating information in a specific format based on the obtained image prompt. This specific format information can be understood as an image generation instruction. The image generation instruction can be parsed by the server to execute the corresponding response processing, that is, to generate the target relief processing image corresponding to the image prompt.

[0394] In another embodiment, the image generation interface includes not only a text input control but also a style selection control. Users can select the desired image style based on this control, such as a sketch style, a 3D (3D) image style, or an embossed image style. This style selection control can be a dropdown menu or other types of selection boxes; this application does not limit its specific type. Users can select an embossed image style using this control to generate the target embossed image. Correspondingly, the client or server can receive the selection operation for the style selection control, and in response, generate embossed prompt information based on the embossed image style. Based on the embossed prompt information and the text characters corresponding to the received input operation, the client determines the image prompt word.

[0395] The embossed prompt is a text prompt generated by the client or server based on the embossed image style selected by the user. It can be understood as text prompts that instruct the server to generate an image with the selected embossed image style. The embossed prompt can be a preset text prompt. The client or server can obtain the text prompt corresponding to the selected embossed image style, thus obtaining the embossed prompt.

[0396] In some embodiments, the client or server can input the embossed image style of the selected operation instruction into a pre-deployed text generation model and obtain the text prompt information output by the text generation model to obtain the embossed prompt information.

[0397] Furthermore, the client or server determines the image prompt word based on the embossed prompt information and the text prompt information. This can mean combining the embossed prompt information and the text prompt information to obtain the image prompt word, or combining the embossed prompt information and the text prompt information and then performing deduplication to obtain the image prompt word.

[0398] In some embodiments, the client or server determines the image prompt word based on the embossed prompt information and the text prompt information. Alternatively, it may select a portion of the prompt information from the embossed prompt information and the text prompt information and combine them to obtain the image prompt word. This application does not limit this.

[0399] In one embodiment, the client or server can generate an image generation request based on the acquired image prompt, or it can generate the image generation request based on the image prompt and other information. Other information may include a parameter specifying the number of target relief images to be generated by the server. Specifically, the image generation interface displayed by the client or server may also include a generation quantity input control, allowing the user to input a set generation quantity. Correspondingly, the client or server can receive the quantity input operation for the generation quantity input control and obtain the set generation quantity corresponding to the quantity input operation. Thus, the client or server can generate the image generation request based on the image prompt and the set generation quantity. The image generation request generated by the client or server may carry the image prompt and the set generation quantity, and this image generation request can be used to instruct the server to generate target relief images with an relief image style, including image elements, where the number of target relief images is the set generation quantity.

[0400] If the image generation request is generated (created) by the client, the client can send it to the server after the request is generated, instructing the server to perform corresponding response processing based on the image generation request. For example, the server can parse the image generation request and perform corresponding image generation processing based on the parsed image prompts to generate a target embossed image including a set number of image elements, such as a target embossed image including a flower pattern.

[0401] In one embodiment, the server can be used to receive an image generation request sent by a single client, or it can be used to receive image generation requests sent separately by multiple clients. To respond promptly to image generation requests from multiple clients, the server can be deployed on a service platform, such as a Container Registry Management System (Kubernetes). Kubernetes, or K8S for short, is a distributed container cluster management platform that enables automated deployment, scaling, and maintenance of container clusters. Through a Kubernetes server, applications can be deployed quickly, scaled rapidly, seamlessly integrated with new application functionalities, and hardware resource utilization optimized.

[0402] Specifically, a server can deploy multiple units, such as processing units, which can also be called processes, services, or instances (Pods). A Pod is the foundation of all business types in a Kubernetes cluster and the smallest unit of management in Kubernetes. A Pod is a combination of one or more containers that share storage, network, namespaces, and rules for how they run. Within a Pod, all containers are uniformly arranged and scheduled. For a specific application, a Pod is its logical host, containing multiple application containers related to the business. In essence, a Pod represents a running microservice process. The server can receive image generation requests from multiple clients through multiple deployed processing units (Pods); that is, one processing unit (Pod) is used to receive a generation request from one client.

[0403] Please refer to Figure 40, which is a schematic diagram of the server-side architecture for receiving generation requests according to an embodiment of this application. As shown in Figure 40, the explanation is based on an example of multiple users, such as users A to N, each corresponding to a client, and multiple processing units (Pods) created in the server's service platform (Kubernetes), such as processing unit A (Pod_A) to processing unit N (Pod_N). The server can receive image generation requests sent by a user through the client through the multiple processing units. For example, the server can receive image generation requests sent by user A through the corresponding client through processing unit A, and simultaneously receive image generation requests sent by user B through the corresponding client through processing unit B. That is, the server can process multiple image generation requests simultaneously through multiple processing units to ensure timely response to requests initiated by multiple users.

[0404] It should be noted that after receiving a generation request through a processing unit (Pod), the server can process the received request. Specifically, the processing unit can respond to the image prompts obtained from the image generation request to generate an image, resulting in a target relief image including the image elements to be laser-processed. The result of this processing (i.e., the target relief image) can then be returned to the client that sent the image generation request. Therefore, image generation requests sent by multiple users through their respective clients can be responded to by the server simultaneously. This prevents other users from having to wait excessively due to the long response time of one image generation request, avoiding processing blockages and improving the processing efficiency of image generation requests to a certain extent.

[0405] Specifically, the server can traverse multiple processing units in a predefined order. If the currently traversed target processing unit is idle, it responds to the client's image generation request through that target processing unit and performs the response processing. The multiple processing units created by the server are in a predefined order, such as processing unit A, processing unit B, processing unit C…processing unit N. This predefined order can be the order in which the processing units are created or the order set by the administrator; this application does not limit this.

[0406] Understandably, the number of processing units deployed on the server is limited, and a single processing unit cannot handle two or more image generation requests simultaneously. Therefore, busy processing units are used to receive image generation requests sent by other users through their respective clients, while only idle processing units can receive image generation requests from clients. For example, the server can first determine whether processing unit A is idle according to a predefined order. If processing unit A is not idle, it then determines whether processing unit B, which is next in line in the predefined order, is idle. If processing unit B is idle, the server can use processing unit B as the target processing unit to receive the image generation request from the client and process it accordingly.

[0407] In one embodiment, if the server finds no idle target processing unit among the multiple processing units it has created, it indicates that all processing units are busy. The server can then create a designated processing unit and use that unit to receive image generation requests from the client. In other words, the server can dynamically expand the processing unit capacity to meet current processing demands. If there are currently no idle processing units (Pods), the server can create a new processing unit (Pod), i.e., a designated processing unit, to receive and process image generation requests from the client.

[0408] In some embodiments, the designated processing unit can be set as the last in the set order. If the server does not receive any generation requests through the designated processing unit within a preset time range, the server can delete the designated processing unit to reduce resource waste.

[0409] In another embodiment, if the server finds no idle target processing unit among the multiple processing units, it can continuously monitor the operating status of each processing unit. If a specific processing unit is detected to be idle, the server receives the image generation request from the client through that specific processing unit. In other words, if the server detects that all processing units are busy, it can continuously monitor the operating status of multiple processing units. During this time, the image generation request sent by the client needs to wait to be received until a specific idle processing unit is detected. Then, the server receives the image generation request from the client through that specific processing unit and performs response processing.

[0410] In some embodiments, if the server continuously monitors the running status of multiple processing units and detects that multiple processing units are simultaneously idle, the server can receive the image generation request sent by the client through the processing unit that is first in the set order and perform response processing.

[0411] It should be noted that the response process for multiple image generation requests received by the server is the same. For ease of description, this application takes the response to one image generation request as an example. The server can perform image generation processing based on the image prompts obtained in response to the image generation request to obtain a target relief image including the image elements corresponding to the image prompts.

[0412] S402, Obtain the initial noisy image.

[0413] In this embodiment of the application, the process of image generation processing based on image prompts can specifically refer to the server inputting image prompts into the text-to-image processing model, and the text-to-image processing model performing calculations based on the image prompts to obtain the target relief processing image output by the text-to-image processing model.

[0414] In one embodiment, since the image generation request can be generated based on image prompts and a user-inputted set generation quantity, after inputting the image prompts into the text-to-image processing model, and performing image generation processing based on the image prompts, the set number of target relief processing images generated by the text-to-image processing model can be obtained, such as two target relief processing images. Each target relief processing image includes image elements to be laser-processed; different target relief processing images may include the same type of image elements, but the patterns may differ.

[0415] In other words, among the target relief images generated by the server through the image processing model, each target relief image includes the image elements described by the image prompt, such as the flower mentioned above. The patterns of the flowers in different target relief images are different.

[0416] In one embodiment, the text image processing model can be a diffusion model, such as a stable diffusion model, which involves a back-diffusion process that progressively (iteratively) denoises the initial noisy image based on feature representation information extracted from image prompts, thereby generating the image required by the user, such as the target relief processing image including image elements to be laser-processed in the embodiments of this application.

[0417] The text-to-image processing model can include two components: a text encoder and an image generator. The text encoder is used to extract features from image prompts, and the image generator generates the corresponding target relief image based on the extracted feature representations. Specifically, the image generator mainly consists of two parts: an image information creator and an image decoder. The image information creator generates a corresponding latent image representation based on the feature representations of the image prompts, and the decoder decodes (converts) the latent image representation into a real image, thus obtaining the target relief image.

[0418] In one embodiment, in addition to image prompts, the input to the text-to-image processing model includes noise generation parameters, which can be called a seed. A seed is a numerical value, specifically a latent seed, i.e., a randomly generated value. The noise generation parameters can be used to initialize the feature representation information of a noisy image, i.e., to generate an initial noisy image, facilitating subsequent gradual denoising. Taking a random seed as an example, it can be used to determine the random number sequence for generating the initial noisy image. Generating the initial noisy image based on this random seed means generating a series of random numbers that conform to a Gaussian distribution, filling the generated random numbers into a matrix of a preset size, and obtaining the initial noisy image.

[0419] For example, this texturing image processing model can generate a seed value for a random seed based on a random number generator, such as 60, and then generate a series of random numbers conforming to a Gaussian distribution according to the random seed. The generated random numbers are then filled into a matrix of a preset size to obtain an initial noisy image. The preset size can be the same as the size of the target relief image to be generated, such as 512×512.

[0420] It should be noted that the initial noise image generated above can be understood as a feature representation, which is usually composed of Gaussian noise (Gaussian Noise ~ N(0,1)), that is, each pixel value is randomly generated according to a Gaussian distribution. Therefore, the initial noise image can also be called a Gaussian noise image (feature representation). In the embodiments of this application, the size (preset size) of the initial noise image can also be the same as the size corresponding to the latent space, such as 64×64. Thus, the initial noise image (feature representation) generated based on the random seed can also be called a random latent image representation.

[0421] It's important to note that the latent space, also known as the image information space, refers to a low-dimensional representation of data. This is because the feature representations (vectors) in the latent space are obtained by compressing the original pixel space to a lower dimension. It can include compressed information from the initial noisy image, meaning that data can be represented with fewer variables, preserving key information, and its size is much smaller than the original image; for example, 64×64 is much smaller than 512×512. Subsequent noise reduction processing of the initial noisy image by the image information creator is performed in the latent space. Compared to processing in the original pixel space, this requires less memory, improves running speed, and lowers the requirements for computer hardware.

[0422] S403. Based on the above image prompts, the initial noisy image is denoised to obtain the target relief processing image.

[0423] Specifically, the process of the server inputting image prompts into the text-based image processing model to denoise the initial noisy image based on the image prompts can be as follows: the server performs feature extraction processing on the image prompts using a text encoder to obtain the feature representation information of the image prompts. Then, the server can use an image information creator to denoise the initial noisy image (random latent image representation) based on the feature representation information to obtain the target relief processing image. It can be understood that this target relief processing image can be used for laser processing, i.e., to guide the processing equipment to perform laser processing. The target relief image can also include the image elements described in the image prompts, such as the flowers mentioned above.

[0424] The text encoder is a special type of Transformer language model, such as a Contrastive Language-Image Pre-Training (CLIP) model. The server can first segment the image prompts using the text encoder to obtain semantic units (tokens), where a semantic unit is the smallest meaningful word in the image prompt. Then, the server can perform text feature extraction on the semantic units in the image prompts using the text encoder to obtain feature representation information. In other words, the text encoder can convert the semantic units in the image prompts into a list of numbers, which can be considered the feature representation information corresponding to the image prompt. This list of numbers can be understood as a vector, representing each syntactic unit (i.e., word) in the image prompt.

[0425] Please refer to Figure 41, which is a schematic diagram illustrating the principle of image prompt processing by a text encoder according to an embodiment of this application. As shown in Figure 41, the image prompt can be input into the text encoder, which performs prediction / encoding processing on the image prompt to extract the feature representation information corresponding to the image prompt, thus obtaining the vector (list of numbers) shown on the right side of Figure 41. Figure 41 illustrates the conversion of the image prompt into 77×768 text embeddings by the text encoder as an example, which can be used to represent a feature matrix or vector with 77 rows and 768 columns.

[0426] Understandably, the output of the text encoder is connected to the input of the image generator, specifically to the input of the image information creator. The image information creator receives the feature representation information output by the text encoder and performs denoising on the random latent image representation (initial noisy image) based on the feature representation information. In other words, the list of numbers predicted by the text encoder is submitted to the image information creator for further denoising.

[0427] The image information creator can also include a denoising network and a decoder. The denoising network can consist of a U-net and a scheduling algorithm. The text feature representation (number list) and the initial noisy image (random latent image representation) can be used as inputs to the denoising network. Based on the feature representation information of the image prompt words, the denoising network performs noise prediction processing on the initial noisy image to obtain the target denoised image features. Then, the decoder decodes the target denoised image features and converts them into a real image to obtain the target relief processing image.

[0428] Specifically, the server-side uses a denoising network to perform noise prediction processing on the initial noisy image based on the feature representation information of the image prompt words, obtaining the target denoised image features. This can be interpreted as the denoising network performing noise prediction processing on the initial noisy image based on the feature representation information, obtaining a predicted noise residual, and then using this predicted noise residual to denoise the initial noisy image, thus obtaining the target denoised image features. Here, the predicted noise residual output by the denoising network can be understood as the residual of image noise, i.e., the noise feature, rather than the predicted denoised image feature representation. Denoising the initial noisy image based on the predicted noise residual can be understood as removing this predicted noise residual from the initial noisy image to obtain the target denoised image features.

[0429] The denoising process based on the predicted noise residual for the initial noisy image can refer to the use of a scheduling algorithm to calculate the denoised latent image representation based on the predicted noise residual and the random latent image representation. The scheduling algorithm can be used to remove noise features from the initial noisy image (random latent image representation). The process of removing a predicted noise feature once can be understood as a denoising process (denoising operation). This denoising process (denoising operation) needs to be repeated N times, such as 50-100 times, to gradually remove noise from the initial noisy image, that is, to gradually retrieve better latent image representations and obtain the target denoised image features.

[0430] Specifically, denoising the initial noisy image based on the predicted noise residual can refer to denoising the initial noisy image based on the predicted noise residual to obtain the first denoised image features. If the number of noise prediction processes performed by the denoising network does not reach a set threshold, then the denoising network performs noise prediction processing on the first denoised image features based on the feature representation information to obtain a second predicted noise residual. This second predicted noise residual is then used to denoise the first denoised image features to obtain the second denoised image features. If the number of noise prediction processes performed by the denoising network reaches the set threshold, then the last denoised image feature obtained after the denoising network performs the noise prediction processing for the set threshold is determined as the target denoised image feature.

[0431] In other words, the image information creator can use the latent image representation after the first denoising process as input again. Based on the denoising network, the latent image representation is subjected to noise prediction processing again according to the feature representation information of the image prompt words. The noise residual is then predicted again, which is the noise feature to be removed for the second time. The denoised latent image representation is then calculated through a scheduling algorithm. This process is repeated until the number of repetitions reaches a threshold N, such as 50-100 times, to obtain the latent image representation after the last iteration, which is the target denoised image feature.

[0432] Please also refer to Figure 42, which is a schematic diagram illustrating the principle of denoising processing of an image information creator according to an embodiment of this application. As shown in Figure 42, the left side represents the input of the image information creator, namely the feature representation information (number list) and the initial noisy image (random latent image representation). The U-net consists of an encoder and a decoder. In Figure 42, the trapezoid on the left represents the encoder, and the trapezoid on the right represents the decoder; both are composed of residual blocks (ResNet).

[0433] It should be noted that U-Net can include a Low-Rank Adaptation (LoRA) module, which can be called a fine-tuning module and is specified by the user during training. Since U-Net has a large number of model parameters, the network parameters of specified network layers or modules (residual blocks) can be updated only during training. For example, only the network parameters of the low-rank adaptation matrix can be updated. Then, the network parameters in this matrix can be summed with the network parameters of the specified residual block to fine-tune and update the U-Net model parameters, thus completing the update of the U-Net model parameters.

[0434] The denoising network deployed in this embodiment is a trained U-Net. This can be understood as adding a network parameter residual to the network parameters of a specified residual block. This residual structure is crucial for the current denoising task and is also key to the final output of the target relief image. Through the combined action of U-Net and this residual structure, it can be used to progressively denoise the initial noisy image to obtain a better potential image representation.

[0435] Specifically, the encoder in U-Net compresses image features into lower-resolution image features, a process known as downsampling. The decoder in U-Net decodes these lower-resolution features back into higher-resolution image features, a process known as upsampling. To prevent the loss of important information during downsampling, skip connections are typically placed between each downsampled residual block in the encoder and each upsampled residual block in the decoder. U-Net also includes a cross-attention module, also known as a cross-attention layer, located in both the encoder and decoder. This module is used to denoise the initial image features, including noisy ones, conditioned on the text feature representation.

[0436] Specifically, the input to U-net can include feature representation information of image prompts and an initial noisy image (random latent image representation) of size 64×64. U-net can perform noise prediction processing based on the feature representation information and random latent image representation to obtain the predicted noise residual. Then, a scheduling algorithm is used to calculate the denoised latent image representation (i.e., the first denoised image features), thus completing the first denoising process. Further, noise prediction processing can be performed again based on the first denoised image features and feature representation information by the denoising network to perform the second denoising process. This process is repeated until the set number of repetitions is reached, such as 50-100 times as shown in Figure 42, to obtain the latent image representation after the last iteration (i.e., the last denoised image features), which has a size of 64×64. The last denoised image features can then be determined as the target denoised image features. The target denoised image features can also be referred to as conditional latent vectors.

[0437] Therefore, the target denoised image features can be further processed, that is, the decoder can be used to convert the target denoised image features predicted by the image information creator into a real image, thus obtaining the target relief processing image.

[0438] Please also refer to Figure 43, which is a schematic diagram of the principle of the decoder processing the latent image representation in an embodiment of this application. As shown in Figure 43, the server can decode the target denoised image features with a size of 64×64 based on the decoder, and restore the target denoised image features in the latent space to the real image (real image) in the original pixel space. The size of the real image is 512×512, which is the target denoised image features output by the text generation processing model.

[0439] It should be understood that the text-based image processing model in this application embodiment is explained using a stable diffusion model as an example. With the development of AI technology, the text-based image processing model can also be other image synthesis algorithms or network models in the field of Artificial Intelligence Generated Content (AIGC), and this application does not limit it in this regard. Therefore, users only need to input simple image prompts to generate target denoised image features that match their descriptions (including the image elements corresponding to the image prompts). The target denoised image features generated by the text-based image processing model can, to a certain extent, meet the requirements for image detail and precision, and also help meet the personalized and customized needs of users, allowing users to experience the charm of cutting-edge AIGC technology.

[0440] It is understandable that the above-described text-based image processing model generates a single target relief image. The process of generating multiple target relief images follows the same principle, as detailed in the previous section, and will not be repeated here. Therefore, after generating the target relief image, the server can either further process it or return it to the client for further processing.

[0441] In some embodiments, after denoising the initial noisy image based on image prompts, at least two candidate relief processing images can be obtained. The client or server can then display these two candidate relief processing images, i.e., show the generated relief processing image to the user. In response to a selection operation on the candidate relief processing images, the selected candidate relief processing image is determined as the target relief processing image. That is, the user can select one or more of the at least two candidate relief processing images as the final target relief processing image used to guide the processing equipment.

[0442] Specifically, after denoising, the server can store at least two candidate embossing images for subsequent processing, such as output processing, like displaying them to the user for selection. The server can also return the candidate embossing images to the client via a communication connection, specifically through a processing unit (Pod) that receives the image generation request. If the set generation quantity carried in the image generation request is greater than one, the server can send the set number of candidate embossing images to the client. Correspondingly, the client can receive the set number of candidate embossing images returned by the server. Furthermore, the client can perform output processing on the candidate embossing images, such as displaying them to the user for selection.

[0443] In some embodiments, the client or server can output at least two candidate relief images in the area designated for outputting candidate relief images in the image generation interface. For example, please refer to Figure 44, which is a schematic diagram of an image generation interface according to an embodiment of this application. As shown in Figure 44, the image generation interface can be divided into left and right areas. The left area is the user operation area, including text input controls, style selection controls, and generation quantity input controls. The text input controls can be text input boxes, and can also display the number of characters currently entered by the user and the total character limit. As shown in Figure 44, the image prompt message entered by the user is "Very simple and easy-to-draw patterns, coloring pages, clean line art, no shading," and the English image prompt message can be "Very simple easy flower patterns, coloring pages, clean line art, no shading," describing the image element as a flower. The character count and total character limit are 76 / 300. The style selection control may include a control for displaying different image styles for the same image element, allowing the user to select the displayed image style. Figure 44 shows images with different image styles, including cats, where the user can select the embossing style. The quantity input control may be a drop-down selection box, used to select the number of target embossed images to generate, as shown in Figure 44 where 2 is selected.

[0444] The lower left area can also display controls for triggering the generation of the target embossed image, such as a "Generate" button. When the user presses this button, the client or server responds to the trigger operation, determining an image prompt based on the selected embossed image style and the entered text characters. Based on the image prompt and the set generation quantity, an image generation request is generated. The server responds to this image generation request, generating the set number of candidate embossed images, which can then be sent to the client. The client or server can output the set number of candidate embossed images in the right area of ​​the image generation interface. As shown in Figure 44, the right area is the image display area, which can display the two candidate embossed images generated by the server. It can be seen that both candidate embossed images include flowers (the image element described by the image prompt), but the flower patterns are different.

[0445] As another example, please refer to Figure 45, which is a schematic diagram of another image generation interface shown in an embodiment of this application. Figure 45 uses the text prompt message entered by the user into the text input control as "A silhouette of a cowboy riding a horse in a vast open field, under a sky full of stars", and the English image prompt message as "A silhouette of a cowboy riding a horse in a vast open field, under a sky full of stars", and sets the generation quantity to 1 as an example for explanation. The right area of ​​this image generation interface can be used to display candidate relief processing images. Since there is only one, the candidate relief processing image can be the target relief processing image, which includes the image element of a cowboy riding a horse under a starry sky.

[0446] If the number of images to be generated is greater than 1, as shown in Figure 44, the user can select the target relief images to be generated in the image generation interface. These two target relief images can be regarded as candidate relief images. The user can select the target relief image that he or she is satisfied with to trigger its import into the laser processing process for laser printing (processing).

[0447] In other words, the client or server can respond to the selection operation of the candidate relief processing image in the image generation interface, determine the selected candidate relief processing image as the target relief processing image, and then import it into the relief processing process, such as displaying the target relief processing image in the editable interface.

[0448] S404. Import the target relief processing image into the laser processing process.

[0449] In one embodiment, importing the target relief processing image into the laser processing process can refer to displaying the target relief processing image in an editable interface, which includes an image import control. In response to a trigger operation on the image import control, the client or server can import the target relief processing image into the laser processing process, that is, trigger the laser processing process based on the target relief processing image.

[0450] Please refer to Figure 46, which is a user interface diagram illustrating a user selecting a target relief processing image according to an embodiment of this application. As shown in Figure 46, the user inputs a selection operation on the candidate relief processing image on the right side of the right area in the image generation interface shown in Figure 44. For example, clicking on the candidate relief processing image on the right side of Figure 44 displays the editable interface shown in Figure 46. This editable interface may include a magnified image of the candidate relief processing image on the right side, and may include controls for saving the candidate relief processing image and image import controls (such as "Import Laser Software"). If the user clicks the "Download to Local" button, the client or server can download the candidate relief processing image to the device for local storage. If the user clicks the "Import Laser Software" button, the client or server can import the candidate relief processing image as the target relief processing image into the laser processing process, that is, import the process for laser processing based on the target image.

[0451] In another embodiment, importing the target relief image into the laser processing process by the server device can mean that the client or server 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 server device can send the processing instructions to the laser processing equipment, so that the laser processing equipment can perform laser processing on the material to be processed based on the processing instructions. That is, this process involves the host computer software of the laser processing equipment performing a series of processes to generate laser processing instructions.

[0452] 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 client or server can, on the one hand, respond to a trigger operation 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. On the other hand, the client or server can, in response to a trigger operation on the laser processing parameter adjustment controls, adjust the laser processing parameters corresponding to the target relief image, and use the adjusted laser processing parameters as the target laser processing parameters. Thus, the client or server can generate processing instructions that include target image parameters and / or target laser processing parameters.

[0453] 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.

[0454] 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.

[0455] In some embodiments, the editable interface may be a user interface that includes a canvas for editing the target relief image, i.e., the "Import Laser Software" control shown in Figure 46 may also be a button called "import to canvas" (import button). Users can edit the target relief image based on this canvas, and can also trigger the generation of processing quality for laser printing (processing).

[0456] Therefore, for users with laser engraving needs, compared to downloading relief processing materials to their local machine and then importing them into the laser software, this embodiment of the application eliminates the need for downloading. The target relief processing image can be immediately imported into the editable canvas of the laser software, avoiding cumbersome import steps and making the generation of relief works simpler and more convenient. This allows users to focus more on creating image works suitable for laser engraving, which is conducive to improving the efficiency of obtaining relief works and, to a certain extent, also improves the user's hands-on ability and creativity.

[0457] Please refer to Figure 47, which is a schematic diagram of an editable interface according to an embodiment of this application. As shown in Figure 47, the editable interface can display the target relief processing image selected by the user. The interface can also display various tools for editing the target relief processing image, such as image parameter adjustment controls and laser processing parameter adjustment controls. The editable interface also includes a processing device connected to a client or server, as shown on the right side of Figure 47, processing device 1. Processing device 1 can be a laser processing device connected to the client or server via wired or wireless connection. The editable interface can also include laser processing controls, such as a processing button corresponding to processing device 1, which the user clicks. Correspondingly, in response to the trigger operation of the laser processing control, the client or server can generate a processing instruction and send the processing quality to processing device 1 to control processing device 1 to perform laser processing on the engraving material based on the target relief processing image, thereby obtaining engraved material filled with image elements included in the target relief processing image.

[0458] Please also refer to Figure 48, which is a timing diagram illustrating a method for generating a target relief processing image according to an embodiment of this application. As shown in Figure 48, the user can perform related operations on the client, such as entering text prompts and selecting an image style in the image generation interface shown in Figures 44 and 45. Then, the user can click the generate button in the image generation interface, and the client can generate an image generation request and send the request to the server. Upon receiving the image generation request, the server performs image generation processing based on the text-to-image processing model deployed on the server (e.g., a server) to obtain the target relief processing image.

[0459] Then, the server can return the target relief image to the client for display. If the number of target relief images is greater than one, multiple target relief images can be output as candidate relief images. The user can click on their favorite candidate relief image in the image generation interface shown in Figure 44 to use it as the target relief image, and then click on the control for importing into the laser software shown in Figure 46 to directly import the target relief image into the laser processing process, such as into the canvas of the laser software, to obtain the laser processing interface shown in Figure 47. The user can then trigger laser engraving, printing, and other operations.

[0460] Therefore, combining the target relief processing image generated by AI technology with the laser processing process can simplify the operation for users to obtain target relief processing image materials that meet their needs, which is conducive to improving the user experience of laser software.

[0461] In some embodiments of this application, in response to an image generation request, an image prompt is obtained, which describes the image elements to be laser-processed, and an initial noisy image is obtained. Then, based on the image prompt, the initial noisy image is denoised to obtain a target relief processing image. This target relief processing image is used for laser processing and contains the image elements corresponding to the image prompt. The target relief processing image is then imported into the laser processing process. Therefore, during laser processing, the rapid generation of high-quality relief images based on image prompts obtained from the user's request improves the efficiency of generating relief processing materials that meet user needs. Furthermore, since the image prompts describe the image elements to be laser-processed, they are prompts related to laser processing, making the generated relief processing materials more suitable for laser processing scenarios, thereby improving laser processing efficiency and quality to a certain extent.

[0462] Referring to Figure 49, an exemplary embodiment of this application also provides an image processing apparatus for laser processing, applied to a server device or a client device. The apparatus 140 includes:

[0463] The acquisition unit 1401 is used to acquire image prompts in response to an image generation request; wherein the image prompts are used to describe the image elements to be laser-processed;

[0464] The acquisition unit 1401 is also used to acquire an initial noise image;

[0465] The processing unit 1402 is used to perform denoising processing on the initial noisy image based on the image prompt word to obtain a target relief processing image; wherein, the target relief processing image is used for laser processing, and the target relief processing image contains image elements corresponding to the image prompt word;

[0466] Import unit 1403 is used to import the target relief processing image into the laser processing process.

[0467] In one embodiment, the processing unit 1402 is configured to perform denoising processing on the initial noisy image based on the image prompt words to obtain the target relief processing image, specifically for:

[0468] Based on the image prompts, the initial noisy image is denoised to obtain at least two candidate relief images.

[0469] Display the at least two candidate relief processing images;

[0470] 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.

[0471] In one embodiment, the import unit 1403 is used to import the target relief processing image into the laser processing process, specifically for:

[0472] The target relief processing image is displayed in an editable interface; wherein, the editable interface includes an image import control;

[0473] In response to a trigger operation on the image import control, the target relief processing image is imported into the laser processing process.

[0474] In one embodiment, the import unit 1403 is used to import the target relief processing image into the laser processing process, specifically for:

[0475] 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;

[0476] 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.

[0477] In one embodiment, the editable interface includes image parameter adjustment controls and laser processing parameter adjustment controls; the import unit 1403 is used to generate processing instructions based on the target relief processing image, specifically for:

[0478] 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; and / or,

[0479] 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;

[0480] Generate processing instructions that include the target image parameters and / or the target laser processing parameters.

[0481] In one embodiment, the acquisition unit 1401 is configured to acquire image prompts in response to an image generation request, specifically for:

[0482] Display an image generation interface, which includes a text input control;

[0483] In response to receiving an input operation for the text input control, an image generation request is created;

[0484] Obtain the text character corresponding to the input operation, and determine the text character as the image prompt word.

[0485] In one embodiment, the image generation interface further includes a style selection control; the acquisition unit 1401 is used to determine the text characters as the image prompt words, specifically for:

[0486] In response to receiving a selection operation for the style selection control, an embossed hint message is generated based on the embossed image style indicated by the selection operation, and the image hint word is determined based on the embossed hint message and the text character.

[0487] In one embodiment, the processing unit 1402 is configured to perform denoising processing on the initial noisy image based on the image prompt words to obtain the target relief processing image, specifically for:

[0488] Based on the text encoder, feature extraction processing is performed on the image prompt words to obtain the feature representation information of the image prompt words;

[0489] The image information creator performs denoising processing on the initial noisy image based on the feature representation information to obtain the target relief processing image.

[0490] In one embodiment, the processing unit 1402 is configured to perform feature extraction processing on the image prompt words based on a text encoder to obtain feature representation information of the image prompt words, specifically for:

[0491] The image prompt words are segmented based on the text encoder to obtain semantic units in the image prompt words;

[0492] Based on the text encoder, text feature extraction processing is performed on the semantic units in the image prompt words to obtain the feature representation information.

[0493] In one embodiment, the image information creator includes a denoising network and a decoder. The processing unit 1402 is configured to denoise the initial noisy image based on the feature representation information provided by the image information creator to obtain the target relief processing image. Specifically, it is configured to:

[0494] Based on the denoising network, noise prediction processing is performed on the initial noisy image according to the feature representation information to obtain the target denoised image features;

[0495] The target denoised image features are decoded based on the decoder to obtain the target relief processing image.

[0496] In one embodiment, the method is applied to an electronic device having multiple processing units deployed; the acquisition unit 1401 is configured to acquire image prompts in response to an image generation request, specifically for:

[0497] The multiple processing units are traversed in a set order. If the target processing unit being traversed is in an idle state, the target processing unit responds to the image generation request and obtains the image prompt word.

[0498] In one embodiment, the method is applied to an electronic device having multiple processing units deployed; the acquisition unit 1401 is further configured to, if it is found that there is no target processing unit in the idle state among the multiple processing units, create a specified processing unit and acquire the image prompt word in response to the image generation request through the specified processing unit.

[0499] In one embodiment, the method is applied to an electronic device having multiple processing units deployed; the acquisition unit 1401 is further configured to continuously detect the operating state of the multiple processing units if it is found that there is no target processing unit in the idle state among the multiple processing units.

[0500] If a designated processing unit among the plurality of processing units is detected to be in the idle state, the designated processing unit responds to the image generation request and obtains the image prompt word.

[0501] It should be noted that the image processing apparatus 140 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 140 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.

[0502] It is worth mentioning that the various units in the devices shown in Figures 10, 20, 36, or 49 can be individually or entirely combined into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. In other words, the above units are based on logical functional division. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the aforementioned devices may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0503] According to another embodiment of this application, the apparatus shown in FIG10 or FIG20, and the method of the embodiment of this application, can be constructed and implemented by running a computer program (including program code) capable of performing the steps involved in the corresponding method shown in FIG3 or FIG13 on a computing device including processing elements and storage elements such as a central processing unit (CPU), random access storage medium (RAM), and read-only storage medium (ROM). The computer program can be recorded on, for example, a computer-readable storage medium, loaded into the above-described apparatus through the computer-readable storage medium, and executed therein.

[0504] 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.

[0505] Figure 37 shows a schematic diagram of a computer system suitable for implementing the embodiments of this application. It should be noted that the computer system 1900 of the electronic device shown in Figure 37 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0506] As shown in Figure 37, 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. The RAM 1903 also stores various programs and data required for system operation. The CPU 1901, ROM 1902, and RAM 1903 are interconnected via a bus 1904. An Input / Output (I / O) interface 1905 is also connected to the bus 1904.

[0507] 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 such as LAN (Local Area Network) 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.

[0508] 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.

[0509] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, 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 devices, magnetic storage devices, or any suitable combination thereof. Computer programs contained on computer-readable media can be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0510] Another aspect of this application provides a program product including computer instructions, wherein when a processor reads and executes the computer instructions, the image processing method for laser processing provided in the above method embodiments is implemented.

[0511] It should be noted that the principles by which the devices, systems, related equipment, and computer-readable media provided in the embodiments of this application solve the problem all belong to the same inventive concept as the aforementioned corresponding methods. Therefore, the relevant implementation methods can continue to be referred to the corresponding method embodiments, and for the sake of brevity, they will not be repeated here. Furthermore, it should be understood that the above content is only a preferred embodiment of this application and is not intended to limit the implementation scheme 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, wherein, The image processing method comprises: in response to an image generation request, obtaining a line drawing image; obtaining a depth image corresponding to the line drawing image; generating a target relief processing image based on the line drawing image and the depth image, and importing the target relief processing image into a laser processing process; wherein the target relief processing image is used for laser processing, and the target relief processing image contains image elements indicated by the line drawing image.

2. The method of claim 1, wherein, The method further comprises: in response to an image generation request, obtaining a line drawing image from the image generation request; obtaining a depth image corresponding to the line drawing image, comprising: in response to an image generation request, obtaining a line drawing image to be processed by laser from the image generation request; 3. The method of claim 2, wherein, based on the line drawing image, performing 3D style processing to obtain a 3D style image, and performing depth map extraction on the 3D style image to obtain a depth image corresponding to the 3D style image. After importing the target relief processing image into the laser processing process, the method further comprises: displaying the target relief processing image in an editable interface created by the laser processing process, and generating processing instructions based on the target relief processing image; 4. The method of claim 3, wherein, sending the processing instructions to a processing device to enable the processing device to perform laser processing on a material to be processed based on the processing instructions. The editable interface comprises image parameter adjustment controls and laser processing parameter adjustment controls; the processing instructions based on the target relief processing image comprise: in response to an adjustment operation on the image parameter adjustment control, obtaining target image parameters obtained by adjusting image parameters of the target relief processing image; in response to an adjustment operation on the laser processing parameter adjustment control, obtaining target laser processing parameters obtained by adjusting laser processing parameters corresponding to the target relief processing image; 5. The method of claim 2, wherein, generating processing instructions containing the target image parameters and the target laser processing parameters. The method further comprises: based on the line drawing image and the depth image, generating and displaying at least two candidate relief processing images, different candidate relief processing images corresponding to different image styles; 6. The method of claim 2, wherein, in response to a selection operation on the candidate relief processing image, determining the selected candidate relief processing image as the target relief processing image. Before the method further comprises: displaying an image generation interface, the image generation interface comprising an image input area; 7. The method of claim 6, wherein, if a line drawing image is displayed in the image input area, creating the image generation request based on the line drawing image displayed in the image input area. The method further comprises: in response to a movement operation on the line drawing image in the image generation interface, moving the line drawing image in the image generation interface according to the movement track of the movement operation; 8. The method of claim 6, wherein, if the line drawing image is moved to the image input area, displaying the line drawing image in the image input area. The image generation interface further comprises an image upload control, and the method further comprises: In response to a selection operation on the image upload control, an image selection interface is displayed, the image selection interface containing at least one line drawing image; If a selection operation on any line drawing image is detected, the selected line drawing image is displayed in the image input area.

9. The method of claim 2, wherein, The target relief processing image is generated based on the line drawing image and the depth image, including: Prompt word inference is performed based on the line drawing image to obtain an image prompt word, the image prompt word being used to describe an image element contained in the line drawing image; The target relief processing image is generated based on the image prompt word, the line drawing image, and the depth image, the target relief processing image containing the image element described by the image prompt word.

10. The method of claim 9, wherein, The prompt word inference based on the line drawing image to obtain an image prompt word includes: Image element recognition is performed on the line drawing image to obtain an image element contained in the line drawing image; Prompt word prediction is performed based on the recognized image element to obtain the image prompt word.

11. The method of claim 9, wherein, The target relief processing image is generated based on the image prompt word, the line drawing image, and the depth image, including: A preset gray prompt word is obtained; An image gray prompt word is generated based on the image prompt word and the gray prompt word, the image gray prompt word being used to describe a gray feature required by the target relief processing image; The target relief processing image is generated based on the image gray prompt word, the line drawing image, and the depth image.

12. The method of claim 2, wherein, The target relief processing image is generated based on the line drawing image and the depth image, including: An image texture feature is extracted from the line drawing image by calling a line drawing processing network; An image depth feature is extracted from the depth image by calling a depth map processing network; Image generation processing is performed by calling an image generation network based on the image texture feature and the image depth feature to obtain the target relief processing image.

13. The method of claim 2, wherein, The depth map extraction from the 3D style image to obtain a depth image corresponding to the 3D style image includes: A plurality of candidate gray ranges are obtained; A candidate depth image in each candidate gray range is obtained by performing depth map extraction on the 3D style image in the candidate gray range; A candidate depth image in which the image quality meets a quality requirement is selected as the depth image corresponding to the 3D style image.

14. The method of claim 2, wherein, The 3D style processing based on the line drawing image to obtain a 3D style image includes: A texture feature of the line drawing image is extracted by calling a line drawing processing model; The 3D style image is obtained by performing 3D style processing based on the texture feature of the line drawing image.

15. The method of claim 14, wherein, The method further includes: An image prompt word corresponding to the line drawing image is obtained; Prompt word optimization is performed on the image prompt word to obtain an optimized prompt word, the optimized prompt word being used to describe a 3D feature required by the 3D style image to be generated; The 3D style processing based on the texture feature of the line drawing image to obtain the 3D style image includes: perform 3D style processing on the 3D features described by the optimized prompt word and texture features of the line drawing image to obtain the 3D style image.

16. The method of claim 1, wherein, The line drawing image is obtained in response to the image generation request. The depth image corresponding to the line drawing image is obtained, including: In response to the image generation request, an image prompt word is obtained, the image prompt word being used to describe an image element to be laser processed. A three-dimensional image containing the image element is generated based on the image prompt word. The three-dimensional image is subjected to line drawing processing to obtain a line drawing image corresponding to the three-dimensional image, and the three-dimensional image is subjected to depth map extraction to obtain a depth image corresponding to the three-dimensional image.

17. The method of claim 16, wherein, Before the image prompt word is obtained from the image generation request in response to the image generation request, the method further includes: An image generation interface is displayed, the image generation interface containing a prompt word input area; In response to an input operation on the prompt word input area, a text character corresponding to the input operation is obtained; The text character is taken as an image prompt word, and an image generation request containing the image prompt word is created.

18. The method of claim 16, wherein, The three-dimensional image containing the image element is generated based on the image prompt word, including: The image prompt word is subjected to prompt word optimization to obtain an optimized prompt word, the optimized prompt word being used to describe three-dimensional features that the image element needs to have in the three-dimensional image; A three-dimensional image containing the image element is generated based on the three-dimensional features described by the optimized prompt word.

19. The method of claim 16, wherein, The three-dimensional image is subjected to line drawing processing to obtain a line drawing image corresponding to the three-dimensional image, including: The line drawing image generation model is called to extract texture features of the three-dimensional image, and line drawing processing is performed based on the texture features; The line drawing image output by the line drawing image generation model after line drawing processing is obtained, and the output line drawing image is taken as the line drawing image corresponding to the three-dimensional image.

20. The method of claim 1, wherein, The line drawing image is obtained in response to the image generation request. The depth image corresponding to the line drawing image is obtained, including: In response to the image generation request, the input image is obtained; the input image includes an image element to be laser processed; Based on the input image, contour extraction processing is performed to obtain a line drawing image corresponding to the input image, and depth calculation processing is performed based on the input image to obtain a depth image corresponding to the input image.

21. The method of claim 20, wherein, The input image is obtained in response to the image generation request carrying the input image, including: An image generation interface is displayed, the image generation interface including an image upload control; In response to an input operation on the image upload control, an image generation request is created, an image corresponding to the input operation is obtained, and the image is taken as the input image.

22. The method of claim 20, wherein, After the input image is obtained in response to the image generation request carrying the input image, the method further includes: A target prompt word corresponding to the input image is obtained; The target relief processing image is generated based on the target prompt word, the depth image, and the line drawing image. ​ 23. The method of claim 22, wherein, The obtaining the target prompt word corresponding to the input image comprises: displaying an image generation interface, the image generation interface comprising a prompt word input control; in response to an input operation on the prompt word input control, obtaining a text character corresponding to the input operation and taking the text character as the target prompt word.

24. The method of claim 22, wherein, The obtaining the target prompt word corresponding to the input image comprises: performing label generation processing on the input image based on a label generation model to obtain a label set corresponding to the input image; determining the target prompt word based on a label in the label set.

25. The method of claim 20, wherein, The depth calculation processing based on the input image to obtain a depth image corresponding to the input image comprises: performing depth calculation processing on the input image based on a plurality of depth image generation models respectively to obtain depth images respectively output by the plurality of depth image generation models, the plurality of depth image generation models respectively corresponding to different depth calculation processing parameters; selecting a target depth image from the plurality of depth images as the depth image corresponding to the input image.

26. The method of claim 25, wherein, The selecting a target depth image from the plurality of depth images to obtain the depth image corresponding to the input image comprises: obtaining exposure histograms respectively corresponding to the plurality of depth images, the exposure histograms comprising an association between a luminance value and a pixel number in the corresponding depth image; based on the association in the exposure histogram corresponding to each depth image, selecting a target depth image from the plurality of depth images to obtain the depth image corresponding to the input image.

27. The method of claim 26, wherein, The selecting a target depth image from the plurality of depth images based on the association in the exposure histogram corresponding to each depth image to obtain the depth image corresponding to the input image comprises: traversing the exposure histograms respectively corresponding to the plurality of depth images, if the number of pixels in a specified luminance value interval in the currently traversed exposure histogram is within a set threshold range, determining the depth image corresponding to the currently traversed exposure histogram as the target depth image to obtain the depth image corresponding to the input image.

28. A processing apparatus wherein, The processing device comprises: a slide rail; a processing head, the processing head being slidably arranged on the slide rail; a communication component, the communication component being configured to receive a target relief processing image obtained according to the steps of the image processing method for laser processing according to any one of claims 1 to 27; a controller, the controller being configured to control the processing head to move on the slide rail for processing based on the target relief processing image.

29. A processing system, wherein, The processing system comprises: a processing device, the processing device comprising a communication component, a controller, a slide rail, and a movable head, the movable head being slidably arranged on the slide rail; and a terminal device in communication with the processing device, the terminal device being configured to execute the image processing method for laser processing according to any one of claims 1 to 27.

30. A computer readable medium having stored thereon a computer program, wherein, The computer program, when executed by a processor, implements the image processing method for laser processing according to any one of claims 1 to 27.

31. A computer program product comprising computer instructions, wherein, The computer instructions, when executed by a processor, implement the image processing method for laser processing as claimed in any one of claims 1 to 27.