Surface detection device for colored casting
By designing a non -color casting surface detection device including collecting controllers and processors, using multi -channel fusion and adaptive threshold technology to solve the detection of false positive and false problems in existing technologies, and realize the surface defects of non -ferrous castings. More accurate recognition.
Patent Information
- Application Number
- CN202411623815.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-11-14
AI Technical Summary
The prior art is prone to false positives and false negatives when detecting surface defects of colored castings, and traditional methods that rely on grayscale information are difficult to effectively distinguish defects of multiple colors and textures.
A non -color casting surface detection device including collecting controllers, databases and processors. Collect the controller to obtain the casting process parameters and images. The processor uses the feature extraction unit to use the Sobel operator and the gray symbiotic matrix to analyze the image characteristics, combining the cast process parameters to establish a defect probability model to perform defect recognition and classification.
Through multi -channel fusion and adaptive threshold technology, it can more accurately identify the texture characteristics of different color areas, reduce false positive and false negatives, and improve the reliability of test results.
Smart Images

Figure CN119375236A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image recognition, in particular to a surface detection device for non-ferrous castings. Background Art
[0002] With the continuous improvement of industrial automation and intelligence, higher requirements are placed on the accurate identification and positioning of casting surface defects (such as pores, cracks, etc.). Traditional human eye detection is not only inefficient, but also easily affected by subjective factors, making it difficult to ensure the consistency and accuracy of detection. Therefore, the development of efficient and accurate automated surface detection technology has become an urgent need in the industry. Nonferrous castings have rich surface colors and complex textures, which increase the difficulty of detection, prompting researchers to explore the application of advanced image processing technology and machine learning algorithms to casting surface detection to achieve automatic identification and classification of subtle defects, thereby greatly improving production efficiency and product quality; in the existing technology, false positives (misidentified defects) and false negatives (missed defects) may occur, and there may be multiple colors and textures on the casting surface. The traditional method that relies on grayscale information may not be able to effectively distinguish the defects on the casting surface. Therefore, a surface detection device for nonferrous castings is designed. Summary of the invention
[0003] The purpose of the present invention is to provide a surface detection device for non-ferrous castings to solve the problems proposed in the above-mentioned background technology, such as false positives (misidentified defects) and false negatives (missed defects), and that the surface of the casting may have a variety of colors and textures, and the traditional method relying on grayscale information may not be able to effectively distinguish the defects on the surface of the casting.
[0004] To achieve the above object, the present invention provides a surface detection device for nonferrous castings, comprising: An acquisition controller, the acquisition controller is used to acquire casting process parameters, environmental data and images of the surface of the non-ferrous casting, and transmit the casting process parameters, environmental data and images of the surface of the non-ferrous casting to a database; A database, wherein the database is used to store the data and images collected by the acquisition controller, and each storage record is timestamped; A processor, the processor is used to process the image and identify defects, introduce the influence of spatial position information and adaptive thresholds to optimize the defect identification process, and establish a relationship model between process parameters and defect probability in combination with casting process parameters; wherein the defects include cracks and bubbles; The processor includes a feature extraction unit, a defect recognition unit, and a parameter analysis unit; The terminal is used to display the test results in the form of images and charts, generate detailed test reports, and record defect information and process parameters.
[0005] As a further improvement of the technical solution, the casting process parameters of the acquisition controller include pouring temperature, cooling speed, and casting pressure.
[0006] As a further improvement of the technical solution, the specific steps of acquiring the image of the surface of the colored casting in the acquisition controller are as follows: S11. Before shooting, select a high-resolution camera, lighting equipment, and fixtures. Also select a temperature sensor, cooling rate meter, pressure sensor, and temperature and humidity sensor. S12, setting sampling frequency and trigger condition parameters, and setting camera parameters, photographing the casting surface from multiple angles to cover all defect areas; S13, start the data acquisition software, collect and record the pouring temperature, cooling rate, casting pressure and ambient temperature and humidity data in real time, and use a high-resolution camera to take images of the casting surface, and finally transmit the collected data and images to the database.
[0007] As a further improvement of the technical solution, in the processor: The feature extraction unit is used to detect the edge in the image using the Sobel operator and analyze the texture features of the image using the gray-level co-occurrence matrix to identify the defective area on the surface of the non-ferrous casting; The defect recognition unit is used to classify the identified defect area and determine whether it is a crack or a pore; The parameter analysis unit is used to analyze the causes of defects in combination with casting process parameters, establish a relationship model between process parameters and defect probability, and obtain the influencing factors of defect generation.
[0008] As a further improvement of the technical solution, in the feature extraction unit, the Sobel operator is used to detect the edge in the image, as follows: ; in, is the convolution kernel in the horizontal direction; is a pixel; ; in, is the convolution kernel in the vertical direction; ; in, is the gradient amplitude; ; in, is the gradient direction.
[0009] As a further improvement of the technical solution, in the feature extraction unit, the texture features of the image are analyzed using a gray level co-occurrence matrix, as follows: Each pixel in the collected colored casting image has three color channels, and a separate , and then for each color channel Combine to form multiple channels ; Known , , are grayscale images of the image on three color channels, then for each color channel, the constructed , recorded as , , ,in is the distance between pixels, It is the direction; ; in, For the distance and direction The gray value is The pixel and gray value are The joint probability of the pixels appearing; is the color channel; ; For images in color channels Upper position The gray value at ; is the number of pixel pairs that meet the conditions; For color channels The weight of .
[0010] As a further improvement of the technical solution, in the processor, the influence of spatial position information and adaptive threshold is introduced in the defect recognition process for optimization, and the optimization is as follows: ; in, is the spatial position function; is the center coordinate of the image; is the standard deviation of the Gaussian function; is the base of the exponential function; ; in, is the adaptive threshold function; and To adjust the parameters; For The standard deviation of the gray value in the local area centered at ; but: ; in, For the optimized distance and direction The gray value is The pixel and gray value are The joint probability of the pixels appearing; is the indicator function.
[0011] As a further improvement of this technical solution, based on the optimized formula , , , generate texture features: ; in, For any one ; is the contrast; is the gray-level co-occurrence matrix Middle Line The element value of the column; ; in, for relevance; Gray value The average value of Gray value The average value of Gray value The standard deviation of Gray value The standard deviation of ; in, for energy; ; in, For homogeneity.
[0012] As a further improvement of the technical solution, the defect recognition unit is specifically as follows: S31. Collect a large number of casting surface images in advance, including samples containing cracks and pores, mark each sample, indicate the location and type of defects, and then standardize the images; S32, combining texture features to form a high-dimensional feature vector, and using a linear analysis method to reduce the feature dimension, retaining information that can distinguish cracks and pores; S33, selecting a model and finding the best model parameter configuration, then training and evaluating the model, and continuously adjusting the model according to the evaluation results until the best performance level is achieved; S34. Finally, the trained model is used for defect detection to distinguish cracks and pores.
[0013] As a further improvement of the technical solution, the S32 is specifically as follows: Feature extraction: ; in, is a high-dimensional feature vector; For the Contrast features; For the correlation features; For the energy characteristics; For the Homogeneous characteristics; Centralization: ; in, is the centered feature vector; is the mean vector of the eigenvectors; Covariance matrix: ; in, is the covariance matrix; for The transposed matrix of Eigenvalues and eigenvectors: ; in, is the feature vector; is the characteristic value; Before selection The eigenvectors corresponding to the eigenvalues form the projection matrix : ; in, is the projection matrix; PCA Projection: ; in, is the eigenvector after PCA projection; Within-class scatter matrix: ; in, is the intra-class scatter matrix; For the The sample set of the class; For the The mean vector of the class; Between-class scatter matrix: ; in, is the inter-class scatter matrix; For the The number of class samples; Generalized Eigenvalue Problem: ; in, is the feature vector; is the characteristic value; Before selection The eigenvectors corresponding to the eigenvalues form the projection matrix : ; in, is the projection matrix; LDA Projection: ; in, is the feature vector after LDA projection.
[0014] Compared with the prior art, the present invention has the following beneficial effects: 1. In the surface inspection device for non-ferrous castings, multi-channel fusion can more comprehensively reflect the surface features. By combining color information with the grayscale co-occurrence matrix, the texture features of different color areas can be more accurately identified. By introducing color channel weights, the formula can adjust the contribution of different color channels, making the identification of defects sensitive to specific colors more accurate. 2. In the surface inspection device for non-ferrous castings, the features of the central area of the image are emphasized by a Gaussian function to ensure that the features of the key area are given a higher weight in defect detection, and the algorithm can adaptively determine the threshold according to the local characteristics of the image, so as to more accurately identify defects in different areas, especially in images with uneven lighting or complex backgrounds, reduce false positives and false negatives, and improve the reliability of the detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is the overall flow chart of the present invention; Figure 2 is a system block diagram of the processor in the present invention; The meaning of each number in the figure is: 1. Acquisition controller; 2. Database; 3. Processor; 31. Feature extraction unit; 32. Defect identification unit; 33. Parameter analysis unit; 4. Terminal. DETAILED DESCRIPTION
[0016] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0017] See also Figure 1-2 As shown, a surface detection device for nonferrous castings is provided, comprising a collection controller 1, a database 2, a processor 3 and a terminal 4; wherein, The acquisition controller 1 is used to acquire casting process parameters, environmental data and images of the surface of non-ferrous castings, and transmit the casting process parameters, environmental data and images of the surface of non-ferrous castings to the database 2; the casting process parameters acquired by the acquisition controller 1 include pouring temperature, cooling speed and casting pressure; The specific steps of acquiring the image of the surface of the colored casting in the acquisition controller 1 are as follows: S11. Before shooting, select high-resolution cameras, lighting equipment and fixtures to ensure that the image quality is high enough to clearly capture fine cracks and pores. Use appropriate lighting equipment, such as ring lights, coaxial lights or backlights, to ensure that the surface of the casting is evenly illuminated to avoid shadows and reflections. Use fixtures (such as tripods and clamps) to ensure that the camera is stable to avoid shaking during shooting. Also select temperature sensors, cooling rate measuring instruments, pressure sensors and temperature and humidity sensors; S12. Set the sampling frequency and trigger condition parameters to ensure that the sampling frequency and trigger condition settings of all sensors are reasonable to meet actual needs, and set the camera parameters to shoot the casting surface from multiple angles to cover all defect areas, ensure that all possible defect areas are covered, and improve the comprehensiveness of detection; S13, start the data acquisition software, collect and record the pouring temperature, cooling rate, casting pressure and ambient temperature and humidity data in real time, and use a high-resolution camera to capture the surface image of the casting, and save the image file according to a unified naming rule, such as "casting number_shooting location_date time.jpg". Finally, the collected data and images are transmitted to database 2.
[0018] Database 2 is used to store the data and images collected by acquisition controller 1, and each storage record has a time stamp; Processor 3 is used to process the image and identify defects. In the defect identification process, spatial position information and the influence of adaptive threshold are introduced for optimization, and a relationship model between process parameters and defect probability is established in combination with casting process parameters; wherein defects include cracks and bubbles; The processor 3 includes a feature extraction unit 31, a defect recognition unit 32, and a parameter analysis unit 33; In processor 3: The feature extraction unit 31 is used to detect the edge in the image using the Sobel operator, and analyze the texture features of the image using the gray level co-occurrence matrix to identify the defective area on the surface of the non-ferrous casting; In the feature extraction unit 31, the Sobel operator is used to detect the edge in the image, as follows: ; in, is the convolution kernel in the horizontal direction; is a pixel; ; in, is the convolution kernel in the vertical direction; ; in, is the gradient amplitude; ; in, is the gradient direction; The gradient amplitude reflects the degree of change in the grayscale value of pixels in the image. Edges usually correspond to areas with large changes in grayscale values, so areas with high gradient amplitudes are often edges; by setting a threshold, areas with high gradient amplitudes can be marked as edges, thereby achieving edge detection. The gradient direction can be used for edge linking, which helps to connect broken edges and form a continuous edge curve; In the feature extraction unit 31, the texture features of the image are analyzed using the gray level co-occurrence matrix, as follows: Since the casting surface is colored, relying solely on grayscale information may not be sufficient to accurately distinguish pores from other defects or normal areas. Combined, for example by building multi-channel Alternatively, you can first convert to a color space that is more suitable for distinguishing color differences (such as HSV or Lab), which can enhance the ability to identify pores. Specifically: Each pixel in the collected colored casting image has three color channels (red R, green G, blue B), and a separate , and then for each color channel Combine to form multiple channels ; Known , , are grayscale images of the image on three color channels (red, green, and blue), then for each color channel, the constructed , recorded as , , ,in is the distance between pixels, It is the direction; ; in, For the distance and direction The gray value is The pixel and gray value are The joint probability of the pixels appearing; is the color channel; ; For images in color channels Upper position The gray value at ; is the number of pixel pairs that meet the conditions; For color channels The weights are used to adjust the contribution of different color channels or under different conditions; Kronecker Function, returns 1 if the two parameters are equal, otherwise returns 0; Because there may be multiple colors and textures on the surface of the casting, relying solely on grayscale information may not be able to effectively distinguish them. , can adapt to this complexity and improve the robustness and accuracy of detection. Specifically, it is constructed in the red, green and blue color channels respectively. , and then combine them to form multi-channel , which enables the system to capture the features of the casting surface from multiple angles. It reflects the texture information in a specific color space, and multi-channel fusion can more comprehensively reflect the surface features. By combining color information with the gray-level co-occurrence matrix, the texture features of different color areas can be more accurately identified. By introducing color channel weights, the formula can adjust the contribution of different color channels, making the identification of defects sensitive to specific colors more accurate, and using Kronecker The function simplifies the calculation process and only counts when the grayscale values are equal, reducing unnecessary calculations and improving the efficiency of feature extraction; The influence of spatial position information and adaptive threshold is introduced in the defect recognition process for optimization. The optimization is as follows: ; in, It is a spatial position function, which can be a Gaussian function or other forms of functions, used to emphasize the characteristics of certain areas; is the center coordinate of the image; is the standard deviation of the Gaussian function, which controls the width of the function; is the base of the exponential function; ; in, It is an adaptive threshold function that dynamically adjusts the threshold according to local characteristics; and To adjust the parameters; For The standard deviation of the gray value in the local area centered at ; Specifically, the parameters The weight coefficient used to enlarge or reduce the local standard deviation. It controls the influence of the local grayscale standard deviation on the threshold in the image and determines the sensitivity to small defects. The offset used to balance the overall threshold value so that a reasonable threshold starting point can be maintained in areas with low image brightness or smooth changes. It is usually set to 0.5- 1.5. Depending on the detection requirements, if you want to be more sensitive to small defects (such as tiny cracks or pores), you can choose a higher initial value (such as 1.0 - 1.5); in a scene with more noise, you can choose a lower value (such as 0.5 - 1.0). It is usually set to a value between 0 and 20 to compensate for threshold deviation in low-contrast areas. Data-driven methods can be used to automatically adjust the threshold based on a set of image samples. and : Label sample images containing defects in different and Defect detection is performed under the combination of the two methods, and the error between the detection result and the actual annotation is recorded. By minimizing the mean square error between the detection result and the annotation, the optimal detection accuracy can be found. and Group value.
[0019] but: ; in, For the optimized distance and direction The gray value is The pixel and gray value are The joint probability of the pixels appearing; is the indicator function, when and The gray value difference is less than Returns 1 when gray value difference is less than the adaptive threshold, otherwise returns 0, ensuring that the probability is only taken into account when the gray value difference is less than the adaptive threshold, which helps to filter noise and improve the accuracy of defect recognition; The Gaussian function is used to emphasize the features of the central area of the image, or specific areas are emphasized according to application requirements, ensuring that the features of key areas are given higher weights in defect detection. Dynamic adjustment is made based on the standard deviation of local grayscale values, so that the algorithm can adaptively determine the threshold based on the local characteristics of the image, thereby more accurately identifying defects in different areas, especially in images with uneven lighting or complex backgrounds.
[0020] After introducing adaptive thresholds and spatial position information, the algorithm's adaptability to local changes in the image is enhanced, reducing false positives (misidentified defects) and false negatives (missed defects), and improving the reliability of detection results.
[0021] Based on the above formula , , , generate texture features: ; in, For any one ; is the contrast; is the gray-level co-occurrence matrix Middle Line The element value of the column; Contrast reflects the drastic change in the grayscale value of the image. In the formula, Represents grayscale value and The square of the difference between them, multiplied by the joint probability of their occurrence , and for all and Sum. The larger the contrast value, the higher the texture contrast in the image, that is, the more dramatic the change in grayscale value; ; in, for relevance; Gray value The average value of Gray value The average value of Gray value The standard deviation of Gray value The standard deviation of Correlation reflects the linear dependence between gray values in the image. In the formula, Represents grayscale value and The degree of deviation from their mean, multiplied by their joint probability of occurrence , and for all and Sum, and finally, divide the result by the product of the standard deviations of the two gray values to get the normalized correlation value. The closer the correlation value is to 1 or -1, the stronger the linear relationship between the gray values. ; in, for energy; Energy reflects the uniformity of grayscale distribution in the image. In the formula, Represents grayscale value and The square of the joint probability of occurrence, for all and Sum; the larger the energy value, the higher the frequency of occurrence of certain gray value pairs in the image, that is, the gray value distribution is more concentrated; ; in, for homogeneity; Homogeneity reflects the uniformity of grayscale values in an image. In the formula, Represents grayscale value and The joint probability of occurrence is divided by the absolute difference between them plus 1, for all and Sum, the larger the homogeneity value, the smaller the difference between the gray values in the image, that is, the gray value distribution is more uniform; By using the above method, we can construct a separate , and extract a variety of texture features (contrast, correlation, energy, homogeneity) from it. These features can be combined into a multi-channel feature vector for subsequent classification or recognition tasks, thereby improving the recognition ability of pores on the surface of non-ferrous castings.
[0022] The defect recognition unit 32 is used to classify the identified defect area and determine whether it is a crack or a pore; the details are as follows: S31. Collect a large number of casting surface images in advance, including samples containing cracks and pores, to ensure that the samples cover a variety of environmental conditions and defect forms to increase the generalization ability of the model, annotate each sample, indicate the location and type of defects (cracks or pores), and then standardize the images, such as resizing, graying, noise removal, etc., to reduce the influence of irrelevant factors and improve the accuracy of feature extraction; S32, combining texture features to form a high-dimensional feature vector, and using a linear analysis method to reduce the feature dimension, retaining information that can distinguish cracks and pores, while reducing the complexity of subsequent processing; S33, selecting a model and finding the best model parameter configuration, then training and evaluating the model, and continuously adjusting the model according to the evaluation results until the best performance level is achieved; S34. Finally, the trained model is used for defect detection to distinguish cracks and pores.
[0023] S32 is as follows: Calculated in 4 directions (0°, 45°, 90°, 135°) and 3 distances (1, 2, 3) , each feature has 12 values; Feature extraction: ; in, is a high-dimensional feature vector; For the Contrast features; For the correlation features; For the energy characteristics; For the Homogeneous characteristics; By extracting a variety of texture features (contrast, correlation, energy, homogeneity), the texture information of the image can be fully captured, and the richness and representativeness of the features can be improved; by calculating GLCM at different directions and distances, the texture information of different scales and directions can be captured, and the robustness and diversity of the features can be enhanced; Centralization: ; in, is the centered feature vector; is the mean vector of the eigenvectors; Centralization eliminates the mean shift of feature vectors, making data distribution more concentrated, which is conducive to subsequent feature extraction and dimensionality reduction. Centralized data is easier to perform numerical calculations, avoiding numerical instability problems caused by data shift. Covariance matrix: ; in, is the covariance matrix; for The transposed matrix of The covariance matrix reflects the linear correlation between features, which helps to understand the relationship between features. The covariance matrix can be used to find the main direction of data change, providing a basis for subsequent dimensionality reduction; Eigenvalues and eigenvectors: ; in, is the feature vector; is the characteristic value; Eigenvalues and eigenvectors are the core of PCA. Eigenvalues can be used to determine the main direction of data change, while eigenvectors provide specific representations of these directions. Selecting eigenvectors with larger eigenvalues can retain the main information of the data while reducing the feature dimension and computational complexity. Before selection The eigenvectors corresponding to the eigenvalues form the projection matrix : ; in, is the projection matrix, The eigenvalues correspond to the eigenvectors; By selecting The eigenvector corresponding to the eigenvalue can project high-dimensional data into low-dimensional space, retaining the most important information. The data after dimensionality reduction is easier to process, reducing the consumption of computing resources and improving the processing speed. PCA Projection: ; in, is the eigenvector after PCA projection; PCA projection converts high-dimensional data into low-dimensional data, retains the main features of the data, simplifies subsequent analysis and modeling, and can also remove noise from the data, improving the quality of the data and the robustness of the model; Within-class scatter matrix: ; in, is the intra-class scatter matrix; For the The sample set of the class; For the The mean vector of the class; the intra-class scatter matrix reflects the differences between the data of the same class, which helps to understand the data distribution within the class. By minimizing the intra-class scatter, the consistency of the data within the class can be improved and the classification effect can be enhanced; Between-class scatter matrix: ; in, is the inter-class scatter matrix; For the The number of class samples; the inter-class scatter matrix reflects the differences between different classes of data, which helps to understand the degree of separation between classes. By maximizing the inter-class scatter, the distinction between different classes of data can be enhanced and the accuracy of classification can be improved; Generalized Eigenvalue Problem: ; in, is the feature vector; The generalized eigenvalue problem provides the optimal projection direction, which maximizes the difference between classes and minimizes the difference within classes after projection. By selecting the appropriate eigenvector, the performance of the classification model can be significantly improved. Before selection The eigenvectors corresponding to the eigenvalues form the projection matrix : ; in, is the projection matrix, The eigenvalues correspond to the eigenvectors; LDA Projection: ; in, is the feature vector after LDA projection. LDA projection projects the data into the optimal classification subspace, which enhances the distinction between different types of data and improves the accuracy of classification; LDA projection further simplifies the data, making the classification model easier to train and apply; Through the above steps, the texture features are combined into a high-dimensional feature vector, and the linear analysis method is used to reduce the feature dimension, thereby improving the accuracy and efficiency of casting surface defect detection. Each step has clear benefits, ensuring the effectiveness and reliability of the entire process, not only improving the representativeness and robustness of the features, but also optimizing the performance of the classification model.
[0024] The parameter analysis unit 33 is used to analyze the causes of defects in combination with casting process parameters, establish a relationship model between process parameters and defect probability, and obtain the influencing factors of defect generation; Terminal 4 is used to display the test results in the form of images and charts, generate detailed test reports, and record defect information and process parameters.
[0025] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments, and the above embodiments and descriptions are only preferred examples of the present invention, and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements all fall within the scope of the present invention to be protected.
Claims
1. A surface detection device for nonferrous castings, characterized in that: include: An acquisition controller (1), the acquisition controller (1) being used to acquire casting process parameters, environmental data and an image of the surface of a non-ferrous casting, and transmit the casting process parameters, environmental data and the image of the surface of the non-ferrous casting to a database (2); A database (2), the database (2) being used to store the data and images collected by the collection controller (1), each storage record being provided with a timestamp; A processor (3), the processor (3) being used to process the image and identify defects, introducing spatial position information and the influence of an adaptive threshold to optimize the defect identification process, and combining casting process parameters to establish a relationship model between process parameters and defect probability; wherein the defects include cracks and bubbles; The processor (3) includes a feature extraction unit (31), a defect recognition unit (32), and a parameter analysis unit (33); The terminal (4) is used to display the test results in the form of images and charts, generate a detailed test report, and record defect information and process parameters.
2. The surface detection device for nonferrous castings according to claim 1, characterized in that: The casting process parameters collected by the controller (1) include pouring temperature, cooling speed, and casting pressure.
3. The surface detection device for nonferrous castings according to claim 2, characterized in that: The specific steps of acquiring the image of the surface of the colored casting in the acquisition controller (1) are as follows: S11. Before shooting, select a high-resolution camera, lighting equipment, and fixtures. Also select a temperature sensor, cooling rate meter, pressure sensor, and temperature and humidity sensor. S12, setting sampling frequency and trigger condition parameters, and setting camera parameters, photographing the casting surface from multiple angles to cover all defect areas; S13, start the data acquisition software, collect and record the pouring temperature, cooling rate, casting pressure and ambient temperature and humidity data in real time, and use a high-resolution camera to take images of the casting surface. Finally, the collected data and images are transmitted to the database (2).
4. The surface detection device for nonferrous castings according to claim 3, characterized in that: In the processor (3): The feature extraction unit (31) is used to detect edges in the image using a Sobel operator and analyze texture features of the image using a gray-level co-occurrence matrix to identify defective areas on the surface of the non-ferrous casting; The defect recognition unit (32) is used to classify the identified defect area and determine whether it is a crack or a pore; The parameter analysis unit (33) is used to analyze the causes of defects in combination with casting process parameters, establish a relationship model between process parameters and defect probability, and obtain influencing factors of defect generation.
5. The surface detection device for nonferrous castings according to claim 4, characterized in that: In the feature extraction unit (31), the Sobel operator is used to detect the edge in the image, as follows: ; in, is the convolution kernel in the horizontal direction; is a pixel; ; in, is the convolution kernel in the vertical direction; ; in, is the gradient amplitude; ; in, is the gradient direction.
6. The surface detection device for nonferrous castings according to claim 5, characterized in that: In the feature extraction unit (31), the texture features of the image are analyzed using a gray level co-occurrence matrix, as follows: Each pixel in the collected colored casting image has three color channels, and a separate , and then for each color channel Combine to form multiple channels ; Known , , are grayscale images of the image on three color channels, then for each color channel, the constructed , recorded as , , ,in is the distance between pixels, It is the direction; ; in, For the distance and direction The gray value is The pixel and gray value are The joint probability of the pixels appearing; is the color channel; ; For images in color channels Upper position The gray value at ; is the number of pixel pairs that meet the conditions; For color channels The weight of .
7. The surface detection device for nonferrous castings according to claim 6, characterized in that: In the processor (3), the influence of spatial position information and adaptive threshold is introduced in the defect recognition process for optimization, and the optimization is as follows: ; in, is the spatial position function; is the center coordinate of the image; is the standard deviation of the Gaussian function; is the base of the exponential function; ; in, is the adaptive threshold function; and To adjust the parameters; For The standard deviation of the gray value in the local area centered at ; but: ; in, For the optimized distance and direction The gray value is The pixel and gray value are The joint probability of the pixels appearing; is the indicator function.
8. The surface detection device for nonferrous castings according to claim 7, characterized in that: Based on the optimized formula , , , generate texture features: ; in, For any one ; is the contrast; is the gray-level co-occurrence matrix Middle Line The element value of the column; ; in, for relevance; Gray value The average value of Gray value The average value of Gray value The standard deviation of Gray value The standard deviation of ; in, for energy; ; in, For homogeneity.
9. The surface detection device for nonferrous castings according to claim 8, characterized in that: The defect identification unit (32) is specifically as follows: S31. Collect a large number of casting surface images in advance, including samples containing cracks and pores, mark each sample, indicate the location and type of defects, and then standardize the images; S32, combining texture features to form a high-dimensional feature vector, and using a linear analysis method to reduce the feature dimension, retaining information that can distinguish cracks and pores; S33, selecting a model and finding the best model parameter configuration, then training and evaluating the model, and continuously adjusting the model according to the evaluation results until the best performance level is achieved; S34. Finally, the trained model is used for defect detection to distinguish cracks and pores.
10. The surface detection device for nonferrous castings according to claim 9, characterized in that: The S32 is specifically as follows: Feature extraction: ; in, is a high-dimensional feature vector; For the Contrast features; For the correlation features; For the Energy characteristics; For the Homogeneous characteristics; Centralization: ; in, is the centered feature vector; is the mean vector of the eigenvectors; Covariance matrix: ; in, is the covariance matrix; for The transposed matrix of Eigenvalues and eigenvectors: ; in, is the feature vector; is the characteristic value; Before selection The eigenvectors corresponding to the eigenvalues form the projection matrix : ; in, is the projection matrix; PCA Projection: ; in, is the eigenvector after PCA projection; Within-class scatter matrix: ; in, is the intra-class scatter matrix; For the The sample set of the class; For the The mean vector of the class; Between-class scatter matrix: ; in, is the inter-class scatter matrix; For the The number of class samples; Generalized Eigenvalue Problem: ; in, is the feature vector; is the characteristic value; Before selection The eigenvectors corresponding to the eigenvalues form the projection matrix : ; in, is the projection matrix; LDA Projection: ; in, is the feature vector after LDA projection.
Citation Information
Patent Citations
Casting defect identification method based on Adaboost model of SVM
CN110533083A
Casting quality detection method, system and equipment based on machine vision
CN118505703A
Fusion vision-based die casting defect identification method and platform
CN118887174A
Cited By
Motorcycle shell high-pressure casting mold defect detection system and method
CN119985172A
Casting riser image recognition method based on machine learning
CN121033528A