Visual Inspection Methods and Systems for Powder Metallurgy Parts
By adopting an adaptive visual inspection method based on center importance, the problems of poor adaptability and insufficient robustness in the inspection of powder metallurgy parts are solved. This method enables high-precision inspection of complex backgrounds and various defects, thereby improving the accuracy and efficiency of inspection.
Patent Information
- Application Number
- CN202511133916.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-14
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-08-14
AI Technical Summary
Existing visual inspection methods for powder metallurgy parts have poor adaptability, insufficient feature fusion, low robustness, and difficulty in effectively identifying complex backgrounds and various defects, resulting in high false detection and false negative rates.
An adaptive visual detection method based on center importance is adopted. By acquiring grayscale images, the window scale coefficient, global grayscale center point and center point offset coefficient are calculated. Combined with multidimensional feature space and global-local dual correction mechanism, the region of interest and non-region of interest are divided and scale transformation is performed to achieve high-precision defect detection.
It improves the adaptability and sensitivity of detection, achieves effective fusion of multiple features, enhances the robustness and accuracy of detection, reduces false detection rate and false negative rate, and meets the real-time detection needs of the production line.
Smart Images

Figure CN120672747B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of powder metallurgy manufacturing, specifically to a visual inspection method and system for powder metallurgy parts, and particularly to an adaptive visual inspection technology based on center importance. Background Technology
[0002] Powder metallurgy is a process for manufacturing metal parts by pressing and sintering metal powders. It is widely used in the automotive, home appliance, and aerospace industries. Due to its special manufacturing process, powder metallurgy parts are prone to surface defects such as cracks, porosity, surface scratches, and burrs. These defects can seriously affect the quality and service life of the product.
[0003] Traditional quality inspection of powder metallurgy parts largely relies on manual methods, which suffer from low efficiency, high subjectivity, and susceptibility to fatigue. With the development of machine vision technology, visual inspection systems are increasingly being applied to defect detection in powder metallurgy parts. However, existing visual inspection methods still have some limitations:
[0004] On the one hand, traditional visual inspection methods often use fixed thresholds and fixed window sizes, which are difficult to adapt to surface defects of different scales and shapes. In particular, for products with complex and varied surfaces such as powder metallurgy parts, the inspection results are often unsatisfactory.
[0005] On the other hand, existing methods usually only consider one of the local or global features, lacking an effective feature fusion mechanism, resulting in insufficient detection accuracy and robustness, especially in cases of complex backgrounds and the coexistence of multiple defects, with high false detection and false negative rates.
[0006] In addition, existing detection algorithms are mostly optimized for specific types of defects, lacking versatility and adaptability, making it difficult to meet the diverse detection needs of different types of powder metallurgy parts.
[0007] Therefore, there is an urgent need to develop a visual inspection method with adaptive capabilities and high robustness, which can effectively identify various defects on the surface of powder metallurgy parts and improve the accuracy and efficiency of inspection. Summary of the Invention
[0008] The purpose of this invention is to provide a visual inspection method and system for powder metallurgy parts, aiming to solve the problems of poor inspection adaptability, insufficient feature fusion, and low robustness in the existing technology.
[0009] This invention proposes a visual inspection method and system for powder metallurgy parts, including:
[0010] Obtain a grayscale image of the part surface;
[0011] The window scale coefficient of each pixel in the grayscale image is obtained based on the grayscale changes of other pixels within the neighborhood of each pixel in the grayscale image.
[0012] The global gray-level center point is obtained based on the gray-level distribution of the gray-level image;
[0013] For each pixel in the grayscale image, the center point offset coefficient of the pixel is obtained based on the window scale coefficient of the pixel, the grayscale difference between the pixel and other pixels in its neighborhood, the grayscale mean of the pixel and the pixels in its neighborhood, and the grayscale difference between the global grayscale center point.
[0014] The importance of a pixel to the center of the grayscale image is obtained based on the center point offset coefficient of the pixel.
[0015] Based on the center point offset coefficient of the pixel, it is divided into region of interest or region of non-interest. The scale transformation of the region of interest and region of non-interest in the grayscale image is performed by combining the center importance of each pixel to complete the visual inspection of the part.
[0016] The determination of the importance of a pixel to the center of a grayscale image includes:
[0017] Obtain the overall importance of each pixel in the grayscale image to the grayscale image;
[0018] Obtain the correction coefficient for the overall importance of local information of each pixel in the grayscale image;
[0019] The importance of a pixel to the center of the grayscale image is obtained based on the pixel's center point offset coefficient, overall importance, and correction coefficient.
[0020] Preferably, acquiring the grayscale image of the part surface includes:
[0021] Acquire images of the part surface using an industrial camera;
[0022] The image of the surface of the acquired part is converted to grayscale to obtain the grayscale image.
[0023] Preferably, the step of obtaining the window scale coefficient of each pixel in the grayscale image based on the grayscale changes of other pixels within the neighborhood of each pixel in the grayscale image includes:
[0024] For each pixel in the grayscale image, the grayscale of each pixel in the window centered on that pixel is taken as the window grayscale, and the average window grayscale of all pixels in each window is taken as the window average.
[0025] The window coefficient of all pixels in the grayscale image relative to the window average of their respective windows is used as the window scale coefficient of each pixel in the grayscale image.
[0026] Preferably, obtaining the global gray-level center point based on the gray-level distribution of the gray-level image includes:
[0027] The average gray level of all pixels in the grayscale image is taken as the first average gray level of the grayscale image;
[0028] Obtain the suspected grayscale mean values in the grayscale image whose grayscale mean is greater than the first grayscale mean value, and take the grayscale mean values of each pixel in the grayscale image that are greater than the first grayscale mean value as each suspected grayscale mean value;
[0029] Histogram statistics are performed on the gray levels of all pixels in the grayscale image to obtain the grayscale distribution histogram of the grayscale image. The grayscale distribution value corresponding to the highest peak in the grayscale distribution histogram is determined as the second grayscale mean.
[0030] Determine whether the second grayscale mean is the same as the first grayscale mean;
[0031] If the second grayscale mean is the same as the first grayscale mean, then the first grayscale mean is taken as the global grayscale center point;
[0032] If the second grayscale mean is different from the first grayscale mean, then the second grayscale mean is taken as the new first grayscale mean, and the operation of performing histogram statistics on the grayscale of all pixels in the grayscale image is returned to obtain the grayscale distribution histogram of the grayscale image.
[0033] Preferably, the determination of the importance of a pixel to the center of the grayscale image includes:
[0034] The initial feature value of the pixel is obtained based on the center point offset coefficient of the pixel;
[0035] Based on the initial feature values of the pixels in the neighborhood of the pixel after window downsampling at the window scale coefficient and the corresponding window scale coefficient, the overall transformation scale of the grayscale image is obtained.
[0036] Based on the initial feature value of the pixel, the overall transformation scale, the difference between the global grayscale center point and the pixel, the transformation scale under the window corresponding to the window scale coefficient where the pixel is located, and the global grayscale center point, the overall importance of the pixel to the grayscale image is obtained.
[0037] Based on the correction coefficient of the importance of the pixel to the whole by the pixels in the neighborhood of the pixel and the transformation scale under the window corresponding to the window scale coefficient of the pixel, the correction coefficient of the local information of the pixel to the overall importance is obtained.
[0038] The importance of the pixel to the center of the grayscale image is obtained based on the initial feature value of the pixel and the correction coefficient.
[0039] Preferably, the step of determining the overall importance of a pixel to the grayscale image based on the pixel's initial feature value, the overall transformation scale, the difference between the pixel and the global grayscale center point, the transformation scale of the window containing the pixel, and the global grayscale center point includes:
[0040] Based on the window scale coefficient of the window where the pixel is located, the average transformation scale of all pixels in the window of the pixel is obtained.
[0041] Based on the window scale coefficient, the average transformation scale of other pixels in the pixel window, excluding the pixel itself, is obtained;
[0042] The overall importance of a pixel to the grayscale image is obtained based on the average transformation scale of all pixels in the pixel window, the average transformation scale of other pixels in the pixel window besides the pixel itself, the grayscale difference between the pixel and the global grayscale center point, and preset parameters.
[0043] Preferably, the step of obtaining the correction coefficient for the overall importance of a pixel's local information based on the correction coefficient for the overall importance of pixels in the pixel's neighborhood and the transformation scale of the window corresponding to the window size coefficient of the pixel includes:
[0044] Calculate the average transformation scale of pixels within the neighboring window of the window containing the pixel;
[0045] Based on the overall importance of the pixel to the grayscale image, the initial feature value of the window where the pixel is located, and the average transformation scale of the pixels in the neighboring windows of the window where the pixel is located, the correction coefficient of the local information of the pixel on the overall importance is obtained.
[0046] Preferably, the step of dividing the pixel into regions of interest or non-interest regions based on the center point offset coefficient includes:
[0047] Set the center point offset coefficient threshold;
[0048] Pixels with a center point offset coefficient greater than the center point offset coefficient threshold are classified as regions of interest;
[0049] Pixels whose center point offset coefficient is less than or equal to the center point offset coefficient threshold are classified as regions of non-interest.
[0050] Morphological processing is performed on the segmentation results to eliminate isolated points and small regions, ensuring the smoothness and continuity of the region boundaries.
[0051] Preferably, the scaling transformation of the regions of interest and non-regions of interest in the grayscale image based on the center importance of each pixel includes:
[0052] Design a transformation function to enhance contrast and detail for the region of interest;
[0053] Design a transformation function to suppress noise and non-critical information for the non-interest region;
[0054] Adjust the parameters of the corresponding transformation function according to the center importance of each pixel;
[0055] Smooth transitions are applied at region boundaries to avoid discontinuous transformations.
[0056] Features are extracted from the transformed image to identify and classify surface defects of parts.
[0057] A visual inspection system for powder metallurgy parts, comprising:
[0058] Image acquisition module, used to acquire grayscale images of the part surface;
[0059] The center point offset coefficient acquisition module is used to obtain the window scale coefficient of each pixel in the grayscale image based on the grayscale changes of other pixels in the neighborhood of each pixel in the grayscale image; to obtain the global grayscale center point based on the grayscale distribution of the grayscale image; and to obtain the center point offset coefficient of the pixel based on the window scale coefficient of the pixel, the grayscale difference between the pixel and other pixels in its neighborhood, the grayscale mean of the pixel and the pixels in its neighborhood, and the grayscale difference between the global grayscale center point of the grayscale distribution.
[0060] The overall importance acquisition module is used to acquire the overall importance of each pixel in the grayscale image to the grayscale image;
[0061] The correction coefficient acquisition module is used to acquire the correction coefficient of the local information of the pixels in the grayscale image on the overall importance of the image.
[0062] The center importance acquisition module is used to obtain the overall importance of the pixel in the grayscale image based on the initial feature value of the window where the pixel is located, the overall transformation scale, the difference between the global grayscale center point and the pixel, the average transformation scale of the pixel after window downsampling according to the scale coefficient of the window where it is located, and the global grayscale center point; to obtain a correction coefficient for the local information of the pixel in the grayscale image on the overall importance based on the initial feature value of the window where the pixel is located, the overall transformation scale, and the average transformation scale of the pixel after window downsampling according to the scale coefficient of the window where it is located; and to obtain the center importance of the pixel in the grayscale image based on the initial feature value of the pixel and the correction coefficient.
[0063] The scaling module is used to divide the pixels into regions of interest or regions of non-interest based on the center point offset coefficient of each pixel, and to perform scaling transformation on the regions of interest and regions of non-interest in the grayscale image based on the center importance of each pixel, thereby completing the visual inspection of the part.
[0064] The adaptive visual inspection method based on center importance proposed in this invention achieves high-precision detection of surface defects in powder metallurgy parts by constructing a multi-dimensional feature space and a global-local dual correction mechanism. This method has the following beneficial effects:
[0065] 1. This invention establishes a mapping relationship from pixel space to feature space through adaptive window analysis and iterative localization of global grayscale center points, which can automatically adapt to surface defects of different scales and shapes, thereby improving the adaptability and sensitivity of detection.
[0066] 2. This invention introduces the concepts of multi-dimensional feature vectors and center point offset coefficients, comprehensively considering the local structure, gradient information, contrast features, and global reference relationships of pixels, thereby achieving effective fusion of multiple features and enabling more comprehensive capture of defect features.
[0067] 3. This invention innovatively proposes a method for calculating the center importance of a dual global-local correction. By combining the global importance and the local correction coefficient, a balance between global consistency and local sensitivity is achieved, thereby improving the robustness and accuracy of detection.
[0068] 4. The region division and scale transformation method based on the importance of the center in this invention can effectively highlight the region of interest, suppress background interference, and further improve the accuracy and reliability of defect detection.
[0069] 5. The method of the present invention has high computational efficiency, is suitable for real-time processing, meets the online detection requirements of the production line, and can significantly improve the quality control level and production efficiency of powder metallurgy parts. Attached Figure Description
[0070] Figure 1 This is a flowchart of the visual inspection method for powder metallurgy parts provided by the present invention;
[0071] Figure 2 This is a structural block diagram of the visual inspection system for powder metallurgy parts provided by the present invention. Detailed Implementation
[0072] Please refer to Figure 1 - Figure 2 The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0073] refer to Figure 1 The present invention provides a visual inspection method for powder metallurgy parts, comprising the following steps:
[0074] Step S1: Obtain a grayscale image of the part surface;
[0075] Step S2: Based on the grayscale changes of other pixels within the neighborhood of each pixel in the grayscale image, obtain the window scale coefficient of each pixel in the grayscale image;
[0076] Step S3: Obtain the global gray-level center point based on the gray-level distribution of the gray-level image;
[0077] Step S4: For each pixel in the grayscale image, obtain the center point offset coefficient of the pixel based on the window scale coefficient of the pixel, the grayscale difference between the pixel and other pixels in its neighborhood, the grayscale mean of the pixel and the pixels in its neighborhood, and the grayscale difference between the global grayscale center point.
[0078] Step S5: Determine the importance of a pixel to the center of the grayscale image based on the pixel's center point offset coefficient;
[0079] Step S6: Divide the pixels into regions of interest or regions of non-interest based on the center point offset coefficient. Combine the importance of the center of each pixel to perform scale transformation on the regions of interest and regions of non-interest in the grayscale image to complete the visual inspection of the part.
[0080] In step S5, obtaining the importance of a pixel to the center of a grayscale image includes: obtaining the overall importance of each pixel in the grayscale image to the overall grayscale image; obtaining the correction coefficient of the local information of each pixel in the grayscale image to the overall importance; and obtaining the importance of a pixel to the center of the grayscale image based on the pixel's center point offset coefficient, overall importance, and correction coefficient.
[0081] The following is a detailed explanation of each step:
[0082] Step S1: Obtain a grayscale image of the part surface.
[0083] In a preferred embodiment of the present invention, acquiring a grayscale image of the part surface includes: acquiring an image of the part surface using an industrial camera; and performing grayscale processing on the acquired image of the part surface to obtain a grayscale image.
[0084] Specifically, this invention uses an industrial-grade camera to acquire images of the surface of powder metallurgy parts. Preferably, a CMOS or CCD camera with a resolution of at least 5MP is used to ensure image clarity. Taking powder metallurgy brake system linings on an automotive parts production line as an example, these parts require high surface flatness and need to be inspected for micro-cracks and pores. To improve the acquisition quality, a ring-shaped LED light source with a 45° angle is used to provide uniform illumination while avoiding surface reflections that could interfere with the detection results.
[0085] The acquired raw images are usually color images (RGB format). To simplify subsequent processing, they need to be converted to grayscale images. Grayscale conversion uses a weighted average method, and the calculation formula is as follows:
[0086] ,
[0087] in, The converted grayscale value ranges from [0, 255]. This represents the red channel value of the pixel, ranging from [0, 255]. This represents the green channel value of the pixel, ranging from [0, 255]. The value is the blue channel value of the pixel, ranging from [0, 255]. This weighting method takes into account the differences in human eye sensitivity to different colors, and can preserve the main information in the image, especially the fine defects on the surface of powder metallurgy parts.
[0088] Step S2: Based on the grayscale changes of other pixels within the neighborhood of each pixel in the grayscale image, obtain the window scale coefficient of each pixel in the grayscale image.
[0089] The calculation process for the window scaling factor in this step is as follows:
[0090] For each pixel in a grayscale image, the grayscale of all pixels in the window centered on that pixel is taken as the window grayscale, and the average window grayscale of all pixels in each window is taken as the window average of that window; the window coefficient of all pixels in the grayscale image with respect to the window average of their respective windows is taken as the window scale coefficient of each pixel in the grayscale image.
[0091] In practical implementation, the first step is to select a suitable window size. In a preferred embodiment of the invention, the window size can be 3×3, 5×5, 7×7, etc., depending on the surface characteristics of the powder metallurgy parts. The specific selection is determined based on the complexity of the surface texture and the characteristics of the defects. For example, for parts with relatively smooth surfaces, such as iron-based powder metallurgy bearing rings, a smaller window size (e.g., 3×3) is selected to improve local sensitivity; for parts with more complex surface textures, such as copper-based powder metallurgy gears, a larger window size (e.g., 7×7) is selected to obtain more contextual information.
[0092] For pixel p(i,j), its average gray level within the window The calculation is as follows:
[0093] ,
[0094] in: For pixels The average grayscale value of the window in which it is located; Indicates coordinates as The grayscale value of the pixel, with a value range of [0, 255]; The radius is the window radius, which can take values of 1, 2, 3, etc., corresponding to window sizes of 3×3, 5×5, 7×7, etc. This represents the total number of pixels within the window. The summation symbol indicates that the grayscale values of all pixels within the window are summed and then divided by the number of pixels to obtain the average value.
[0095] Then, calculate the window scale factor of the pixel. :
[0096] ,
[0097] in: For pixels Window scaling factor; The standard deviation of grayscale within the window; This represents the average grayscale value within the window. This is the proportionality coefficient, with a value of 0.5. This is a small positive number, taking the value 0.0001, to avoid a denominator of zero. This formula directly uses the standard deviation as the primary metric and introduces the grayscale mean as an adjustment factor, thus preserving the original information about the grayscale variation while considering the influence of the grayscale baseline level. When the grayscale mean within the window is low, the multiplicative adjustment factor... The window scale factor is appropriately increased, which helps enhance the detection sensitivity of subtle defects in low grayscale areas. When the mean grayscale value within the window is high, the adjustment factor approaches 1, mainly relying on the standard deviation to reflect the degree of grayscale variation. This allows the window scale factor to more accurately reflect the degree of grayscale distribution variation within the neighborhood of a pixel. A larger value indicates more drastic grayscale changes in a local area, potentially indicating the presence of edges or textures; a smaller value indicates gentler grayscale changes in a local area, possibly indicating a uniform region. For powder metallurgy parts, defect areas typically exhibit drastic local grayscale changes, thus possessing a high window scale factor. For example, when inspecting iron-based powder metallurgy connecting rods, the window scale factor for cracked areas is usually above 25, while the window scale factor for normal surface areas is generally less than 10.
[0098] Standard deviation of grayscale within the window The calculation formula is:
[0099] ,
[0100] Wherein: the square root symbol represents the square root of the average of the sum of the squares of the differences between all pixels in the window and the mean, which yields the standard deviation.
[0101] Window scaling factor This reflects the degree of variation in grayscale distribution within the neighborhood of a pixel. A larger value indicates more drastic grayscale changes in a local area, potentially indicating the presence of edges or textures; a smaller value indicates gentler grayscale changes in a local area, possibly a uniform region. For powder metallurgy parts, defect areas typically exhibit drastic local grayscale changes, thus possessing a high window scale factor. For example, when inspecting iron-based powder metallurgy connecting rods, the window scale factor for cracked areas is usually above 0.5, while the window scale factor for normal surface areas is generally less than 0.2.
[0102] Step S3: Obtain the global gray-level center point based on the gray-level distribution of the gray-level image.
[0103] In this step, the process of determining the global grayscale center point is as follows:
[0104] The process involves: 1) Using the average grayscale value of all pixels in the grayscale image as the first grayscale average; 2) Obtaining the possible grayscale average values of pixels in the grayscale image whose average grayscale value is greater than the first grayscale average, and using these as the possible grayscale average values; 3) Performing histogram statistics on the grayscale values of all pixels in the grayscale image to obtain the grayscale distribution histogram of the grayscale image, and determining the grayscale distribution value corresponding to the highest peak in the grayscale distribution histogram as the second grayscale average; 4) Determining whether the second grayscale average is the same as the first grayscale average; 5) If the second grayscale average is the same as the first grayscale average, then using the first grayscale average as the global grayscale center point; 6) If the second grayscale average is different from the first grayscale average, then using the second grayscale average as the new first grayscale average, and returning to perform histogram statistics on the grayscale values of all pixels in the grayscale image to obtain the grayscale distribution histogram of the grayscale image.
[0105] In practice, the mean gray level of the entire grayscale image is first calculated. :
[0106] ,
[0107] in: The first grayscale mean; and These are the height and width of the image, respectively, in pixels. coordinates The value of the pixel at a given location is [0, 255]. This formula represents the average value of the grayscale values of all pixels in the image.
[0108] Then, count the gray values greater than For each pixel, calculate the average grayscale value of these pixels as the suspected average grayscale value:
[0109] ,
[0110] in: This is a suspected grayscale mean. This is an indicator function, taking the value 1 when the condition is true and 0 otherwise. This formula calculates the average gray value of all pixels whose gray values are greater than the first gray mean.
[0111] Next, construct the grayscale histogram of the grayscale image. And find the gray value corresponding to the highest peak in the histogram as the second gray mean. A grayscale histogram represents the frequency distribution of grayscale values in an image, with the highest peak corresponding to the grayscale value that appears most frequently in the image.
[0112] Compare and If the difference between the two is less than a preset threshold (For example, in the inspection of powder metallurgy parts, one can take...) Considering the grayscale value range is [0, 255], this threshold is small enough to ensure convergence accuracy, then convergence is considered complete. As the global grayscale center point Otherwise, As a new Then, a new histogram statistical analysis was performed. This iterative optimization method mainly solves the problem of the multi-peak characteristics of the gray-level distribution on the surface of powder metallurgy parts. Taking an image of a connecting rod made of iron-based powder metallurgy as an example, the initial gray-level mean... The calculated result was 128, but this value was affected by the grayscale of the background and edge areas, failing to accurately reflect the grayscale characteristics of the main surface of the part. A second grayscale mean was obtained through histogram analysis. The value is 143, so 143 is used as the new value. Reanalysis allows for a more focused analysis of the grayscale distribution in the main area of the part, resulting in a more accurate global grayscale center point. In practical applications, most powder metallurgy part images can obtain a stable global grayscale center point after 2-3 iterations, rarely requiring multiple iterations. Setting a maximum number of iterations ensures the algorithm's stability under special circumstances; this limit is usually not reached in practical applications. The global grayscale center point determined by this method... This method can more accurately represent the main grayscale characteristics of the part surface, providing a reliable global reference for subsequent center point offset coefficient calculation. It significantly improves the accuracy and robustness of defect detection. This advantage is particularly pronounced for powder metallurgy parts with complex surface textures or multiple material regions.
[0113] Global grayscale center point Serving as a reference point for the overall image grayscale distribution, the global grayscale center point provides a benchmark for subsequent center point offset calculations. In powder metallurgy part inspection, the global grayscale center point typically reflects the main grayscale characteristics of the part surface. For example, for iron-based powder metallurgy parts, the surface grayscale center point is usually between 120 and 150; while for copper-based parts, due to different material colors, the grayscale center point may be between 170 and 200. Accurately determining the global grayscale center point helps distinguish normal surfaces from defective areas in subsequent steps.
[0114] Step S4: For each pixel in the grayscale image, obtain the center point offset coefficient of the pixel based on the window scale coefficient of the pixel, the grayscale difference between the pixel and other pixels in its neighborhood, the grayscale mean of the pixel and the pixels in its neighborhood, and the grayscale difference between the global grayscale center point.
[0115] This step is crucial for calculating the pixel center point offset coefficient. The center point offset coefficient reflects the importance and salience of a pixel in the entire image and is the basis for subsequent region segmentation and importance calculation.
[0116] In specific implementation, for pixels Its center point offset coefficient The calculation takes into account the following four factors:
[0117] Window scaling factor : Reflects the structural complexity of a local area;
[0118] Grayscale difference between a pixel and its neighboring pixels : Reflects local gradient information;
[0119] Difference between the grayscale value of a pixel and the average grayscale value of its neighbors : Reflects local contrast;
[0120] Difference between a pixel and the global grayscale center point Establish a connection with the global reference.
[0121] Among them, local grayscale differences The calculation is as follows:
[0122] ,
[0123] in: For pixels The average grayscale difference between the pixel and its neighboring pixels; Represents pixels With pixels The absolute value of the grayscale difference; Let Kronecker function be used when The value is 1 if the condition is met, and 0 otherwise. This represents the number of pixels within the window excluding the center pixel. The formula calculates the average grayscale difference between the center pixel and all other pixels within the window.
[0124] Local mean difference The calculation is as follows:
[0125] ,
[0126] in: For pixels The difference between its average grayscale value and the value within its window; For pixels The calculation method for the average grayscale value of the window has been given in step S2. This formula represents the degree of difference between the grayscale value of the center pixel and the average grayscale value within the window.
[0127] Global differences The calculation is as follows:
[0128] ,
[0129] in: For pixels The difference from the global grayscale center point; The global grayscale center point is calculated using a method already given in step S3. This formula represents the degree of deviation of the pixel's grayscale value from the overall grayscale center of the image.
[0130] Finally, the center point offset coefficient Calculated using the following formula:
[0131] ,
[0132] in: For pixels The center point offset coefficient; and These are weighting coefficients, corresponding to the importance of the four factors, satisfying... ; and It normalizes the grayscale differences to the range of [0,1], which facilitates the weighted combination of different factors.
[0133] In a preferred embodiment of the present invention, based on the surface characteristics of the powder metallurgy parts, the following can be set: The weights can be adjusted for different types of defects: for example, for crack defect detection, the weights can be increased. (Local gradient information weights) reduced to 0.4, decrease (Global difference weight) reduced to 0.1; for porosity defect detection, it can be increased. (Local contrast weight) reduced to 0.3, decrease (Structural complexity weight) to 0.2.
[0134] To ensure the consistency and comparability of the center point offset coefficients, the calculation results are normalized:
[0135] ,
[0136] in: The normalized center point offset coefficient has a range of values. and These are the minimum and maximum values of the center point offset coefficients for all pixels, respectively.
[0137] Normalized center point offset coefficient A higher value indicates a more important pixel, making it more likely to be part of a defect area. In powder metallurgy part inspection practice, the center point offset coefficient of defect areas is usually significantly higher than that of normal areas. For example, for surface cracks, the center point offset coefficient is usually above 0.7; for porosity defects, the center point offset coefficient is usually between 0.6 and 0.8; while the center point offset coefficient of normal surface areas is generally less than 0.4.
[0138] Step S5: Obtain the importance of the pixel to the center of the grayscale image based on the center point offset coefficient of the pixel.
[0139] This step is one of the core innovations of this invention. Through a global-local dual correction mechanism, the central importance of each pixel is calculated, achieving a balance between global consistency and local sensitivity.
[0140] Specifically, this step includes the following sub-steps:
[0141] (1) Obtain the initial feature value of the pixel based on the center point offset coefficient of the pixel;
[0142] (2) Based on the initial feature values of the pixels in the neighborhood after window downsampling of the pixel and the corresponding window scale coefficient, the overall transformation scale of the grayscale image is obtained.
[0143] (3) Based on the initial feature value of the pixel, the overall transformation scale, the difference between the global gray center point and the pixel, the transformation scale under the window corresponding to the window scale coefficient where the pixel is located, and the global gray center point, the overall importance of the pixel to the grayscale image is obtained.
[0144] (4) Based on the correction coefficient of the importance of the pixel to the whole by the pixel in the neighborhood and the transformation scale of the window where the pixel is located, the correction coefficient of the local information of the pixel to the overall importance is obtained.
[0145] (5) Based on the initial feature value and correction coefficient of the pixel, the importance of the pixel to the center of the grayscale image is obtained.
[0146] First, calculate the initial feature value of the pixel based on the center point offset coefficient. :
[0147] ,
[0148] in: For pixels The initial eigenvalues, taking values in the range [0,1]; This is the normalized center point offset coefficient; This is the balance coefficient, with a value range of [0,1]. This is a natural exponential function. For the inspection of powder metallurgy parts, for the surface of general powder metallurgy parts, the preferred method is... This approach preserves the main information of the original offset coefficients, enhances the effect of high offset coefficients through nonlinear transformation, and suppresses the influence of low offset coefficients, which helps to highlight the defect area.
[0149] The specific selection method for this parameter requires comprehensive consideration of factors such as the part's material, surface characteristics, expected defect type, and inspection requirements. For parts with relatively smooth surfaces (such as bearing rings and bushings), The value can be appropriately increased to the range of 0.75-0.8, which can retain more of the original offset coefficient information and reduce the false detection rate; for parts with relatively rough surfaces or complex textures (such as gears, connecting rods, etc.), The value can be appropriately reduced to the range of 0.6-0.65 to increase the weight of the nonlinear transformation and improve the detection sensitivity for subtle defects. Considering the defect type, when detecting crack defects, due to their obvious edge features and local gray-scale gradient changes, a higher value is advisable. Value (0.7-0.75); When detecting porosity defects, since they usually appear as a gray-scale gradient area, a lower value should be used. Values (0.65-0.7) are used to enhance contrast, especially for surface scratches and defects. The value can be taken as the middle value, 0.7. Material properties will also have an impact. The selection of iron-based powder metallurgy parts is usually based on their surface reflectivity and texture characteristics. The value is typically 0.65-0.7; for copper-based powder metallurgy parts, it can be 0.7-0.75. In practical applications, comparative experiments can be conducted on typical samples to analyze the differences. Choose the value with the highest detection accuracy from the test results. For example, when testing a certain type of iron-based powder metallurgy brake pad, when λ=0.65, the detection rate of fine cracks is 92%, and the false detection rate is 8%; when λ=0.7, the detection rate is 95%, and the false detection rate is 5%; when... At a value of 0.75, the detection rate is 93% and the false positive rate is 3%. Considering both the detection rate and the false positive rate, the final selection was... =0.7 is considered the optimal value for this type of part. By scientifically and rationally selecting the balance coefficient λ, the expressive power of the initial eigenvalues can be significantly improved, providing a more accurate basis for subsequent calculations of the center importance.
[0150] Then, calculate the overall transformation scale. :
[0151] ,
[0152] in: To represent the feature distribution across the entire map by changing the scale; For pixels The initial eigenvalues; For pixels The window scale factor is calculated using this formula. It represents the weighted average of the initial feature values of each pixel across the entire image and their window scale factor, reflecting the global feature distribution of the entire image.
[0153] Next, calculate the pixel points. Average transformation scale of the window :
[0154] ,
[0155] in: For pixels The average transformation scale of the window in question; pixels within the window The initial eigenvalues; This represents the total number of pixels within the window. This formula calculates the average of the initial feature values of all pixels within the window.
[0156] And the average transformation scale of the window excluding pixel (i,j) :
[0157] ,
[0158] in: The average transformation scale of the window, excluding pixel (i,j); This is the Kronecker function, which takes the value 1 when (i,j) = (m,n), and 0 otherwise. This represents the number of pixels within the window excluding the center pixel; the formula calculates the average of the initial feature values of all pixels within the window excluding the center pixel.
[0159] Based on the above calculations, the overall importance of each pixel is obtained. :
[0160] ,
[0161] in: The overall importance of pixel (i,j); The initial feature value of the pixel; The average transformation scale of the window containing the pixel; The average transformation scale of the window excluding pixels; The difference between a pixel and the global grayscale center point; For regularization parameters; Use small positive numbers to avoid having a denominator of zero.
[0162] For the inspection of powder metallurgy parts, the preferred method is... , . The value selection takes into account the typical range of grayscale differences, with smaller values being preferred. A higher value makes the overall importance more sensitive to differences in grayscale, which is beneficial for detecting defects with small grayscale changes (such as shallow cracks); a larger value... A lower value will reduce this sensitivity, making it suitable for detecting defects with obvious grayscale contrast, such as deep holes.
[0163] Then, calculate the local correction coefficients. :
[0164] ,
[0165] in: For pixels Local correction coefficients; The overall importance of each pixel; The initial feature value of the pixel; The average transformation scale within the neighborhood window of a pixel; Use small positive numbers to avoid having a denominator of zero.
[0166] The calculation formula is:
[0167] ,
[0168] in: For pixels Average transformation scale within the neighborhood window; For pixels in the neighborhood The average transformation scale of the window in question; For weighting functions; The radius of the neighborhood window is usually taken as... ; This represents the total number of pixels within the neighborhood window.
[0169] Weighting function The calculation formula is:
[0170] ,
[0171] in: The weighting function has a range of values. ; Control the range of influence of spatial distance; Control the influence range of grayscale similarity; The weighting function is a natural exponential function. It considers both spatial distance and grayscale similarity; pixels that are closer together and have more similar grayscale values receive a greater weight.
[0172] In the inspection of powder metallurgy parts, the following can be taken: , . The choice of [value] is related to the size of the neighborhood window, ensuring that the weight of the pixels at the edge of the window is not too small; The grayscale value range [0, 255] and the grayscale variation characteristics of powder metallurgy parts surface were considered. This value is moderate, which can distinguish different areas without being overly sensitive to small grayscale changes.
[0173] Finally, the center importance of each pixel is calculated. :
[0174] ,
[0175] in: For pixels The degree of central importance; The overall importance of each pixel; This represents the local correction coefficient for each pixel. The formula multiplies the overall importance by the local correction coefficient, achieving a balance between global consistency and local sensitivity.
[0176] To ensure consistency and comparability of center importance, the calculation results were normalized:
[0177] ,
[0178] in: The normalized center importance, with a range of values. ; and These are the minimum and maximum values of the center importance of all pixels, respectively.
[0179] Normalized center importance A higher value indicates that the pixel is more important in the image and is more likely to be a key part of the defect area. In the practice of powder metallurgy parts inspection, the center importance of different types of defects varies significantly: for example, for crack defects, the center importance is usually above 0.8; for porosity defects, the center importance is usually between 0.7 and 0.9; for surface scratches, the center importance is usually between 0.6 and 0.8; while the center importance of normal surface areas is generally less than 0.5.
[0180] Step S6: Divide the pixels into regions of interest or regions of non-interest based on the center point offset coefficient. Combine the importance of the center of each pixel to perform scale transformation on the regions of interest and regions of non-interest in the grayscale image to complete the visual inspection of the part.
[0181] This step will divide the image into regions and scale it based on the previously calculated center point offset coefficient and center importance, highlighting defective areas and achieving the final visual detection.
[0182] First, the region is divided. In a preferred embodiment of the present invention, the region division includes the following sub-steps:
[0183] Set center point offset coefficient threshold ; Set the center point offset coefficient to be greater than The pixels are divided into regions of interest; the center point offset coefficient is less than or equal to The pixels are divided into regions of non-interest; the division results are morphologically processed to eliminate isolated points and small regions, ensuring the smoothness and continuity of the region boundaries.
[0184] Threshold The choice of threshold is crucial, affecting the accuracy of region segmentation. In this embodiment, an adaptive thresholding method is used to determine the threshold based on the global statistical characteristics of the image:
[0185] ,
[0186] in: The threshold value for the center point offset coefficient; and These are the mean and standard deviation of the center point offset coefficients for all pixels, respectively. The adjustment coefficient controls the sensitivity of the partitioning.
[0187] For different types of powder metallurgy parts, The value can be adjusted: for parts with relatively smooth surfaces (such as bearing rings, bushings, etc.), a value of [value] can be used. At this point, the threshold setting is relatively low, which can detect more subtle defects; for parts with more complex surface textures (such as gears, connecting rods, etc.), a higher threshold can be set. This increases the classification threshold and reduces false positives. In practical applications, it can be fine-tuned according to the specific characteristics of the parts and the testing requirements. For example, for brake pads with high precision requirements, the threshold can be further reduced. The value was increased to 0.8 to improve detection sensitivity.
[0188] To ensure the stability and continuity of the region segmentation results, morphological processing is performed on the initial segmentation results, including opening operations (erosion followed by dilation) to eliminate small noise points, and closing operations (dilation followed by erosion) to fill small holes. Specifically, 3×3 or 5×5 structuring elements can be used, with 1-2 iterations, which effectively eliminates noise without overly smoothing the boundaries. Simultaneously, regions with an area smaller than a preset threshold (e.g., 50 pixels for a 5MP image) are merged or deleted to avoid excessive fragmentation.
[0189] Then, scaling is performed. In a preferred embodiment of the invention, scaling includes the following sub-steps:
[0190] Design transformation functions to enhance contrast and detail for regions of interest; design transformation functions to suppress noise and non-critical information for regions of non-interest; adjust the parameters of the corresponding transformation functions according to the center importance of each pixel; perform smooth transition processing at region boundaries to avoid transformation discontinuities; extract features from the transformed image to identify and classify surface defects of parts.
[0191] For the region of interest, a contrast enhancement transformation function T_{ROI} is used:
[0192] ,
[0193] in: For the region of interest pixels The transformed grayscale value; The original grayscale value; The normalized center importance; This represents the average grayscale value of the local neighborhood of a pixel. The enhancement factor controls the intensity of the enhancement.
[0194] Mean gray value of the neighborhood of pixel (i,j) The calculation process is as follows:
[0195] ,
[0196] in: The grayscale mean of the neighborhood of pixel (i,j); This represents the grayscale value of the pixel at coordinates (m, n), with a value range of [0, 255]. This is the radius of the neighborhood window, usually taken as 3 or 5, corresponding to a neighborhood window size of 7×7 or 11×11; This represents the total number of pixels within the neighborhood window. The formula calculates the average grayscale value of all pixels within the neighborhood window centered at pixel (i,j). Neighborhood window radius. The choice depends on the typical size of the defect and the image resolution; for small defects or high-resolution images, a smaller size can be selected. Values should be selected to preserve local details; larger values can be chosen for large defects or low-resolution images. Use the value to obtain more contextual information.
[0197] Addressing different types of defects in powder metallurgy parts. The value can be adjusted: for crack-type defects, a value of [value] can be taken as follows: This enhances the contrast of narrow slits; for porosity defects, it can be used to... To moderately enhance the visibility of circular holes; for surface scratches, one can take... This avoids over-enhancing, which could cause normal textures to be misjudged as defects.
[0198] For regions of non-interest, a smooth transformation function is used. .
[0199] ,
[0200] in: pixels in the region of interest The transformed grayscale value; This represents the average grayscale value of the local neighborhood of a pixel. The original grayscale value; The normalized center importance; The smoothing coefficient controls the intensity of smoothing.
[0201] In the inspection of powder metallurgy parts, the following can be taken: This value effectively suppresses interference from non-defect areas while retaining sufficient background reference information. It can also be adjusted appropriately for parts with varying surface complexities: for parts with relatively uniform surfaces, a value of [value missing] can be used. Further smooth the background; for parts with obvious surface textures, you can take... Preserve appropriate texture information as a reference.
[0202] To ensure a smooth transition at the regional boundaries, a weighted average is applied to the boundary areas:
[0203] ,
[0204] in: For the boundary region pixels The transformed grayscale value; The transformation function is the region of interest. For transformation functions of regions of non-interest; This is the distance from the pixel to the nearest region boundary; This is the weighting function.
[0205] Weighting function The calculation formula is:
[0206]
[0207] in: The weighting function has a range of values. ; This is the distance from a pixel to the nearest region boundary, in pixels. This is the boundary transition threshold, in pixels. The weighting function is a sine function. This weighting function ensures a smooth transition in the boundary region, avoiding obvious boundary lines in the transformed image.
[0208] In the inspection of powder metallurgy parts, the following can be taken: The pixel value is moderate, ensuring a smooth transition without excessively blurring the boundaries. For high-resolution images or larger parts, this value can be increased to 8-10 pixels; for small parts or applications requiring precise positioning of defect boundaries, it can be reduced to 3-4 pixels.
[0209] Finally, defect detection and classification are performed on the transformed image. Based on common defect types in powder metallurgy parts, defects can be categorized into several major types, including surface cracks, porosity defects, surface scratches, dimensional deviations, surface burrs, and deformation defects. For different types of defects, corresponding feature parameters are extracted, such as area, perimeter, aspect ratio, roundness, average gray level, and gray level standard deviation. Defect identification and classification are then performed using feature matching or classification algorithms.
[0210] For example, crack defects are characterized by being elongated (aspect ratio > 5) and having low grayscale (20–50 units lower than the surrounding area); pore defects are characterized by being round or elliptical (circularity > 0.8) and having low grayscale; surface burrs are characterized by localized areas with high grayscale (15–40 units higher than the surrounding area) and sharp edges (gradient value > 30). These different types of defects can be accurately identified through feature template matching.
[0211] Furthermore, the severity of defects can be assessed by calculating parameters such as the defect area, depth (estimated based on grayscale differences), and location, classifying defect severity into four levels: minor, moderate, severe, and catastrophic. For example, for a bearing bushing with a diameter of 2mm, a pore area less than 0.01mm² is considered minor, 0.01–0.05mm² is moderate, 0.05–0.1mm² is severe, and greater than 0.1mm² is catastrophic. Defect location also affects severity assessment; for instance, defects located in critical stress areas are more severe than defects of the same size located at edges. These assessment results provide a basis for subsequent quality control and defect handling.
[0212] refer to Figure 2 The present invention also provides a visual inspection system for parts processed by powder metallurgy, comprising:
[0213] Image acquisition module 1 is used to acquire a grayscale image of the part surface; center point offset coefficient acquisition module 2 is used to obtain the window scale coefficient of each pixel in the grayscale image based on the grayscale changes of other pixels in the neighborhood of each pixel in the grayscale image; obtain the global grayscale center point based on the grayscale distribution of the grayscale image; obtain the center point offset coefficient of the pixel based on the window scale coefficient of the pixel, the grayscale difference between the pixel and other pixels in its neighborhood, the grayscale mean of the pixel and the pixels in its neighborhood, and the grayscale difference between the global grayscale center point of the grayscale distribution; overall importance acquisition module 3 is used to obtain the overall importance of each pixel in the grayscale image to the grayscale image; correction coefficient acquisition module 4 is used to obtain the correction coefficient brought by the local information of the pixels in the grayscale image to the overall importance.
[0214] The center importance acquisition module 5 is used to obtain the overall importance of a pixel in a grayscale image based on the initial feature value of the window where the pixel is located, the overall transformation scale, the difference between the global grayscale center point and the pixel, the average transformation scale of the pixel after window downsampling according to the scale coefficient of the window where it is located, and the global grayscale center point; to obtain the correction coefficient of the local information of the pixel in the grayscale image on the overall importance based on the initial feature value of the window where the pixel is located, the overall transformation scale, and the average transformation scale of the pixel after window downsampling according to the scale coefficient of the window where it is located; and to obtain the center importance of the pixel in the grayscale image based on the initial feature value of the pixel and the correction coefficient.
[0215] The scaling module 6 is used to divide the pixel into regions of interest or regions of non-interest based on the center point offset coefficient of the pixel, and to perform scaling transformation on the regions of interest and regions of non-interest in the grayscale image based on the center importance of each pixel, so as to complete the visual inspection of the part.
[0216] In a preferred embodiment of the present invention, the system further includes: a result output module 7 for displaying the detection results, including information such as defect location, type, and severity; a parameter setting module 8 for setting and adjusting the parameters of each module, such as window size, weight coefficient, and threshold; a data storage module 9 for storing the detection results and historical data, supporting quality trend analysis and traceability; and a communication interface module 10 for exchanging data with a host computer, industrial control computer, or other devices.
[0217] The modules exchange data through standardized interfaces, forming a closed-loop processing flow. The system adopts a modular design, facilitating maintenance and upgrades. Each module can be optimized for parameters according to actual needs, improving the system's adaptability and flexibility.
[0218] In terms of hardware implementation, the system can be built on an industrial computer or embedded platform, configured with sufficient computing resources (such as Intel i7 / i9 processors, 16GB or more of memory, NVIDIA GTX1660 or higher GPUs) to meet real-time processing requirements. For standard powder metallurgy parts, the system processing speed can reach 10-15 pieces / second, meeting the real-time inspection needs of the production line. The image acquisition equipment uses industrial-grade cameras with a resolution of no less than 5MP, equipped with a ring LED light source system to ensure image quality. The system supports multiple communication protocols (such as Profinet, EtherCAT, ModbusTCP, etc.) for easy integration with the production line.
[0219] This system can be flexibly deployed at different stages of a powder metallurgy production line, such as post-forming inspection (detecting forming defects such as uneven density and cracks), pre-sintering inspection (detecting surface contamination and micro-cracks), or final quality inspection (comprehensive detection of various defects). Parameter configurations can be adjusted according to the inspection needs of different stages. The system also supports integration with enterprise information systems such as MES and ERP to achieve closed-loop management of quality data.
[0220] The visual inspection method and system for powder metallurgy parts provided by this invention can effectively identify various defects on the surface of powder metallurgy parts, greatly improve the accuracy and efficiency of inspection, significantly improve the level of product quality control, and bring significant economic benefits to powder metallurgy manufacturing enterprises.
[0221] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A visual inspection method for parts processed by powder metallurgy, characterized in that, The method includes: Obtain a grayscale image of the part surface; The window scale coefficient of each pixel in the grayscale image is obtained based on the grayscale changes of other pixels within the neighborhood of each pixel in the grayscale image. The global gray-level center point is obtained based on the gray-level distribution of the gray-level image; For each pixel in the grayscale image, the center point offset coefficient of the pixel is obtained based on the window scale coefficient of the pixel, the grayscale difference between the pixel and other pixels in its neighborhood, the grayscale mean of the pixel and the pixels in its neighborhood, and the grayscale difference between the global grayscale center point. The importance of a pixel to the center of the grayscale image is obtained based on the center point offset coefficient of the pixel. Based on the center point offset coefficient of the pixel, it is divided into region of interest or region of non-interest. The scale transformation of the region of interest and region of non-interest in the grayscale image is performed by combining the center importance of each pixel to complete the visual inspection of the part. The determination of the importance of a pixel to the center of a grayscale image includes: Obtain the overall importance of each pixel in the grayscale image to the grayscale image; Obtain the correction coefficient for the overall importance of local information of each pixel in the grayscale image; The importance of a pixel to the center of the grayscale image is obtained based on the pixel's center point offset coefficient, overall importance, and correction coefficient.
2. The visual inspection method for powder metallurgy parts according to claim 1, characterized in that, The process of acquiring a grayscale image of the part surface includes: Acquire images of the part's surface using an industrial camera; The image of the surface of the acquired part is converted to grayscale to obtain the grayscale image.
3. The visual inspection method for powder metallurgy parts according to claim 1, characterized in that, The step of obtaining the window scale coefficient of each pixel in the grayscale image based on the grayscale changes of other pixels within the neighborhood of each pixel includes: For each pixel in the grayscale image, the grayscale of each pixel in the window centered on that pixel is taken as the window grayscale, and the average window grayscale of all pixels in each window is taken as the window average. The window coefficient of all pixels in the grayscale image relative to the window average of their respective windows is used as the window scale coefficient of each pixel in the grayscale image.
4. The visual inspection method for parts processed by powder metallurgy according to claim 1, characterized in that, The step of obtaining the global gray-level center point based on the gray-level distribution of the gray-level image includes: The average gray level of all pixels in the grayscale image is taken as the first average gray level of the grayscale image; The grayscale average value of each pixel in the grayscale image that is greater than the first grayscale average value is taken as the suspected grayscale average value. Histogram statistics are performed on the gray levels of all pixels in the grayscale image to obtain the grayscale distribution histogram of the grayscale image. The grayscale distribution value corresponding to the highest peak in the grayscale distribution histogram is determined as the second grayscale mean. Determine whether the second grayscale mean is the same as the first grayscale mean; If the second grayscale mean is the same as the first grayscale mean, then the first grayscale mean is taken as the global grayscale center point; If the second grayscale mean is different from the first grayscale mean, then the second grayscale mean is taken as the new first grayscale mean, and the operation of performing histogram statistics on the grayscale of all pixels in the grayscale image is returned to obtain the grayscale distribution histogram of the grayscale image.
5. The visual inspection method for powder metallurgy parts according to claim 1, characterized in that, The determination of the importance of a pixel to the center of a grayscale image includes: The initial feature value of the pixel is obtained based on the center point offset coefficient of the pixel; Based on the initial feature values of the pixels in the neighborhood of the pixel after window downsampling at the window scale coefficient and the corresponding window scale coefficient, the overall transformation scale of the grayscale image is obtained. Based on the initial feature value of the pixel, the overall transformation scale, the difference between the global grayscale center point and the pixel, the transformation scale under the window corresponding to the window scale coefficient where the pixel is located, and the global grayscale center point, the overall importance of the pixel to the grayscale image is obtained. Based on the correction coefficient of the importance of the pixel to the whole by the pixels in the neighborhood of the pixel and the transformation scale under the window corresponding to the window scale coefficient of the pixel, the correction coefficient of the local information of the pixel to the overall importance is obtained. The importance of the pixel to the center of the grayscale image is obtained based on the initial feature value of the pixel and the correction coefficient.
6. The visual inspection method for powder metallurgy parts according to claim 5, characterized in that, The method of determining the overall importance of a pixel to a grayscale image based on its initial feature value, overall transformation scale, the difference between the pixel and the global grayscale center point, the transformation scale within the window corresponding to the pixel's window scale coefficient, and the global grayscale center point includes: Based on the window scale coefficient of the window where the pixel is located, the average transformation scale of all pixels in the window of the pixel is obtained. Based on the window scale coefficient, the average transformation scale of other pixels in the pixel window, excluding the pixel itself, is obtained; The overall importance of a pixel to the grayscale image is obtained based on the average transformation scale of all pixels in the pixel window, the average transformation scale of other pixels in the pixel window besides the pixel, the grayscale difference between the pixel and the global grayscale center point, and preset parameters.
7. The visual inspection method for powder metallurgy parts according to claim 5, characterized in that, The step of obtaining the correction coefficient for the overall importance of a pixel's local information based on the correction coefficient of the pixels in the pixel's neighborhood to the overall importance, and the transformation scale of the window corresponding to the window scale coefficient of the pixel, includes: Calculate the average transformation scale of pixels within the neighboring window of the window containing the pixel; Based on the overall importance of the pixel to the grayscale image, the initial feature value of the window where the pixel is located, and the average transformation scale of the pixels in the neighboring windows of the window where the pixel is located, the correction coefficient of the local information of the pixel on the overall importance is obtained.
8. The visual inspection method for powder metallurgy parts according to claim 1, characterized in that, The step of dividing the pixel into regions of interest or non-interest regions based on the center point offset coefficient includes: Set the center point offset coefficient threshold; Pixels with a center point offset coefficient greater than the center point offset coefficient threshold are classified as regions of interest; Pixels whose center point offset coefficient is less than or equal to the center point offset coefficient threshold are classified as regions of non-interest. Morphological processing is performed on the segmentation results to eliminate isolated points and small regions, ensuring the smoothness and continuity of the region boundaries.
9. The visual inspection method for powder metallurgy parts according to claim 1, characterized in that, The scaling transformation of the regions of interest and non-regions of interest in the grayscale image based on the center importance of each pixel includes: Design a transformation function to enhance contrast and detail for the region of interest; Design a transformation function to suppress noise and non-critical information for the non-interest region; Adjust the parameters of the corresponding transformation function according to the center importance of each pixel; Smooth transitions are applied at region boundaries to avoid discontinuous transformations. Features are extracted from the transformed image to identify and classify surface defects of parts.
10. A visual inspection system for parts processed by powder metallurgy, characterized in that, The system includes: Image acquisition module, used to acquire grayscale images of the part surface; The center point offset coefficient acquisition module is used to obtain the window scale coefficient of each pixel in the grayscale image based on the grayscale changes of other pixels in the neighborhood of each pixel in the grayscale image; to obtain the global grayscale center point based on the grayscale distribution of the grayscale image; and to obtain the center point offset coefficient of the pixel based on the window scale coefficient of the pixel, the grayscale difference between the pixel and other pixels in its neighborhood, the grayscale mean of the pixel and the pixels in its neighborhood, and the grayscale difference between the global grayscale center point of the grayscale distribution. The overall importance acquisition module is used to acquire the overall importance of each pixel in the grayscale image to the grayscale image; The correction coefficient acquisition module is used to acquire the correction coefficient of the local information of the pixels in the grayscale image on the overall importance of the image. The center importance acquisition module is used to obtain the overall importance of a pixel in the grayscale image based on the initial feature value of the window where the pixel is located, the overall transformation scale, the difference between the global grayscale center point and the pixel, the average transformation scale of the pixel after window downsampling according to the scale coefficient of its window, and the global grayscale center point; to obtain a correction coefficient for the local information of the pixel in the grayscale image on the overall importance based on the initial feature value of the window where the pixel is located, the overall importance of the pixel in the grayscale image, and the average transformation scale of the pixel after window downsampling according to the scale coefficient of its window; and to obtain the center importance of the pixel in the grayscale image based on the initial feature value of the pixel and the correction coefficient. The scaling module is used to divide the pixels into regions of interest or regions of non-interest based on the center point offset coefficient of each pixel, and to perform scaling transformation on the regions of interest and regions of non-interest in the grayscale image based on the center importance of each pixel, thereby completing the visual inspection of the part.
Citation Information
Patent Citations
Photovoltaic panel image adaptive enhancement method based on image processing
CN117078567A
Optical cable surface defect detection method
CN117173166A