Alloy casting processing quality inspection method based on machine vision
Patent Information
- Application Number
- CN202411253227.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-09-09
AI Technical Summary
[0003]现有技术虽然能够将合金铸件表面的加工质量较差的缺陷区域检测出来,但是由于造成缺陷的原因不同,各种缺陷的形态多样,无法准确地对缺陷类型进行检测,导致对合金铸件加工质量的检测并不准确
[0036] (1) First, according to the degree of difference in gray value between the area where the pixel is located and the surrounding area and the roughness of the casting, the hole area characteristic value of each pixel point in its neighborhood window in the surface image of the alloy casting is obtained, and then the hole characteristic image is obtained , and then use the canny edge detection operator to obtain the edge information of the hole feature image, and then obtain the hole area, instead of directly obtaining the hole area based on the edge information of the surface image of the alloy casting, to avoid dividing other defect areas into hole defect areas, and improve the hole quality Accuracy of defective area detection.
Smart Images

Figure CN118762028B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image processing, and in particular to a method for detecting the machining quality of alloy castings based on machine vision. Background Art
[0002] Alloy castings are alloy molded objects obtained by various casting methods, that is, the smelted liquid alloy is poured into a pre-prepared mold by pouring, injection, suction or other casting methods, and then cooled and polished to obtain objects with certain shapes, sizes and properties. Alloy casting quality inspection is an indispensable part of the casting process and is widely used in the casting industry, including aerospace, automobile, shipbuilding, machinery manufacturing and other fields. It can be used to detect defects such as cracks, pores, inclusions, shrinkage cavities, etc. of castings, as well as determine the size, shape and structure of castings, and confirm the safety and reliability of castings. Through the inspection of castings, it can be ensured that the quality of castings meets the relevant standards and avoid safety accidents and economic losses. At the same time, casting quality inspection can also improve the level of casting technology and promote industrial development.
[0003] Although the existing technology can detect defective areas with poor processing quality on the surface of alloy castings, due to the different causes of the defects and the diverse forms of various defects, it is impossible to accurately detect the defect type, resulting in inaccurate detection of the processing quality of alloy castings. Summary of the invention
[0004] The purpose of the present invention is to provide an alloy casting processing quality detection method based on machine vision, which improves the accuracy of hole defect area detection, improves the reliability of hole area classification, and improves the accuracy of alloy casting processing quality detection.
[0005] To achieve the above object, the present invention provides a method for detecting the machining quality of alloy castings based on machine vision, comprising the following steps:
[0006] S1, collecting the surface image of the alloy casting and preprocessing it;
[0007] S2. Obtaining the roughness of the casting in the area according to the complexity of the texture features in the neighborhood window of each pixel point in the surface image of the alloy casting;
[0008] S3, comprehensively considering the difference between the grayscale values of the area where the pixel point is located and the surrounding area and the roughness of the casting, obtaining the hole area characteristic value of each pixel point in the surface image of the alloy casting within its neighborhood window, and then obtaining a hole characteristic image;
[0009] S4, using the canny edge detection operator to obtain edge information of the hole feature image, and calculating the hole wall roughness and hole shape regularity of each closed edge;
[0010] S5. Classify each hole area according to its hole wall roughness and hole shape regularity;
[0011] S6. The processing quality of the alloy casting is tested and graded according to the hole wall roughness, hole shape regularity and hole area of each hole region.
[0012] Preferably, in step S1, an industrial camera is used to capture a surface image of the alloy casting to obtain an image in RGB space, and the acquired image is denoised and enhanced to eliminate some noise and the effects of external interference.
[0013] Preferably, in step S2, according to the difference of LBP values of each pixel point in the surface image of the alloy casting in its neighborhood window, the casting roughness of the area where the pixel point is located is obtained, and a preliminary judgment is made on whether the pixel point is in the slag hole or shrinkage hole area; the LBP feature descriptor is obtained in the neighborhood window, and the i-th pixel point in the neighborhood window of the pixel point x is obtained. , the jth pixel The LBP values are , , then the casting roughness of the area where the pixel point x is located is It is expressed as follows:
[0014]
[0015] in, is the Hamming distance between the binary numbers represented by the two boxes in the brackets; , are the i-th pixel in the neighborhood window of pixel x respectively. , the LBP value of the jth pixel represents the texture features around each pixel.
[0016] Preferably, in step S3, the hole region feature value of each pixel point in the surface image of the alloy casting in its neighborhood window is obtained according to the difference between the grayscale value of the area where the pixel point is located and the surrounding area and the roughness of the casting, and whether the pixel point is in the hole region is judged, including the following steps:
[0017] (1) The average gray value of the alloy casting surface image is , the mean gray value in the neighborhood window is , then the hole area feature value of pixel x It is expressed as follows:
[0018]
[0019] Among them, the casting roughness of the area where the pixel point x is located represents the possibility that the pixel point is in the slag hole or shrinkage hole area; is the mean gray value of the alloy casting surface image, is the mean gray value in the neighborhood window of pixel point x;
[0020] (2) Taking into account the different pore characteristics of pores, shrinkage pores, and slag pores, the pore area characteristic value of each pixel point in the surface image of the alloy casting is obtained in its neighborhood window to obtain the pore feature image .
[0021] Preferably, in step S4, the following steps are included:
[0022] (1) Use the canny edge detection operator to obtain the hole feature image The edge information of the closed edge is the hole area. There are M hole areas in total. The mean roughness of the casting at each pixel point in the kth hole area is the hole wall roughness of the hole area. ;
[0023] (2) A pixel point is randomly selected from each edge pixel point of a hole area using a random function. Starting from this pixel point, the coordinates of each edge pixel point of the hole area are arranged in a clockwise direction according to the circumference. Then, the ARIMA model is used to calculate the pixel points according to the previous The horizontal and vertical coordinates of the edge pixel points are calculated, and the horizontal and vertical coordinates of the next edge pixel points are predicted. Then, the regularity of the hole shape is obtained according to the degree of deviation between the predicted position and the actual position of each edge pixel point. The length of the input data for the ARIMA model;
[0024] (3) The kth hole area has edge pixels, the distance between the predicted position and the actual position of the i-th edge pixel is , then the hole shape regularity of the kth hole area is It is expressed as follows:
[0025]
[0026] in, is the regularity of the hole shape in the hole area; is the distance between the predicted position and the actual position of the i-th edge pixel in the hole area, and e is a natural constant.
[0027] Preferably, in step S5, the hole wall roughness threshold is set according to the value range of the hole wall roughness and the hole shape regularity. and hole shape regularity threshold , classify the hole areas into:
[0028] When the hole wall roughness is less than or equal to the threshold , the hole shape regularity is greater than the threshold When the hole area is less than or equal to the threshold, the hole area is judged to be a pore area; when the hole wall roughness is less than or equal to the threshold , the hole shape regularity is less than or equal to the threshold When the hole wall roughness is greater than the threshold When , the hole area is judged to be a shrinkage area.
[0029] Preferably, in step S6, the processing quality of the alloy casting is divided into three levels: poor, medium, and excellent according to the severity of the holes, and a first-level threshold of the hole severity is set. , Secondary threshold of hole severity , when the hole severity is less than or equal to the threshold When the severity of the hole is greater than the threshold, the processing quality is excellent; , less than or equal to the threshold When the hole severity is greater than the threshold, the processing quality is medium; The processing quality is poor.
[0030] Preferably, in step S6, the severity of the holes in the alloy casting is calculated as follows:
[0031] The area of each hole region is approximated by the number of pixels inside it. The hole area of the kth hole region is , then the severity of the holes in the alloy castings It is expressed as follows:
[0032]
[0033] in, is the hole wall roughness of the kth hole area; is the hole shape regularity of the kth hole area.
[0034] Preferably, , , The empirical values are 0.5, 0.5, 0.3, and 0.6.
[0035] Therefore, the present invention adopts the above-mentioned alloy casting processing quality detection method based on machine vision, and its technical effects are as follows:
[0036] (1) First, the hole area feature value of each pixel in the surface image of the alloy casting in its neighborhood window is obtained according to the difference in grayscale values between the pixel area and the surrounding area and the roughness of the casting, and then the hole feature image is obtained. Then, the canny edge detection operator is used to obtain the edge information of the hole feature image, and then the hole area is obtained, instead of directly obtaining the hole area based on the edge information of the surface image of the alloy casting. This avoids dividing other defect areas into hole defect areas, thereby improving the accuracy of hole defect area detection.
[0037] (2) The regional characteristics and edge characteristics of each hole area are comprehensively considered, and each hole area is classified according to its hole wall roughness and hole shape regularity, which improves the reliability of hole area classification.
[0038] (3) Not only the hole defect areas on the surface of the alloy castings are obtained, but also the processing quality of the alloy castings is tested according to the characteristics of different hole defect areas and the degree of influence on the casting quality, thereby improving the accuracy of the alloy casting processing quality detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a schematic flow chart of the alloy casting processing quality detection method based on machine vision of the present invention;
[0040] Figure 2 This is a schematic diagram of common shrinkage defects on the surface of alloy castings;
[0041] Figure 3 This is a schematic diagram of common slag hole defects on the surface of alloy castings. DETAILED DESCRIPTION
[0042] This embodiment takes the common hole defects on the surface of alloy castings as an example to analyze its processing quality. The image schematic diagram of the present invention is as follows: Figure 2 and Figure 3 shown.
[0043] Embodiment 1:
[0044] like Figure 1 As shown, the present invention provides a method for detecting the machining quality of alloy castings based on machine vision, comprising the following steps:
[0045] S1. Use an industrial camera to collect surface images of alloy castings and preprocess them.
[0046] The present invention needs to detect the processing quality of alloy castings. Since the grayscale difference between the defective area and the background area on the surface of the alloy casting is small, and the industrial camera has the characteristics of high resolution, high sensitivity and high dynamic range, it can capture the detailed information of its surface. First, the surface image of the alloy casting is collected using the industrial camera to obtain the image in RGB space, and the acquired image is denoised and enhanced to eliminate the influence caused by some noise and external interference, and enhance the accuracy of subsequent analysis. The present invention uses bilateral filtering to process the image, and the implementer can also adopt other image enhancement methods, and then convert the acquired RGB image into a grayscale image.
[0047] S2. According to the complexity of the texture features in the neighborhood window of the pixel point, the roughness of the casting in the area where the pixel point is located is obtained.
[0048] In casting production, hole defects are common defects and are also one of the defects that cause the greatest losses to foundries. The hole defects on the surface of alloy castings can be divided into three categories: pores, shrinkage cavities, and slag pores. In order to classify the hole defects on the surface of alloy castings and to achieve more accurate detection of the processing quality of the casting surface, it is necessary to analyze them according to their different characteristics.
[0049] In order to ensure product quality and make the product more beautiful, alloy castings are often polished during processing. Therefore, the surface of the area with better processing quality is smoother and the color is more consistent, while the texture of the area with poor processing quality is rougher and the color is different from that of the area with better processing quality.
[0050] Slag holes are holes caused by the slag in the molten metal not being removed completely, or poor slag blocking during pouring, or improper pouring system settings, which cause the slag to enter the mold cavity with the molten metal. They are the most frequent surface defects on castings. Shrinkage pores are dense pinhole-shaped holes, which are dispersed and tiny shrinkage pores that appear on the cross-section of the casting, and the inner wall of the shrinkage pore is like the tip of a dendrite. When slag holes or shrinkage pores appear on the surface of alloy castings, their texture characteristics are different from the surrounding areas, and the hole wall is relatively rough.
[0051] First, according to the difference in the LBP value of each pixel in the surface image of the alloy casting within its neighborhood window, the roughness of the casting in the area where it is located is obtained, and a preliminary judgment is made on whether the pixel is in the slag hole or shrinkage hole area. The size of the neighborhood window is a×a, and the empirical value of a is 9. For each pixel in its 3×3 neighborhood, its LBP feature descriptor is obtained. Each LBP feature descriptor corresponds to an 8-bit binary number, and the LBP feature descriptor reflects the neighborhood texture characteristics of the pixel. The i-th pixel in the neighborhood window of pixel x , the jth pixel The LBP values are , , then the casting roughness of the area where the pixel point x is located is It can be expressed as follows:
[0052]
[0053] in, is the Hamming distance between the binary numbers represented by the two boxes in the brackets; , are the i-th pixel in the neighborhood window of pixel x respectively. , the jth pixel The LBP value represents the texture features around each pixel. is the size of the neighborhood window. When the Hamming distance between the LBP feature descriptors of each pixel in the neighborhood window is larger, the difference in texture features is greater, indicating that the texture features of the area where the pixel is located are more complex and the casting roughness in the area is higher.
[0054] S3. The difference between the grayscale values of the pixel area and the surrounding area and the roughness of the casting are comprehensively considered to obtain the hole area feature value of each pixel in the surface image of the alloy casting within its neighborhood window, and then obtain the hole feature image.
[0055] Since the grayscale values of the hole and the surrounding area are different, the characteristic value of the hole area of each pixel in the surface image of the alloy casting in its neighborhood window can be obtained according to the difference between the grayscale values of the pixel area and the surrounding area and the roughness of the casting, and whether the pixel is in the hole area can be judged. The average grayscale value of the surface image of the alloy casting is , the mean gray value in the neighborhood window is , then the hole area feature value of pixel x It can be expressed as follows:
[0056]
[0057] in, is the characteristic value of the hole area of pixel x; is the casting roughness of the area where the pixel point x is located, representing the possibility that the pixel point is in the slag hole or shrinkage hole area. The larger the casting roughness value, the more likely it is to be in the slag hole or shrinkage hole area, and the larger the characteristic value of the hole area; is the mean gray value of the alloy casting surface image, is the mean gray value in the neighborhood window of pixel point x. When the difference between the gray values is greater, it means that the gray characteristics of the area where pixel point x is located are more different from those of the entire image, and the more likely it is a hole area, the larger the characteristic value of the hole area.
[0058] The characteristic values of the hole area are obtained by comprehensively considering the different intra-hole characteristics of pores, shrinkage pores, and slag pores. The grayscale value difference is not obvious in the slag pore or shrinkage pore area with relatively rough texture, while the texture of the pore area with relatively obvious grayscale value difference is not rough. It describes the texture features. The grayscale feature added here is the difference between the grayscale value in the hole area and the grayscale value of the whole image. When the roughness of the casting is small, but the difference in the mean grayscale value is large, the pixel point may be in the pore area, and its hole area feature value is still large; when the difference in the mean grayscale value is small, but the roughness of the casting is high, the pixel point may be in the slag hole or shrinkage area, and its hole area feature value is still large.
[0059] For each pixel point in the alloy casting surface image, the hole area feature value is obtained in its neighborhood window, and the hole feature image is obtained. .
[0060] S4. Use the canny edge detection operator to obtain edge information of the hole feature image, and calculate the hole wall roughness and hole shape regularity of each closed edge.
[0061] Pores are holes on the surface or inside of castings, usually in round or elliptical shapes, while shrinkage cavities are holes that are formed when castings shrink during the condensation process and cannot be replenished by alloy solution. They are irregular in shape. Therefore, different types of cavities can be distinguished based on the regularity of the pore edges. Since the shape of shrinkage cavities is irregular, if the Hough circle transform is used directly to detect pores on the surface of alloy castings, there may be problems of missed detection. Therefore, it is necessary to first use the canny edge detection operator to obtain the pore feature image. The edge information of the closed edge is the hole area. There are M hole areas in total. The mean roughness of the casting at each pixel point in the kth hole area is the hole wall roughness of the hole area. .
[0062] In order to measure the regularity of the hole edges in each hole area, a pixel point is randomly selected from the edge pixels of a hole area using a random function. Starting from this pixel point, the coordinates of the edge pixels of the hole area are arranged in a clockwise direction according to the circumference. Then, the ARIMA model is used to calculate the regularity of the hole edges according to the previous The horizontal and vertical coordinates of the edge pixel points are calculated, and the horizontal and vertical coordinates of the next edge pixel points are predicted. Then, the regularity of the hole shape is obtained according to the degree of deviation between the predicted position and the actual position of each edge pixel point. The length of the input data for the ARIMA model.
[0063] The k-th hole area has a total of edge pixels, the distance between the predicted position and the actual position of the i-th edge pixel is , then the hole shape regularity of the kth hole area is It can be expressed as follows:
[0064]
[0065] in, is the regularity of the hole shape in the hole area; is the distance between the predicted position and the actual position of the ith edge pixel point in the hole area, and e is a natural constant. The greater the difference between the predicted position and the actual position of each edge pixel point, the more inconsistent the actual edge is with the regular curve, and the lower the hole shape regularity of the hole area. When the hole shape regularity is lower, it is more likely to be a slag hole or a shrinkage hole; conversely, when the hole shape regularity is higher, it is more likely to be a gas hole.
[0066] S5. Taking into account the regional characteristics and edge characteristics of each hole area, the hole areas are divided into three categories: air holes, slag holes, and shrinkage holes according to the roughness of the hole wall and the regularity of the hole shape.
[0067] Shrinkage cavities are usually produced on the last solidification hot junction of the casting. The reason for their formation is that the molten metal shrinks during the solidification process and cannot be replenished. The inner wall is in the shape of the tip of a dendrite, and the hole wall is very rough. Slag holes are holes caused by impurities in the cavity or low-melting-point substances in the liquid entering the cavity. They are irregular in shape and have slag inside. They are usually glass-like, with rougher inner walls than pores and smoother than shrinkage cavities. Pores are holes on the surface or inside of castings, generally round or elliptical, with smooth hole walls and relatively regular shapes. The characteristics of each type of hole area are shown in Table 1 below:
[0068] Table 1 Hole characteristics table
[0069]
[0070] Considering the regional characteristics and edge characteristics of each hole area, the hole wall roughness threshold is set according to the value range of the hole wall roughness and hole shape regularity. and hole shape regularity threshold , classify the hole areas, , The empirical value is 0.5. When the hole wall roughness is less than or equal to the threshold , the hole shape regularity is greater than the threshold When the hole area is less than or equal to the threshold, the hole area is judged to be a pore area; when the hole wall roughness is less than or equal to the threshold , the hole shape regularity is less than or equal to the threshold When the hole wall roughness is greater than the threshold , then the hole area is judged to be a shrinkage area.
[0071] S6. The machining quality of alloy castings is tested according to the hole wall roughness, hole shape regularity and hole area of each hole area, and divided into three grades: poor, medium and excellent.
[0072] When the area of the hole is larger, it means that the influence range of the hole is larger. The area of each hole area can be approximated by the number of pixels inside it. The hole area of the kth hole area is , then the severity of the holes in the alloy castings It can be expressed as follows:
[0073]
[0074] in, is the hole area of the kth hole region. The larger the hole area, the larger the impact range of the hole and the higher the severity of the hole. is the hole wall roughness of the kth hole area. The larger the value, the rougher the processing area and the higher the severity of the hole. is the regularity of the hole shape of the kth hole area. The more irregular the hole shape is, the less predictable its impact on the quality of the casting is, and the higher the severity of the hole is. M is the number of hole areas.
[0075] According to the severity of the holes in the alloy castings, the processing quality is divided into three levels: poor, medium, and excellent. The first-level threshold of the hole severity is set. , Secondary threshold of hole severity , the empirical values are 0.3 and 0.6 respectively. When the severity of the hole is less than or equal to the threshold When the severity of the hole is greater than the threshold, the processing quality is excellent; , less than or equal to the threshold When the hole severity is greater than the threshold, the processing quality is medium; The processing quality is poor.
[0076] Therefore, the present invention adopts the above-mentioned alloy casting processing quality detection method based on machine vision, which improves the accuracy of hole defect area detection, improves the reliability of hole area classification, and improves the accuracy of alloy casting processing quality detection.
[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. Alloy casting processing quality inspection method based on machine vision, It is characterized in that The following steps are involved: S1, collecting surface images of alloy castings; S2. Obtaining the roughness of the casting in the area according to the complexity of the texture features in the neighborhood window of each pixel point in the surface image of the alloy casting; S3, comprehensively considering the difference between the grayscale values of the area where the pixel point is located and the surrounding area and the roughness of the casting, obtaining the hole area characteristic value of each pixel point in the surface image of the alloy casting within its neighborhood window, and then obtaining a hole characteristic image; S4, using the canny edge detection operator to obtain edge information of the hole feature image, and calculating the hole wall roughness and hole shape regularity of each closed edge; S5. Classify each hole area according to its hole wall roughness and hole shape regularity; S6. Testing the machining quality of the alloy casting according to the hole wall roughness, hole shape regularity and hole area of each hole region and classifying them; In step S4, the following steps are included: (1) Use the canny edge detection operator to obtain the hole feature image The edge information of the closed edge is the hole area. There are M hole areas in total. The mean roughness of the casting at each pixel point in the kth hole area is the hole wall roughness of the hole area. ; (2) A pixel point is randomly selected from each edge pixel point of a hole area using a random function. Starting from this pixel point, the coordinates of each edge pixel point of the hole area are arranged in a clockwise direction according to the circumference. Then, the ARIMA model is used to calculate the pixel points according to the previous The horizontal and vertical coordinates of the edge pixel points are used to predict the horizontal and vertical coordinates of the next edge pixel points, and then the hole shape regularity is obtained according to the degree of deviation between the predicted position and the actual position of each edge pixel point. The length of the input data for the ARIMA model; (3) The kth hole area has edge pixels, the distance between the predicted position and the actual position of the i-th edge pixel is , then the hole shape regularity of the kth hole area is It is expressed as follows: in, is the regularity of the hole shape in the hole area; is the distance between the predicted position and the actual position of the i-th edge pixel in the hole area, and e is a natural constant; In step S5, the hole wall roughness threshold is set according to the value range of the hole wall roughness and hole shape regularity. and hole shape regularity threshold , classify the hole areas into: When the hole wall roughness is less than or equal to the threshold , the hole shape regularity is greater than the threshold When the hole wall roughness is less than or equal to the threshold , the hole shape regularity is less than or equal to the threshold When the hole wall roughness is greater than the threshold When , the hole area is judged to be a shrinkage area; In step S6, the processing quality of the alloy casting is divided into three levels: poor, medium, and excellent according to the severity of the holes, and the first-level threshold of the hole severity is set. , Secondary threshold of hole severity , when the hole severity is less than or equal to the threshold When the severity of the hole is greater than the threshold, the processing quality is excellent; , less than or equal to the threshold When the hole severity is greater than the threshold, the processing quality is medium; When , the processing quality is poor; In step S6, the severity of the holes in the alloy casting is calculated as follows: The area of each hole region is approximated by the number of pixels inside it. The hole area of the kth hole region is , then the severity of the holes in the alloy castings It is expressed as follows: in, is the hole wall roughness of the kth hole area; is the hole shape regularity of the kth hole area, M is the number of hole areas, is a natural constant.
2. The method for detecting the machining quality of alloy castings based on machine vision according to claim 1, It is characterized in that In step S1, an industrial camera is used to collect the surface image of the alloy casting to obtain an image in the RGB space, and the acquired image is denoised and enhanced to eliminate the influence of some noise and external interference.
3. The method for detecting the machining quality of alloy castings based on machine vision according to claim 1, It is characterized in that In step S2, according to the difference of LBP values of each pixel point in the surface image of the alloy casting in its neighborhood window, the roughness of the casting in the area where it is located is obtained, and a preliminary judgment is made on whether the pixel point is in the slag hole or shrinkage hole area; the LBP feature descriptor is obtained in the neighborhood window, and the i-th pixel point in the neighborhood window of the pixel point x is obtained. , the jth pixel The LBP values are , , then the casting roughness of the area where the pixel point x is located is It is expressed as follows: in, is the Hamming distance between the binary numbers represented by the two boxes in the brackets; , are the i-th pixel in the neighborhood window of pixel x respectively. , the LBP value of the jth pixel, represents the texture features around each pixel, is the size of the neighborhood window.
4. The method for detecting the machining quality of alloy castings based on machine vision according to claim 1, It is characterized in that In step S3, the hole area feature value of each pixel point in the surface image of the alloy casting in its neighborhood window is obtained according to the difference between the gray value of the area where the pixel point is located and the surrounding area and the roughness of the casting, and whether the pixel point is in the hole area is judged, including the following steps: (1) The average gray value of the alloy casting surface image is , the mean gray value in the neighborhood window is , then the hole area feature value of pixel x It is expressed as follows: Among them, the casting roughness of the area where the pixel point x is located represents the possibility that the pixel point is in the slag hole or shrinkage hole area; is the mean gray value of the alloy casting surface image, is the mean gray value in the neighborhood window of pixel point x, is the casting roughness of the area where the pixel point x is located; (2) Taking into account the different pore characteristics of pores, shrinkage pores, and slag pores, the pore area characteristic value of each pixel point in the surface image of the alloy casting is obtained in its neighborhood window to obtain the pore feature image .
5. The method for detecting the machining quality of alloy castings based on machine vision according to claim 1, It is characterized in that , , The empirical values are 0.5, 0.5, 0.3, and 0.6.
