A method for detecting surface quality of special-shaped bars
By calculating the light intensity matrix division characteristics and image superposition technology of the surface image of the special-shaped rod, the detection inaccuracy problem caused by simple image superposition is solved, and the surface quality detection accuracy and reliability are achieved.
Patent Information
- Application Number
- CN202411701467.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-11-26
AI Technical Summary
In the prior art In the surface quality detection of special-shaped metal rods, simple image superposition will lead to unnecessary texture features being extracted, affecting the accuracy of the detection.
By obtaining the grayscale images of multiple surface images of special-shaped rods at different angles, the division characteristics of the corresponding areas of the light intensity matrix are calculated, and suspected abnormal images are determined, and edge manifested images are obtained through image superposition and superposition index sorting, and finally the quality of special-shaped rods is judged based on surface quality evaluation.
This method can more comprehensively capture the texture and characteristics of the surface of the special-shaped rod, improve the accuracy of surface defect detection, reduce misjudgment and missed detection, and improve the reliability of detection.
Smart Images

Figure CN119180823B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of bar quality inspection, and more specifically, to a method for inspecting the surface quality of special-shaped bars. Background Art
[0002] Special-shaped metal bars are those with irregular cross-sectional shapes. Unlike common round, square or rectangular bars, their shapes may be more complex, such as polygonal, star-shaped, wavy, etc. Such bars have specific uses in industrial applications due to their unique shapes, but they also bring some challenges, especially in quality inspection. At present, the quality inspection of the surface of special-shaped metal bars based on machine vision is often affected by light, which makes it impossible to extract the fine texture information in the surface image of the special-shaped bar, resulting in inaccurate surface quality inspection.
[0003] The existing Chinese patent application document with publication number CN118115428A discloses a method for detecting surface defects of metal bars, which belongs to the field of defect detection technology. The patent application document includes: First, the collected surface images of the metal bars to be tested are preprocessed using CLAHE, and the preprocessed images are decomposed and reconstructed using NSST. Second, the M-SPP module in YOLOv5 is improved to replace the SPP module in the backbone network, and the improved space and coordinate attention module SCA is added. A new scale feature extraction layer is added to the feature fusion network to improve the loss function. Third, the enhanced data is sent to the network for iterative training, and the learning rate is adjusted using the Cosine Warmup algorithm. Fourth, after the model training is completed, the image to be detected is input into the optimal model obtained after training to detect the position, size and number of surface defects of the metal bars. This application document combines YOLOv5 with image processing, and the model structure is relatively simple, which can improve the accuracy of surface defects of metal bars to a certain extent.
[0004] In the above application documents, the contrast of the image is enhanced to make the defect features more obvious, and the image is decomposed and reconstructed to extract more texture and edge information; currently, traditional image enhancement includes: image superposition, contrast enhancement and brightness adjustment, among which contrast enhancement and brightness adjustment are commonly used technical means, but when simply superimposing the image, unnecessary texture features will be extracted, thereby affecting the accuracy of the enhanced surface quality detection. Summary of the invention
[0005] In order to solve the problem that unnecessary texture features are extracted when simply superimposing images, thereby affecting the accuracy of enhanced surface quality detection, the present invention provides solutions in the following aspects.
[0006] A method for detecting the surface quality of a special-shaped bar comprises: obtaining grayscale images of a plurality of surface images of the special-shaped bar at different angles, obtaining a light intensity matrix of each grayscale image, calculating the division characteristics of the area corresponding to the light intensity matrix, presetting a detection threshold based on the division characteristics, and determining a suspected abnormal image; superimposing the suspected abnormal images at different angles and obtaining a superposition index, sorting them based on the superposition index, and obtaining an edge-manifested image when a stop superposition condition is met; subtracting the edge-manifested image from a standard image, taking the ratio of the number of non-zero points to the number of all pixel points as a surface quality evaluation, and judging the quality of the special-shaped bar based on the surface quality evaluation; wherein the stop superposition condition is: in response to no new continuous pixel points appearing, the superposition is stopped; otherwise, the protrusion degree between the new continuous pixel points and the pixel points in the neighborhood is calculated, and in response to the minimum protrusion degree being less than a preset threshold, the superposition is stopped; wherein the protrusion degree Satisfies the following relationship: ; In the formula, , Respectively represent the image to be superimposed and the superimposed target The pixel value of the newly appeared edge pixel, , Respectively represent the image to be superimposed and the superimposed target The first of the newly appeared edge pixels The pixel value of the neighboring pixel points, Represents the mean value function.
[0007] The effect is as follows: by acquiring grayscale images from multiple angles and calculating the light intensity matrix, the method can more comprehensively capture the texture and features of the surface of special-shaped bars, thereby improving the accuracy of surface defect detection; by utilizing the divided features and the preset detection threshold, the method can effectively identify suspected abnormal images; by introducing the overlay index and the stop overlay condition, it can avoid unnecessary texture interference while retaining important features, thereby optimizing the image overlay process; the calculation of the protrusion degree and the application of the stop overlay condition help reduce misjudgment and missed detection, and improve the reliability of detection.
[0008] Preferably, obtaining the light intensity matrix includes:
[0009] A mixed Gaussian distribution model is used to statistically analyze the frequency of gray levels in the grayscale image to determine the distribution of grayscale values. The number of peaks is determined based on the mixed Gaussian distribution model, wherein the peaks represent the grayscale centers of different areas in the grayscale image. The number of peaks is used as the number of K-means clusters for clustering to obtain multiple clusters, and a light intensity matrix is constructed for each cluster.
[0010] The effect is: the mixed Gaussian distribution model can more finely analyze the distribution of gray levels in the grayscale image, and by fitting multiple Gaussian distributions to capture the grayscale characteristics of different areas in the image, and constructing multiple light intensity matrices, this method can more accurately segment the image. Each light intensity matrix corresponds to a cluster, which can more accurately evaluate the local quality of the image and help improve the standards of product quality control.
[0011] Preferably, the calculation of the division characteristics of the area corresponding to the light intensity matrix includes:
[0012] The distance between each pixel point and the cluster center in the cluster corresponding to the light intensity matrix is calculated as the degree of eccentricity, the grayscale mean of all pixel points in the light intensity matrix is calculated, the average value of the sum of the absolute differences between the degree of eccentricity and the grayscale mean is taken, and normalized to obtain the division characteristics of the area corresponding to the light intensity matrix.
[0013] The effect is that by analyzing the degree of eccentricity, it helps to analyze the texture structure of the image, where the texture is usually related to the distribution of pixels relative to the center of the region. It can capture the position information of each pixel in the image relative to its cluster center, which helps to describe the characteristics of the image more accurately.
[0014] Preferably, the step of presetting a detection threshold based on the division features to determine a suspected abnormal image includes:
[0015] In response to the division feature being greater than a preset detection threshold, the region corresponding to the light intensity matrix has a higher probability of an abnormality, and conversely, the region corresponding to the light intensity matrix has a lower probability of an abnormality;
[0016] The grayscale image corresponding to the light intensity matrix whose division feature is greater than the preset detection threshold is regarded as a suspected abnormal image.
[0017] The effect is that by automatically identifying suspected abnormal images, inspection resources can be allocated more efficiently, and detailed analysis of parts that may have problems can be prioritized, making it easier to quickly locate images with abnormal areas.
[0018] Preferably, the superimposing of the suspected abnormal images at different angles includes:
[0019] A set of suspected abnormal images under the same angle is obtained, the first suspected abnormal image is used as a superimposed target, and other suspected abnormal images except the superimposed target are used as images to be superimposed, and the superimposed target is superimposed with the image to be superimposed.
[0020] The effect is: by superimposing suspected abnormal images from different angles, the visibility of abnormal features can be enhanced, making defects that were not obvious in a single image more prominent in the superimposed image. The superimposed image can provide more comprehensive perspective information, which helps to more accurately identify and confirm abnormal areas and reduce misjudgments and missed judgments.
[0021] Preferably, obtaining the superposition index includes:
[0022] Acquire overlapping edges and non-overlapping edges between the superimposed target and the image to be superimposed;
[0023] Calculate the The ratio between the sum of the number of pixels of all edges where the to-be-superimposed image and the superimposed target overlap and the sum of the number of pixels of all edges of the superimposed target is used as a first ratio;
[0024] Get the The ratio between the number of overlapping edges of the image to be overlapped and the maximum number of overlapping edges of all the images to be overlapped is used as the second ratio;
[0025] The product of the first ratio and the second ratio is taken as the The overlay index of the image to be overlaid and the overlay target.
[0026] The effect is that by comprehensively considering the number of pixels of overlapping edges and the number of coincident edges, the degree of matching between images can be evaluated more accurately, which is conducive to quickly identifying which images to be superimposed have the highest degree of matching with the superimposed target based on the superposition index, thereby optimizing the selection process of image superposition.
[0027] Preferably, obtaining the superposition index further includes:
[0028] Calculate the The length of each overlapping edge in the image to be superimposed is calculated, and the number of overlapping edges is used as the weight for weighted summation to obtain the edge weighted length;
[0029] Calculate the product of the sum of the lengths of the overlapping edges of all the images to be superimposed and the sum of the numbers of the overlapping edges of all the images to be superimposed to obtain the comprehensive degree of overlapping edges;
[0030] The ratio between the weighted length of the edge and the comprehensive degree of the overlapping edges is taken as the first The overlay index of the image to be overlaid and the overlay target.
[0031] Preferably, the pixel value of the edge highlighting image is the average value of all pixel points after superposition.
[0032] Preferably, judging the quality of the special-shaped bar based on surface quality evaluation includes:
[0033] In response to the surface quality evaluation being greater than a preset threshold, the special-shaped bar is a low-quality bar, otherwise, the special-shaped bar is a high-quality bar.
[0034] The present invention has the following effects:
[0035] 1. The present invention determines suspected abnormal images by calculating the division features of the area corresponding to the light intensity matrix and presetting the detection threshold according to the division features. It can quickly locate local surface defects and more accurately distinguish surface defects from unnecessary texture features, which helps to reduce false alarms, that is, avoid misjudging normal textures as defects, thereby improving the accuracy of surface quality detection.
[0036] 2. The present invention superimposes suspected abnormal images from multiple angles and controls the image superposition process according to the superposition index and the stop superposition condition to ensure that only the truly important features are enhanced and unnecessary texture features are suppressed, thereby effectively highlighting the abnormal features and enabling the detection system to more reliably identify and locate surface defects. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0038] Figure 1 It is a method flow chart of steps S1 to S3 in a method for detecting surface quality of special-shaped bars in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0040] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0041] The specific implementation scenario is: cameras are set at equal distances above the conveyor belt to capture the surface images of the special-shaped bars as they move along the conveyor belt. Due to the irregular shape of the special-shaped bars, the surface brightness at different positions is inconsistent, and the texture features of the irregular side at different angles are analyzed, and the brightness features of the irregular side are obtained. The specific steps are as follows:
[0042] Reference Figure 1A method for detecting the surface quality of a special-shaped bar includes steps S1 to S3, which are specifically as follows:
[0043] S1: Obtain multiple grayscale images of the surface images of the special-shaped rods at different angles, obtain the light intensity matrix of each grayscale image, calculate the division features of the area corresponding to the light intensity matrix, preset the detection threshold based on the division features, and determine the suspected abnormal image.
[0044] In this embodiment, the preset detection threshold is 0.8, which can be adjusted according to actual conditions.
[0045] A mixed Gaussian distribution model is used to statistically analyze the grayscale frequency of the grayscale image to determine the distribution of the grayscale value. The number of peaks is determined based on the mixed Gaussian distribution model, where the peaks represent the grayscale centers of different areas in the grayscale image. The number of peaks is used as the number of K-means clustering to obtain multiple clusters, and a light intensity matrix is constructed for each cluster.
[0046] Exemplarily, three peaks are determined according to the mixed Gaussian distribution model GMM, so three cluster centers are used for K-means clustering. For each cluster, a light intensity matrix is constructed. Specifically, cluster 1 may represent a specific area in the image, such as a surface of a special-shaped bar; cluster 2 may represent another area, such as a background area; cluster 3 may represent a third area, such as another surface of another special-shaped bar. Each light intensity matrix contains the grayscale values of all pixels in the corresponding cluster, which is used to analyze the texture, brightness, contrast and other characteristics of the area.
[0047] In addition, in another embodiment, the DBSCAN algorithm is used to cluster the grayscale image to obtain a plurality of clusters. Specifically, the operation steps are as follows:
[0048] Apply DBSCAN clustering to the grayscale image, set eps to 10 and min samples to 5, which can be adjusted according to actual conditions. After the algorithm is executed, 3 clusters are obtained. For each cluster, a light intensity matrix is constructed. Specifically, for example, cluster 1: contains pixels with higher brightness in the image, which may represent the bright surface of the object of the special-shaped bar; cluster 2: contains pixels with lower brightness in the image, which may represent the shadow or background area of the special-shaped bar; cluster 3: contains pixels with medium brightness in the image, which may represent the surface of another object of the special-shaped bar.
[0049] Each light intensity matrix will contain the grayscale values of all pixels in the cluster, which can be used to analyze the texture, brightness, contrast and other characteristics of the area.
[0050] The specific steps to obtain the partitioning features are as follows:
[0051] The distance between each pixel point and the cluster center in the cluster corresponding to the light intensity matrix is calculated as the degree of eccentricity, the grayscale mean of all pixels in the light intensity matrix is calculated, the average value of the absolute difference between the degree of eccentricity and the grayscale mean is summed and normalized to obtain the division characteristics of the area corresponding to the light intensity matrix.
[0052] Specifically, the partitioning features satisfy the following relationship:
[0053] ;
[0054] In the formula, represents the division characteristics of the area corresponding to the light intensity matrix, Indicates the number of pixels in the cluster corresponding to the light intensity matrix, represents the first The degree of eccentricity of each pixel, represents the set of elements of the light intensity matrix, Indicates The exponential function with base , Represents the mean value function.
[0055] That is, the exponential function converts the mean absolute difference into When the mean absolute difference is small (i.e. the gray value of the pixel is close to the mean gray value), the partition feature is close to 1, indicating that the internal consistency of the region is high. When the mean absolute difference is large, the partition feature is close to 0, indicating that the internal difference of the region is significant.
[0056] In addition, in another embodiment, the entropy value of each pixel in the light intensity matrix is calculated as the division feature of the area corresponding to the light intensity matrix. The specific operation is as follows:
[0057] Based on each pixel in the light intensity matrix, the probability of each gray level appearing is calculated, and the probability of each gray level appearing is obtained by counting the number of times each gray level appears in the light intensity matrix and dividing it by the total number of pixels;
[0058] Specifically, the entropy value satisfies the following relationship:
[0059] ;
[0060] In the formula, represents the division characteristics of the area corresponding to the light intensity matrix, Indicates The probability of a gray level appearing, represents the logarithmic function with base 2, Indicates the total number of gray levels.
[0061] That is to say, by calculating the entropy value of the light intensity matrix as the division feature, the entropy value is the sum of all grayscale information, and the complexity of the entire image area can be analyzed. The higher the entropy value, the more complex the grayscale distribution of the image area is and the greater the amount of information.
[0062] In response to the division feature being greater than a preset detection threshold, the region corresponding to the light intensity matrix has a higher probability of an abnormality, and conversely, the region corresponding to the light intensity matrix has a lower probability of an abnormality;
[0063] The grayscale image corresponding to the light intensity matrix whose division feature is greater than the preset detection threshold is regarded as a suspected abnormal image.
[0064] In the above steps, by automatically identifying suspected abnormal images, it is possible to quickly locate abnormal areas in surface images at different angles, more effectively allocate inspection resources, and give priority to detailed analysis of parts that may have problems.
[0065] S2: Superimpose the suspected abnormal images at different angles and obtain the superposition index, sort them based on the superposition index, and obtain the edge explicitation image when the superposition stop condition is met.
[0066] A set of suspected abnormal images under the same angle is obtained, the first suspected abnormal image is used as the superimposed target, and other suspected abnormal images except the superimposed target are used as images to be superimposed, and the superimposed target is superimposed with the image to be superimposed.
[0067] It should be noted that the set of suspected abnormal images obtained at the same angle can constitute multiple sets, and one set represents the abnormal area under one viewing angle. The purpose is: since the abnormal texture of the area exists in multiple consecutive frames of images after the abnormal area of the special-shaped rod is found, comparing and analyzing the images at the same angle can reduce the misjudgment caused by the difference in viewing angle, thereby improving the accuracy of abnormality detection.
[0068] Obtain overlapping edges and non-overlapping edges between the superimposed target and the image to be superimposed;
[0069] Calculate the The ratio between the sum of the number of pixels of all edges where the to-be-superimposed image and the superimposed target overlap and the sum of the number of pixels of all edges of the superimposed target is used as a first ratio;
[0070] Get the The ratio between the number of overlapping edges of the image to be overlapped and the maximum number of overlapping edges of all the images to be overlapped is used as the second ratio;
[0071] The product of the first ratio and the second ratio is taken as the The overlay index of the image to be overlaid and the overlay target.
[0072] Specifically, the superposition index satisfies the following relationship:
[0073] ;
[0074] In the formula, Indicates The superposition index of the image to be superimposed and the superposition target, Indicates the number of overlapping edges, Indicates The image to be superimposed overlaps with the superimposed target. The number of pixels of overlapping edges, Indicates the number of non-overlapping edges, represents the number of all edges, Indicates the first The number of pixels on the edge of the strip, represents the maximum value function, Indicates The number of overlapping edges of the superimposed images, Indicates The number of overlapping edges of the images to be superimposed, Indicates The number of overlapping edges of the images to be superimposed.
[0075] That is to say, Indicates the number of pixels that overlap between each superimposed image and the superimposed target in all overlapping edges. Represents the number of pixels in all edges (i.e., overlapping edges and non-overlapping edges). Indicates The ratio of the number of overlapping edges of the image to be superimposed to the maximum number of overlapping edges in all images. The closer the ratio is to 1, the smaller the number of overlapping edges in the first image. The first image to be superimposed has the most overlapping edges, indicating that the alignment between the image to be superimposed and the superimposed target is the highest; on the contrary, if this ratio is close to 0, it means that the first image to be superimposed has the most overlapping edges. The number of overlapping edges of the image to be superimposed is much smaller than the maximum value, indicating that the alignment degree between the image to be superimposed and the superimposed target is low.
[0076] In addition, in another embodiment, by calculating the The length of each overlapping edge in the image to be superimposed is calculated, and the number of overlapping edges is used as the weight for weighted summation to obtain the edge weighted length;
[0077] Calculate the product of the sum of the lengths of the overlapping edges of all the images to be superimposed and the sum of the numbers of the overlapping edges of all the images to be superimposed to obtain the comprehensive degree of overlapping edges;
[0078] The ratio between the weighted length of the edge and the comprehensive degree of the overlapping edges is taken as the first The overlay index of the image to be overlaid and the overlay target.
[0079] Specifically, the superposition index satisfies the following relationship:
[0080] ;
[0081] In the formula, Indicates The superposition index of the image to be superimposed and the superposition target, Indicates The number of overlapping edges of the images to be superimposed, Indicates The image to be superimposed overlaps with the superimposed target. The length of the overlapping edges, Represents the total length of the overlapping edges of all images to be superimposed, Represents the sum of the number of overlapping edges of all images to be superimposed.
[0082] By using the overlay index, we can identify which images contribute the most to the overlay effect, and thus give priority to overlaying these images to optimize the final image fusion effect. At the same time, we can reduce unnecessary calculations, give priority to processing those images that have the greatest impact on the results, and improve the overall processing efficiency. Images with high overlay indexes often have better alignment and matching. Prioritizing overlaying these images can also reduce the interference of noise and irrelevant features.
[0083] The stopping condition is:
[0084] In response to no new continuous pixel points appearing, the superposition is stopped. Otherwise, the protrusion degree between the new continuous pixel points and the pixel points in the neighborhood is calculated. In response to the minimum protrusion degree being less than a preset threshold, the superposition is stopped.
[0085] Specifically, the protrusion degree satisfies the following relationship:
[0086] ;
[0087] In the formula, Indicates The prominence of the newly appeared edge pixels, Indicates the first The pixel value of the newly appeared edge pixel, Indicates the first The pixel value of the newly appeared edge pixel, Indicates the first The first of the newly appeared edge pixels The pixel value of the neighboring pixel points, Indicates the first The first of the newly appeared edge pixels The pixel value of the neighboring pixel points, Represents the mean value function.
[0088] S3: Subtract the edge-revealed image from the standard image, and use the ratio of the number of non-zero points to the number of all pixels as the surface quality evaluation, and judge the quality of the special-shaped bar based on the surface quality evaluation.
[0089] The pixel value of the edge highlighting image is the average value of all pixels after superposition.
[0090] In response to the surface quality evaluation being greater than a preset threshold, the special-shaped bar is a low-quality bar, otherwise, the special-shaped bar is a high-quality bar.
[0091] Specifically, in this embodiment, the preset threshold is 0.1, which can be adjusted according to actual conditions.
[0092] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0093] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A method for detecting the surface quality of a special-shaped bar, characterized in that: include: Obtaining grayscale images of the surface images of a plurality of special-shaped bars at different angles, obtaining a light intensity matrix of each grayscale image, calculating the division features of the area corresponding to the light intensity matrix, presetting a detection threshold based on the division features, and determining a suspected abnormal image; Superimpose the suspected abnormal images at different angles and obtain the superposition index, sort them based on the superposition index, and obtain the edge explicitation image when the superposition stop condition is met; Subtracting the edge-revealed image from the standard image, taking the ratio of the number of non-zero points to the number of all pixel points as a surface quality evaluation, and judging the quality of the special-shaped bar based on the surface quality evaluation; The stopping condition of superposition is: if no new continuous pixel points appear, the superposition is stopped; otherwise, the protrusion degree between the new continuous pixel points and the pixel points in the neighborhood is calculated, and if the minimum protrusion degree is less than a preset threshold, the superposition is stopped; wherein the protrusion degree Satisfies the following relationship: ; In the formula, , Respectively represent the image to be superimposed and the superimposed target The pixel value of the newly appeared edge pixel, , Respectively represent the image to be superimposed and the superimposed target The first of the newly appeared edge pixels The pixel value of the neighboring pixel, Represents the mean value function.
2. A method for detecting surface quality of special-shaped bars according to claim 1, characterized in that: Acquiring the light intensity matrix comprises: A mixed Gaussian distribution model is used to statistically analyze the frequency of gray levels in the grayscale image to determine the distribution of grayscale values. The number of peaks is determined based on the mixed Gaussian distribution model, wherein the peaks represent the grayscale centers of different areas in the grayscale image. The number of peaks is used as the number of K-means clusters for clustering to obtain multiple clusters, and a light intensity matrix is constructed for each cluster.
3. The method for detecting the surface quality of a special-shaped bar according to claim 1, characterized in that: The calculation of the division characteristics of the area corresponding to the light intensity matrix includes: The distance between each pixel point and the cluster center in the cluster corresponding to the light intensity matrix is calculated as the degree of eccentricity, the grayscale mean of all pixel points in the light intensity matrix is calculated, the average value of the sum of the absolute differences between the degree of eccentricity and the grayscale mean is taken, and normalized to obtain the division characteristics of the area corresponding to the light intensity matrix.
4. The method for detecting the surface quality of a special-shaped bar according to claim 1, characterized in that: The step of presetting a detection threshold based on the division features and determining a suspected abnormal image includes: In response to the division feature being greater than a preset detection threshold, the region corresponding to the light intensity matrix has a higher probability of an abnormality, and conversely, the region corresponding to the light intensity matrix has a lower probability of an abnormality; The grayscale image corresponding to the light intensity matrix whose division feature is greater than the preset detection threshold is regarded as a suspected abnormal image.
5. The method for detecting the surface quality of a special-shaped bar according to claim 1, characterized in that: The superposition of the suspected abnormal images at different angles includes: A set of suspected abnormal images under the same angle is obtained, the first suspected abnormal image is used as a superimposed target, and other suspected abnormal images except the superimposed target are used as images to be superimposed, and the superimposed target is superimposed with the image to be superimposed.
6. A method for detecting the surface quality of a special-shaped bar according to claim 5, characterized in that: Obtaining the superposition index includes: Acquire overlapping edges and non-overlapping edges between the superimposed target and the image to be superimposed; Calculate the The ratio between the sum of the number of pixels of all edges where the to-be-superimposed image and the superimposed target overlap and the sum of the number of pixels of all edges of the superimposed target is used as a first ratio; Get the The ratio between the number of overlapping edges of the image to be superimposed and the maximum number of overlapping edges of all the images to be superimposed is used as the second ratio; The product of the first ratio and the second ratio is taken as the The overlay index of the image to be overlaid and the overlay target.
7. A method for detecting surface quality of special-shaped bars according to claim 5, characterized in that: Obtaining the superposition index also includes: Calculate the The length of each overlapping edge in the image to be superimposed is calculated, and the number of overlapping edges is used as the weight for weighted summation to obtain the edge weighted length; Calculate the product of the sum of the lengths of the overlapping edges of all the images to be superimposed and the sum of the numbers of the overlapping edges of all the images to be superimposed to obtain the comprehensive degree of overlapping edges; The ratio between the weighted edge length and the comprehensive degree of the overlapping edges is taken as the first The overlay index of the image to be overlaid and the overlay target.
8. The method for detecting the surface quality of a special-shaped bar according to claim 1, characterized in that: The pixel value of the edge highlighting image is the average value of all pixel points after superposition.
9. The method for detecting the surface quality of a special-shaped bar according to claim 1, characterized in that: The method of judging the quality of the special-shaped bar based on the surface quality evaluation includes: In response to the surface quality evaluation being greater than a preset threshold, the special-shaped bar is a low-quality bar, otherwise, the special-shaped bar is a high-quality bar.
Citation Information
Patent Citations
Metal bar surface defect detection method
CN118115428A
Phase recovering method
CN104266769A
Metal surface defect detection method
CN115082482A