A method for laser hole classification based on support vector machines
Through the method based on the support vector machine, the features of laser hole images are extracted and processed, and the problems of low artificial recognition accuracy and difficult neural networks to recognize unbroken and semi-broken penetration in the prior art are solved, and accurate identification and efficient classification of laser hole types are achieved.
Patent Information
- Application Number
- CN202411882893.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2044-12-19
AI Technical Summary
In the prior art, the accuracy of manually identifying laser holes is low, and it is difficult for neural networks to accurately identify unbroken and semi-broken conditions under different processing materials and shooting environments.
Using a support vector machine-based method, by acquiring and processing the hole punched image of the laser processing cooling hole, extracting the inner and outer contours, calculating the weighted distance and the total area of the inverse threshold color blocks of the central area and the annular zone, and inputting the support vector machine for classification.
Accurate identification of laser hole types is achieved, recognition efficiency and accuracy are improved, and dependence on a large number of data sets is reduced.
Smart Images

Figure CN119810059B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to image classification technology, and particularly to a method for classifying laser holes based on a support vector machine. Background Art
[0002] An aero-engine is one of the extremely important components in an aircraft, which can provide sufficient power for the climb and flight of the aircraft. As the core component of the aero-engine, the design and manufacturing level and working performance of the turbine blade affect the service life of the aero-engine. The cooling of the turbine blade is mainly achieved through the combined action of internal flow cooling and external film cooling. Effectively avoiding the phenomenon of too high operating temperature of the aero-engine, and at the same time, it can further improve the performance of the aero-engine, ensure the normal operation of the aero-engine, and ensure the safe operation of the space shuttle. Therefore, the normality of the cooling holes is crucial for the normal operation of the aero-engine. Due to the special small size of the cooling holes of the aero-engine, laser processing is generally used, but laser processing has certain instability, resulting in two abnormal situations that the processed cooling holes may not be drilled through and half drilled through. Therefore, it is necessary to inspect the holes. Currently, it is mainly to manually identify each hole picture taken one by one. This method has low efficiency and a certain probability of misjudgment. If the hole features are automatically extracted from the hole images by using a neural network, and a classification neural network is learned and constructed, but the existing neural network methods are limited by the need to use a large number of pictures for label annotation, and because the backgrounds of each hole state are different, the undrilled and half-drilled holes show different performances under different processing materials and shooting environments, which brings great difficulties to training an accurate and effective model by the neural network. Summary of the Invention
[0003] Aiming at the above deficiencies in the prior art, the method for classifying laser holes based on a support vector machine provided by the present invention solves the problems of low accuracy of manual recognition in the prior art and the inability of the neural network to accurately identify the undrilled and half-drilled situations.
[0004] In order to achieve the above invention purpose, the technical solution adopted by the present invention is as follows:
[0005] Provide a method for classifying laser holes based on a support vector machine, which includes the steps:
[0006] S1. Obtain the drilling image of the cooling hole of the aero-engine processed by laser, convert it into a grayscale image, and perform an inverse operation on the grayscale value of the grayscale image to obtain an inverse image;
[0007] S2. Binarize the inverse image according to the statistical threshold A, and extract the largest contour and its contour center in the binarized image, and use the largest contour as the inner contour;
[0008] S3. Binarize the reverse image according to the statistical threshold B, extract the largest contour and its contour center in the binarized image, and take the largest contour as the outer contour;
[0009] S4. Determine the central region of the area where the inner contour is located according to the inner contour and the outer contour, and take the part of the outer contour that does not belong to the inner contour as the annular region;
[0010] S5. Count the multiple color blocks composed of the pixel points whose pixel values in the central region and the annular region are lower than their corresponding region thresholds, calculate the area of each color block, count the total area of the color blocks in the central region and the annular region as the total area of its anti-threshold color blocks, and calculate the distance from the contour center to the contour center of the outer contour;
[0011] S6. Perform distance weighting according to the areas of the color blocks in the central region and the annular region to obtain the weighted distances of the central region and the annular region respectively;
[0012] S7. Input the weighted distances of the central region and the annular region and the total area of the anti-threshold color blocks into a support vector machine for classification to obtain the classification result of the cooling holes; the types of cooling holes include normal penetration, semi-penetration, and non-penetration.
[0013] Further, the method for determining the central region includes:
[0014] S41. Taking the contour center of the inner contour as the center, draw several rays, record the intersection positions of the rays and the inner contour to obtain several line segments, and take the average value of all line segments as the radius r of the equivalent circle in ;
[0015] S42. Calculate the skewness W and roundness D of the equivalent circle corresponding to the inner contour according to the lengths of all line segments and the radius r of the equivalent circle in , where:
[0016]
[0017] where C in is the contour center of the inner contour; C out is the contour center of the outer contour; r max is the length of the longest line segment; r min is the length of the shortest line segment; D is the roundness.
[0018] S43. Judge whether any value of the skewness W and the roundness D satisfies its corresponding threshold condition. If so, take the overlapping area of the equivalent circle in step S41 and the inner contour as the central region; otherwise, take the area where the inner contour is located as the central region.
[0019] Further, the threshold condition for the skewness W is W > 0.382 * 0.618, and r in / rout <0.5, r out is the radius of the equivalent circle of the outer contour, and its acquisition method is the same as that of r in ; the threshold condition of the roundness D is D > 0.382 * 0.618.
[0020] Further, step S7 further includes:
[0021] S71. Input the weighted distance sum and the total area S of the anti-threshold color blocks in the central region all,x into the first support vector machine for classification to obtain the classification result of the cooling holes;
[0022] S72. Determine whether the classification result is of the drilled-through type. If so, proceed to step S73; otherwise, directly output the classification result;
[0023] S73. Input the weighted distance sum and the total area of the anti-threshold color blocks in the annular region into the second support vector machine for classification to obtain the classification result of the cooling holes.
[0024] Further, the expression of the weighted distance is:
[0025]
[0026] where x is a variable, when its value is 1, it represents the central region, and when its value is 2, it represents the annular region; n x is the total number of color blocks in x; C i,x is the distance from the contour center of the i-th color block in x to the center of the outer contour; S i,x is the contour area of the i-th color block in x; r out is the radius of the equivalent circle of the outer contour; S all,x is the total area of all color blocks in x; is the weighted distance corresponding to x.
[0027] Further, the acquisition methods of the statistical threshold A and the statistical threshold B include:
[0028] A1. According to the preset pixel range, perform binary processing on the reverse image to obtain the binary image A, and extract the largest contour A and the central position A of the largest contour A in the binary image A;
[0029] A2. Count the number of pixel points with pixel values greater than the first threshold in the binary image A, convert the counted number of pixel points into the area of the weighted equivalent circle, and calculate the equivalent radius A of the weighted equivalent circle;
[0030] A3. Count the pixel values inside the circle drawn with the central position A as the center and the equivalent radius A as the radius, and calculate the statistical threshold A using reverse weighted calculation according to the pixel values sorted in ascending order inside the circle;
[0031] A4. Binarize the reverse image according to the statistical threshold A to obtain a binarized image B, and extract the largest contour B and the center position B of the largest contour B in the binarized image B;
[0032] A5. Binarize the area of the largest contour B and perform a reverse operation to obtain a first mask; convert the pixel points in the area of the largest contour B into the area of an equivalent circle, and calculate the equivalent radius B of the equivalent circle;
[0033] A6. Take the center position B as the center and the preset multiple of the equivalent radius B as the radius to obtain a circle B, binarize the part outside the area of the circle B to obtain a second mask;
[0034] A7. Overlap the first mask and the second mask, reverse the pixel values in the annular area to obtain a statistical area, and calculate the statistical threshold B by reverse weighted calculation according to the pixel values sorted in ascending order within the statistical area.
[0035] Further, the method for extracting the largest contour in step S2, step S3, step A1, and step A4 is as follows:
[0036] Process the binarized image using the dilation function, erosion function, and denoising function in the opencv2 software, and then use the contour recognition function of opencv2 to identify the contour to obtain the largest contour in the binarized image;
[0037] The method for extracting the center position of the largest contour in step S2, step S3, step A1, and step A4 is as follows: Use the center extraction function in the opencv2 software to extract the center position of the largest contour.
[0038] Further, the expressions for calculating the statistical threshold A and the statistical threshold B by reverse weighted calculation are both:
[0039]
[0040] where k is a variable, Th1 is the statistical threshold A, Th2 is the statistical threshold B; V p,k , P k , V i,k and N k are the weight distribution rate, quantity segmentation rate, the i-th pixel value sorted in ascending order within the region, and the total quantity of the i-th pixel value within the region corresponding to k, respectively; M p,k and V p,k are the intermediate variables corresponding to k, respectively; is the mean parameter corresponding to k;
[0041] The regional threshold th corresponding to the central area c = Th1; The regional threshold corresponding to the annular area: th b= Th2 * 0.9; The expression of the first threshold Th1 is Th1 = 0.618 * 255.
[0042] Further, the calculation formula for the equivalent radius A in step A2 is:
[0043]
[0044] where r A is the equivalent radius A; S A is the area of the weighted equivalent circle of the maximum contour A; N A is the number of pixel points counted in the maximum contour A;
[0045] The calculation formulas for the equivalent radius B in A5 are all:
[0046]
[0047] where r B is the equivalent radius B; S B is the area of the equivalent circle corresponding to the maximum contour B; N B is the number of pixel points counted in the maximum contour B.
[0048] Further, according to the preset pixel range, the method for binarizing the reverse image is: setting the pixel values in the reverse image within the preset pixel range to 255, and the remaining pixel values to 0;
[0049] In steps S2 and A4, the method for binarizing the reverse image according to the statistical threshold A is: setting the pixel values in the reverse image greater than the statistical threshold A to 255, and the remaining pixel values to 0;
[0050] In steps S3 and A5, the method for binarizing the reverse image according to the statistical threshold B is: setting the pixel values in the reverse image greater than the statistical threshold B to 255, and the remaining pixel values to 0.
[0051] Compared with the prior art, the beneficial effects of the present invention are:
[0052] (1) Through the set thresholds in this solution, the inner contour and outer contour can be accurately extracted. On this basis, the characteristics of the perforation state of the corresponding picture (two weighted distances) can be accurately and automatically extracted. Then, combined with the trained support vector machine, the types of holes in laser processing can be accurately identified, which is more convenient, efficient, and accurate than manual work. Compared with neural networks for image calibration and processing, it does not require a large amount of data sets for initial training.
[0053] (2) When performing image processing, this solution can automatically extract the weighted distances of the central region and the annular region, and then, combined with the support vector machine, it can greatly reduce the workload of operators, achieve highly automated recognition and classification processing, and improve the efficiency of detecting holes. Description of the Drawings
[0054] Figure 1 It is a flowchart of a method for laser hole classification based on a support vector machine.
[0055] Figure 2 It is the original image of the punched hole image that needs edge extraction.
[0056] Figure 3 It is a visualization diagram of the gray pixel value distribution of the picture.
[0057] Figure 4 It is an inverse gray scale image of the pixel values.
[0058] Figure 5 It is a roughly processed binary image.
[0059] Figure 6 It is a binary image after dilation and erosion denoising processing.
[0060] Figure 7 It is a schematic diagram of the largest contour B.
[0061] Figure 8 It is the first masking diagram.
[0062] Figure 9 It is the second masking diagram.
[0063] Figure 10 It is a diagram of the circular ring threshold statistical area.
[0064] Figure 11 It is an outer contour effect diagram.
[0065] Figure 12 It is two typical pictures of the cooling holes being normally drilled through.
[0066] Figure 13 It is two typical pictures of the cooling holes being half drilled through.
[0067] Figure 14 It is two typical pictures of the cooling holes not being drilled through.
[0068] Figure 15 It is a side photo of three different states of the circle (normally drilled through, half drilled through, and not drilled through).
[0069] Figure 16 It is a schematic diagram of the area after processing the punched hole image, where (a) is the schematic diagram of the inner contour, (b) is the schematic diagram of the outer contour, and (c) is the schematic diagram of the annular region.
[0070] Figure 17 Schematic diagram for the formation of the central region, where (a) is the equivalent circle of the inner contour; (b) is the central region formed by the overlap of the inner contour and its equivalent circle; (c) is the central region formed by the inner contour.
[0071] Figure 18 Schematic diagrams of the circles not penetrated by three singular states; where (a) is the schematic diagram of the sieve circle; (b) is the schematic diagram of the crescent circle; (d) is the schematic diagram of the deformed circle.
[0072] Figure 19 Diagram of the anti-threshold color blocks of the central regions and strip regions of circles in three types (fully penetrated, semi-penetrated, and non-penetrated) of states. Detailed implementation manners
[0073] The following describes the detailed implementation manners of the present invention to facilitate those skilled in the art of this technology to understand the present invention. However, it should be clear that the present invention is not limited to the scope of the detailed implementation manners. For those ordinary skilled in the art of this technology, as long as various changes are within the spirit and scope of the present invention defined and determined by the appended claims, these changes are obvious, and all inventions and creations using the concept of the present invention are within the scope of protection.
[0074] When classifying the cooling holes processed in the drilling image, their types include penetrated and non-penetrated, where penetrated includes semi-penetrated and fully penetrated. That is, when classifying the cooling holes, there are three types: semi-penetrated, fully penetrated, and non-penetrated. For ease of understanding, the top views and side views of fully penetrated, semi-penetrated, and non-penetrated are given in this solution. Specifically, reference can be made to Figures 12 to 15 .
[0075] Reference Figure 1 . Figure 1 shows a flowchart of a method for classifying laser holes based on a support vector machine; as shown in Figure 1 , this method S includes steps S1 to S7.
[0076] In S1, obtain the drilling image of the laser-processed aero-engine cooling holes (a schematic of the drilling image can be referred to Figure 2 ), and convert it into a grayscale image (a schematic of the grayscale image can be referred to Figure 3 ). Perform an inverse operation on the grayscale value of the grayscale image to obtain an inverse image (a schematic of the inverse image can be referred to Figure 4 ).
[0077] During implementation, the expression for preferably converting the drilling image into a grayscale image in this solution is:
[0078] V = 0.299 * R + 0.587 * G + 0.114 * B
[0079] Wherein, V is the gray value; R is the red component; G is the green component; B is the blue component;
[0080] The expression for performing the reverse operation is:
[0081] V` = 255 - V
[0082] Wherein, V` is the value after reversing V.
[0083] In step S2, the reverse image is binarized according to the statistical threshold A, and the largest contour and its contour center in the binarized image are extracted. The largest contour is used as the inner contour, and the schematic diagram of the inner contour can be referred to Figure 16 (a) in.
[0084] In step S3, the reverse image is binarized according to the statistical threshold B, and the largest contour and its contour center in the binarized image are extracted. The largest contour is used as the outer contour, and the schematic diagram of the outer contour can be referred to Figure 16 (b) in.
[0085] In an embodiment of the present invention, the method for obtaining the statistical threshold A and the statistical threshold B includes:
[0086] A1. According to the preset pixel range, the reverse image is binarized to obtain the binarized image A (a schematic diagram of the binarized image A can be referred to Figure 5 ), and the largest contour A and the center position A of the largest contour A in the binarized image A are extracted; the method for binarizing the reverse image according to the preset pixel range is: setting the pixel values within the preset pixel range in the reverse image to 255, and setting the remaining pixel values to 0; wherein, the preset pixel range is 60 - 255.
[0087] A2. Count the number of pixel points with pixel values greater than the first threshold in the binarized image A, convert the counted number of pixel points into the area of a weighted equivalent circle, and calculate the equivalent radius A of the weighted equivalent circle; in implementation, the preferred expression for calculating the first threshold Th1 in this solution is Th1 = 0.618 * 255.
[0088] The calculation formula for the equivalent radius A in step A2 is:
[0089]
[0090] Wherein, r A is the equivalent radius A; S A is the area of the weighted equivalent circle of the largest contour A; N A is the number of pixel points counted in the largest contour A;
[0091] A3. Count the pixel values inside the circle drawn with the center position A as the center and the equivalent radius A as the radius, and calculate the statistical threshold A using reverse weighting according to the pixel values sorted in ascending order inside the circle;
[0092] A4. Binarize the reverse image according to the statistical threshold A to obtain a binarized image B, and extract the center position B of the largest contour B and the largest contour B in the binarized image B (specifically, reference Figure 7 ); In step S2 and step A4, the method of binarizing the reverse image according to the statistical threshold A is: set the pixel values greater than the statistical threshold A in the reverse image to 255, and the remaining pixel values to 0.
[0093] A5. Binarize the area of the largest contour B and perform a reverse operation to obtain a first mask (specifically refer to Figure 8 ); Convert the pixel points in the area of the largest contour B into the area of an equivalent circle, and calculate the equivalent radius B of the equivalent circle. In step S3 and step A5, the method of binarizing the reverse image according to the statistical threshold B is: set the pixel values greater than the statistical threshold B in the reverse image to 255, and the remaining pixel values to 0.
[0094] The calculation formula for the equivalent radius B in step A5 is:
[0095]
[0096] where r B is the equivalent radius B; S B is the area of the equivalent circle corresponding to the largest contour B; N B is the number of pixel points counted in the largest contour B.
[0097] A6. Take the center position B as the center and the preset multiple of the equivalent radius B as the radius to obtain a circle B, binarize the part outside the area of the circle B to obtain a second mask (refer to Figure 9 ); The preset multiple is preferably 2.5 - 2.8, and the optimal value is 2.5.
[0098] A7. Overlap the first mask and the second mask, reverse the pixel values in the circular ring area to obtain a statistical area (refer to Figure 10 ), and calculate the statistical threshold B using reverse weighting according to the pixel values sorted in ascending order in the statistical area.
[0099] This solution adjusts the threshold through a certain weighting operation based on the number of pixel points inside the extracted contour and the distribution characteristics of the pixel values, and performs more accurate local statistics for the characteristics of the hole edges, making the statistical thresholds A and B more accurate, so that the accuracy of the final contour extraction and hole classification is greatly improved.
[0100] In step S4, according to the inner contour and the outer contour, the central region of the area where the inner contour is located is determined, and the part of the outer contour that does not belong to the inner contour is used as the annular region. For the schematic diagram of the annular region, reference can be made to Figure 16 in (c).
[0101] In an embodiment of the present invention, the method for determining the central region includes:
[0102] S41. Taking the contour center of the inner contour as the center, draw a number of rays (in this solution, it is preferably to draw a ray every time the central angle increases by one degree), record the intersection positions of the rays and the inner contour, obtain a number of line segments, and take the average value of all line segments as the radius r of the equivalent circle in , for the schematic diagram of the equivalent circle of the inner contour, reference can be made to Figure 17 in (a).
[0103] S42. According to the lengths of all line segments and the radius r of the equivalent circle in , calculate the skewness W and roundness D of the equivalent circle corresponding to the inner contour:
[0104]
[0105] where C in is the contour center of the inner contour; C out is the contour center of the outer contour; r max is the length of the longest line segment; r min is the length of the shortest line segment; D is the roundness.
[0106] S43. Judge whether any value of the skewness W and the roundness D satisfies its corresponding threshold condition. If so, take the overlapping area of the equivalent circle in step S41 and the inner contour as the central region. For details, reference can be made to Figure 17 in (b). Otherwise, take the area where the inner contour is located as the central region. For details, reference can be made to Figure 17 in (c).
[0107] This solution defines the central region to consider special cases such as the sieve circle (see Figure 18 in (a)), the crescent circle (see Figure 18 in (b)), the deformed circle (see Figure 18 in (c)), etc., to avoid the situation where only part of the inner contour is detected at the inner contour position, which affects the determination of the annular region and further affects the subsequent classification detection.
[0108] Among them, the threshold condition for the skewness W is W > 0.382 * 0.618, and r in / r out < 0.5, r out is the radius of the equivalent circle of the outer contour, and its acquisition method is the same as that of r inThe acquisition method is the same; the threshold condition for the roundness D is D > 0.382 * 0.618.
[0109] In step S5, count the multiple color patches formed by the pixel points with pixel values lower than the corresponding area thresholds in the central area and the annular area, calculate the area of each color patch, and count the total area of the color patches in the central area and the annular area as the total area of its anti-threshold color patches and calculate the distance from the contour center of the central area to the contour center of the outer contour;
[0110] In step S6, according to the areas of the color patches in the central area and the annular area, perform distance weighting to obtain the weighted distances of the central area and the annular area respectively. The expression for the weighted distance is:
[0111]
[0112] where x is a variable. When its value is 1, it represents the central area; when its value is 2, it represents the annular area; n x is the total number of color patches in x; C i,x is the distance from the contour center of the i-th color patch in x to the center of the outer contour; S i,x is the contour area of the i-th color patch in x; r out is the radius of the equivalent circle of the outer contour; S all,x is the total area of all color patches in x; is the weighted distance corresponding to x.
[0113] In step S7, input the weighted distances of the central area and the annular area and the total area of the anti-threshold color patches into a support vector machine for classification to obtain the classification result of the cooling holes; the types of cooling holes include fully penetrated, semi-penetrated, and non-penetrated.
[0114] In implementation, this solution preferably further includes step S7:
[0115] S71. Input the weighted distance of the central area and the total area of the anti-threshold color patches into the first support vector machine for classification to obtain the classification result of the cooling holes;
[0116] S72. Judge whether the classification result is of the penetrated type. If so, proceed to step S73; otherwise, directly output the classification result (non-penetrated);
[0117] S73. Input the weighted distance of the annular area and the total area of the anti-threshold color patches into the second support vector machine for classification to obtain the classification result of the cooling holes (fully penetrated or semi-penetrated).
[0118] When training the first support vector machine and the second support vector machine, several punching images including normal punching through, semi-punching through, and non-punching through are obtained. For these images, the weighted distance between the central region and the annular region and the total area of the anti-threshold color blocks are obtained respectively in the manner of steps S1 to S6 of this solution. The weighted distance of the central region, the total area of the anti-threshold color blocks, and the label (here, the labels for semi-punching through and normal punching through are both punching through, and the label for non-punching through remains non-punching through) are used as a data set to train the first support vector machine.
[0119] The weighted distance and the total area of the anti-threshold color blocks of the annular regions corresponding to all labels of semi-punching through and normal punching through are used as a training set to train the second support vector machine. The label of the punching picture can be determined through the side view of the cooling hole processed by laser machining (reference can be made to Figure 15 ).
[0120] In an embodiment of the present invention, the method for extracting the maximum contour in steps S2, S3, step A1, and step A4 is as follows:
[0121] The dilation function, erosion function, and denoising function in the opencv2 software are used to process the binary image. The processed image can be referred to Figure 6 , and then the contour recognition function of opencv2 is used to recognize the contour to obtain the maximum contour in the binary image;
[0122] The method for extracting the central position of the maximum contour in steps S2, S3, step A1, and step A4 is as follows: The central extraction function in the opencv2 software is used to extract the central position of the maximum contour.
[0123] During implementation, in this solution, it is preferred that when extracting the maximum contour in step A1, the kernel of the dilation function is 3*3, the kernel of the erosion function is 3*3, the kernel of the denoising function is 5*5, dilation and erosion are both iterated once, and denoising is performed once.
[0124] In an embodiment of the present invention, the expressions for calculating the statistical threshold A and the statistical threshold B using reverse weighted calculation are both:
[0125]
[0126] Among them, k is a variable, Th1 is the statistical threshold A, Th2 is the statistical threshold B; V p,k , P k , V i,k , and N k are the weight distribution rate, quantity segmentation rate, the i-th pixel value in ascending order within the region, and the total quantity of the i-th pixel value within the region corresponding to k respectively; M p,k and V p,k are the intermediate variables corresponding to k respectively; is the mean parameter corresponding to k;
[0127] The central region corresponds to the region threshold th c = Th1; the region threshold corresponding to the annular region: th b = Th2 * 0.9; the expression of the first threshold Th1 is Th1 = 0.618 * 255.
[0128] The weight distribution rate corresponding to the calculation of the statistical threshold A is 30%, and the quantity segmentation rate is 70%; the weight distribution rate corresponding to the calculation of the statistical threshold B is 61.8%, and the quantity segmentation rate is 70%.
[0129] In summary, the classification algorithm provided by this solution solves the low efficiency of the existing traditional method of manually judging and classifying punched pictures, effectively improves the accuracy of identifying the hole state, and greatly improves the efficiency of hole classification.
Claims
1. A method for laser hole classification based on support vector machine, characterized in that: Includes steps: S1, obtaining a punching image of a laser-processed cooling hole of an aero-engine, converting it into a grayscale image, and performing a reverse operation on the grayscale value of the grayscale image to obtain a reverse image; S2, binarizing the reverse image according to the statistical threshold A, extracting the maximum contour and its contour center in the binarized image, and taking the maximum contour as the inner contour; S3, binarizing the reverse image according to the statistical threshold B, extracting the maximum contour and its contour center in the binarized image, and taking the maximum contour as the outer contour; S4. According to the inner contour and the outer contour, determine the central area of the area where the inner contour is located, and use the part of the outer contour that does not belong to the inner contour as the annular zone area; S5, counting multiple color blocks consisting of pixel points whose pixel values in the central area and the annular area are lower than the threshold value of the corresponding area, calculating the area of each color block, counting the total area of the color blocks in the central area and the annular area as the total area of the anti-threshold color blocks, and calculating the distance from the contour center to the contour center of the outer contour; S6. Perform distance weighting according to the color block areas of the central area and the annular area to obtain weighted distances of the central area and the annular area respectively; S7. The weighted distance between the central area and the annular area and the total area of the anti-threshold color block are input into a support vector machine for classification to obtain a classification result of the cooling holes; the types of cooling holes include normal penetration, half penetration and non-penetration.
2. The method for laser hole classification based on support vector machine according to claim 1, characterized in that: Methods for determining the central area include: S41. Take the center of the inner contour as the center, make several rays, record the intersection of the rays and the inner contour, get several line segments, and take the average value of all line segments as the radius r of the equivalent circle in ; S42. According to the length of all line segments and the radius r of the equivalent circle in , calculate the skewness W and roundness D of the equivalent circle corresponding to the inner contour: Among them, C in is the contour center of the inner contour; C out is the contour center of the outer contour; r max is the length of the longest line segment; r min is the length of the shortest line segment; D is the roundness; S43, determine whether any value of the skewness W and the roundness D meets the corresponding threshold condition. If so, the overlapping area of the equivalent circle and the inner contour in step S41 is taken as the central area, otherwise the area where the inner contour is located is taken as the central area.
3. The method for laser hole classification based on support vector machine according to claim 2, characterized in that: The threshold condition of the skewness W is W>0.382*0.618, and r in / r out <0.5, r out is the radius of the equivalent circle of the outer contour, and its acquisition method is the same as r in The acquisition method is the same; the threshold condition of the roundness D is D>0.382*0.
618.
4. The method for laser hole classification based on support vector machine according to claim 1, characterized in that: Step S7 further comprises: S71, inputting the weighted distance of the central area and the total area of the anti-threshold color block into the first support vector machine for classification, to obtain the classification result of the cooling hole; S72, determining whether the classification result is a punch-through type, if so, proceeding to step S73, otherwise directly outputting the classification result; S73, inputting the weighted distance of the annular zone and the total area of the anti-threshold color block into the second support vector machine for classification, and obtaining the classification result of the cooling hole.
5. The method for laser hole classification based on support vector machine according to claim 1, characterized in that: The expression of weighted distance is: Where x is a variable. When its value is 1, it indicates the central area, and when its value is 2, it indicates the annular area. x is the total number of color blocks in x; C i,x is the distance from the center of the outline of the i-th color block in x to the center of the outer contour; S i,x is the contour area of the i-th color block in x; r out is the radius of the equivalent circle of the outer contour; S all,x is the total area of all color blocks in x; is the weighted distance corresponding to x.
6. The method for laser hole classification based on support vector machine according to claim 1, characterized in that: The method for obtaining the statistical threshold A and the statistical threshold B includes: A1. Binarize the reverse image according to a preset pixel range to obtain a binary image A, and extract the maximum contour A and the center position A of the maximum contour A in the binary image A; A2, counting the number of pixel points in the binary image A whose pixel values are greater than the first threshold, converting the counted number of pixel points into the area of a weighted equivalent circle, and calculating the equivalent radius A of the weighted equivalent circle; A3, counting the pixel values inside a circle drawn with the center position A as the center and the equivalent radius A as the radius, and using the reverse weighted calculation statistical threshold A according to the pixel values in ascending order within the circle; A4. Binarize the reverse image according to the statistical threshold A to obtain a binary image B, and extract the maximum contour B and the center position B of the maximum contour B in the binary image B; A5, binarizing the maximum contour area B, and performing a reverse operation to obtain a first mask; converting the pixel points of the maximum contour area B into the area of an equivalent circle, and calculating the equivalent radius B of the equivalent circle; A6, taking the center position B as the center and the preset multiple of the equivalent radius B as the radius to obtain a circle B, and performing binarization processing on the part outside the circle B area to obtain a second mask; A7, overlapping the first mask and the second mask, performing inverse calculation on the pixel values of the circular area to obtain a statistical area, and calculating a statistical threshold B by inverse weighting according to the ascending pixel values in the statistical area.
7. The method for laser hole classification based on support vector machine according to claim 6, characterized in that: The method for extracting the maximum contour in step S2, step S3, step A1 and step A4 is: The dilation function, erosion function and denoising function in the opencv2 software are used to process the binary image, and then the contour recognition function of opencv2 is used to identify the contour to obtain the maximum contour in the binary image; The method for extracting the center position of the maximum contour in step S2, step S3, step A1 and step A4 is: using the center extraction function in the opencv2 software to extract the center position of the maximum contour.
8. The method for laser hole classification based on support vector machine according to claim 6, characterized in that: The expressions of the statistical threshold A and the statistical threshold B calculated by reverse weighting are: M p,k =N k *P k Where k is a variable, Th1 is the statistical threshold A, Th2 is the statistical threshold B; V p,k , P k 、V i,k and N k are the weight distribution rate corresponding to k, the number division rate, the i-th pixel value in the region in ascending order, and the total number of i-th pixel values in the region; M p,k and V p,k are the intermediate variables corresponding to k respectively; is the mean parameter corresponding to k; The central area corresponds to the area threshold th c =Th1; the corresponding area threshold of the ring area: th b =Th2*0.9; the expression of the first threshold Th1 is Th1=0.618*255.
9. The method for laser hole classification based on support vector machine according to claim 6, characterized in that: The calculation formula for the equivalent radius A in step A2 is: S A =N A *0.618 Among them, r A is the equivalent radius A; S A is the area of the weighted equivalent circle of the maximum contour A; N A is the number of pixels counted in the maximum contour A; The calculation formulas for the equivalent radius B in A5 are: S B =N B *0.618 Among them, r B is the equivalent radius B; S B is the area of the equivalent circle corresponding to the maximum contour B; N B is the number of pixels counted in the maximum contour B.
10. The method for laser hole classification based on support vector machine according to claim 6, characterized in that: According to the preset pixel range, the method of binarizing the reverse image is as follows: setting the pixel values in the reverse image within the preset pixel range to 255, and setting the remaining pixel values to 0; In step S2 and step A4, according to the statistical threshold A, the method of binarizing the reverse image is as follows: setting the pixel values in the reverse image that are greater than the statistical threshold A to 255, and setting the remaining pixel values to 0; In step S3 and step A5, according to the statistical threshold B, the method of binarizing the reverse image is as follows: the pixel values in the reverse image that are greater than the statistical threshold B are set to 255, and the remaining pixel values are set to 0.
Citation Information
Patent Citations
Lunar surface rock detection method based on super-pixel description
CN103871062A
Sound hole defect detection method and system for cellphone glass panel
CN105321182A