A quality inspection method and system for aluminum profile cross section

Through industrial camera collection and ant algorithm processing of aluminum profile cross-section images, the problems of low efficiency and low accuracy of traditional detection methods are solved, and efficient and accurate aluminum profile cross-section detection is achieved, adapting to products of different shapes and sizes, and reducing the cost of inconsistency. Qualified product rate and the impact of human judgment.

CN118379289BActive Publication Date: 2024-09-20JIANGXI TELET ALUMINUM CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410814220.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-09-20
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

Traditional aluminum profile cross-section inspection methods are inefficient and inaccurate. They suffer from manual subjectivity and insufficient adaptability. They cannot flexibly cope with products of different shapes and sizes, resulting in a high rate of defective products and inconsistent inspection results.

Method used

An industrial camera is used to collect the cross-sectional image of the aluminum profile, and the optimal segmentation threshold and pixel distance are calculated through the ant algorithm for initial positioning and edge segmentation. The linear function expression and the least square method are combined for grayscale processing, and the preset standard size table is matched to determine the aluminum profile. quality.

Benefits of technology

It improves detection efficiency and accuracy, reduces the rate of defective products, enhances the adaptability and credibility of detection, ensures compliance with product specifications, and reduces the subjectivity of human judgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118379289B
    Figure CN118379289B
Patent Text Reader

Abstract

The present invention relates to the technical field of material detection, and specifically to a quality detection method and system for aluminum profile cross sections, comprising: performing image acquisition on a target aluminum profile cross section through an industrial camera to obtain a target aluminum profile cross section image, and performing a preprocessing operation on the target aluminum profile cross section image to obtain a standard target aluminum profile cross section image; performing an initial positioning of the edge of the standard target aluminum profile cross section image through an ant algorithm to obtain a first edge contour image of the standard target aluminum profile cross section image. The present invention improves the efficiency of detection through efficient image acquisition and initial positioning of aluminum profile cross sections, so that aluminum profile cross section images can be quickly acquired and processed, saving time costs on the production line, and by calculating the optimal segmentation threshold of the edge contour image and the pixel distance between quantized edge contour lines, accurate detection of the cross-sectional dimensions of the aluminum profile is achieved, thereby ensuring the accuracy of the detection results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of material detection, and in particular to a quality detection method and system for a cross section of an aluminum profile. Background Art

[0002] The cross-section of aluminum profile refers to the cross-sectional shape formed after cutting, pressing or extruding the aluminum material during the processing or production process. The cross-section of aluminum profile can be various shapes, such as round, square, rectangular, oval, etc. Its size and shape are usually determined according to specific usage needs and design requirements. Aluminum profile cross-section is widely used in construction, engineering, manufacturing and other fields. It is often used to make window frames, door frames, tracks, pipes, frames and other structures or parts. Due to the excellent corrosion resistance, light weight and high strength of aluminum, aluminum profile cross-section has an important position and application value in modern industry.

[0003] Traditional methods may rely on manual operation or simple detection equipment, and cannot quickly and efficiently obtain aluminum profile cross-sectional images and process them, resulting in low detection efficiency and easily causing a waste of time on the production line. Traditional methods may not be very accurate in size detection. Since they rely on human visual judgment or simple measuring tools, errors are prone to occur, resulting in product sizes not meeting specifications and increasing the defective rate. Traditional methods may rely on manual judgment and operation, and have a high degree of subjectivity. They are prone to inconsistent results due to individual differences or subjective judgments, reducing the credibility of the test results. Traditional methods may lack the ability to adapt to aluminum profiles of different shapes and sizes, and cannot flexibly respond to products of different models and sizes, limiting the versatility and scope of application of the methods. Summary of the invention

[0004] The purpose of the present invention is to solve the problems existing in the background technology and to provide a quality inspection method and system for the cross section of aluminum profiles.

[0005] The technical solution of the present invention is a method for detecting the quality of an aluminum profile cross section, comprising:

[0006] Capturing an image of a target aluminum profile cross section by an industrial camera to obtain a target aluminum profile cross section image, and performing a preprocessing operation on the target aluminum profile cross section image to obtain a standard target aluminum profile cross section image;

[0007] Preliminarily positioning the edge of the standard target aluminum profile cross-section image by using an ant algorithm to obtain a first edge contour image of the standard target aluminum profile cross-section image;

[0008] Calculating an optimal segmentation threshold of the first edge contour image, and segmenting the edge contour and the background area of ​​the first edge contour image based on the optimal segmentation threshold to obtain a second edge contour image;

[0009] Quantifying the pixel distance between edge contour lines in the second edge contour image, and obtaining a pixel equivalent corresponding to the pixel distance according to a ratio of a pixel size of the industrial camera and a cross-sectional size of the target aluminum profile;

[0010] Acquire the detection size of the cross section of the target aluminum profile based on the pixel equivalent, compare the detection size with a preset standard size table, and if the error between the two is higher than a preset detection threshold, it indicates that the quality inspection of the target aluminum profile fails;

[0011] If the error between the two is lower than a preset detection threshold, the second edge contour image is matched with the preset standard edge contour image to obtain a matching degree between the two. If the matching degree is higher than the preset matching threshold, it indicates that the target aluminum profile quality inspection is qualified; otherwise, it indicates that the target aluminum profile quality inspection is unqualified.

[0012] Preferably, the target aluminum profile cross-section image is preprocessed to obtain a standard target aluminum profile cross-section image, including:

[0013] Performing regional segmentation on a part of the target aluminum profile cross-section image to obtain a plurality of regional aluminum profile cross-section images;

[0014] The cross-sectional images of aluminum profiles in multiple regions are expressed by linear functions, and the mean square error cost function of the linear function is calculated. The linear function is as follows:

[0015] ;

[0016] in, Represents the output value of the linear function corresponding to the i-th pixel point in the regional aluminum profile cross-section image, and represents the constant coefficient of the aluminum profile cross-section image in the kth region, Represents the pixel gray value of the i-th pixel in the regional aluminum profile cross-section image;

[0017] The mean square error cost function is as follows:

[0018] ;

[0019] in, represents the mean square error cost function, represents the cross-sectional image of the aluminum profile in the kth region, represents the compensation coefficient;

[0020] The mean square error cost function is solved by the least square method to obtain the constant coefficient of the optimized k-th region aluminum profile cross-section image, and the constant coefficient of the optimized k-th region aluminum profile cross-section image is substituted into the linear function to obtain the standard target aluminum profile cross-section image. The constant coefficient expression of the optimized k-th region aluminum profile cross-section image is as follows:

[0021] ;

[0022] in, and represents the constant coefficient of the optimized k-th region aluminum profile cross-section image, Represents the pixel grayscale mean of the target aluminum profile cross-section image, represents the pixel grayscale mean of the aluminum profile cross-section image in the kth region, represents the pixel grayscale standard deviation of the aluminum profile cross-section image in the kth region, Indicates the number of area aluminum profile cross-section images.

[0023] Preferably, initially locating the edge of the standard target aluminum profile cross-section image by using an ant algorithm to obtain a first edge contour image of the standard target aluminum profile cross-section image includes:

[0024] Randomly arrange P ants in the standard target aluminum profile cross-section image, wherein all pixel points in the standard target aluminum profile cross-section image are nodes that the ants need to traverse;

[0025] The transformation probability of the ant moving from the first node to the second node is calculated, and the movement path of the ant in the standard target aluminum profile cross-section image is obtained based on the transformation probability, where the movement path is the first edge contour of the standard target aluminum profile cross-section image.

[0026] Preferably, the transformation probability calculation formula is as follows:

[0027] ;

[0028] in, represents the probability of the ant changing from the first node to the second node, Represents the second node of the n-1th iteration The pheromone value of Represents the second node The heuristic information value of and Represent the impact factors of pheromone matrix and heuristic matrix respectively, Represents the first node The set of all pixels in the neighborhood of , represents the normalization factor, Represents the second node The total pixel intensity in the neighborhood of Represents the second node The pixel intensity value at , and .

[0029] Preferably, the second node The calculation formula of the heuristic information value is as follows:

[0030] ;

[0031] in, Indicates the volatility factor of pheromone.

[0032] Preferably, calculating the optimal segmentation threshold of the first edge contour image includes:

[0033] The first edge contour image is divided into k+1 regional edge contour images by setting k pixel value segmentation thresholds, and the occurrence probability of the pixel of each regional edge contour image is calculated. The calculation formula of the occurrence probability of the pixel is as follows:

[0034] ;

[0035] in, Respectively represent the occurrence probability of pixels of the edge contour images of the 0th, 1st to kth regions, Represents the probability of different pixel values ​​i appearing in the region edge contour image, represents the k pixel value segmentation threshold;

[0036] The average grayscale value of each of the regional edge contour images is calculated based on the occurrence probability of the pixels of the regional edge contour image, and the average grayscale value of the first edge contour image is calculated based on the average grayscale value of each of the regional edge contour images. The average grayscale value calculation formula of the regional edge contour image is as follows:

[0037] ;

[0038] in, Respectively represent the average gray value of the pixels of the edge contour image of the 0th, 1st to kth regions;

[0039] The average gray value calculation formula of the first edge contour image is as follows:

[0040] ;

[0041] in, They respectively represent the average gray value of the first edge contour image.

[0042] Preferably, calculating the optimal segmentation threshold of the first edge contour image further includes:

[0043] The inter-class variance of the first edge contour image is calculated based on the average grayscale value of the first edge contour image. The inter-class variance calculation formula of the first edge contour image is as follows:

[0044] ;

[0045] in, Respectively represent the inter-class variance of the first edge contour image;

[0046] The optimal segmentation threshold is represented based on the inter-class variance of the first edge contour image, and the optimal segmentation threshold is solved based on the representation of the optimal segmentation threshold to obtain the optimal segmentation threshold. The optimal segmentation threshold is represented as follows:

[0047] ;

[0048] in, represents the inter-class variance of the first edge contour image corresponding to the optimal segmentation threshold, represents the k best segmentation thresholds;

[0049] The optimal segmentation threshold calculation formula is as follows:

[0050] .

[0051] Preferably, matching the second edge contour image with a preset standard edge contour image to obtain a matching degree between the two includes:

[0052] Performing feature extraction on the second edge contour image through a feature extraction model to obtain first image features, and performing feature extraction on the standard edge contour image through a feature extraction model to obtain second image features;

[0053] The similarity between the first image feature and the second image feature is calculated through a similarity model, and the similarity is the matching degree between the second edge contour image and a preset standard edge contour image.

[0054] Preferably, the similarity model is as follows:

[0055] ;

[0056] in, represents the similarity between the first image feature and the second image feature, and Respectively represent image features as types The first image feature u and the second image feature v, and Respectively represent image features as types The average feature vector of the first image feature u and the second image feature v, represents the common image feature type of the first image feature u and the second image feature v;

[0057] ;

[0058] in, Represents image features as type The penalty factor, Indicates that the image feature type is type The number of Represents image features as type The number of image features is greater than or equal to a preset threshold value.

[0059] The technical solution of the present invention is a quality inspection system for aluminum profile cross sections, which is applicable to the quality inspection method for aluminum profile cross sections, comprising:

[0060] An image acquisition unit, the image acquisition unit is used to acquire an image of a target aluminum profile cross section through an industrial camera, and perform a preprocessing operation on the obtained image to obtain a standard target aluminum profile cross section image;

[0061] An edge positioning unit, the edge positioning unit is used to use an ant algorithm to initially position the edge of the standard target aluminum profile cross-section image to obtain a first edge contour image;

[0062] An image segmentation unit, the image segmentation unit is used to calculate an optimal segmentation threshold of the first edge contour image, segment it from the background area to obtain a second edge contour image, and quantify the pixel distance between edge contour lines;

[0063] A quality detection unit, which is used to obtain a pixel equivalent corresponding to a pixel distance based on a ratio of a pixel size to a cross-sectional size of an aluminum profile, thereby calculating a detection dimension of the cross-sectional size of the aluminum profile, and comparing the detection dimension with a preset standard dimension table to determine whether the quality of the aluminum profile is qualified;

[0064] The matching calculation unit is used to match the second edge contour image with a preset standard edge contour image, calculate their matching degree, and compare them with a preset matching threshold to determine whether the quality of the aluminum profile is qualified.

[0065] Compared with the prior art, the above technical solution of the present invention has the following beneficial technical effects:

[0066] The present invention improves the efficiency of detection by efficiently collecting and initially positioning the cross section of the aluminum profile, so that the cross section image of the aluminum profile can be quickly acquired and processed, saving the time cost on the production line, and by calculating the optimal segmentation threshold of the edge contour image and the pixel distance between the quantized edge contour lines, the accurate detection of the cross section size of the aluminum profile is achieved, and the accuracy of the detection result is guaranteed, so that the product can be ensured to meet the specifications and the defective rate caused by the size deviation is reduced, and by adopting the linear function expression and the least square method to solve, the cross section images of the aluminum profiles in different regions are gray-scale processed, so that the method has a certain degree of adaptability and can adapt to aluminum profiles of different shapes and sizes. In this way, aluminum profiles of different models and sizes can be handled, and the versatility of the method is improved, and by setting a preset standard size table and a matching threshold, the detection result is judged, thereby ensuring the reliability and accuracy of the cross section quality detection of the aluminum profile, so that the subjectivity of human judgment can be reduced and the credibility of the detection result is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 A schematic flow chart of an overall method in an embodiment of the present invention;

[0068] Figure 2 A schematic diagram of a flow chart of an image preprocessing operation in an embodiment of the present invention;

[0069] Figure 3 A schematic diagram of a process of initial edge positioning in an embodiment of the present invention;

[0070] Figure 4 A schematic diagram of a flow chart of calculating an optimal segmentation threshold in an embodiment of the present invention;

[0071] Figure 5 A schematic diagram of a flow chart of matching degree calculation in an embodiment of the present invention;

[0072] Figure 6 A schematic diagram of the overall system flow in an embodiment of the present invention.

[0073] Figure numerals: 1. Image acquisition unit; 2. Edge positioning unit; 3. Image segmentation unit; 4. Quality detection unit; 5. Matching calculation unit. DETAILED DESCRIPTION

[0074] Embodiment 1, as Figure 1 As shown, the present invention provides a quality inspection method for aluminum profile cross section, comprising:

[0075] S1. Capturing an image of a target aluminum profile cross section by an industrial camera to obtain a target aluminum profile cross section image, and performing a preprocessing operation on the target aluminum profile cross section image to obtain a standard target aluminum profile cross section image;

[0076] S2. Preliminarily locating the edge of the standard target aluminum profile cross-section image by using an ant algorithm to obtain a first edge contour image of the standard target aluminum profile cross-section image;

[0077] S3, calculating an optimal segmentation threshold of the first edge contour image, and segmenting the edge contour of the first edge contour image from the background area based on the optimal segmentation threshold to obtain a second edge contour image;

[0078] S4, quantifying the pixel distance between the edge contour lines in the second edge contour image, and obtaining the pixel equivalent corresponding to the pixel distance according to the ratio of the pixel size of the industrial camera and the cross-sectional size of the target aluminum profile;

[0079] S5. Obtain the detection size of the target aluminum profile cross section based on pixel equivalent, and compare the detection size with a preset standard size table. If the error between the two is higher than a preset detection threshold, it indicates that the target aluminum profile quality inspection fails;

[0080] S6. If the error between the two is lower than a preset detection threshold, the second edge contour image is matched with the preset standard edge contour image to obtain a matching degree between the two. If the matching degree is higher than the preset matching threshold, it indicates that the target aluminum profile quality inspection is qualified; otherwise, it indicates that the target aluminum profile quality inspection is unqualified.

[0081] In the present invention, an industrial camera is a camera device specially designed for industrial applications, and usually has the characteristics of high resolution, high speed and durability. They are usually used for visual inspection, automatic control, image acquisition and other applications on production lines to meet the requirements of image quality and stability in industrial environments; the ant algorithm is a heuristic optimization algorithm based on the behavior of ant colonies in nature. This algorithm was originally inspired by the behavior of ants in finding food and choosing paths, and finds the optimal solution by simulating the pheromones released by ants when looking for food and communicating with other ants; ants release a chemical called pheromone when looking for food, and the pheromone concentration on the path is affected by factors such as the frequency of ants passing by and the length of the path. Other ants will choose a path based on the pheromone concentration, and usually tend to choose a path with a higher pheromone concentration. As time goes by, the pheromone will evaporate, so the pheromone concentration on a shorter path will gradually increase, thereby attracting more ants to choose the path, and finally forming a stable path.

[0082] In the present invention, the pixel distances between edge contour lines in the second edge contour image are quantified, and the specific steps are: extracting the pixel coordinates or contour point sets of the edge contour lines, for each pair of adjacent pixel points on the contour lines, the distance between them can be calculated using the Euclidean distance formula, and the distances between all pixel points are quantified or summed to obtain the average pixel distance or other statistics between the edge contour lines.

[0083] Embodiment 2, as Figure 2-Figure 5 As shown, the quality inspection method of the aluminum profile cross section proposed by the present invention, compared with the first embodiment, this embodiment further includes: performing a preprocessing operation on the target aluminum profile cross section image to obtain a standard target aluminum profile cross section image, including:

[0084] A1. Performing regional segmentation on a part of the target aluminum profile cross-section image to obtain multiple regional aluminum profile cross-section images;

[0085] A2. Express the cross-sectional images of aluminum profiles in multiple regions through linear functions, and calculate the mean square error cost function of the linear function. The linear function is as follows:

[0086] ;

[0087] in, Represents the output value of the linear function corresponding to the i-th pixel point in the regional aluminum profile cross-section image, and represents the constant coefficient of the aluminum profile cross-section image in the kth region, Represents the pixel gray value of the i-th pixel in the regional aluminum profile cross-section image;

[0088] The mean square error cost function is as follows:

[0089] ;

[0090] in, represents the mean square error cost function, represents the cross-sectional image of the aluminum profile in the kth region, represents the compensation coefficient;

[0091] A3. Solve the mean square error cost function by the least square method to obtain the constant coefficient of the optimized k-th region aluminum profile cross-section image. Substitute the constant coefficient of the optimized k-th region aluminum profile cross-section image into the linear function to obtain the standard target aluminum profile cross-section image. The constant coefficient expression of the optimized k-th region aluminum profile cross-section image is as follows:

[0092] ;

[0093] in, and represents the constant coefficient of the optimized k-th region aluminum profile cross-section image, Represents the pixel grayscale mean of the target aluminum profile cross-section image, represents the pixel grayscale mean of the aluminum profile cross-section image in the kth region, represents the pixel grayscale standard deviation of the aluminum profile cross-section image in the kth region, Indicates the number of area aluminum profile cross-section images.

[0094] In this embodiment, the mean square error cost function is used to measure the difference between the linear function fitting and the actual image, and the quality of the fitting is evaluated by calculating the mean square error between the linear function and the actual pixel value of each region; the least squares method is a common mathematical optimization method used to solve the optimal solution in a linear equation system or a nonlinear equation system. Here, the least squares method is used to optimize the constant coefficient of the aluminum profile cross-section image of each region to minimize the mean square error; the constant coefficient is used as the coefficient expressed by the linear function, which represents the characteristics of the aluminum profile cross-section image of each region. The optimal constant coefficient is obtained by solving the least squares method and is used to generate a standard target aluminum profile cross-section image; the compensation coefficient is used to adjust the output value of the linear function to better fit the pixel value distribution of the actual image.

[0095] In an optional embodiment, initially locating the edge of the standard target aluminum profile cross-section image by using an ant algorithm to obtain a first edge contour image of the standard target aluminum profile cross-section image includes:

[0096] B1. Randomly arrange P ants in the standard target aluminum profile cross-section image, where all pixel points in the standard target aluminum profile cross-section image are nodes that the ants need to traverse;

[0097] B2. Calculate the transformation probability of the ant moving from the first node to the second node, and obtain the movement path of the ant in the standard target aluminum profile cross-section image based on the transformation probability. The movement path is the first edge contour of the standard target aluminum profile cross-section image.

[0098] It should be noted that ant layout is to randomly place ants on the pixels of the image as the starting state of the ant algorithm; the traversed nodes here refer to all the pixels in the image, and the ants need to traverse these pixels through the ant algorithm to determine the edge contour; the transformation probability is the probability of the ant moving from one node to another, which is usually related to the distance between the nodes and the pheromone concentration. Here, the movement path of the ant in the image is determined by calculating the transformation probability to obtain the edge contour; the movement path is the path of the ant moving in the image, which is determined according to the rules and probabilities of the ant algorithm and is used to preliminarily locate the edge contour of the image.

[0099] In an optional embodiment, the transformation probability calculation formula is as follows:

[0100] ;

[0101] in, represents the probability of the ant changing from the first node to the second node, Represents the second node of the n-1th iteration The pheromone value of Represents the second node The heuristic information value of and Represent the impact factors of pheromone matrix and heuristic matrix respectively, Represents the first node The set of all pixels in the neighborhood of , represents the normalization factor, Represents the second node The total pixel intensity in the neighborhood of Represents the second node The pixel intensity value at , and .

[0102] In an optional embodiment, the second node The calculation formula of the heuristic information value is as follows:

[0103] ;

[0104] in, Indicates the volatility factor of pheromone.

[0105] In an optional embodiment, calculating the optimal segmentation threshold of the first edge contour image includes:

[0106] C1. Set k pixel value segmentation thresholds to segment the first edge contour image into k+1 regional edge contour images, and calculate the appearance probability of pixels in each regional edge contour image. The calculation formula for the appearance probability of pixels is as follows:

[0107] ;

[0108] in, Respectively represent the occurrence probability of pixels of the edge contour images of the 0th, 1st to kth regions, Represents the probability of different pixel values ​​i appearing in the region edge contour image, represents the k pixel value segmentation threshold;

[0109] C2. Calculate the average gray value of each regional edge contour image based on the occurrence probability of the pixels of the regional edge contour image, and calculate the average gray value of the first edge contour image based on the average gray value of each regional edge contour image. The average gray value calculation formula of the regional edge contour image is as follows:

[0110] ;

[0111] in, Respectively represent the average gray value of the pixels of the edge contour image of the 0th, 1st to kth regions;

[0112] The calculation formula for the average gray value of the first edge contour image is as follows:

[0113] ;

[0114] in, They respectively represent the average gray value of the first edge contour image.

[0115] In an optional embodiment, calculating the optimal segmentation threshold of the first edge contour image further includes:

[0116] C3. Calculate the inter-class variance of the first edge contour image based on the average gray value of the first edge contour image. The inter-class variance calculation formula of the first edge contour image is as follows:

[0117] ;

[0118] in, Respectively represent the inter-class variance of the first edge contour image;

[0119] C4. The optimal segmentation threshold is expressed based on the inter-class variance of the first edge contour image. The optimal segmentation threshold is solved based on the expression of the optimal segmentation threshold to obtain the optimal segmentation threshold. The optimal segmentation threshold is expressed as follows:

[0120] ;

[0121] in, represents the inter-class variance of the first edge contour image corresponding to the optimal segmentation threshold, represents the k best segmentation thresholds;

[0122] The optimal segmentation threshold calculation formula is as follows:

[0123] .

[0124] In an optional embodiment, matching the second edge contour image with a preset standard edge contour image to obtain a matching degree between the two includes:

[0125] D1. extracting features from the second edge contour image using a feature extraction model to obtain first image features, and extracting features from the standard edge contour image using a feature extraction model to obtain second image features;

[0126] D2. Calculate the similarity between the first image feature and the second image feature through a similarity model. The similarity is the matching degree between the second edge contour image and the preset standard edge contour image.

[0127] It should be noted that a feature extraction model is a machine learning model used to extract key features from data. In the field of image processing, the feature extraction model is usually a convolutional neural network (CNN) or other deep learning models, which are used to extract representative features from images. These features include but are not limited to the edges, textures, and shapes of the images.

[0128] In an optional embodiment, the similarity model is as follows:

[0129] ;

[0130] in, represents the similarity between the first image feature and the second image feature, and Respectively represent image features as types The first image feature u and the second image feature v, and Respectively represent image features as types The average feature vector of the first image feature u and the second image feature v, represents the common image feature type of the first image feature u and the second image feature v;

[0131] ;

[0132] in, Represents image features as type The penalty factor, Indicates that the image feature type is type The number of Represents image features as type The number of image features is greater than or equal to a preset threshold value.

[0133] Embodiment three, as Figure 6 As shown, the present invention proposes a quality inspection system for aluminum profile cross sections, which is applicable to the quality inspection method for aluminum profile cross sections, and includes:

[0134] An image acquisition unit 1 is used to acquire an image of a target aluminum profile cross section through an industrial camera, and perform a preprocessing operation on the obtained image to obtain a standard target aluminum profile cross section image;

[0135] The edge positioning unit 2 is used to use an ant algorithm to initially position the edge of the standard target aluminum profile cross-section image to obtain a first edge contour image;

[0136] The image segmentation unit 3 is used to calculate the optimal segmentation threshold of the first edge contour image, segment it from the background area, obtain the second edge contour image, and quantify the pixel distance between the edge contour lines;

[0137] The quality detection unit 4 is used to obtain the pixel equivalent corresponding to the pixel distance based on the ratio of the pixel size and the cross-sectional size of the aluminum profile, and then calculate the detection size of the cross-sectional size of the aluminum profile, and compare the detection size with a preset standard size table to determine whether the quality of the aluminum profile is qualified;

[0138] The matching calculation unit 5 is used to match the second edge contour image with the preset standard edge contour image, calculate their matching degree, and compare them with the preset matching threshold to determine whether the quality of the aluminum profile is qualified.

[0139] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited thereto, and various changes can be made within the knowledge scope of technicians in the relevant technical field without departing from the purpose of the present invention.

Claims

1. A quality inspection method for aluminum profile cross section, It is characterized in that include: Capturing an image of a target aluminum profile cross section by an industrial camera to obtain a target aluminum profile cross section image, and performing a preprocessing operation on the target aluminum profile cross section image to obtain a standard target aluminum profile cross section image; Preliminarily positioning the edge of the standard target aluminum profile cross-section image by using an ant algorithm to obtain a first edge contour image of the standard target aluminum profile cross-section image; Calculating an optimal segmentation threshold of the first edge contour image, and segmenting the edge contour and the background area of ​​the first edge contour image based on the optimal segmentation threshold to obtain a second edge contour image; Quantifying the pixel distance between edge contour lines in the second edge contour image, and obtaining a pixel equivalent corresponding to the pixel distance according to a ratio of a pixel size of the industrial camera and a cross-sectional size of the target aluminum profile; Acquire the detection size of the cross section of the target aluminum profile based on the pixel equivalent, compare the detection size with a preset standard size table, and if the error between the two is higher than a preset detection threshold, it indicates that the quality inspection of the target aluminum profile fails; If the error between the two is lower than a preset detection threshold, the second edge contour image is matched with the preset standard edge contour image to obtain a matching degree between the two. If the matching degree is higher than the preset matching threshold, it indicates that the target aluminum profile quality inspection is qualified; otherwise, it indicates that the target aluminum profile quality inspection is unqualified.

2. A quality inspection method for an aluminum profile cross section according to claim 1, It is characterized in that The target aluminum profile cross-section image is preprocessed to obtain a standard target aluminum profile cross-section image, including: Performing regional segmentation on a part of the target aluminum profile cross-section image to obtain a plurality of regional aluminum profile cross-section images; The cross-sectional images of aluminum profiles in multiple regions are expressed by linear functions, and the mean square error cost function of the linear function is calculated. The linear function is as follows: ; in, Represents the output value of the linear function corresponding to the i-th pixel point in the regional aluminum profile cross-section image, and represents the constant coefficient of the aluminum profile cross-section image in the kth region, Represents the pixel gray value of the i-th pixel in the regional aluminum profile cross-section image; The mean square error cost function is as follows: ; in, represents the mean square error cost function, represents the cross-sectional image of the aluminum profile in the kth region, represents the compensation coefficient; The mean square error cost function is solved by the least square method to obtain the constant coefficient of the optimized k-th region aluminum profile cross-section image, and the constant coefficient of the optimized k-th region aluminum profile cross-section image is substituted into the linear function to obtain the standard target aluminum profile cross-section image. The constant coefficient expression of the optimized k-th region aluminum profile cross-section image is as follows: ; in, and represents the constant coefficient of the optimized k-th region aluminum profile cross-section image, Represents the pixel grayscale mean of the target aluminum profile cross-section image, represents the pixel grayscale mean of the aluminum profile cross-section image in the kth region, represents the pixel grayscale standard deviation of the aluminum profile cross-section image in the kth region, Indicates the number of area aluminum profile cross-section images.

3. A quality inspection method for aluminum profile cross section according to claim 1, It is characterized in that Preliminarily locating the edge of the standard target aluminum profile cross-section image by using an ant algorithm to obtain a first edge contour image of the standard target aluminum profile cross-section image, including: Randomly arrange P ants in the standard target aluminum profile cross-section image, wherein all pixel points in the standard target aluminum profile cross-section image are nodes that the ants need to traverse; The transformation probability of the ant moving from the first node to the second node is calculated, and the movement path of the ant in the standard target aluminum profile cross-section image is obtained based on the transformation probability, where the movement path is the first edge contour of the standard target aluminum profile cross-section image.

4. A quality inspection method for aluminum profile cross section according to claim 3, It is characterized in that The transformation probability calculation formula is as follows: ; in, represents the probability of the ant changing from the first node to the second node, Represents the second node of the n-1th iteration The pheromone value of Represents the second node The heuristic information value of and Represent the impact factors of pheromone matrix and heuristic matrix respectively, Represents the first node The set of all pixels in the neighborhood of , represents the normalization factor, Represents the second node The total pixel intensity in the neighborhood of Represents the second node The pixel intensity value at , and .

5. A quality inspection method for aluminum profile cross section according to claim 4, It is characterized in that The second node The calculation formula of the heuristic information value is as follows: ; in, Indicates the volatility factor of pheromone.

6. A quality inspection method for aluminum profile cross section according to claim 1, It is characterized in that Calculating the optimal segmentation threshold of the first edge contour image includes: The first edge contour image is divided into k+1 regional edge contour images by setting k pixel value segmentation thresholds, and the occurrence probability of the pixel of each regional edge contour image is calculated. The calculation formula of the occurrence probability of the pixel is as follows: ; in, Respectively represent the occurrence probability of pixels of the edge contour images of the 0th, 1st to kth regions, Represents the probability of different pixel values ​​i appearing in the region edge contour image, represents the k pixel value segmentation threshold; The average grayscale value of each of the regional edge contour images is calculated based on the occurrence probability of the pixels of the regional edge contour image, and the average grayscale value of the first edge contour image is calculated based on the average grayscale value of each of the regional edge contour images. The average grayscale value calculation formula of the regional edge contour image is as follows: ; in, Respectively represent the average gray value of the pixels of the edge contour image of the 0th, 1st to kth regions; The average gray value calculation formula of the first edge contour image is as follows: ; in, They respectively represent the average gray value of the first edge contour image.

7. A quality inspection method for aluminum profile cross section according to claim 6, It is characterized in that Calculating the optimal segmentation threshold of the first edge contour image also includes: The inter-class variance of the first edge contour image is calculated based on the average grayscale value of the first edge contour image. The inter-class variance calculation formula of the first edge contour image is as follows: ; in, Respectively represent the inter-class variance of the first edge contour image; The optimal segmentation threshold is represented based on the inter-class variance of the first edge contour image, and the optimal segmentation threshold is solved based on the representation of the optimal segmentation threshold to obtain the optimal segmentation threshold. The optimal segmentation threshold is represented as follows: ; in, represents the inter-class variance of the first edge contour image corresponding to the optimal segmentation threshold, represents the k best segmentation thresholds; The optimal segmentation threshold calculation formula is as follows: 。 8. A quality inspection method for aluminum profile cross section according to claim 1, It is characterized in that Matching the second edge contour image with a preset standard edge contour image to obtain a matching degree between the two includes: Performing feature extraction on the second edge contour image through a feature extraction model to obtain first image features, and performing feature extraction on the standard edge contour image through a feature extraction model to obtain second image features; The similarity between the first image feature and the second image feature is calculated through a similarity model, and the similarity is the matching degree between the second edge contour image and a preset standard edge contour image.

9. A quality inspection method for an aluminum profile cross section according to claim 8, It is characterized in that The similarity model is as follows: ; in, represents the similarity between the first image feature and the second image feature, and Respectively represent image features as types The first image feature u and the second image feature v, and Respectively represent image features as types The average feature vector of the first image feature u and the second image feature v, represents the common image feature type of the first image feature u and the second image feature v; ; in, Represents image features as type The penalty factor, Indicates that the image feature type is type The number of Represents image features as type The number of image features is greater than or equal to a preset threshold value.

10. A quality inspection system for aluminum profile cross sections, which is applicable to the quality inspection method for aluminum profile cross sections according to any one of claims 1 to 9. It is characterized in that include: An image acquisition unit, the image acquisition unit is used to acquire an image of a target aluminum profile cross section through an industrial camera, and perform a preprocessing operation on the obtained image to obtain a standard target aluminum profile cross section image; An edge positioning unit, the edge positioning unit is used to use an ant algorithm to initially position the edge of the standard target aluminum profile cross-section image to obtain a first edge contour image; An image segmentation unit, the image segmentation unit is used to calculate an optimal segmentation threshold of the first edge contour image, segment it from the background area to obtain a second edge contour image, and quantify the pixel distance between edge contour lines; A quality detection unit, which is used to obtain a pixel equivalent corresponding to a pixel distance based on a ratio of a pixel size to a cross-sectional size of an aluminum profile, thereby calculating a detection dimension of the cross-sectional size of the aluminum profile, and comparing the detection dimension with a preset standard dimension table to determine whether the quality of the aluminum profile is qualified; The matching calculation unit is used to match the second edge contour image with a preset standard edge contour image, calculate their matching degree, and compare them with a preset matching threshold to determine whether the quality of the aluminum profile is qualified.

Citation Information

Cited By

  • Automatic turnover and anti-bending carrying device for sectional materials

    CN224618989U