Quality evaluation method of titanium alloy flat wire based on image processing

Through threshold segmentation and optimized weighting processing, the problem of interference from reflective areas in titanium alloy flat wire images is solved, efficient quality assessment is achieved, and detection accuracy is improved.

CN118447027BActive Publication Date: 2024-10-18BAOJI TALENT HI-TECH TITANIUM IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410907327.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2024-10-18
Estimated Expiration
2044-07-08

AI Technical Summary

Technical Problem

Existing technology is difficult to effectively distinguish and remove reflective areas and scratches in titanium alloy flat wire images, resulting in reduced quality detection accuracy. Traditional non-local mean filtering algorithms cannot effectively remove reflective information.

Method used

Obtain suspected reflective areas through threshold segmentation, calculate the degree of reflective features and optimization coefficients, and set optimized weights for filtering to remove reflective information and improve the accuracy of quality assessment.

Benefits of technology

Effectively remove reflective information, reduce filter distortion, and improve the accuracy and precision of titanium alloy flat wire quality assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118447027B_ABST
    Figure CN118447027B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and more specifically, to a quality assessment method for titanium alloy flat wire based on image processing, the method comprising: obtaining a suspected reflective area in a titanium alloy flat wire area image; calculating the reflective feature degree of pixels in the suspected reflective area, and setting the reflective feature degree of pixels that are not in the suspected reflective area to 0; obtaining a filtering reference pixel of each pixel in the titanium alloy flat wire area image, and calculating an optimization coefficient of the filtering reference pixel; using the optimization coefficient to set an optimized weighted weight of the filtering reference pixel, and performing filtering processing based on the optimized weighted weight to assist in the quality assessment of the titanium alloy flat wire. By eliminating the interference of reflection, a more accurate quality assessment of the titanium alloy flat wire can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and more specifically, to a quality assessment method for titanium alloy flat wire based on image processing. Background Art

[0002] In order to ensure that the titanium alloy flat wire that flows into the hands of customers is a qualified product, the produced titanium alloy flat wire must be quality tested before being sold to customers.

[0003] To use machine vision to inspect the quality of titanium alloy flat wire, it is necessary to first collect the initial image of titanium alloy flat wire. Since the surface of titanium alloy flat wire is relatively smooth and has metallic luster, the collected initial image of titanium alloy flat wire is often accompanied by reflective areas. Quality problems of titanium alloy flat wire, such as scratches, also appear white. Reflective areas and scratches cannot be distinguished well by color. Since the reflective areas have different shapes, some reflective areas also appear in long strips. The morphological characteristics cannot be used to distinguish the reflective areas from scratches. Therefore, the reflective area will affect the quality inspection accuracy of titanium alloy flat wire.

[0004] The existing patent application document CN116416241A shows a metal parts surface quality assessment system and method based on image recognition. This patent document does not consider the influence of reflective information when assessing the quality of the metal parts surface. Therefore, the quality assessment method in this patent document is not suitable for quality inspection of titanium alloy flat wire.

[0005] Traditionally, filtering is often used to remove reflective areas in images. As a filtering denoising algorithm, the non-local mean filtering algorithm (Non-localMeans) is often used in the pre-processing step of defect detection. The filtering algorithm first calculates the weighted weights of other pixels by analyzing the similarity between the local window where the current filtering pixel is located and the local windows where other pixels are located, and then uses the weighted weights of other pixels to perform weighted summation on all other pixels to obtain the filtered pixel value of the current filtering pixel. Reflective pixels generally exist in regions, so most of the information in the local window where the reflective pixel is located is reflective information. The reflective area has a high similarity with other reflective areas and a low similarity with non-reflective areas. Therefore, it is more likely that the local windows of other pixels with high similarity to the local window where the reflective pixel is located are all reflective pixels. Therefore, the weights of other reflective pixels calculated by the non-local mean filtering algorithm are large, and the weights of other non-reflective pixels are small, so the reflective information cannot be filtered out by weighted summation. Therefore, the traditional non-local mean filtering algorithm cannot effectively remove the reflective information in the titanium alloy flat wire area image. Summary of the invention

[0006] In order to solve the problem that reflective information interferes with the quality assessment of titanium alloy flat wire, the present invention proposes a quality assessment method for titanium alloy flat wire based on image processing, which comprises the following steps:

[0007] Obtain the suspected reflective area in the titanium alloy flat wire area image by threshold segmentation; calculate the reflective feature degree of the pixels in the suspected reflective area, the reflective feature degree is positively correlated with the decreasing law index and the number of reflective center pixels in the 8-neighborhood of the reflective center pixel, the decreasing law index represents the change of grayscale value in the suspected reflective area, and the reflective center pixel is the pixel in the category with the largest grayscale value in the suspected reflective area; set the reflective feature degree of the pixels that are not in the suspected reflective area to 0;

[0008] Obtaining a filtering reference pixel of each pixel in the titanium alloy flat wire area image, and calculating an optimization coefficient of the filtering reference pixel, wherein the optimization coefficient is negatively correlated with the degree of the reflective feature and positively correlated with the degree of surrounding reference; the degree of surrounding reference is positively correlated with the feature similarity of the surrounding window of the window where the corresponding pixel is located and the surrounding window of the window where the filtering reference pixel is located;

[0009] The optimization coefficient is used to set the optimization weight of the filtering reference pixel, the optimization weight is positively correlated with the optimization coefficient, and filtering processing is performed based on the optimization weight to assist in the quality assessment of the titanium alloy flat wire.

[0010] Preferably, the calculating the reflective feature degree of pixels in the suspected reflective area includes:

[0011] The reflective characteristic degree of the suspected reflective area is calculated. The reflective characteristic degree of the suspected reflective area is positively correlated with the decreasing law index, and is also positively correlated with the number of reflective center pixels in the 8-neighborhood of the reflective center pixel;

[0012] The degree of reflective features of the suspected reflective area is divided by the distance between each pixel and the geometric center of the reflective center pixel to obtain the degree of reflective features of each pixel in the suspected reflective area.

[0013] Preferably, the calculating the degree of the reflective feature of the suspected reflective area includes:

[0014] ;

[0015] The sequence of pixels from the geometric center of the reflection center pixel of the suspected reflection area to each boundary pixel is recorded as the analysis pixel sequence. Indicates the suspected reflective area An indicator of decreasing regularity of analyzing pixel sequence, Indicates the suspected reflective area The total number of pixels contained in the analyzed pixel sequence, The number of analyzed pixel sequences representing suspected reflection areas, Indicates the suspected reflective area The number of reflective center pixels in the 8-neighborhood of the reflective center pixel, Indicates the number of reflection center pixels, Indicates the degree of reflective characteristics of suspected reflective areas.

[0016] Preferably, the calculating the optimization coefficient of the filtered reference pixel includes:

[0017] ;

[0018] in, Indicates the pixel The surrounding reference degree of the filtered reference pixel, The Euclidean distance between the center of the window where the filtered reference pixel of the pixel is located and the center of the surrounding window of the window, Indicates the pixel The average reflective feature level of all pixels in the window where the filtered reference pixel is located, Indicates the average value of the reflective characteristics of all pixels in the window where the pixel is located. represents the maximum and minimum normalization method, Indicates the pixel The optimization coefficients of the filtered reference pixels.

[0019] Preferably, the method for obtaining the surrounding reference degree includes:

[0020] The similarity between the LBP features of each surrounding window of the window where a pixel is located and the LBP features of the corresponding surrounding window of the filtered reference pixel is used as the first similarity between the pixel and the surrounding windows of the filtered reference pixel;

[0021] The inverse of the mean of the reflective feature levels of all pixels in the surrounding windows of the window where the pixel is located is used as the weight of each surrounding window, and the first similarity between the pixel and the surrounding windows of the filtered reference pixel is weighted and summed to obtain the surrounding reference degree of the filtered reference pixel of the pixel.

[0022] The present invention avoids the problem of reduced similarity caused by light difference between the window where the pixel is located and the window where the filtered reference pixel is located by analyzing the feature similarity between the surrounding windows of the window where the pixel is located and the surrounding windows of the window where the filtered reference pixel is located, thereby providing a basis for subsequently setting a higher weight for the filtered reference pixels with truly higher similarity.

[0023] Preferably, the step of setting the optimized weight of the filtered reference pixel by using the optimized coefficient comprises:

[0024] The similarity between the LBP feature of the window where a pixel is located and the LBP feature of the window where the filtered reference pixel is located is used as the initial weighted weight of the filtered reference pixel of the pixel;

[0025] The initial weighted weight is multiplied by the cumulative sum of 1 and the optimization coefficient to obtain the optimized weighted weight of the filtered reference pixel of the pixel.

[0026] Preferably, the method for acquiring the titanium alloy flat wire area image comprises:

[0027] The pixels whose color values ​​in the initial image of the titanium alloy flat wire belong to the preset color interval are regarded as the titanium alloy flat wire pixels, and the pixels whose color values ​​do not belong to the preset color interval are regarded as the pixels to be verified;

[0028] Determine whether the pixel to be verified meets the preset judgment condition, and use the pixel to be verified that meets the preset judgment condition as the titanium alloy flat wire pixel; the preset judgment condition is that the angle between all reference exploration lines and adjacent reference exploration lines is less than or equal to 180 degrees, and the reference exploration line is the line between the pixel to be verified and the titanium alloy flat wire pixel;

[0029] The regional image formed by all the titanium alloy flat wire pixels is used as the titanium alloy flat wire regional image.

[0030] The present invention removes background information interference by acquiring an image of the titanium alloy flat wire region, thereby providing a basis for subsequent accurate titanium alloy quality assessment.

[0031] Preferably, the method for acquiring the reflective central pixel includes:

[0032] K-means is used to cluster all pixels in the suspected reflection area into two categories, and the pixels in the category with a large grayscale mean are taken as the reflection center pixels of the suspected reflection area.

[0033] Preferably, the method for obtaining the filtered reference pixel includes:

[0034] The preset area side length W1 is obtained with one pixel as the center The area is recorded as the reference area of ​​the pixel, and each pixel in the reference area of ​​the pixel is called the filtering reference pixel of the pixel.

[0035] The present invention has the following beneficial effects:

[0036] When analyzing the degree of reflective features, the decreasing law index and the number of reflective center pixels in the 8-neighborhood of the reflective center pixel are introduced to accurately reflect the reflective features in each suspected reflective area, providing a basis for reducing the impact of reflective pixels on filtering in the future.

[0037] Furthermore, when analyzing the optimization coefficients, the similarity relationship between the window around each pixel and the window around the filtered reference pixel is introduced to eliminate the interference of the light difference between the pixel and the filtered reference pixel on the similarity calculation, thereby setting a larger weight for the filtered reference pixel with higher similarity, so that the obtained filtered pixel value is closer to the real pixel, thereby avoiding pixel distortion caused by filtering.

[0038] Furthermore, filtering based on the optimized weighted weights set by the optimization coefficients can not only effectively remove the reflection information, but also reduce the distortion caused by filtering, thus providing a basis for quality assessment. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] 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:

[0040] Figure 1 It is a flow chart of the steps of a quality assessment method of titanium alloy flat wire based on image processing according to an embodiment of the present invention. DETAILED DESCRIPTION

[0041] 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.

[0042] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0043] See also Figure 1 , which shows a flow chart of the steps of a quality assessment method of titanium alloy flat wire based on image processing provided by an embodiment of the present invention, the method comprising the following steps:

[0044] S1. Obtain the initial image of the titanium alloy flat wire.

[0045] Specifically, the camera is used to collect the initial image of the titanium alloy flat wire, which includes three color channel images of RGB, where R represents red, G represents green, and B represents blue.

[0046] S2. Obtain an image of the titanium alloy flat wire area.

[0047] It should be noted that there are some background areas that do not belong to the titanium alloy flat wire in the collected initial image. The information in the background areas is useless for the quality inspection of the titanium alloy flat wire, so these background areas need to be removed.

[0048] Preferably, as an example, the method for acquiring the titanium alloy flat wire area image includes:

[0049] The R channel color interval, B channel color interval, and G channel color interval are preset. In this embodiment, the R channel color interval is [165, 180], the G channel color interval is [175, 190], and the B channel color interval is [200, 215] as an example for illustration. Other embodiments may take other values, and this embodiment does not make specific limitations.

[0050] It should be noted that the preset color intervals of each channel given in this embodiment are obtained based on the color information statistics of a large number of images collected in this experimental environment, so the value ranges may be different in different experimental environments.

[0051] The color value of a pixel is obtained in the R channel image, the G channel image and the B channel image of the initial image of the titanium alloy flat wire respectively. When the color value of the pixel in the R channel image belongs to the preset R channel color interval, the color value of the pixel in the G channel image belongs to the preset G channel color interval, and the color value of the pixel in the B channel image belongs to the preset B channel color interval, the pixel is regarded as a titanium alloy flat wire pixel. Otherwise, the pixel is regarded as a pixel to be verified.

[0052] It should be noted that the defects and reflections on the surface of the titanium alloy flat wire will cause the color to deviate from the original titanium alloy color. As a result, the complete titanium alloy flat wire area cannot be segmented by color interval. The defects and reflection areas are generally inside the titanium alloy flat wire. Therefore, it is possible to determine whether the pixel to be verified is a titanium alloy flat wire pixel based on the presence of titanium alloy flat wire pixels around each pixel to be verified.

[0053] Any pixel to be verified is recorded as the target pixel to be verified, and the line connecting the target pixel to be verified and each titanium alloy pixel is recorded as the reference exploration line of the target pixel to be verified. The angle between the reference exploration line and the reference exploration line adjacent to the clockwise direction is taken as the right angle of the reference exploration line, and the angle between the reference exploration line and the reference exploration line adjacent to the counterclockwise direction is taken as the left angle of the reference exploration line. The maximum angle between the left angle and the right angle of the reference exploration line is taken as the decision angle of the reference exploration line. The maximum value of the decision angles of all reference exploration lines of the target pixel to be verified is taken as the final decision angle of the target pixel to be verified. When the final decision angle of the target pixel to be verified is less than or equal to 180 degrees, the target pixel to be verified is taken as a titanium alloy flat wire pixel. Similarly, all pixels to be verified are judged to obtain all titanium alloy flat wire pixels.

[0054] The regional image formed by all titanium alloy flat wire pixels is recorded as the titanium alloy flat wire regional image.

[0055] The titanium alloy flat wire region image is grayed to obtain a grayscale image of the titanium alloy flat wire region image. For ease of description, the grayscale image of the titanium alloy flat wire region image is still referred to as the titanium alloy flat wire region image in the following.

[0056] S3: Obtain the suspected reflective area in the titanium alloy flat wire area image through threshold segmentation; calculate the reflective feature degree of the pixels in the suspected reflective area, the reflective feature degree is positively correlated with the decreasing law index and the number of reflective center pixels in the 8-neighborhood of the reflective center pixel, the decreasing law index characterizes the change of grayscale value in the suspected reflective area, the reflective center pixel is the pixel in the category with the largest grayscale value in the suspected reflective area; set the reflective feature degree of the pixels that are not in the suspected reflective area to 0.

[0057] S30: Obtaining the suspected reflective area in the titanium alloy flat wire area image by threshold segmentation.

[0058] It should be noted that, through the above analysis, for non-reflective pixels, the weighted weights of other pixels can be determined more accurately by directly comparing similarities. However, for reflective pixels, the weighted weights of other pixels cannot be accurately obtained by directly comparing similarities. In order to more accurately determine the weighted weights of other pixels corresponding to each pixel. Therefore, it is necessary to analyze the situation where each pixel in the titanium alloy flat wire area image is a reflective pixel. Since the grayscale value of the reflective area is large, the possible reflective area in the titanium alloy flat wire area image can be segmented out based on this.

[0059] Optionally, as an example, the suspected reflective area in the titanium alloy flat wire area image is obtained by threshold segmentation, including:

[0060] The titanium alloy flat wire region image is analyzed by iterative threshold segmentation method to obtain the segmentation threshold, and the pixels in the titanium alloy flat wire region image that are larger than the segmentation threshold are regarded as suspected reflective pixels, and the connected domain formed by the suspected reflective pixels is regarded as the suspected reflective region.

[0061] Preferably, as an example, obtaining the suspected reflective area in the titanium alloy flat wire area image by threshold segmentation includes:

[0062] The grayscale values ​​of all pixels in the titanium alloy flat wire area image are analyzed by the Otsu threshold method to obtain the segmentation threshold, and the pixels in the titanium alloy flat wire area image that are greater than the segmentation threshold are regarded as suspected reflective pixels. The connected domain formed by the suspected reflective pixels is regarded as the suspected reflective area.

[0063] S31: Calculate the degree of reflective features of pixels in the suspected reflective area, the reflective feature degree is positively correlated with the decreasing law index and the number of reflective center pixels in the 8-neighborhood of the reflective center pixel, the decreasing law index represents the change of grayscale value in the suspected reflective area, the reflective center pixel is the pixel in the category with the largest grayscale value in the suspected reflective area; set the degree of reflective features of pixels that are not in the suspected reflective area to 0.

[0064] Preferably, as an example, calculating the degree of reflective characteristics of pixels in the suspected reflective area includes S310-S312.

[0065] It should be noted that in the titanium alloy flat wire area image, not only the grayscale value of the reflective pixels is large, but also the grayscale value of the defect is large. Therefore, the suspected reflective area obtained by threshold segmentation may be a reflective area or a defect area. Therefore, it is necessary to further determine the suspected reflective area based on the reflective characteristics.

[0066] It should be further explained that the surface of the titanium alloy flat wire does not have any structural features of uneven changes, and the surface of the titanium alloy flat wire is relatively smooth. Therefore, the reflective area on the surface of the titanium alloy flat wire generally has a concentrated reflective center, and then there is a certain decrease in light from the reflective center to the surrounding areas. Therefore, the situation of each pixel being a reflective pixel can be evaluated based on this feature. First, the reflective center pixel needs to be obtained.

[0067] S310: Acquire a reflection center pixel in a suspected reflection area.

[0068] It should be noted that the grayscale value of the reflection center pixel in the suspected reflection area is relatively large, and the reflection center pixel can be obtained based on this.

[0069] Optionally, a method for obtaining a reflective center pixel includes:

[0070] The pixel corresponding to the maximum grayscale value in the suspected reflection area is taken as the reflection center pixel.

[0071] It should be noted that since the reflection center is generally an area, the single light center pixel should be the geometric center of the reflection center area. It is not accurate to directly use the pixel corresponding to the maximum grayscale value as the reflection center pixel.

[0072] Preferably, the method for obtaining the reflective center pixel includes:

[0073] K-means is used to cluster all pixels in the suspected reflection area into two categories, and the pixels in the category with a large grayscale mean are taken as the reflection center pixels of the suspected reflection area.

[0074] S311: Obtain a decreasing regularity indicator.

[0075] It should be noted that the reflective area has a certain light decreasing characteristic from the reflective center to the surroundings, so it is necessary to describe the grayscale change characteristics of each suspected reflective area, and then analyze the situation where each suspected reflective area meets the reflective area characteristics. This embodiment uses a decreasing regularity indicator to reflect the grayscale change characteristics of each suspected reflective area.

[0076] Preferably, as an example, a method for obtaining a decreasing regularity index of each analysis pixel sequence of a suspected reflective area includes:

[0077] The outermost circle of pixels in the suspected reflective area is recorded as the boundary pixels, the sequence of pixels from the geometric center of the reflective center pixel of the suspected reflective area to each boundary pixel is recorded as the analysis pixel sequence, and the gray value difference between each pixel in the analysis pixel sequence and the next pixel is recorded as the first-order difference of each pixel in the analysis pixel sequence. The number of pixels with a first-order difference greater than 0 in the analysis pixel sequence is obtained and recorded as a decreasing regularity indicator of the analysis pixel sequence of each suspected reflective area.

[0078] S312: Calculate the degree of reflection characteristics of pixels in the suspected reflection area.

[0079] First, the degree of the reflective feature of the suspected reflective area is calculated.

[0080] It should be noted that the reflective area on the surface of the titanium alloy flat wire generally has a concentrated reflective center, and there is a certain light decreasing trend from the reflective center to the surrounding area. The above steps have used the decreasing law index to describe the grayscale change characteristics of the suspected reflective area. The following describes the degree to which each suspected reflective area meets the reflective characteristics based on the decreasing law index and the concentration of the reflective center. This embodiment describes the degree to which each suspected reflective area meets the reflective characteristics by the degree of reflective characteristics.

[0081] Preferably, as an example, the degree of the reflective feature of the suspected reflective area satisfies the relationship:

[0082] ;

[0083] in, Indicates the suspected reflective area An indicator of the decreasing law of the analyzed pixel sequence. The larger the value, the more the grayscale change characteristics in the suspected reflective area are consistent with the light change characteristics of the reflective area. Therefore, the larger the value, the greater the possibility that the suspected reflective area is a reflective area. Indicates the suspected reflective area The total number of pixels contained in the analyzed pixel sequence, The number of analyzed pixel sequences representing suspected reflection areas, Indicates the suspected reflective area The number of reflective center pixels in the 8-neighborhood of a reflective center pixel. The larger the value, the more concentrated the reflective center pixels are. The greater the possibility that the suspected reflective area where the reflective center pixel is located is the reflective area. Indicates the number of reflection center pixels, Indicates the degree of reflective characteristics of suspected reflective areas.

[0084] Then, the degree of the reflection characteristics of the pixels in the suspected reflection area is calculated.

[0085] Optionally, as an example, calculating the degree of reflective features of pixels in the suspected reflective area includes:

[0086] The degree of the reflection feature in the suspected reflection area is used as the degree of the reflection feature of the pixel in the suspected reflection area.

[0087] It should be noted that the closer the pixel is to the reflection center, the greater the degree of its reflection characteristics. Therefore, directly using the reflection characteristic degree of the suspected reflection area as the reflection characteristic degree of the pixel in the suspected reflection area will not be accurate enough.

[0088] Preferably, as an example, calculating the reflective feature degree of pixels in the suspected reflective area includes:

[0089] The degree of reflective features of the suspected reflective area is divided by the distance between each pixel and the geometric center of the reflective center pixel to obtain the degree of reflective features of each pixel in the suspected reflective area.

[0090] S4: Obtain the filtered reference pixel of each pixel in the titanium alloy flat wire area image, and calculate the optimization coefficient of the filtered reference pixel, wherein the optimization coefficient is negatively correlated with the degree of reflective characteristics and positively correlated with the degree of surrounding reference; the degree of surrounding reference is positively correlated with the feature similarity of the surrounding window of the window where the corresponding pixel is located and the surrounding window of the window where the filtered reference pixel is located.

[0091] Preferably, as an example, obtaining the filtering reference pixel of each pixel in the titanium alloy flat wire area image and calculating the optimization coefficient of the filtering reference pixel include steps S40-S42.

[0092] It should be noted that the titanium alloy flat wire information in some areas of the titanium alloy flat wire area image is disturbed by the reflective information, which makes it impossible to accurately obtain the titanium alloy flat wire information with similar information to the area, resulting in the calculated weighted weight being inaccurate. At the same time, some areas in the titanium alloy flat wire area image are disturbed, but the surrounding areas may not be disturbed. The information in the surrounding areas can be used to assist in obtaining the titanium alloy flat wire information with similar information to the area, and then to correct the initial weight. This embodiment reflects the similarity between the surrounding area and the area with the surrounding reference degree.

[0093] S40: Obtain a filtering reference pixel of the pixel.

[0094] Optionally, a method for acquiring a filtered reference pixel of a pixel includes:

[0095] The preset area side length W1 is obtained with one pixel as the center The area is recorded as the reference area of ​​the pixel, and each pixel in the reference area of ​​the pixel is called the filtering reference pixel of the pixel. This embodiment is described with W1 being 500, and other embodiments may take other values, which are not specifically limited in this embodiment.

[0096] It should be noted that, in this embodiment, a method for obtaining filtering reference pixels in a non-local mean filtering algorithm is referred to to obtain filtering reference pixels. The non-local mean filtering algorithm is a prior art and will not be described in detail here.

[0097] S41: Calculate the degree of reference of the surrounding filtered reference pixels of the pixel.

[0098] Preferably, as an example, calculating the surrounding reference degree of the filtered reference pixel of the pixel includes:

[0099] The preset window length W2 is obtained with one pixel as the center The window of the pixel is taken as the window of the pixel. The filtered reference pixel of the pixel is taken as the center to obtain The window of is used as the window of the filtering reference pixel of the pixel. Taking the window as the basic unit, the window within the 8-neighborhood range of the window of the pixel is obtained as the surrounding window of the window where the pixel is located.

[0100] The local binary pattern algorithm (Local Binary Pattern) is used to process the surrounding window of the window where the pixel is located to obtain the LBP feature image of the surrounding window of the window where the pixel is located. The sequence composed of the grayscale values ​​of all pixels in the LBP feature image of the surrounding window of the window where the pixel is located is used as the LBP feature sequence of the surrounding window of the window where the pixel is located. Similarly, the LBP feature sequence of the surrounding window of the window where the filtered reference pixel of the pixel is located is obtained. This embodiment is described by taking W2 as 9 as an example, and other embodiments can take other values, and this embodiment does not make specific restrictions.

[0101] The cosine similarity between the LBP feature sequence of the surrounding windows of the window where the pixel is located and the LBP feature sequence of the corresponding surrounding windows of the filtered reference pixel is used as the first similarity between the pixel and each surrounding window of the filtered reference pixel;

[0102] The inverse of the mean of the reflective feature levels of all pixels in the surrounding windows of the window where the pixel is located is used as the weight of each surrounding window, and the first similarity between the pixel and the surrounding windows of the filtered reference pixel is weighted and summed to obtain the surrounding reference degree of the filtered reference pixel of the pixel.

[0103] S42: Calculate the optimization coefficient of the filtered reference pixel of the pixel.

[0104] Preferably, as an example, calculating the optimization coefficient of the filtered reference pixel of the pixel includes:

[0105] ;

[0106] in, Indicates the pixel The larger the value, the greater the reference degree of the surrounding of the filtered reference pixel. The surrounding window of the first filtered reference pixel contains less reflection information, and the surrounding window of the pixel is The information similarity between the surrounding windows of the filtered reference pixel is high, so the pixel The probability that the window where the first filtered reference pixel is located is similar to the window where the pixel is located is large, so the pixel The greater the degree to which the filtered reference pixels can be referenced, It represents the Euclidean distance between the center of the window where the filtered reference pixel of the pixel is located and the center of the surrounding windows of the window. The larger the value, the farther the distance between the window where the pixel is located and the surrounding windows. The farther the distance, the greater the possibility of information change. Therefore, the credibility of using the surrounding windows to describe the similarity between the window where the filtered reference pixel is located and the window where the pixel is located is lower. Indicates the pixel The average reflective feature level of all pixels in the window where the filtered reference pixel is located, Indicates the average value of the reflective characteristics of all pixels in the window where the pixel is located. The larger the value is, the greater the reflection effect is on the window where the pixel is located and the window where the filtered reference pixel is located. The similarity calculated using the window where the pixel is located and the window where the filtered reference pixel is located is less reliable. Represents the maximum and minimum normalization method, which is used to normalize the data to the range of -1 to 1. Indicates the pixel The optimization coefficients of the filtered reference pixels.

[0107] S5: Using the optimization coefficient to set the optimization weight of the filtered reference pixel, the optimization weight is positively correlated with the optimization coefficient.

[0108] Preferably, as an example, setting the optimized weighted weight of the filtered reference pixel using the optimized coefficient includes steps S50-S51.

[0109] S50: Calculate an initial weighting weight of a filtered reference pixel of the pixel.

[0110] Optionally, as an example, calculating an initial weighted weight of a filtered reference pixel of a pixel includes:

[0111] The LBP feature sequence of the window where a pixel is located and the LBP feature sequence of the window where the filtered reference pixel of the pixel are located are obtained, and the cosine similarity between the LBP feature sequence of the window where the pixel is located and the LBP feature sequence of the window where the filtered reference pixel are located is used as the initial weighted weight of the filtered reference pixel of the pixel.

[0112] S51: Calculate the optimized weighted weights of the filtered reference pixels.

[0113] Preferably, as an example, calculating the optimized weighted weight of the filtered reference pixel includes:

[0114] The initial weighted weight is multiplied by the cumulative sum of 1 and the optimization coefficient to obtain the optimized weighted weight of the filtered reference pixel of the pixel.

[0115] S6: Filtering is performed based on the optimized weighted weights to assist in the quality assessment of the titanium alloy flat wire.

[0116] S61: Perform filtering processing based on the optimized weighted weights.

[0117] Optionally, as an example, filtering is performed based on optimizing weighted weights, including:

[0118] The optimized weighted weight of the filtered reference pixel of the pixel is used as the weight value, and the grayscale values ​​of all the filtered reference pixels of the pixel are weighted and summed to obtain the filtered grayscale value of the pixel. The image composed of the filtered grayscale values ​​of all pixels is used as the filtered titanium alloy flat wire area image.

[0119] S62: Perform quality assessment of titanium alloy flat wire.

[0120] Optionally, as an example, quality assessment of titanium alloy flat wire is performed, including:

[0121] The Canny algorithm is used to perform edge detection processing on the filtered titanium alloy flat wire area image to obtain an edge image. The quality index of the titanium alloy flat wire is obtained by dividing the number of all pixels in the edge image by the cumulative sum of the number of edge pixels in the edge image and the preset anti-zero coefficient. The preset anti-zero coefficient is to prevent the denominator from being 0. This embodiment takes the preset anti-zero coefficient as 0.0001 as an example for explanation. Other embodiments may take other values, and this embodiment is not specifically limited. The larger the value, the fewer defects on the titanium alloy flat wire and the better the quality.

[0122] At this point, this embodiment is completed.

[0123] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A quality assessment method for titanium alloy flat wire based on image processing, characterized in that: include: The suspected reflective area in the titanium alloy flat wire area image is obtained by threshold segmentation; Calculating the reflective feature degree of the pixels in the suspected reflective area, including: the reflective feature degree of the suspected reflective area is positively correlated with the decreasing law index, and is also positively correlated with the number of reflective center pixels in the 8-neighborhood of the reflective center pixel; dividing the reflective feature degree of the suspected reflective area by the distance between each pixel and the geometric center of the reflective center pixel to obtain the reflective feature degree of each pixel in the suspected reflective area, the reflective feature degree is positively correlated with the decreasing law index and the number of reflective center pixels in the 8-neighborhood of the reflective center pixel, the decreasing law index represents the change of grayscale value in the suspected reflective area, and the reflective center pixel is a pixel in the category with the largest grayscale value in the suspected reflective area; setting the reflective feature degree of the pixel not in the suspected reflective area to 0; Obtain the filtering reference pixel of each pixel in the titanium alloy flat wire area image, and calculate the optimization coefficient of the filtering reference pixel, including: ; in, Indicates the pixel The surrounding reference degree of the filtered reference pixel, The Euclidean distance between the center of the window where the filtered reference pixel of the pixel is located and the center of the surrounding window of the window, Indicates the pixel The average reflective feature level of all pixels in the window where the filtered reference pixel is located, Indicates the average value of the reflective characteristics of all pixels in the window where the pixel is located. represents the maximum and minimum normalization method, Indicates the pixel an optimization coefficient of a filtered reference pixel, wherein the optimization coefficient is negatively correlated with the degree of the reflective feature and positively correlated with the degree of surrounding reference; the degree of surrounding reference is positively correlated with the feature similarity of the surrounding window of the window where the corresponding pixel is located and the surrounding window of the window where the filtered reference pixel is located; The optimized weighted weight of the filtering reference pixel is set by using the optimized coefficient, the optimized weighted weight is positively correlated with the optimized coefficient, and filtering processing is performed based on the optimized weighted weight to assist in the quality assessment of the titanium alloy flat wire.

2. The quality assessment method of titanium alloy flat wire based on image processing according to claim 1 is characterized in that: The calculating the degree of the reflective feature of the suspected reflective area includes: ; The sequence of pixels from the geometric center of the reflection center pixel of the suspected reflection area to each boundary pixel is recorded as the analysis pixel sequence. Indicates the suspected reflective area An indicator of decreasing regularity of analyzing pixel sequence, Indicates the suspected reflective area. The total number of pixels contained in the analyzed pixel sequence, The number of analyzed pixel sequences representing suspected reflection areas, Indicates the suspected reflective area. The number of reflective center pixels in the 8-neighborhood of the reflective center pixel, Indicates the number of reflection center pixels, Indicates the degree of reflective characteristics of suspected reflective areas.

3. The quality assessment method of titanium alloy flat wire based on image processing according to claim 1 is characterized in that: The method for obtaining the surrounding reference degree includes: The similarity between the LBP features of each surrounding window of the window where a pixel is located and the LBP features of the corresponding surrounding window of the filtered reference pixel is used as the first similarity between the pixel and the surrounding windows of the filtered reference pixel; The inverse of the mean of the reflective feature levels of all pixels in the surrounding windows of the window where the pixel is located is used as the weight of each surrounding window, and the first similarity between the pixel and the surrounding windows of the filtered reference pixel is weighted and summed to obtain the surrounding reference degree of the filtered reference pixel of the pixel.

4. The quality assessment method of titanium alloy flat wire based on image processing according to claim 1 is characterized in that: The step of setting the optimized weight of the filtered reference pixel by using the optimized coefficient comprises: The similarity between the LBP feature of the window where a pixel is located and the LBP feature of the window where the filtered reference pixel is located is used as the initial weighted weight of the filtered reference pixel of the pixel; The initial weighted weight is multiplied by the cumulative sum of 1 and the optimization coefficient to obtain the optimized weighted weight of the filtered reference pixel of the pixel.

5. The quality assessment method of titanium alloy flat wire based on image processing according to claim 1 is characterized in that: The method for acquiring the titanium alloy flat wire area image comprises: The pixels whose color values ​​in the initial image of the titanium alloy flat wire belong to the preset color interval are regarded as the titanium alloy flat wire pixels, and the pixels whose color values ​​do not belong to the preset color interval are regarded as the pixels to be verified; Determine whether the pixel to be verified meets the preset judgment condition, and use the pixel to be verified that meets the preset judgment condition as the titanium alloy flat wire pixel; the preset judgment condition is that the angle between all reference exploration lines and adjacent reference exploration lines is less than or equal to 180 degrees, and the reference exploration line is the line between the pixel to be verified and the titanium alloy flat wire pixel; The regional image formed by all the titanium alloy flat wire pixels is used as the titanium alloy flat wire regional image.

6. The quality assessment method of titanium alloy flat wire based on image processing according to claim 1 is characterized in that: The method for acquiring the reflective central pixel comprises: K-means is used to cluster all pixels in the suspected reflection area into two categories, and the pixels in the category with a large grayscale mean are taken as the reflection center pixels of the suspected reflection area.

7. The quality assessment method of titanium alloy flat wire based on image processing according to claim 1 is characterized in that: The method for obtaining the filtering reference pixel comprises: The preset area side length W1 is obtained with one pixel as the center The area is recorded as the reference area of ​​the pixel, and each pixel in the reference area of ​​the pixel is called the filtering reference pixel of the pixel.

Citation Information

Patent Citations

  • Automatic weld joint searching method based on textural features

    CN112700441A

  • Titanium alloy furniture production quality monitoring system

    CN116611748A