A method and system for surface image enhancement of a fused deposition modeling part
By combining dual-path central difference gradient and attribute determination function, the problems of low contrast and complex texture in the surface image of fused deposition modeling parts are solved, achieving efficient image enhancement and feature recognition, and adapting to diverse surface features of fused deposition modeling parts.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAN AERONAUTICAL UNIV
- Filing Date
- 2026-01-28
- Publication Date
- 2026-04-17
AI Technical Summary
Traditional image enhancement algorithms struggle to adapt to the low contrast, high noise, and complex texture features of fused deposition modeled parts surface images, making it difficult to identify minute defects and failing to meet the requirements of non-destructive testing.
A dual-path center difference gradient method is adopted to construct an attribute determination function. By calculating the gray-level changes of pixels, the true features are distinguished from background noise. Pixel attribute judgment conditions are set to adapt to the surface features of different fused deposition modeling parts.
It achieves efficient enhancement of surface images of fused deposition modeled parts, ensuring that no morphological changes are missed, accurately distinguishing features from the background, adapting to different brightness requirements, and improving image clarity and feature recognition.
Smart Images

Figure CN121599891B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image enhancement technology, and more specifically, to a method and system for surface image enhancement of fused deposition modeled parts. Background Technology
[0002] Fused deposition modeling (FDM) refers to the process of heating and melting a filamentary thermoplastic material, such as ABS or PLA plastic, and then extruding it through a micro-nozzle, depositing and solidifying it layer by layer to ultimately form a three-dimensional solid part. A surface image of a fused deposition modeled part refers to an image obtained by photographing or scanning the surface of the three-dimensional solid part manufactured using fused deposition modeling technology, which reflects the appearance, morphological characteristics, and microscopic state of the part's surface.
[0003] Surface images of fused deposition modeling (FDM) parts contain crucial information reflecting the quality and morphology of three-dimensional solid parts. They serve as the core basis for subsequent non-destructive testing and provide important references for process optimization. This key information includes not only surface contour information, such as boundary morphology, geometric details, edge smoothness, and the presence of offsets or gaps, directly related to whether geometric accuracy meets standards; but also internal morphological features, such as interlayer gaps, surface pores, filament stacking stripes, and microscopic defects like depressions and protrusions, which determine key quality indicators such as surface roughness; and grayscale and texture information. The grayscale distribution patterns and periodic textures formed by the filament arrangement can indirectly determine the rationality of process parameters such as the filament melting state and extrusion speed matching. Therefore, the clarity and feature recognition of the surface images of fused deposition modeling parts directly affect the accuracy of quality assessment for three-dimensional solid parts.
[0004] Due to the characteristics of the molding process, the core features of the surface images of fused deposition modeled parts are significant surface stripes and interlayer textures. At the edges, there may be blurring or unclear phenomena due to insufficient thermal melting of the material. It has typical characteristics of low contrast, high noise interference, complex and diverse features, and strong texture correlation. The low contrast makes the gray-scale difference between tiny defects and the substrate extremely small, and the high noise further masks the true features. The diverse macro contours and micro defects are superimposed and have different shapes. Periodic textures are also easily confused with defects, which makes it difficult for traditional image enhancement algorithms to adapt.
[0005] Traditional algorithms such as histogram equalization can improve overall brightness, but they can over-amplify noise and fail to effectively improve local contrast. Ordinary filtering can blur microscopic defects while suppressing noise, and edge enhancement algorithms can amplify noise. Single threshold segmentation can easily misjudge textures as defects or miss real defects. In the end, the processed image has insufficient contour accuracy and defect recognition, which cannot provide a reliable basis for subsequent quantitative analysis of the surface quality of three-dimensional solid parts and cannot meet the actual needs of non-destructive testing of fused deposition modeling parts. Summary of the Invention
[0006] The technical problem to be solved by this application is to provide a surface image enhancement method and system for fused deposition modeling parts, which addresses the shortcomings of the prior art. The system has a simple structure and reasonable design, and sets up dual paths to ensure that no surface morphology changes are missed. It constructs an attribute determination function based on the central difference gradient, which can adapt to the surface features of different fused deposition modeling parts. It sets evaluation conditions for pixel attribute judgment to distinguish between the real features of the part surface and background noise.
[0007] To solve the above-mentioned technical problems, the technical solution adopted in this application is:
[0008] In a first aspect, the present invention provides a method for surface image enhancement of fused deposition modeled parts, characterized by comprising the following steps:
[0009] Step 1: Acquire surface images of the fused deposition modeled 3D solid part;
[0010] Step 2: Preprocess the surface image to obtain the image grayscale matrix;
[0011] Step 3: Calculate the first central difference gradient along the first path and the second path respectively. Second central difference gradient ,in This represents the first central difference gradient obtained along the first path for the non-edge pixel in the i-th row and j-th column. This represents the second central difference gradient obtained along the second path for the non-edge pixel in the i-th row and j-th column;
[0012] Step 4: Construct the first attribute determination function , , This represents the median of all first-center difference gradients in the image. This represents the squared difference of the first center difference gradient of the non-edge pixel in the i-th row and j-th column. Represent the variance of the first central difference gradient; construct the second attribute determination function. , , This represents the median of all second-center difference gradients in the image. This represents the squared difference of the second center difference gradient of the non-edge pixel in the i-th row and j-th column. This represents the variance of the second central difference gradient;
[0013] Step 5: Calculate the first attribute determination function value of the non-edge pixels in the i-th row and j-th column of the image grayscale matrix. Second attribute determination function value ;
[0014] Step Six, if Proceed to step 601, if Proceed to step 602, where represents the average gray value of all non-edge pixels in the image, and b represents the number of bits in the image;
[0015] Step 601: If or Then, the attribute of the non-edge pixel in the i-th row and j-th column is determined as a feature point, and its pixel gray value is determined. Perform enhancement assignment; otherwise, adjust the pixel grayscale value. Perform a weakened assignment;
[0016] Step 602: If or If it is determined to be a feature point, its pixel grayscale value is then analyzed. Perform a weakened assignment; otherwise, adjust the pixel grayscale value. Perform enhancement assignment;
[0017] Step 7: Repeat steps 5 and 6 until all non-edge pixels are traversed, generating a new image grayscale matrix and restoring the enhanced surface image of the fused deposition modeled part.
[0018] The above-mentioned surface image enhancement method for fused deposition modeled parts is characterized in that: in step three, the first path is a row path, according to the formula... Calculate the first central difference gradient, where This represents the grayscale value of a non-edge pixel in the (i+1)th row and jth column. This represents the grayscale value of a non-edge pixel in the (i-1)th row and jth column. Indicates the row spacing in pixels along the row path.
[0019] The above-mentioned surface image enhancement method for fused deposition modeled parts is characterized in that: in step three, the second path is a column path, according to the formula... Calculate the second central difference gradient, where This represents the grayscale value of a non-edge pixel in the i-th row and j+1-th column. This represents the grayscale value of a non-edge pixel in the i-th row and (j-1)-th column. This indicates the pixel row spacing of the column path.
[0020] The above-mentioned surface image enhancement method for fused deposition modeling parts is characterized in that: the pixel gray value in the image gray matrix is calculated by assigning weights to the RGB three color components of each non-edge pixel in the image, and obtaining the pixel gray value through weighted calculation.
[0021] The above-mentioned surface image enhancement method for fused deposition modeled parts is characterized in that: in step four, , This represents the mean of the absolute values of all first-center difference gradients in the image. ; , where m represents the number of rows in the image and n represents the number of columns in the image.
[0022] The above-mentioned surface image enhancement method for fused deposition modeled parts is characterized in that: in step four, , This represents the mean of the absolute values of all second-center difference gradients in the image. ; , where m represents the number of rows in the image and n represents the number of columns in the image.
[0023] The above-mentioned surface image enhancement method for fused deposition modeled parts is characterized in that: in step 601, the enhancement value is assigned as... When assigning a weak value, the value is 0.
[0024] The above-mentioned surface image enhancement method for fused deposition modeled parts is characterized in that: in step 602, during the weakening assignment, the surface image of the part is enhanced by... Assigning a value of 0 enhances the assignment process. Assigned value .
[0025] The above-described surface image enhancement method for fused deposition modeling parts is characterized by: traversing non-edge pixels along a first path to obtain all first central difference gradients in the image; sorting the absolute values of the first central difference gradients from smallest to largest to obtain the median of the first central difference gradients. Traverse the second path for non-edge pixels to obtain all second central difference gradients in the image. Sort the absolute values of the second central difference gradients from smallest to largest to obtain the median of the second central difference gradients. .
[0026] In a second aspect, the present invention provides a surface image enhancement system for fused deposition modeled parts, characterized in that it includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the surface image enhancement method for fused deposition modeled parts as described above.
[0027] This application has the following advantages compared with the prior art:
[0028] 1. The method of this application is simple, reasonably designed, and easy to implement and use.
[0029] 2. This application sets up a first path and a second path. As long as a pixel shows sufficient grayscale change on either path, it will be determined as a feature point. The combination of the two paths can realize the capture of features in multiple directions in the two-dimensional plane, ensuring that no surface morphology changes are missed.
[0030] 3. This application constructs an attribute determination function based on the central difference gradient, calculates the attribute determination function value based on the image's own features, and uses the attribute determination function value as the judgment threshold for feature point attributes. There is no need to manually set a fixed threshold through trial and error. It can adapt to the surface features of different fused deposition modeling parts and ensure that feature points and background points can be accurately distinguished in various scenarios.
[0031] 4. This application assigns values according to image brightness, preserves the original grayscale levels of the image, maximizes the contrast between features and background, and adapts to the enhancement needs of fused deposition modeling images with different brightness.
[0032] 5. This application uses the comparison result of the absolute value of the central difference gradient and the absolute value of the attribute determination function as the evaluation condition for pixel attribute determination, and uses the degree of grayscale change to reflect the characteristics of the sudden change in the surface morphology of the part, so as to distinguish the true features of the part surface from the background noise.
[0033] In summary, this application sets up a dual-path system to ensure that no abrupt changes in surface morphology are missed; it constructs an attribute determination function based on the central difference gradient, which can adapt to the surface characteristics of different fused deposition modeling parts, ensuring that feature points and background points can be accurately distinguished in various scenarios; it sets evaluation conditions for pixel attribute judgment, using the degree of grayscale change to reflect the characteristics of abrupt changes in the surface morphology of the part, distinguishing the real features of the part surface from background noise, and achieving good enhancement effect.
[0034] The technical solution of this application will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0035] Figure 1 This is a flowchart of the method of the present invention.
[0036] Figure 2 This is a flowchart of the pixel attribute evaluation method of the present invention.
[0037] Figure 3 The original image of the fused deposition modeled part.
[0038] Figure 4 The image is an enhanced image obtained by the enhancement method of the present invention.
[0039] Figure 5 This is the enhanced image obtained by processing using the fixed global threshold method. Detailed Implementation
[0040] The present application will now be described in further detail with reference to the accompanying drawings and embodiments thereof.
[0041] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0042] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0043] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0044] For ease of description, spatial relative terms such as "above," "on top of," "on the upper surface of," "above," etc., are used herein to describe the spatial positional relationship of a device or feature as shown in the figures to other devices or features. It should be understood that spatial relative terms are intended to encompass different orientations in use or operation beyond the orientation of the device as described in the figures. For example, if the device in the figures were inverted, a device described as "above" or "on top of" other devices or structures would subsequently be positioned as "below" or "under" other devices or structures. Thus, the exemplary term "above" can include both "above" and "below." The device may also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatial relative descriptions used herein will be interpreted accordingly.
[0045] Example 1
[0046] like Figure 1As shown, the present invention provides a surface image enhancement method for fused deposition modeled parts, characterized by comprising the following steps:
[0047] Step 1: Acquire surface images of the fused deposition modeling (FDM) solid parts. Acquire surface images of the fused deposition modeling (FDM) solid parts using a CMOS camera, laser scanner, or structured light scanner. The fused deposition modeling (FDM) solid parts can be sensor housings, gears, or non-standard bearing cages.
[0048] Step 2: Preprocess the surface image to obtain the image grayscale matrix. Assign weights to the RGB components of the non-edge pixels in the i-th row and j-th column, and calculate the grayscale value of the pixel in the i-th row and j-th column using weighted summation. Repeat this step to obtain the pixel grayscale values of all non-edge pixels, thus obtaining the image grayscale matrix.
[0049] In one possible embodiment, the pixel grayscale value of the non-edge pixel in the i-th row and j-th column ,in This represents the red component of the non-edge pixel in the i-th row and j-th column of the image. This represents the green component of the non-edge pixel in the i-th row and j-th column. This represents the blue component of the non-edge pixel in the i-th row and j-th column; This represents the weight of the red component of the non-edge pixel in the i-th row and j-th column. This represents the weight of the green component of the non-edge pixel in the i-th row and j-th column. This represents the weight corresponding to the blue component of the non-edge pixel in the i-th row and j-th column.
[0050] Step 3: Calculate the first central difference gradient along the first path and the second path respectively. Second central difference gradient ,in This represents the first central difference gradient obtained along the first path for the non-edge pixel in the i-th row and j-th column. This represents the second central difference gradient obtained along the second path for the non-edge pixel in the i-th row and j-th column.
[0051] The surface textures, scratches, or defects of fused deposition modeled parts have directional patterns, and these directions vary. Therefore, two paths are defined. For example, a vertical scratch, a feature sensitive only to the horizontal direction, will show a significant difference in grayscale between its left and right edges during column path traversal, making it easily identified as a feature point. However, during row path traversal, the grayscale change along the scratch length is minimal, leading to it being classified as background. Joint judgment using both paths provides high sensitivity to features in any direction. A pixel exhibiting sufficient grayscale change on either path will be identified as a feature point, achieving feature detection and enhancing the algorithm's robustness.
[0052] In one possible embodiment, the first path is a row path, which focuses on pixel gradient changes in the vertical direction, primarily detecting features in the vertical direction. The second path is a column path, which corresponds to pixel gradient changes in the horizontal direction, primarily detecting features in the vertical direction. Combining the two paths enables multi-directional feature capture within a two-dimensional plane, ensuring that no abrupt changes in surface topography are missed.
[0053] The first path is a row path, according to the formula. Calculate the first central difference gradient, where This represents the grayscale value of a non-edge pixel in the (i+1)th row and jth column. This represents the grayscale value of a non-edge pixel in the (i-1)th row and jth column. Indicates the row spacing in pixels along the row path.
[0054] From calculation As can be seen from the formula, the difference is calculated by taking the pixel grayscale values of the same column in the (i+1)th row and the (i-1)th row. The row path is calculated along the row direction, that is, the vertical direction.
[0055] In surface image analysis of fused deposition modeled (FDM) parts, the first central difference gradient represents the degree of grayscale variation of pixels in the surface image of the FDM part in the vertical direction. For example, the first central difference gradient... A larger value indicates a higher pixel grayscale value. and pixel grayscale value Significant differences indicate that the surface morphology of the part changes drastically along the vertical direction in this region, with obvious surface features such as the edges of printed layers, protrusions or depressions caused by uneven material accumulation, and the boundaries of defects such as wire drawing, scratches, and holes. For example, the first central differential gradient... A smaller value indicates a lower pixel grayscale value. and pixel grayscale value A gentle difference indicates that the surface of the part is relatively smooth in the vertical direction and the material is evenly distributed.
[0056] The second path is a column path, according to the formula. Calculate the second central difference gradient, where This represents the grayscale value of a non-edge pixel in the i-th row and j+1-th column. This represents the grayscale value of a non-edge pixel in the i-th row and (j-1)-th column. This indicates the pixel row spacing of the column path.
[0057] From calculation As can be seen from the formula, the difference is calculated by taking the pixel grayscale values of the same row in column j+1 and column j-1. The column path is the column and row direction, that is, the horizontal direction.
[0058] In surface image analysis of fused deposition modeled (FDM) parts, the second central difference gradient represents the degree of grayscale variation of pixels in the surface image of the FDM part in the horizontal direction. For example, the second central difference gradient... A larger value indicates a higher pixel grayscale value. and pixel grayscale value The significant differences indicate that the surface morphology of the part changes drastically along the horizontal direction in this region, exhibiting distinct surface features. For example, the second central differential gradient. A smaller value indicates a lower pixel grayscale value. and pixel grayscale value Small differences indicate that the surface of the part is relatively smooth in the horizontal direction and the material is evenly distributed in this area.
[0059] Step 4: Construct the first attribute determination function , , This represents the median of all first-center difference gradients in the image. This represents the squared difference of the first center difference gradient of the non-edge pixel in the i-th row and j-th column. This represents the variance of the first central difference gradient.
[0060] This is the median of all first-center difference gradients in the image, reflecting the typical grayscale variation of the part's surface in the vertical direction. For example... A large value indicates that there are many pairs of pixels with significant grayscale differences along the row path in the image. This means that the surface of the 3D solid part manufactured by the fused deposition modeling process has many textures, undulations, or defects in the row direction, such as printing layer patterns or uneven material deposition, resulting in significant differences in pixel grayscale. A smaller value indicates that most pixels in the image have a gradual change in grayscale along the row path, meaning that the surface of the three-dimensional solid part manufactured by the fused deposition modeling process is relatively smooth and uniform.
[0061] In one possible embodiment, the first central difference gradients in the image are obtained by traversing the first path for non-edge pixels. The absolute values of the first central difference gradients are then sorted in ascending order to obtain the median of the first central difference gradients. .
[0062] The square of the difference in the gradient of the first central difference is given. , This represents the mean of the absolute values of all first central difference gradients in the image. Used to characterize the degree of grayscale deviation of a single non-edge pixel in the vertical direction. If A large value indicates that there are regions of abrupt morphological changes on the surface of the fused deposition modeled part; A smaller value indicates that the surface of the fused deposition modeled part is relatively uniform and smooth.
[0063] Let Variance be the variance of the first central difference gradient. First central difference gradient , This represents the mean of the absolute values of all first-center difference gradients in the image. Used to measure the degree of grayscale deviation of all pixels in the vertical direction.
[0064] First attribute determination function The molecules are This is used to quantify the degree of deviation of the non-edge pixel in the i-th row and j-th column from the typical grayscale change of the surface in the vertical direction; the first attribute determination function. The denominator is This is used to quantify whether the grayscale deviation of a non-edge pixel in the i-th row and j-th column in the vertical direction constitutes a significant anomaly. The absolute value of the first attribute determination function is... This represents the degree of deviation between the grayscale change of a non-edge pixel in the i-th row and j-th column in the vertical direction and the normal grayscale change of the part surface. First attribute determination function. The numerator introduces the median, and the denominator introduces the variance, making... It can simultaneously take into account the central tendency and dispersion of abrupt changes in the geometric morphology of the surface image itself, which helps to distinguish significant abnormal changes from normal background fluctuations and reduce misjudgments and missed judgments.
[0065] Construct a second attribute determination function , , This represents the median of all second-center difference gradients in the image. This represents the squared difference of the second center difference gradient of the non-edge pixel in the i-th row and j-th column. This represents the variance of the second central difference gradient.
[0066] For the second attribute determination function , , , This represents the mean of the absolute values of all second-center difference gradients in the image. ; Here, m represents the number of rows in the image, and n represents the number of columns. For non-edge pixels, traverse along the second path to obtain all second central difference gradients in the image. Sort the absolute values of the second central difference gradients from smallest to largest to obtain the median of the second central difference gradients. .
[0067] The absolute value of the second attribute determination function. This indicates the degree of deviation between the grayscale change of the non-edge pixel in the i-th row and j-th column in the horizontal direction and the normal grayscale change of the part surface.
[0068] Step 5: Calculate the first attribute determination function value of the non-edge pixels in the i-th row and j-th column of the image grayscale matrix. Second attribute determination function value .
[0069] For a 3D solid part formed by fused deposition modeling, an image of its surface is acquired, and then the first attribute determination function value of each non-edge pixel is calculated. Second attribute determination function value .
[0070] For each non-edge pixel, in the first attribute determination function In the expression, only the median of the first central difference gradient is present. The value is fixed, therefore the value of the first attribute determination function is... It is calculated based on the surface features of the current fused deposition modeled parts. It can adapt to the surface features of different fused deposition modeled parts, replacing the fixed threshold in traditional algorithms. It does not require repeated attempts to set a fixed threshold under different lighting and contrast conditions, and does not require repeated trial and error. It ensures that feature points and background points can be accurately distinguished in various scenarios, providing a judgment standard for subsequent image enhancement.
[0071] Step Six, if Proceed to step 601, if Proceed to step 602, where represents the average grayscale value of all non-edge pixels in the image, and b represents the number of bits in the image.
[0072] This is the median grayscale value of a b-bit image. For an 8-bit image, b=8, and the pixel grayscale value is 2. 8-1 =2 7=128.
[0073] when The image is considered to be too bright overall, and grayscale values are assigned to the brighter image according to step 601; when The image is considered to be dark overall, and grayscale values are assigned to the darker image according to step 602.
[0074] Step 601: or Then, the attribute of the non-edge pixel in the i-th row and j-th column is determined as a feature point, and its pixel gray value is determined. Perform enhancement assignment; otherwise, adjust the pixel grayscale value. Perform a weakened assignment.
[0075] The absolute value of the first central difference gradient This represents the degree of grayscale change of a non-edge pixel in the i-th row and j-th column in the vertical direction; the absolute value of the first attribute determination function. This indicates the degree of deviation between the grayscale change of a non-edge pixel in the i-th row and j-th column in the vertical direction and the normal grayscale change of the part surface. Comparing the two, if... This indicates that the grayscale change at this point in the vertical direction exceeds the normal deviation, corresponding to a real abrupt change in the surface morphology of the part in the vertical direction, and is therefore identified as a feature point; similarly, if If a pixel exhibits a genuine abrupt change in shape along the horizontal direction, it is classified as a feature point. Conversely, if the pixel shows no change in grayscale value, it is classified as a background point, indicating that the grayscale variation is within the normal range of the background. A pixel is considered a feature point if it is identified as such on any path.
[0076] For a brighter image, the background is a relatively darker area, and feature points are brighter details relative to the background. When non-edge pixels... or If the pixel is determined to be a feature point, it is enhanced and assigned a value. For an 8-bit image, b=8, the pixel grayscale value is 2. 8 =256, displayed as pure white. Otherwise, it is considered a background point, and its pixel grayscale value is determined. A weakening assignment is performed, with a value of 0, displaying it as pure black. The enhanced feature points are displayed as white pixels on a pure black background, making the feature points brighter, preserving the grayscale levels of the slightly brighter image, and maximizing the contrast between the feature and the background. Even subtle layer edges and minor streaks can be identified at a glance.
[0077] Step 602: If or If it is determined to be a feature point, its pixel grayscale value is then analyzed. Perform a weakened assignment; otherwise, adjust the pixel grayscale value. Perform an enhancement assignment.
[0078] For darker images, the background is a relatively brighter area, while feature points are darker details relative to the background. Therefore, the assignment is reversed: when enhancing feature points, a value of 0 is assigned, making the feature point pure black and thus darker; when weakening background points, a value of 0 is assigned. The background is pure white, which preserves the grayscale levels of the dark image while maximizing the contrast between the features and the background, highlighting the feature points in the background and achieving an enhancement effect.
[0079] The image is divided into two types, bright and dark, and enhanced with different values. This makes the bright feature points in the bright image brighter and the dark feature points in the dark image darker, preserving the grayscale levels of the image, maximizing the contrast between features and the background, avoiding misjudgment of noise and real features, and making features that were originally blurry and difficult to identify in the image grayscale matrix become exceptionally clear and prominent, adapting to the image enhancement needs of fused deposition modeling with different brightness levels.
[0080] Step 7: Repeat steps 5 and 6 until all non-edge pixels are traversed, generating a new image grayscale matrix and restoring the enhanced surface image of the fused deposition modeled part.
[0081] The enhancement method of this invention significantly improves the grayscale contrast between feature points and background points by employing a technical solution that includes calculating the dual-path center difference gradient, constructing an attribute determination function based on the center difference gradient, determining pixel attributes, and classifying and assigning grayscale values according to image brightness. The dual-path center difference gradient enables multi-directional feature capture within a two-dimensional plane, ensuring no abrupt changes in surface morphology are missed. The attribute determination function, constructed based on the center difference gradient and calculated based on the image's own features, is used as the attribute judgment threshold. This eliminates the need for manual trial-and-error to set fixed thresholds, adapting to the surface features of different fused deposition modeling (FDM) parts and ensuring accurate differentiation between feature points and background points in various scenarios. Classifying and assigning values according to image brightness preserves the original grayscale levels, maximizing the contrast between features and background, and adapting to the enhancement needs of FDM images with varying brightness. The absolute value of the center difference gradient is compared with the absolute value of the attribute determination function to determine pixel attributes, distinguishing between true surface features and background noise, while effectively avoiding missed detections or misjudgments caused by fixed thresholds.
[0082] Enhanced surface images of fused deposition modeled parts provide a clear basis for subsequent machine vision inspection or manual observation, and can be applied to scenarios such as contour extraction, defect identification, non-destructive testing, and quality assessment.
[0083] Example 2
[0084] This embodiment provides a surface image enhancement system for fused deposition modeled parts, comprising: a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement a surface image enhancement method for fused deposition modeled parts.
[0085] It should be noted that the system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.
[0086] This system can be deployed on various platforms or devices and can enhance surface images of fused deposition modeled parts in real-world scenarios.
[0087] Performance testing
[0088] The fused deposition modeled part is removed, and an image acquisition system consisting of a CMOS industrial area array camera and supporting equipment is used to acquire surface images of the fused deposition modeled part. The acquired surface images are saved in .jpg format.
[0089] The original images acquired are Figure 3 The image obtained after processing by the enhancement method of the present invention is Figure 4 The image obtained by processing using the fixed global threshold method is Figure 5 .
[0090] Compare Figure 3 and Figure 4 As can be seen, the enhancement method of the present invention has achieved a clear enhancement effect on the contour boundary, surface stripe anomaly, surface roughness change, boundary deposition anomaly, wire drawing and other features of the fused deposition modeled parts, making the originally blurry details easier to identify.
[0091] Compare Figure 4 and Figure 5 As you can see, Figure 4 It has significant advantages in enhancing features such as contour clarity, surface texture detail, surface roughness, and the ability to identify wire drawing defects. Figure 5 It only has a certain image enhancement effect in some local areas, but the overall details are lost and the expression is poor. It is not enough to enhance the features at the pixel level.
[0092] The enhancement method of the present invention enhances multiple features of the surface image of fused deposition modeled parts. It can distinguish between the real features of the part surface and background noise, clearly highlight the originally blurred details, and perform well in preserving pixel-level details. It is better suited to the complex and diverse features and strong texture correlation of the surface image of fused deposition modeled parts.
[0093] The above description is merely an embodiment of this application and does not constitute any limitation on this application. Any simple modifications, alterations, or equivalent structural changes made to the above embodiments based on the technical essence of this application shall still fall within the protection scope of the technical solution of this application.
Claims
1. A method of surface image enhancement of a fused deposition modeling part, characterized by, Includes the following steps: Step 1: Acquire surface images of the fused deposition modeled 3D solid part; Step 2: Preprocess the surface image to obtain the image grayscale matrix; Step 3: Calculate the first central difference gradient along the first path and the second path respectively. Second central difference gradient ,in This represents the first central difference gradient obtained along the first path for the non-edge pixel in the i-th row and j-th column. This represents the second central difference gradient obtained along the second path for the non-edge pixel in the i-th row and j-th column; Step 4: Construct the first attribute determination function , , This represents the median of all first-center difference gradients in the image. This represents the squared difference of the first center difference gradient of the non-edge pixel in the i-th row and j-th column. Represent the variance of the first central difference gradient; construct the second attribute determination function. , , This represents the median of all second-center difference gradients in the image. This represents the squared difference of the second center difference gradient of the non-edge pixel in the i-th row and j-th column. This represents the variance of the second central difference gradient; Step five, calculating the first attribute decision function value of the non-edge pixel point in the i-th row and j-th column of the image gray matrix and the second attribute decision function value ; Step Six, if Proceed to step 601, if Proceed to step 602, where represents the average gray value of all non-edge pixels in the image, and b represents the number of bits in the image; Step 601: If or Then, the attribute of the non-edge pixel in the i-th row and j-th column is determined as a feature point, and its pixel gray value is determined. Perform enhancement assignment; otherwise, modify the pixel grayscale value. Perform a weakened assignment; Step 602: If or If it is determined to be a feature point, its pixel grayscale value is then analyzed. Perform a weakened assignment; otherwise, adjust the pixel grayscale value. Perform enhancement assignment; Step 7: Repeat steps 5 and 6 until all non-edge pixels are traversed, generating a new image grayscale matrix and restoring the enhanced surface image of the fused deposition modeled part.
2. A method of surface image enhancement of a fused deposition modeling part according to claim 1, characterized in that: In step three, the first path is a row path, according to the formula... Calculate the first center difference gradient of the non-edge pixel in the i-th row and j-th column, where This represents the grayscale value of a non-edge pixel in the (i+1)th row and jth column. This represents the grayscale value of a non-edge pixel in the (i-1)th row and jth column. Indicates the row spacing in pixels along the row path.
3. A method of surface image enhancement of a fused deposition modeling part according to claim 1 or 2, characterized in that: In step three, the second path is a column path, according to the formula. Calculate the second central difference gradient, where This represents the grayscale value of a non-edge pixel in the i-th row and j+1-th column. This represents the grayscale value of a non-edge pixel in the i-th row and (j-1)-th column. This indicates the pixel row spacing of the column path.
4. A method of surface image enhancement of a fused deposition modeling part according to claim 1, characterized in that: The method for calculating pixel gray values in an image gray matrix is as follows: assign weights to the RGB three color components of each non-edge pixel in the image, and obtain the pixel gray value through weighted calculation.
5. A method of surface image enhancement of a fused deposition modeling part according to claim 1, wherein: In step four, , This represents the mean of the absolute values of all first-center difference gradients in the image. ; , where m represents the number of rows in the image and n represents the number of columns in the image.
6. A method of surface image enhancement of a fused deposition modeling part according to claim 1, characterized in that: In step four, , This represents the mean of the absolute values of all second-center difference gradients in the image. ; , where m represents the number of rows in the image and n represents the number of columns in the image.
7. A method of surface image enhancement of a fused deposition modeling part according to claim 1, wherein: In step 601, the enhanced assignment is assigned to 0 in the weakened assignment. 0 in the weakened assignment. 8. A method of surface image enhancement of a fused deposition modeling part according to claim 1, characterized in that: In step 602, during the weakening assignment, the following is performed: Assigning a value of 0 enhances the assignment process. Assigned value .
9. A method of surface image enhancement of a fused deposition modeling part according to claim 1, characterized in that: Traverse the first path for non-edge pixels to obtain all first central difference gradients in the image. Sort the absolute values of the first central difference gradients from smallest to largest to obtain the median of the first central difference gradients. Traverse the second path for non-edge pixels to obtain all second central difference gradients in the image. Sort the absolute values of the second central difference gradients from smallest to largest to obtain the median of the second central difference gradients. .
10. A system for surface image enhancement of a fused deposition modeling part, characterized in that, include: The processor and memory, the memory storing a computer program, the processor executing the computer program for implementing the surface image enhancement method for fused deposition modeled parts according to any one of claims 1 to 9.
Citation Information
Patent Citations
Concrete 3D printing component fine detection method based on machine vision
CN113506246A
Fused deposition modeling product buckling deformation online monitoring method based on image recognition
CN117437195A