Image edge real-time processing method and system for surface exposure light-curing 3D printing
By using threshold determination and random number weighted summation to process edge pixels in surface exposure photopolymerization 3D printing, the problem of surface roughness caused by abrupt changes in edge grayscale is solved, achieving efficient and smooth edge transitions and improving printing quality and real-time performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 江苏镭创高科光电科技有限公司
- Filing Date
- 2026-03-03
- Publication Date
- 2026-05-29
Smart Images

Figure CN121767680B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method and system for real-time image edge processing in surface exposure photopolymerization 3D printing. Background Technology
[0002] Projection photopolymerization 3D printing technologies, such as digital light processing (DLP) technology, achieve efficient part manufacturing by slicing a three-dimensional model into a sequence of two-dimensional images and projecting and solidifying them layer by layer.
[0003] In related technologies, edge processing of 3D printing images often employs binarization or fixed threshold detection methods. These methods divide pixel grayscale values into two extreme ranges: solidified and unsolidified. They ignore the grayscale correlation between edges and neighboring pixels, resulting in significant grayscale abrupt changes in edge contours, leading to rough surfaces and harsh edges on printed products. Some related technologies use fixed-weight neighborhood smoothing to improve this problem, but fixed weights cannot adapt to the edge differences of different images, still exhibiting local grayscale abrupt changes, and are prone to losing edge details and reducing forming accuracy. At the same time, complex edge processing algorithms increase latency, failing to meet the real-time requirements of surface exposure 3D printing and making it difficult to adapt to high-speed printing scenarios.
[0004] There is currently no effective solution to the problem of rough 3D printed surfaces caused by abrupt changes in grayscale at the edge contours when performing edge recognition on 3D printed images in related technologies. Summary of the Invention
[0005] The present invention provides a method and system for real-time image edge processing in surface exposure photopolymerization 3D printing, which at least solves the problem of rough 3D printed surface caused by grayscale abrupt changes at the edge contour when performing edge recognition of 3D printed images in related technologies.
[0006] According to one aspect of the present invention, a real-time image edge processing method for surface exposure photopolymerization 3D printing is provided, comprising: comparing the grayscale value of a target pixel and the grayscale value of its positive neighboring pixels in the 3D printed image with preset thresholds respectively to determine whether the target pixel is an edge pixel; wherein the positive neighboring pixels are the four adjacent pixels above, below, left, and right of the target pixel; if the target pixel is not an edge pixel, using the grayscale value of the target pixel as an output grayscale value; if the target pixel is an edge pixel, obtaining a random value within a preset range as the edge pixel. The first pixel weight of the pixel is calculated; based on the first pixel weight, the second pixel weight of the forward neighboring pixels and the third pixel weight of the diagonal neighboring pixels of the edge pixel are calculated; wherein, the diagonal neighboring pixels are the four adjacent pixels in the diagonal direction of the edge pixel; based on the gray value of the edge pixel, the gray value of the forward neighboring pixels, the gray value of the diagonal neighboring pixels, the first pixel weight, the second pixel weight and the third pixel weight, the output gray value of the edge pixel is obtained by weighted summation; the output gray value is formatted, packaged and output to the 3D printer.
[0007] As an optional approach, the grayscale value of the target pixel and the grayscale value of its positive neighbor pixels in the 3D printed image are compared with preset thresholds to determine whether the target pixel is an edge pixel. This includes: comparing the grayscale value of the target pixel with a first threshold and comparing the grayscale value of the positive neighbor pixels with a second threshold, wherein the preset thresholds include a first threshold and a second threshold, and the first threshold is less than the second threshold; if the grayscale value of the target pixel is less than the first threshold and the grayscale value of at least one of the positive neighbor pixels is greater than the second threshold, the target pixel is determined to be an edge pixel; or, if the grayscale value of the target pixel is greater than the second threshold and the grayscale value of at least one of the positive neighbor pixels is less than the first threshold, the target pixel is determined to be an edge pixel.
[0008] As an optional approach, a value within a preset range is obtained using a random number algorithm as the first pixel weight of the edge pixel; based on the first pixel weight, the second pixel weight of the positive neighboring pixels and the third pixel weight of the oblique neighboring pixels of the edge pixel are calculated, including: the calculation formula for the second pixel weight is: w2=k1*(1-w1); where k1 is a first fixed coefficient; w2 represents the second pixel weight; w1 represents the first pixel weight; the calculation formula for the third pixel weight is: w3=k2*(1-w1); where k2 is a second fixed coefficient; w3 represents the third pixel weight.
[0009] As an optional scheme, the preset range of the random number is 0.2 to 1.0; and / or, the first fixed coefficient k1 = 0.15; the second fixed coefficient k2 = 0.1;
[0010] As an optional approach, based on the first pixel weight, the second pixel weight, and the third pixel weight, the output grayscale value of the edge pixel is obtained by weighted summation, including: adding the product of the grayscale value of the edge pixel and the first pixel weight, the product of the grayscale value of the positive neighboring pixel and the second pixel weight, and the product of the grayscale value of the diagonal neighboring pixel and the third pixel weight to obtain the output grayscale value; the calculation formula for the output grayscale value is as follows: G targ(a) =w1*G orig(a) +w2*G orig(e) +w2*G orig(b) +w2*G orig(c) +w2*G orig(d) +w3*G orig(g) +w3*G orig(f) +w3*G orig(i) +w3*G orig(h) In the formula, G targ(a) G represents the output grayscale value of edge pixels; orig(a) G represents the grayscale value of edge pixels; orig(e) G orig(b) G orig(c) G orig(d) G represents the grayscale values of the positive neighboring pixels in the top, bottom, left, and right directions, respectively; orig(g) G orig(f) G orig(i) G orig(h) These represent the grayscale values of four adjacent pixels along the diagonal.
[0011] As an optional approach, before comparing the grayscale values of the target pixel and its positive neighbor pixels in the 3D printed image with corresponding thresholds to determine whether the target pixel is an edge pixel, the following steps are taken: Constructing a sliding buffer window containing three rows of image data, where, when processing the Nth row of pixels, the sliding buffer window includes pixels from rows N-1, N, and N+1, where N is a positive integer; sequentially taking the M columns of pixels in the Nth row as the target pixel, and determining eight neighbor pixels in a 3×3 region centered on the target pixel, where M is a positive integer, and the neighbor pixels include positive neighbor pixels and diagonal neighbor pixels; extracting and caching the grayscale values of the target pixel and the positive neighbor pixels; wherein, after caching the grayscale values of all pixels in the Nth row, the sliding buffer window removes the grayscale values of the N-1th row and caches the grayscale values of the N+2th row to calculate the grayscale value of the N+1th row of pixels.
[0012] As an alternative approach, when N=1, the grayscale value of the pixel in the (N-1)th row is 0; when N equals the total number of rows in the image, the grayscale value of the pixel in the (N+1)th row is 0; when M=1, the grayscale value of the pixel in the (M-1)th column is 0; and when M equals the total number of columns in the image, the grayscale value of the pixel in the (M+1)th column is 0.
[0013] According to another aspect of the present invention, a real-time image edge processing system for surface exposure photopolymerization 3D printing is also provided, comprising: an image processing module for performing real-time edge processing on a 3D printed image; wherein the image processing module includes: an edge judgment submodule, a weight calculation submodule, and a grayscale value calculation submodule; the edge judgment submodule is used to compare the grayscale value of a target pixel and the grayscale value of its positive neighbor pixels in the 3D printed image with corresponding thresholds respectively to determine whether the target pixel is an edge pixel; wherein the positive neighbor pixels are the four adjacent pixels above, below, left, and right of the target pixel; the weight calculation submodule is used to determine whether the target pixel is an edge pixel. In the case of a single pixel, a value within a preset range is obtained through a random number algorithm and used as the first pixel weight of the edge pixel; based on the first pixel weight, the second pixel weight of the positive neighboring pixels and the third pixel weight of the diagonal neighboring pixels of the edge pixel are calculated; wherein, the diagonal neighboring pixels are the four adjacent pixels in the diagonal direction of the edge pixel; the grayscale value calculation submodule is used to obtain the modified output grayscale value of the edge pixel by weighted summation based on the first pixel weight, the second pixel weight and the third pixel weight; the pixel encapsulation module is used to format and encapsulate the output grayscale value and the grayscale value of non-edge pixels and output them to the 3D printer.
[0014] As an optional solution, it also includes: an interface module for receiving video frame signals from 3D printing and performing serial-to-parallel conversion of the video frame signals; and a grayscale value extraction module for extracting the grayscale values of the pixels from the video frame signals and sending them to the image processing module.
[0015] According to another aspect of the present invention, a surface exposure photopolymerization 3D printing apparatus is also provided, comprising: an industrial control computer for slicing 3D printed images and transmitting them to an optomechanical system; the optomechanical system including an FPGA board, a laser light source, a DMD control board, and a cooling system; wherein the FPGA board integrates the system described in any one of the above claims; and a printing system for printing resin products.
[0016] According to another aspect of the present invention, an electronic device is also provided, comprising: a processor, and a memory storing a program, the program including instructions that, when executed by the processor, cause the processor to perform the method according to any one of the preceding claims.
[0017] According to another aspect of the invention, a non-transitory machine-readable medium storing computer instructions for causing the computer to perform the method according to any one of the preceding claims is also provided.
[0018] According to another aspect of the present invention, a computer program product is also provided, comprising a computer program / instructions that, when executed by a processor, implement the method described in any of the preceding claims.
[0019] This invention provides a real-time image edge processing method and system for surface exposure photopolymerization 3D printing. First, the grayscale values of the target pixel and its adjacent pixels (up, down, left, and right) are compared with preset thresholds to accurately determine edge pixels. The grayscale values of non-edge pixels remain unchanged, ensuring uniform grayscale values in non-edge areas and avoiding abrupt changes. Edge pixels acquire a random number within a preset range as their first weight, and then calculate the corresponding weights of their adjacent pixels (both forward and diagonal). By weighted summing the grayscale values of the edge pixel and its two neighboring pixels, a smooth-transitioning output grayscale value is obtained, thus eliminating abrupt grayscale changes in edge pixels. Finally, the output grayscale value is formatted, packaged, and transmitted to the 3D printer, achieving a smooth grayscale transition at the edges. This solves the problem in related technologies where abrupt grayscale changes at the edge contour during edge recognition of 3D printed images lead to rough 3D printed surfaces. Attached Figure Description
[0020] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other embodiments based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart of a real-time image edge processing method for surface exposure photopolymerization 3D printing according to an embodiment of the present invention.
[0022] Figure 2 This is a schematic diagram illustrating the positional relationship between the target pixel and its neighboring pixels in an embodiment of the present invention.
[0023] Figure 3 This is a schematic diagram of the real-time image edge processing system for surface exposure photopolymerization 3D printing, an embodiment of the present invention.
[0024] Figure 4 This is a schematic diagram of the real-time image edge processing system for surface exposure photopolymerization 3D printing, an embodiment of the present invention.
[0025] Figure 5 This is a schematic diagram of the structure of the surface exposure photopolymerization 3D printing equipment according to an embodiment of the present invention.
[0026] Figure 6 These are small dental membrane effect diagrams corresponding to different preset intervals of random numbers in embodiments of the present invention.
[0027] Figure 7 These are small dental membrane effect diagrams corresponding to different preset thresholds in embodiments of the present invention.
[0028] Figure 8 This is an image of a small dental membrane printed using traditional 3D printing technology.
[0029] Figure 9 This is an example of a small dental membrane 3D printed using this embodiment.
[0030] Figure 10 This is a schematic diagram of the structure of the electronic device created by this invention. Detailed Implementation
[0031] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0032] Surface exposure photopolymerization 3D printing technology projects a two-dimensional image of a sliced 3D model onto the surface of a photopolymer resin using a projection device. The resin is then cured layer by layer using a photopolymerization reaction, eventually stacking to form a three-dimensional solid structure. The edge processing effect of the two-dimensional printed image directly determines the surface quality and forming accuracy of the 3D printed product.
[0033] In the surface exposure curing 3D printing process, the two-dimensional image after slicing the 3D model contains a large number of pixels. The grayscale value of different pixels corresponds to the intensity of the projected light, which in turn determines the degree of resin curing. The higher the grayscale value, the stronger the projected light intensity, the more fully the resin is cured, and the thicker the cured layer; the lower the grayscale value, the weaker the projected light intensity, the shallower the resin curing, and the thinner the layer.
[0034] Different pixel grayscale values at the edges of the 3D printed product outline image, along with varying resin layer thicknesses, directly affect the smoothness and integrity of the product edges. Abrupt changes in pixel grayscale values at the image edges can lead to jagged edges, steps, burrs, and other defects on the surface of the printed product.
[0035] To address the issue of rough 3D printed surfaces caused by abrupt grayscale changes at the edge contours during edge recognition in related technologies, this invention provides a real-time edge processing method for surface exposure photopolymerization 3D printing images, such as... Figure 1 As shown, it includes:
[0036] Step S101: The gray values of the target pixel and the positive neighbor pixels in the 3D printed image are compared with preset thresholds to determine whether the target pixel is an edge pixel; wherein, the positive neighbor pixels are the four adjacent pixels above, below, left and right of the target pixel.
[0037] Step S102: If the target pixel is a non-edge pixel, use the gray value of the target pixel as the output gray value.
[0038] Step S103: When the target pixel is an edge pixel, obtain a random value within a preset range as the first pixel weight of the edge pixel.
[0039] Step S104: Based on the first pixel weight, calculate the second pixel weight of the positive neighbor pixels of the edge pixel and the third pixel weight of the diagonal neighbor pixels; wherein, the diagonal neighbor pixels are the four adjacent pixels in the diagonal direction of the edge pixel.
[0040] Step S105: Based on the gray values of the edge pixels, the gray values of the forward neighbor pixels, the gray values of the diagonal neighbor pixels, the first pixel weight, the second pixel weight, and the third pixel weight, the output gray value of the edge pixels is obtained by weighted summation.
[0041] Step S106: Format and encapsulate the output grayscale values and output them to the 3D printer.
[0042] The above steps are executed by an FPGA (Field Programmable Gate Array) board. The microprocessor on the FPGA board handles the overall scheduling of the image processing flow, data buffer management, and signal interaction with external devices. The core algorithm steps are executed in parallel by the hardware logic circuits built into the FPGA board. FPGA boards have the advantages of high computing speed and strong real-time performance, enabling pixel-by-pixel and line-by-line streaming processing, fully adapting to the high-speed continuous printing requirements of surface exposure 3D printing.
[0043] In slice images of surface-exposure photopolymerization 3D printing, pixel grayscale values directly correspond to the intensity of projected light, which in turn determines the thickness of the resin cured layer. Edge pixels are the boundaries between high-grayscale and low-grayscale regions, and their grayscale values differ significantly from those of adjacent pixels, i.e., there are abrupt changes in grayscale, resulting in a rough printed surface.
[0044] Instead of all eight neighboring pixels, the four forward-facing pixels (top, bottom, left, and right) of the target pixel are selected to balance positioning accuracy and processing efficiency. Since the forward-facing neighboring pixels are closest to the target pixel and have the strongest grayscale correlation, they can quickly capture the core features of sudden changes in brightness. At the same time, the comparison operations of the four diagonal neighboring pixels are reduced, lowering the algorithm complexity and adapting to real-time processing requirements.
[0045] The preset thresholds are set based on the typical grayscale range of surface exposure photopolymer 3D printing, resin curing characteristics, and actual printing scenarios. Specifically, they include a first threshold and a second threshold. The preset thresholds can be calibrated based on historical image grayscale data during normal printing and can also be adaptively adjusted according to the type of 3D printing material, printing accuracy requirements, and optomechanical projection parameters to ensure the accuracy of edge pixel determination in different scenarios.
[0046] Non-edge pixels are target pixels that do not meet the preset threshold conditions. The areas where non-edge pixels are located are uniform grayscale regions of the printed image. The grayscale values of non-edge pixels are stable, with no obvious grayscale abrupt changes, and no additional smoothing processing is required. Using the grayscale values of non-edge pixels directly as the output grayscale values ensures the grayscale stability of non-edge regions, avoiding invalid processing of grayscale fluctuations caused by additional processing; at the same time, it minimizes the computational load of the algorithm, further improving the image processing speed and meeting the real-time requirements of surface exposure 3D printing.
[0047] Current technologies use fixed weights to process edge pixels, resulting in a limited smoothing effect and a tendency to produce repetitive textures. However, introducing random values as the first pixel weight for each edge pixel effectively breaks the repetitive texture defects caused by fixed weights, achieving more flexible and texture-free edge smoothing.
[0048] By leveraging the synergistic effect of neighboring pixel grayscale values, a smooth transition in edge pixel grayscale values is achieved. Since forward neighboring pixels are closer to edge pixels than diagonal neighboring pixels, the weight of the second pixel can be set higher than that of the third pixel to align with the grayscale correlation between pixels. Diagonal neighboring pixels are the four diagonally adjacent pixels of the target edge pixel; working in conjunction with forward neighboring pixels, they can comprehensively cover the surrounding grayscale information of the edge pixel.
[0049] The output grayscale value of edge pixels takes into account both their own grayscale value and the grayscale values of two types of neighboring pixels, preserving edge contour details while eliminating abrupt grayscale changes. By weighted summing and fusing the grayscale values of edge pixels and neighboring pixels, the grayscale values of the edges are smoothly transitioned, thereby improving the problems of rough printed surfaces and harsh edges.
[0050] The output grayscale values are formatted and encapsulated before being sent to the 3D printer. This ensures that the processed grayscale values are compatible with the signal reception format of the 3D printer's optical engine, achieving stable transmission and accurate projection, and guaranteeing the continuity and stability of the printing process. Formatting and encapsulation mainly converts the weighted sum of the output grayscale values into a digital signal format recognizable by the 3D printer's optical engine system, avoiding projection anomalies caused by signal distortion or format incompatibility.
[0051] The present invention provides a real-time image edge processing method and system for surface exposure photopolymerization 3D printing. First, the gray values of the target pixel and its positive neighboring pixels above, below, left, and right are compared with preset thresholds to accurately determine edge pixels. The gray values of non-edge pixels remain unchanged to ensure that there are no abrupt changes and that the gray values of non-edge areas are uniform.
[0052] Edge pixels acquire a random number within a preset range as their first weight, then calculate the corresponding weights of their forward and diagonal neighboring pixels. By weighted summing of the gray values of the edge pixel itself and the two types of neighboring pixels, a smooth transition output gray value is obtained, thereby eliminating gray-scale abrupt changes in edge pixels. Finally, the output gray value is formatted, encapsulated, and transmitted to the 3D printer, achieving a smooth transition of edge gray values. This solves the problem of rough 3D printed surfaces caused by gray-scale abrupt changes at the edge contours when edge recognition is performed on 3D printed images in related technologies.
[0053] As an optional approach, the grayscale value of the target pixel and the grayscale value of its positive neighboring pixels in the 3D printed image are compared with preset thresholds to determine whether the target pixel is an edge pixel. This includes: comparing the grayscale value of the target pixel with a first threshold and comparing the grayscale value of the positive neighboring pixels with a second threshold, wherein the preset thresholds include a first threshold and a second threshold, and the first threshold is less than the second threshold; if the grayscale value of the target pixel is less than the first threshold and the grayscale value of at least one positive neighboring pixel is greater than the second threshold, the target pixel is determined to be an edge pixel; or, if the grayscale value of the target pixel is greater than the second threshold and the grayscale value of at least one positive neighboring pixel is less than the first threshold, the target pixel is determined to be an edge pixel.
[0054] The preset threshold includes a first threshold and a second threshold, with the first threshold being less than the second threshold. The preset threshold does not require complex parameter calibration and adaptive adjustment; edge pixel determination can be achieved simply through numerical comparison. The computational load is far lower than that of full-image processing or geometric calculation-based edge recognition in related technologies.
[0055] The preset threshold is set according to the specific application scenario and image characteristics. In some simple applications, a common threshold, such as 50 to 100 grayscale values, can be selected for initial testing, and then adjusted based on the results. The specific preset threshold needs to be adjusted and experimented with based on image characteristics, processing objectives, and application requirements.
[0056] For example, based on the above principles, this embodiment selected two schemes for comparative experiments: setting the first threshold to 30 grayscale values and the second threshold to 50 grayscale values, resulting in the following... Figure 7 The small dental membrane 3D printing effect shown in Figure C. Setting the first threshold to 20 grayscale values and the second threshold to 60 grayscale values yields the following result. Figure 7 The effect of 3D printing a small dental membrane, as shown in Figure D. Figure 7 As can be seen from the printing effects of C and D, D has a better printing effect. Therefore, in this embodiment, it is preferable to set the first threshold to 20 grayscale values and the second threshold to 60 grayscale values.
[0057] like Figure 2 As shown, with pixel a as the target pixel, the four positive neighboring pixels of pixel a are pixels e, b, c, and d, respectively, and the four diagonal neighboring pixels of pixel a are pixels g, i, h, and f, respectively, located at the top left, top right, bottom left, and bottom right. Threshold comparison is performed only on the grayscale values of the positive neighboring pixels, without incorporating the diagonal neighboring pixels, further reducing the number of comparison operations and minimizing algorithm complexity.
[0058] The first criterion is that the gray value of the target pixel a is less than a first threshold, and the gray value of at least one positive neighboring pixel b, c, d, or e is greater than a second threshold. This scenario corresponds to an edge in a printed image where a low gray value transitions to a high gray value. The target pixel has a low gray value, and at least one adjacent pixel has a high gray value, forming a significant gray-level abrupt change. After being identified as an edge pixel, subsequent gray-level modulation processing can be performed.
[0059] The second criterion is that the gray value of target pixel a is greater than the second threshold, and the gray values of at least one positive neighboring pixel b, c, d, or e are less than the first threshold. This scenario corresponds to the edge in the printed image where high gray values transition to low gray values, complementing the first criterion and ensuring that all boundary areas with abrupt gray value changes receive targeted gray-level smoothing processing.
[0060] The requirement of at least one positive neighboring pixel ensures that both linear edges in a single direction with only one positive neighboring pixel exhibiting a grayscale abrupt change, and corner edges in multiple directions with multiple positive neighboring pixels exhibiting grayscale abrupt changes, can be accurately captured.
[0061] Based on the above grayscale comparison results, the edge pixel determination logic is executed. If either of the two determination conditions is met, the target pixel 'a' can be determined as an edge pixel. These two determination conditions comprehensively cover all boundary edge shapes between low and high grayscale values in the printed image. Furthermore, the determination logic is fixed and can be directly implemented in the microprocessor through hardware logic circuits, resulting in low processing latency.
[0062] In summary, the edge pixel determination step in this embodiment achieves efficient and accurate edge pixel identification by combining a fixed dual-threshold combination of a first threshold and a second threshold, along with targeted grayscale value comparison between the target pixel and its positive neighboring pixels, and two precise determination conditions. Furthermore, this step requires only simple logical judgment, is computationally simple, and has a fixed determination logic, requiring no modification to the core program of the original printing system, thus exhibiting strong compatibility. It also provides a precise processing target for subsequent dynamic random weighted neighborhood mixing algorithms.
[0063] As an optional approach, a value within a preset range is obtained using a random number algorithm as the first pixel weight of the edge pixel. Based on the first pixel weight, the second pixel weight of the positive neighboring pixels and the third pixel weight of the diagonal neighboring pixels of the edge pixel are calculated, including: the calculation formula for the second pixel weight is: w2=k1*(1-w1); where k1 is the first fixed coefficient; w2 represents the second pixel weight; w1 represents the first pixel weight; the calculation formula for the third pixel weight is: w3=k2*(1-w1); where k2 is the second fixed coefficient; w3 represents the third pixel weight.
[0064] The first pixel weight is the weighted proportion of the grayscale value of the edge pixels themselves. The random value of the first pixel weight can be generated by the hardware logic circuit built into the FPGA board through a linear feedback shift register algorithm. This algorithm is a pseudo-random number generation method natively supported by FPGA hardware, which can generate uniformly distributed random numbers through simple shift and XOR logic.
[0065] The first and second fixed coefficients need to be determined based on the actual application scenario and the actual processing effect. The spatial distance between positive neighbor pixels and edge pixels is closer, the correlation of gray-level changes is stronger, and the impact on edge gray-level transition is greater, so a larger fixed coefficient can be set; the spatial distance between oblique neighbor pixels and edge pixels is slightly farther, the gray-level correlation is weaker, so a smaller fixed coefficient can be set.
[0066] The second weighted pixel is the weight value corresponding to the four positive neighbor pixels. Since the positions of the positive neighbor pixels are the same as the target pixel, the weight values of the four positive neighbor pixels are equal. The third pixel weight is the weight value corresponding to the four diagonal neighbor pixels. Since the positions of the diagonal neighbor pixels are the same as the target pixel, the weight values of the four diagonal neighbor pixels are equal.
[0067] The weight calculation steps in this embodiment, through a simple design of a random number algorithm and a fixed coefficient formula, not only overcome the regular texture defects caused by existing fixed weights, but also ensure the real-time performance and hardware compatibility of the algorithm. The independence of random numbers avoids the complex calculations of overfitting edge features, and the fixed coefficient formula provides a stable, flexible, and efficient weight basis for the subsequent weighted summation of edge pixel grayscale values, ultimately achieving the technical effect of irregular textures, smooth transitions, and detail preservation at the edges of printed parts.
[0068] As an optional scheme, the preset range for random numbers is 0.2 to 1.0; and / or, the first fixed coefficient k1 = 0.15; the second fixed coefficient k2 = 0.1;
[0069] The parameters in this embodiment are verified through comparative experiments based on the actual application scenarios of surface exposure photopolymerization 3D printing. The optimal values are finally determined to ensure the edge smoothing effect, eliminate regular textures, and adapt to the real-time computing requirements of FPGA hardware, thereby achieving a technical effect that balances printed surface quality and algorithm efficiency.
[0070] For example, when selecting a preset range of random numbers, comparative experiments can be conducted based on actual application scenarios, such as... Figure 6 As shown in the figure, A represents the final effect of 3D printed small dental membrane obtained by using a random number preset range of 0.1 to 1.0, and B represents the final effect of 3D printed small dental membrane obtained by using a random number preset range of 0.2 to 1.0. The comparison shows that the effect obtained by selecting a random number range of 0.2-1.0 is better.
[0071] The preset random number range is preferably 0.2 to 1.0. Setting the lower limit of 0.2 avoids blurring edge details and distorting contours due to excessively low weight of edge pixels. Setting the upper limit of 1.0 ensures that edges with drastic grayscale changes retain their core features and are not overly smoothed. Random values are generated using a conventional random number algorithm, which is simple to operate and does not add extra processing latency, making it suitable for real-time processing requirements.
[0072] The spatial distance between forward neighbor pixels and edge pixels is closer, resulting in stronger grayscale correlation and a greater impact on edge transition. Therefore, a higher fixed coefficient of 0.15 is assigned. The spatial distance between diagonal neighbor pixels is slightly farther, resulting in weaker grayscale correlation. A lower fixed coefficient of 0.1 is assigned to these pixels to ensure smooth edge performance while preventing excessive grayscale interference from diagonal neighbors with the edge's own features.
[0073] Taking a random value of w1 of 0.5 as an example, the weight of the second pixel is w2 = 0.15 × (1 - 0.5) = 0.075; the weight of the third pixel is w3 = 0.1 × (1 - 0.5) = 0.05. At this time, the weight of the edge pixel itself is 0.5, the total weight of the four positive neighboring pixels is 4 × 0.075 = 0.3, the total weight of the four diagonal neighboring pixels is 4 × 0.05 = 0.2, and the total weight of all the weights is 1. This ensures that the edge pixels retain the core features, and also achieves a smooth transition through the neighborhood weights. Moreover, due to the randomness of w1, the weight distribution ratio of different edge pixels is always different and there is no repetition.
[0074] As an optional approach, based on the first pixel weight, the second pixel weight, and the third pixel weight, the output grayscale value of the edge pixel is obtained through weighted summation. This includes: adding the product of the edge pixel's grayscale value and the first pixel weight, the product of the grayscale values of the forward neighboring pixels and the second pixel weight, and the product of the grayscale values of the diagonal neighboring pixels and the third pixel weight to obtain the output grayscale value; the formula for calculating the output grayscale value is as follows:
[0075] G targ(a) =w1*G orig(a) +w2*G orig(e) +w2*G orig(b) +w2*G orig(c) +w2*G orig(d) +w3*G orig(g) +w3*G orig(f) +w3*G orig(i) +w3*G orig(h) ;
[0076] In the formula, G targ(a) G represents the output grayscale value of edge pixels; orig(a) G represents the grayscale value of edge pixels; orig(e) G orig(b) G orig(c) G orig(d) G represents the grayscale values of the positive neighboring pixels in the top, bottom, left, and right directions, respectively; orig(g) G orig(f) G orig(i) G orig(h) These represent the grayscale values of four adjacent pixels along the diagonal.
[0077] Four positive neighboring pixels use the same second pixel weight, and four diagonal neighboring pixels use the same third pixel weight. This simplifies the calculation while ensuring that the same type of neighboring pixels have a consistent impact on edge transitions, avoiding local grayscale fluctuations caused by uneven weight distribution.
[0078] The first pixel weight of the edge pixel ensures that the details of the edge pixel are not lost, while the second and third pixel weights of the neighboring pixels are used to achieve a smooth grayscale transition, so that the output grayscale value of the edge pixel is between its original grayscale value and the grayscale value of the neighboring pixels, thus eliminating abrupt changes in grayscale value.
[0079] As an optional approach, before comparing the gray values of the target pixel and its positive neighbor pixels in the 3D printed image with corresponding thresholds to determine whether the target pixel is an edge pixel, the following steps are taken: Constructing a sliding buffer window containing three rows of image data, where, when processing the Nth row of pixels, the sliding buffer window includes pixels from rows N-1, N, and N+1, where N is a positive integer; sequentially selecting the M columns of pixels from the Nth row as the target pixel, and determining eight neighbor pixels in a 3×3 region centered on the target pixel, where M is a positive integer, and the neighbor pixels include positive neighbor pixels and diagonal neighbor pixels; extracting and caching the gray values of the target pixel and the positive neighbor pixels; wherein, after caching the gray values of all pixels in the Nth row, the sliding buffer window removes the gray values from the N-1th row and caches the gray values from the N+2th row to calculate the gray value of the N+1th row of pixels.
[0080] The sliding buffer window of three rows of image data provides real-time grayscale value retrieval capability for the 3×3 neighborhood of the target pixel. For 3×3 neighborhood pixels, only the image data of the current processing row ± 1 row needs to be cached to obtain the grayscale values of all neighborhood pixels at once.
[0081] When processing the Nth row of pixels, the sliding buffer window pre-caches the grayscale value of the complete pixel of the row above the target pixel, the grayscale value of the target pixel currently being processed, and the grayscale value of the complete pixel of the row below the target pixel.
[0082] For the boundary pixels of the first row, last row, first column, and last column of the image, this embodiment sets the grayscale value of the neighboring pixels that exceed the image range to a preset value. No additional cache expansion or data completion logic is required. The 3×3 neighborhood construction of the boundary pixels can be completed simply by assigning numerical values, further simplifying the hardware operation logic.
[0083] The target pixel is processed by traversing all pixels of the image from left to right and from top to bottom. After processing the Nth row of pixels from left to right, the sliding buffer window uses a dynamic mechanism of first-in-first-out and row-by-row updates to ensure that the buffer window always maintains three rows of valid data when processing pixel values row by row from top to bottom.
[0084] After calculating the grayscale values of all pixels in row N, the grayscale values of row N-1 in the sliding buffer window are cleared from the window, freeing up storage space in that area. The grayscale values of row N+2 are then read from the video stream and written to the free storage space. After the update, the sliding buffer window retains the data from rows N, N+1, and N+2, and the processing of pixels in row N+1 continues, and so on, until all pixels in all rows have been processed.
[0085] The three-row sliding buffer window design in this embodiment achieves efficient acquisition of grayscale values of 3×3 neighboring pixels through simple hardware logic of three-row buffering, dynamic updating and single-cycle retrieval, thereby achieving the technical effect of low hardware resource consumption and low retrieval latency.
[0086] As an alternative approach, when N=1, the grayscale value of the pixel in the (N-1)th row is 0; when N equals the total number of rows in the image, the grayscale value of the pixel in the (N+1)th row is 0; when M=1, the grayscale value of the pixel in the (M-1)th column is 0; and when M equals the total number of columns in the image, the grayscale value of the pixel in the (M+1)th column is 0.
[0087] In this embodiment, the grayscale values of neighboring pixels that exceed the image range are fixed at a preset value of 0. This aims to solve the problem of no corresponding row or column data when constructing a 3×3 neighborhood of boundary pixels with a very simple numerical assignment logic, while ensuring that the computational load of the algorithm is adapted to the parallel processing architecture of the FPGA hardware and does not introduce additional processing delays.
[0088] The construction of a 3×3 neighborhood depends on the pixel values of the target pixel within ±1 rows and ±1 columns. However, when the first row N=1, there is no N-1 row; when the last row N=the total number of rows, there is no N+1 row; when the first column M=1, there is no M-1 column; and when the last column M=the total number of columns, there is no M+1 column. If the processing flow is interrupted due to lack of data, it will lead to problems such as missing processing in the image boundary areas and edge distortion.
[0089] Therefore, in this embodiment, the grayscale value of all rows or columns of pixels exceeding the image range is fixed at a preset value of 0. Only a logical judgment is needed to determine if the row or column number is out of bounds; if it is, 0 is directly output. No complex interpolation or completion algorithms are required; the judgment and assignment can be completed in a single clock cycle. Setting the grayscale value to a preset value of 0 corresponds to the minimum light intensity required for 3D printing exposure. Setting the grayscale value of neighboring pixels exceeding the image range to 0 ensures that edge detection and grayscale calculation can be completed for any target pixel, avoiding processing interruptions.
[0090] According to another aspect of the present invention, a real-time image edge processing system for surface exposure photopolymerization 3D printing is also provided, such as... Figure 3As shown, it includes: an image processing module for real-time edge processing of 3D printed images; wherein, the image processing module includes: an edge judgment submodule, a weight calculation submodule, and a grayscale value calculation submodule; the edge judgment submodule is used to compare the grayscale value of the target pixel and the grayscale value of the positive neighbor pixels in the 3D printed image with the corresponding thresholds to determine whether the target pixel is an edge pixel; wherein, the positive neighbor pixels are the four adjacent pixels above, below, left, and right of the target pixel; the weight calculation submodule is used to obtain a pre-weighted weight using a random number algorithm when the target pixel is an edge pixel. The values within the interval are set as the first pixel weight of the edge pixel; based on the first pixel weight, the second pixel weight of the positive neighbor pixels and the third pixel weight of the diagonal neighbor pixels of the edge pixel are calculated; where the diagonal neighbor pixels are the four adjacent pixels in the diagonal direction of the edge pixel; the gray value calculation submodule is used to calculate the modified output gray value of the edge pixel by weighted summation based on the first pixel weight, the second pixel weight and the third pixel weight; the pixel encapsulation module is used to format and encapsulate the output gray value and the gray value of non-edge pixels and output them to the 3D printer.
[0091] The edge detection submodule accurately identifies edge pixels in the 3D printed image, providing targeted targets for subsequent processing. The weight calculation submodule only performs weight assignment on edge pixels output by the edge detection submodule; non-edge pixels skip this step. The grayscale value calculation submodule performs a weighted summation of the grayscale values output by the edge pixels based on the weight values output by the weight calculation submodule.
[0092] The grayscale value is output from the grayscale value calculation submodule to the pixel encapsulation module. The pixel encapsulation module is the adapter unit between the system and the DLP optical engine of the 3D printer. It is used to format and encapsulate the processed grayscale value into an HDMI (High Definition Multimedia Interface) video stream format that can be recognized by the DLP optical engine.
[0093] HDMI is a fully digital audio and video transmission standard that supports the simultaneous transmission of uncompressed high-definition video, multi-channel audio, and control signals. The HDMI video stream format is a dedicated format designed to adapt to grayscale image transmission and meet real-time printing needs, while also adhering to the HDMI general transmission specification.
[0094] Specifically, the gray values of edge pixels and non-edge pixels output by the gray value calculation submodule are integrated in the row and column order of the image to keep the spatial position of the pixels consistent with the original image and avoid printing misalignment.
[0095] As an alternative solution, such as Figure 4As shown, it also includes: an interface module for receiving video frame signals from 3D printing and performing serial-to-parallel conversion of the video frame signals; and a grayscale value extraction module for extracting the grayscale values of pixels from the video frame signals and sending them to the image processing module.
[0096] The interface module is connected to the grayscale extraction module and the pixel encapsulation module. The interface module converts the received data into input data and inputs it into the grayscale extraction module. The grayscale extraction module extracts the input pixels from the received input data and inputs the input pixels into the image processing module. The image processing module processes the pixels to obtain the output pixels and inputs the output pixels into the pixel encapsulation module to obtain the output data. The output data is then input into the interface module to be converted into a signal that can be recognized by the DLP optical engine.
[0097] The interface module can be an HDMI interface module. The HDMI interface module is the physical connection and signal adaptation unit between the system and the DLP (Digital Light Processing) optical engine. It is used to receive video frame signals and complete serial-to-parallel conversion, and at the same time, to reversely complete the parallel-to-serial conversion and output of the processed video frame signals. The DLP optical engine is a complete execution unit that can independently realize the projection of digital images onto an ultraviolet light array.
[0098] The HDMI interface module, acting as the receiver, receives the serial video frame signal output from the host computer during serial-to-parallel conversion. It then performs the serial-to-parallel conversion via its IP core, deserializing the high-speed serial TMDS (Transition-Minimized Differential Signaling) signal into parallel 24-bit RGB data, while simultaneously extracting the synchronization timing signal. Cyclic redundancy check is performed on the deserialized video frame signal to filter out erroneous frames and ensure the integrity of the input data. The parallel 24-bit RGB video data and synchronization timing signal are then input to the grayscale extraction module, with the output rate synchronized with the pixel clock. 24-bit RGB data is a basic and universal pixel encoding format; the RGB data of a single pixel consists of three independent channels: red (R), green (G), and blue (B).
[0099] As the transmitting end, the HDMI interface module receives video frame data and synchronization timing signals output by the pixel encapsulation module during parallel-to-serial conversion; it maps 8-bit grayscale data to 24-bit RGB data, conforming to the HDMI colorless video stream transmission specification; it completes parallel-to-serial conversion through the IP core, encodes the parallel data into a TMDS serial signal, and outputs it to the DLP optical engine after superimposing the synchronization timing signal; it ensures that the timing of the output HDMI signal is completely consistent with the input data, avoiding optical engine projection misalignment.
[0100] The grayscale extraction module accurately extracts pixel grayscale values from the input data and sends them to the subsequent image processing module. Specifically, the HDMI interface module outputs 24-bit RGB parallel data; because the video frame of surface exposure 3D printing is a grayscale image, the 8-bit R channel data is directly extracted as the pixel grayscale value; based on the synchronization timing signal, invalid data is filtered out, and only the pixel grayscale values of the valid display area are extracted to avoid invalid data from entering the subsequent processing flow.
[0101] The extracted 8-bit grayscale value is directly sent to the write port of the three-row sliding buffer window built into the image processing module; the grayscale value is written pixel by pixel to the corresponding address of the sliding buffer window according to the row and column order of the video frame, ensuring that the spatial position of the grayscale value is consistent with the original image.
[0102] According to another aspect of the present invention, a surface exposure photopolymerization 3D printing apparatus is also provided, such as... Figure 5 As shown, it includes: an industrial control computer for slicing 3D printed images and transmitting them to an optomechanical system; an optomechanical system including an FPGA board, a laser light source, a DMD (Digital Micromirror Device) control board, and a cooling system; wherein the FPGA board integrates any of the above-mentioned systems; and a printing system for printing resin products.
[0103] The industrial control computer loads the 3D model file and uses dedicated slicing software to slice the model into two-dimensional grayscale images according to the printing layer thickness. Basic parameters such as exposure time and contrast are configured for the sliced images without additional edge processing. The sliced grayscale images are transmitted in real time to the FPGA board of the optomechanical system as video frame signals. The transmission protocol is compatible with the HDMI 1.4 standard to ensure data integrity.
[0104] The FPGA board receives video frame signals from the industrial control computer, performs serial-to-parallel conversion and grayscale value extraction; it performs edge detection, random weight calculation, and weighted summation of grayscale values pixel by pixel for each frame; it encapsulates the processed grayscale image into a video frame signal and transmits it to the DMD control board; it outputs a synchronization trigger signal to the DMD control board to ensure that the projection timing is consistent with the image processing rhythm. The DMD control board receives the video frame signals processed by the FPGA board, converts the grayscale values into flip control signals for the DMD micromirrors; the higher the grayscale value, the longer the micromirrors face the laser light source.
[0105] The laser source, DMD control board, and cooling system together constitute the DLP optomechanical system. The laser source receives the shutter control signal from the DMD control board and outputs a stable ultraviolet laser during the image projection period. The area array exposure of the image is achieved through reflection by the micromirrors of the DMD chip. The cooling system monitors the operating temperature of the laser source, DMD chip, and FPGA board in real time to prevent damage to the optomechanical components.
[0106] The printing system is the resin molding execution unit of the equipment, realizing the layer-by-layer printing and curing of resin products. The printing system receives displacement commands from the industrial control computer, which drives the molding platform to precisely rise and fall according to the layer thickness. After each layer is printed, the platform moves up and down by the corresponding distance to ensure that the new layer of resin covers the product. When the optomechanical system projects and exposes the resin, the molding platform remains stationary. After exposure, the lifting module drives the platform to detach from the resin tank, completing the curing of one layer. This cycle continues until all layers are printed, resulting in the resin product.
[0107] The algorithm logic for edge pixel value processing in this embodiment is a simple numerical calculation and logical judgment that can be implemented purely in hardware. It does not require modification of the host computer software, slicing logic and optical engine control core program of the original 3D printing system. It is executed only in the image processing module of the FPGA board and is fully compatible with the core processes of printing systems such as HDMI signal transmission and optical engine projection in related technologies. After embedding the FPGA board into the optical engine system, a "plug and play" system upgrade can be achieved, which greatly reduces the equipment verification cost and upgrade risk, and achieves low-cost and high-efficiency system performance improvement.
[0108] like Figure 8 The image shown is an example of a small dental membrane printed using traditional 3D printing technology. Figure 9 The image shows the effect of a small dental mold 3D printed using this embodiment. As can be seen from the comparison image, the surface quality of the small dental mold 3D printed using this embodiment is significantly improved. Compared with 3D printing equipment without image processing, the steps and stripes on the surface of the dental mold are significantly reduced.
[0109] Embodiments of the present invention also provide a non-transitory machine-readable medium storing a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform a method according to an embodiment of the present invention.
[0110] Embodiments of the present invention also provide a computer program product, including a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform the method of an embodiment of the present invention.
[0111] An embodiment of the present invention also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, which, when executed by the at least one processor, causes the electronic device to perform the method of the embodiment of the present invention.
[0112] refer to Figure 10The present invention will now describe a structural block diagram of an electronic device that can serve as an embodiment of the present invention, serving as an example of a hardware device applicable to various aspects of the present invention. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0113] like Figure 10 As shown, the electronic device includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. The RAM 603 may also store various programs and data required for the operation of the electronic device. The computing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0114] Multiple components in the electronic device are connected to I / O interface 605, including: input unit 606, output unit 607, storage unit 608, and communication unit 609. Input unit 606 can be any type of device capable of inputting information into the electronic device. Input unit 606 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of the electronic device. Output unit 607 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 608 may include, but is not limited to, disks and optical discs. Communication unit 609 allows the electronic device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, and / or wireless communication transceivers, such as Bluetooth devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0115] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, CPUs, graphics processing units (GPUs), various special-purpose artificial intelligence (AI) computing units, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above. For example, in some embodiments, the method embodiments of the present invention can be implemented as computer programs tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on an electronic device via ROM 602 and / or communication unit 609. In some embodiments, the computing unit 601 can be configured to perform the methods described above by any other suitable means (e.g., by means of firmware).
[0116] Computer programs for implementing the methods of embodiments of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0117] In the context of embodiments of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable signal medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, or infrared systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0118] It should be noted that the term "comprising" and its variations used in the embodiments of this invention are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The modifications of "one" and "a plurality" mentioned in the embodiments of this invention are illustrative and not restrictive, and those skilled in the art should understand that unless explicitly indicated otherwise in the context, they should be understood as "one or more".
[0119] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this invention are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0120] The steps described in the method embodiments provided by the present invention can be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of protection of the present invention is not limited in this respect.
[0121] The term "embodiment" in this specification refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily imply the same embodiment, nor does it imply independence or alternativeity from other embodiments. The various embodiments in this specification are described in a related manner, with reference to each other for similar or identical parts. In particular, for apparatus, device, and system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, and relevant details are referred to in the description of the method embodiments.
[0122] The above-described embodiments are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.
Claims
1. A method for real-time image edge processing in surface exposure photopolymerization 3D printing, characterized in that, include: The grayscale values of the target pixel and its positive neighbor pixels in the 3D printed image are compared with preset thresholds to determine whether the target pixel is an edge pixel. The positive neighbor pixels are the four adjacent pixels above, below, left, and right of the target pixel. The preset thresholds include a first threshold and a second threshold, and the first threshold is less than the second threshold. The grayscale value of the target pixel is compared with a first threshold, and the grayscale value of the positive neighboring pixels is compared with a second threshold. If the gray value of the target pixel is less than the first threshold and the gray value of at least one of the positive neighboring pixels is greater than the second threshold, or if the gray value of the target pixel is greater than the second threshold and the gray value of at least one of the positive neighboring pixels is less than the first threshold, the target pixel is determined to be an edge pixel. Construct a sliding buffer window containing three rows of image data. When processing the pixels of the Nth row, the sliding buffer window includes the pixels of the (N-1)th, Nth, and N+1th rows, where N is a positive integer. The pixels in the M columns of the Nth row are sequentially selected as the target pixels, and 8 neighboring pixels of a 3×3 region centered on the target pixels are determined, where M is a positive integer, and the neighboring pixels include forward neighboring pixels and diagonal neighboring pixels. Extract the grayscale value of the target pixel and the grayscale values of the neighboring pixels and cache them; Wherein, after the sliding buffer window has completed the caching of the gray values of all pixels in the Nth row, it removes the gray values of the (N-1)th row in the sliding buffer window and caches the gray values of the (N+2)th row in order to calculate the gray values of the pixels in the (N+1)th row. If the target pixel is a non-edge pixel, the grayscale value of the target pixel is used as the output grayscale value. When the target pixel is an edge pixel, a random value within a preset range is obtained and used as the first pixel weight of the edge pixel; The formula for calculating the weight of the second pixel is: w2 = k1 * (1 - w1); where k1 is the first fixed coefficient; w2 represents the weight of the second pixel; and w1 represents the weight of the first pixel, which is obtained through a random number algorithm. The formula for calculating the weight of the third pixel is: w3 = k2 * (1 - w1); where k2 is the second fixed coefficient; w3 represents the weight of the third pixel; where the diagonal neighbor pixels are the four adjacent pixels in the diagonal direction of the edge pixels; The grayscale value is obtained by multiplying the grayscale value of the edge pixel by the first pixel weight, the grayscale value of the positive neighbor pixel by the second pixel weight, and the grayscale value of the oblique neighbor pixel by the third pixel weight. The formula for calculating the output grayscale value is as follows: G targ(a) =w1*G orig(a) +w2*G orig(e) +w2*G orig(b) +w2*G orig(c) +w2*G orig(d) +w3*G orig(g) +w3*G orig(f) +w3*G orig(i) +w3*G orig(h) ; In the formula, G targ(a) G represents the output grayscale value of edge pixels; orig(a) G represents the grayscale value of the edge pixel; orig(e) G orig(b) G orig(c) G orig(d) G represents the grayscale values of the positive neighboring pixels in the top, bottom, left, and right directions, respectively; orig(g) G orig(f) G orig(i) G orig(h) These represent the grayscale values of four adjacent pixels along the diagonal direction; The output grayscale values are formatted, encapsulated, and then output to the 3D printer.
2. The real-time image edge processing method for surface exposure photopolymerization 3D printing according to claim 1, characterized in that, The preset range for the random numbers is 0.2 to 1.0; And / or, the first fixed coefficient k1 = 0.15; the second fixed coefficient k2 = 0.
1.
3. The real-time image edge processing method for surface exposure photopolymerization 3D printing according to claim 1, characterized in that, When N=1, the grayscale value of the pixel in the (N-1)th row is 0; When N equals the total number of rows in the image, the grayscale value of the pixel in the (N+1)th row is 0; When M=1, the grayscale value of the pixel in the (M-1)th column is 0; When M equals the total number of columns in the image, the grayscale value of the pixel in the (M+1)th column is 0.
4. A real-time image edge processing system for surface exposure photopolymerization 3D printing, used to execute the real-time image edge processing method for surface exposure photopolymerization 3D printing as described in claim 1, characterized in that, include: An image processing module is used to perform real-time edge processing on 3D printed images; wherein, the image processing module includes: an edge detection submodule, a weight calculation submodule, and a grayscale value calculation submodule; The edge detection submodule is used to compare the grayscale value of the target pixel and the grayscale value of the positive neighbor pixels in the 3D printed image with the corresponding thresholds to determine whether the target pixel is an edge pixel; wherein, the positive neighbor pixels are the four adjacent pixels above, below, left and right of the target pixel; The weight calculation submodule is used to obtain a value within a preset range through a random number algorithm when the target pixel is an edge pixel, and use it as the first pixel weight of the edge pixel; and calculate the second pixel weight of the positive neighboring pixels and the third pixel weight of the diagonal neighboring pixels of the edge pixel based on the first pixel weight; wherein, the diagonal neighboring pixels are the four adjacent pixels in the diagonal direction of the edge pixel. The grayscale value calculation submodule is used to obtain the modified output grayscale value of the edge pixel by weighted summation based on the first pixel weight, the second pixel weight, and the third pixel weight. The pixel encapsulation module is used to format and encapsulate the output grayscale values and the grayscale values of non-edge pixels and output them to the 3D printer.
5. The real-time image edge processing system for surface exposure photopolymerization 3D printing according to claim 4, characterized in that, Also includes: The interface module is used to receive video frame signals from 3D printing and to perform serial-to-parallel conversion of the video frame signals. The grayscale value extraction module is used to extract the grayscale value of the pixel from the video frame signal and send it to the image processing module.
6. A surface exposure photopolymerization 3D printing device, characterized in that, include: The industrial computer is used to slice the 3D printed images and transmit them to the optomechanical system; An optomechanical system includes an FPGA board, a laser source, a DMD control board, and a cooling system; wherein the FPGA board integrates the system described in any one of claims 4 to 5. A printing system used to print resin products.
7. An electronic device, comprising: A processor and a memory storing a program, characterized in that the program includes instructions that, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 3.
8. A non-transitory machine-readable medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 3.
9. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method of any one of claims 1 to 3.