A method for identifying surface cleanliness during rolling of titanium alloy bars
By performing global image acquisition and grayscale processing on the surface of titanium alloy rods, combining texture feature analysis and adaptive filtering, surface stains during the rolling process of titanium alloy rods are identified, solving the problem of surface pollution detection of titanium alloy rods and achieving efficient and reliable surface cleaning recognition.
Patent Information
- Application Number
- CN202510008069.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2045-01-03
AI Technical Summary
Titanium alloy rods are easily contaminated by environmental pollution during the rolling process, resulting in impurities adhering to the surface, affecting the product appearance and subsequent processing technology, and even pose safety hazards.
A surface cleaning recognition method for rolling titanium alloy rods is adopted. By collecting the global image of the surface of titanium alloy rods, greyscale processing and texture feature analysis, global noise index is obtained, and adaptive filtering is performed based on this, and the abnormal sliding window is divided for local feature merging and erosion operations are finally identified.
It improves detection accuracy and reliability, can effectively distinguish smooth areas from areas where defects or stains may exist, reduce the impact of random noise on the image, realize efficient and automated surface detection, and improve surface cleanliness evaluation standards.
Smart Images

Figure CN119399567B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image recognition, in particular to a surface cleanliness recognition method for rolled titanium alloy bars. Background Art
[0002] CN118941931A "A titanium alloy surface defect treatment method" includes: acquiring defect image data of a titanium alloy product, wherein the defect image data includes images of waste titanium alloy products, images of historical titanium alloy products and images of scrapped titanium alloy products; constructing a defect recognition model based on the images of waste titanium alloy products, the images of historical titanium alloy products and the images of scrapped titanium alloy products; performing defect recognition based on the defect recognition model and the titanium alloy product to be tested to determine the defect degree corresponding to the titanium alloy product to be tested; and determining a treatment plan corresponding to the titanium alloy product to be tested based on the defect degree.
[0003] CN114912832A "A method and system for evaluating the quality of magnesium-titanium alloy surface coating process" collects application scenario data of the coating process through a coating quality evaluation system to obtain preset evaluation index parameters; collects images of the target magnesium-titanium alloy surface through an image acquisition module to obtain a surface image acquisition set, and uses a processing module connected thereto to perform image recognition to generate color deviation evaluation parameters and defect evaluation parameters; generates coating thickness evaluation parameters through a thickness measurement module; obtains a flexibility measurement image through a flexibility measurement module, and uses a processing module to process the flexibility measurement image to generate flexibility evaluation parameters, and generates a coating quality evaluation result based on the color deviation evaluation parameters, defect evaluation parameters, coating thickness evaluation parameters and flexibility evaluation parameters.
[0004] In modern industry, titanium alloys are widely used in aerospace, medical equipment, chemical equipment and other industries due to their excellent physical and chemical properties. However, titanium alloy bars are easily affected by environmental pollution during the rolling process, such as impurities such as grease and dust adhering to the surface, which not only affects the appearance of the product, but also may have an adverse effect on its subsequent processing technology. If it is not discovered and handled in time, it may cause safety hazards to the finished product. Therefore, it is particularly important to develop an efficient and reliable method for identifying the surface cleanliness of titanium alloy bars. Summary of the invention
[0005] In order to solve the above technical problems, the object of the present invention is to provide a surface cleaning identification method for titanium alloy bar rolling, comprising the following steps:
[0006] Step s1: collecting a global image of the surface of the titanium alloy bar, graying the global image of the surface of the titanium alloy bar to generate a gray image, performing texture feature analysis on the gray image, and obtaining a global noise index of the gray image;
[0007] Step s2: based on the global noise index, obtain the noise difference coefficient within the neighborhood of each pixel point, and perform adaptive filtering on the grayscale image according to the noise difference coefficient to obtain the grayscale image after noise removal;
[0008] Step s3: performing grayscale variation coefficient analysis on the grayscale image after noise removal, dividing the grayscale image into abnormal sliding windows or normal sliding windows, and performing local feature merging and erosion operations on each abnormal sliding window in the grayscale image after noise removal;
[0009] Step s4: Obtain the stain type corresponding to the abnormal sliding window that completes the local feature merging and erosion operations.
[0010] Furthermore, the process of performing texture feature analysis on the grayscale image includes:
[0011] Construct a grayscale co-occurrence matrix for each pixel in the grayscale image, extract texture features from each grayscale co-occurrence matrix, obtain a number of texture eigenvalues of each grayscale co-occurrence matrix, use the several texture eigenvalues of each grayscale co-occurrence matrix as evaluation indicators, preset the indicator weights and smoothness levels of the evaluation indicators, and obtain the membership matrix of each grayscale co-occurrence matrix for different smoothness levels through fuzzy comprehensive evaluation;
[0012] The smoothness level of each gray-level symbiosis matrix is obtained according to the membership matrix and the indicator weight. The smoothness level of each gray-level symbiosis matrix is compared with a preset smoothness level threshold, and the gray-level symbiosis matrix with a smoothness level greater than the smoothness level threshold is screened out, and the gray-level symbiosis matrix is marked as a smoothed gray-level symbiosis matrix.
[0013] Furthermore, the process of obtaining the smoothing level of each gray level co-occurrence matrix according to the membership matrix and the index weight includes:
[0014] The indicator weights and the membership matrix of the evaluation indicators are integrated through a formula to obtain a fuzzy comprehensive evaluation matrix of the evaluation indicators, the membership of each gray-level symbiosis matrix for different smoothing levels is obtained according to the fuzzy comprehensive evaluation matrix, the smoothing level with the highest membership corresponding to each gray-level symbiosis matrix is screened out, and the smoothing level with the highest membership corresponding to each gray-level symbiosis matrix is used as the smoothing level of each gray-level symbiosis matrix;
[0015] Wherein, the formula is:
[0016] ;
[0017] in, is the fuzzy comprehensive evaluation matrix of the evaluation index, is the indicator weight of the evaluation indicator, is the membership matrix, " represents the multiplication of the weight of the evaluation index and the element at the corresponding position of the membership matrix, It is a weighted parameter for controlling the balance between the weight matrix and the membership matrix in the fuzzy comprehensive evaluation matrix of the evaluation index.
[0018] Furthermore, the process of obtaining the global noise index of the grayscale image includes:
[0019] When the grayscale co-occurrence matrix of the pixel point is marked as a smoothed grayscale co-occurrence matrix, the neighborhood range of the pixel point is determined, and the grayscale mean of the neighborhood range is obtained according to the grayscale values of all pixels in the neighborhood range, and each pixel in the neighborhood range is traversed according to the grayscale mean to obtain the grayscale variation coefficient of the neighborhood range;
[0020] According to the grayscale variation coefficients of each neighborhood range in the grayscale image, an average grayscale variation coefficient of the grayscale image is obtained, and the average grayscale variation coefficient is marked as a global noise index.
[0021] Furthermore, based on the global noise index, a noise difference coefficient within the neighborhood of each pixel is obtained, and the grayscale image is adaptively filtered according to the noise difference coefficient to obtain a grayscale image after noise removal. The process includes:
[0022] Determine the neighborhood range of each pixel in the grayscale image, obtain the grayscale variation coefficient within the neighborhood range of each pixel, compare the grayscale variation coefficient within the neighborhood range of each pixel with the global noise index, and obtain the noise difference coefficient within the neighborhood range of each pixel;
[0023] An adaptive control model is preset, and the grayscale variation coefficient and the noise difference coefficient within the neighborhood of each pixel are input into the adaptive control model. The Gaussian filter parameters corresponding to each pixel are output according to the adaptive control model. According to the Gaussian filter parameters corresponding to each pixel, a Gaussian filter is applied to each pixel for processing to obtain a grayscale image after noise removal.
[0024] Furthermore, the grayscale variation coefficient of the grayscale image after noise removal is analyzed, and the process of dividing the grayscale image into abnormal sliding windows or normal sliding windows includes:
[0025] A sliding window is preset, and the sliding window technology is used to move the sliding window in the grayscale image after noise removal, and the grayscale variation coefficient in each sliding window is obtained. A grayscale variation coefficient threshold is preset, and the grayscale variation coefficient in each sliding window is compared with the grayscale variation coefficient threshold. The sliding window whose grayscale variation coefficient is greater than the grayscale variation coefficient threshold is marked as an abnormal sliding window, and the sliding window whose grayscale variation coefficient is less than or equal to the grayscale variation coefficient threshold is marked as a normal sliding window.
[0026] Furthermore, the process of performing a local feature merging operation on each abnormal sliding window in the grayscale image after noise removal includes:
[0027] If the sliding window adjacent to the abnormal sliding window is marked as an abnormal sliding window, the LBP algorithm is used to encode the local texture information of the abnormal sliding window and the adjacent sliding window, the LBP value of the abnormal sliding window and the LBP value of the adjacent sliding window are obtained, the LBP value of the abnormal sliding window is compared with the LBP value of the adjacent sliding window, the LBP deviation value between the abnormal sliding window and the adjacent sliding window is obtained, the LBP deviation value is compared with a preset LBP deviation threshold, and if the LBP deviation value is less than the LBP deviation threshold, the abnormal sliding window is merged with the adjacent sliding window.
[0028] Furthermore, the process of performing a local feature erosion operation on each abnormal sliding window in the grayscale image after noise removal includes:
[0029] If the sliding window adjacent to the abnormal sliding window is marked as a normal sliding window, then the pixel points at the edge of the abnormal sliding window and the pixel points at the edge of the normal sliding window are obtained, the pixel points adjacent to the pixel points at the edge of the abnormal sliding window are obtained from the pixel points at the edge of the normal sliding window, and the pixel points are marked as pixels to be eroded, and the pixel points adjacent to the pixel points to be compared from the pixel points at the edge of the abnormal sliding window are marked as pixels to be compared, and several texture feature values of the pixels to be compared and the pixels to be eroded are obtained;
[0030] Compare the texture feature values of the pixel to be compared and the pixel to be eroded adjacent to the pixel to be compared, obtain the texture feature similarity between the pixel to be compared and the pixel to be eroded, compare the texture feature similarity with a preset texture feature similarity threshold, if the texture feature similarity is greater than or equal to the texture feature similarity threshold, mark the pixel to be eroded as an eroded pixel, and continue the erosion process of the pixel to be compared, if the texture feature similarity is less than the texture feature similarity threshold, end the erosion process of the pixel to be compared;
[0031] The pixels marked as eroded pixels in the normal sliding window are moved into the abnormal sliding window.
[0032] Furthermore, the process of continuing the erosion process of the pixel to be compared includes:
[0033] The pixel points adjacent to the eroded pixel point in the normal sliding window are marked as the pixel points to be eroded, and several texture feature values of the pixel points to be eroded are obtained. The texture feature values of the pixel points to be eroded are compared with those of the pixel points to be compared, and the texture feature similarity between the pixel points to be compared and the pixel points to be eroded is obtained. The texture feature similarity is compared with a preset texture feature similarity threshold. If the texture feature similarity is greater than or equal to the texture feature similarity threshold, the pixel points to be eroded are marked as eroded pixels, and the erosion process of the pixel points to be compared is continued. If the texture feature similarity is less than the texture feature similarity threshold, the erosion process of the pixel points to be compared is terminated.
[0034] Furthermore, the process of obtaining the stain type corresponding to the abnormal sliding window that completes the local feature merging and erosion operations includes:
[0035] Obtain the geometric features and LBP values of the abnormal sliding window that completes the local feature merging and erosion operations;
[0036] A stain type recognition model is constructed based on deep learning. The geometric features and LBP values of the abnormal sliding window are input into the stain type recognition model. The stain type corresponding to the abnormal sliding window is output according to the stain type recognition model.
[0037] Compared with the prior art, the present invention has the following beneficial effects:
[0038] 1. Improve detection accuracy and reliability. By constructing a grayscale co-occurrence matrix and combining it with texture feature analysis, the present invention can accurately evaluate the smoothness level around each pixel, thereby effectively distinguishing between smooth areas and areas where defects or stains may exist. Furthermore, adaptive filtering based on the global noise index can significantly reduce the impact of random noise on the image, ensuring that the grayscale images used in subsequent analysis steps are clearer and more accurate. This not only improves the authenticity and credibility of the detection results, but also lays a solid foundation for real-time quality monitoring on automated production lines.
[0039] 2. To achieve efficient and automated surface detection, the present invention adopts a series of advanced algorithms and technical means, such as fuzzy comprehensive evaluation, LBP (local binary pattern) encoding and deep learning, to achieve full-process automation from data collection to final stain type identification. In particular, the use of the LBP algorithm to encode the local texture information of the abnormal sliding window and its adjacent areas, and to decide whether to merge the relevant areas by comparing the LBP values, greatly simplifies the traditional manual visual inspection process, while ensuring the consistency and objectivity of the classification results. In addition, with the help of a pre-trained deep learning model to determine the type of stain, the system has a fast response capability and strong generalization performance, and can operate stably under different conditions.
[0040] 3. Improve the surface cleanliness evaluation standard. Traditional surface cleanliness evaluation often relies on qualitative visual inspection or simple quantitative measurement, which is difficult to fully reflect the actual situation. The present invention introduces a variety of quantitative indicators, such as grayscale variation coefficient, LBP deviation value and texture feature similarity, to form a more scientific and reasonable evaluation system. By carefully dividing the grayscale image after noise removal and implementing local feature merging and erosion operations on abnormal sliding windows, small but important surface feature changes can be captured more finely, thereby providing a theoretical basis for formulating more stringent and effective cleaning process specifications. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a schematic diagram of a surface cleaning identification method for titanium alloy bar rolling according to an embodiment of the present application. DETAILED DESCRIPTION
[0042] The following is a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0043] like Figure 1 As shown, a surface cleaning identification method for titanium alloy bar rolling includes the following steps:
[0044] Step s1: collecting a global image of the surface of the titanium alloy bar, graying the global image of the surface of the titanium alloy bar to generate a gray image, performing texture feature analysis on the gray image, and obtaining a global noise index of the gray image;
[0045] Step s2: based on the global noise index, obtain the noise difference coefficient within the neighborhood of each pixel point, and perform adaptive filtering on the grayscale image according to the noise difference coefficient to obtain the grayscale image after noise removal;
[0046] Step s3: performing grayscale variation coefficient analysis on the grayscale image after noise removal, dividing the grayscale image into abnormal sliding windows or normal sliding windows, and performing local feature merging and erosion operations on each abnormal sliding window in the grayscale image after noise removal;
[0047] Step s4: Obtain the stain type corresponding to the abnormal sliding window that completes the local feature merging and erosion operations.
[0048] It should be further explained that, in the specific implementation process, the process of performing texture feature analysis on the grayscale image includes:
[0049] Construct a grayscale co-occurrence matrix for each pixel in the grayscale image, where specific details include quantizing the grayscale level of the surface image data into discrete grayscale levels, dividing the grayscale value range into several levels, for example, an 8-bit image can be divided into 16, 32, and 64 levels, and defining the parameters required for the grayscale co-occurrence matrix, including distance (d) and direction (θ), which are determined according to actual application requirements. The specific steps are not repeated here. Texture feature extraction is performed on each grayscale co-occurrence matrix to obtain several texture eigenvalues of each grayscale co-occurrence matrix. The texture eigenvalues include homogeneity (homogeneity is a measure of the sum of squares of all elements in the grayscale co-occurrence matrix. When the image texture is uniform, that is, when the grayscale changes are small, the elements of the grayscale co-occurrence matrix tend to be concentrated on the main diagonal. When the texture is large, the homogeneity is large; on the contrary, if the texture is complex, the homogeneity is small), contrast (reflects the degree of local change in the image, especially the depth of the grooves. The area with large contrast means that there are more grayscale differences, while low contrast indicates that the grayscale changes in the area are not large and tend to be smooth) and entropy (measures the randomness of the amount of information contained in the image and reflects the complexity of the grayscale distribution of the image. When all values in the co-occurrence matrix are almost equal, the entropy reaches the maximum value, indicating that the image is more complex; on the contrary, the smaller the entropy, the simpler and smoother the image). According to several texture eigenvalues of each grayscale co-occurrence matrix as evaluation indicators, the indicator weights and smoothness levels of the evaluation indicators are preset, and the membership matrix of each grayscale co-occurrence matrix for different smoothness levels is obtained through fuzzy comprehensive evaluation;
[0050] The smoothness level of each gray-level symbiosis matrix is obtained according to the membership matrix and the indicator weight. The smoothness level of each gray-level symbiosis matrix is compared with a preset smoothness level threshold, and the gray-level symbiosis matrix with a smoothness level greater than the smoothness level threshold is screened out, and the gray-level symbiosis matrix is marked as a smoothed gray-level symbiosis matrix.
[0051] It should be further explained that, in the specific implementation process, the process of obtaining the smoothing level of each gray level co-occurrence matrix according to the membership matrix and the indicator weight includes:
[0052] The indicator weights and the membership matrix of the evaluation indicators are integrated through a formula to obtain a fuzzy comprehensive evaluation matrix of the evaluation indicators, the membership of each gray-level symbiosis matrix for different smoothing levels is obtained according to the fuzzy comprehensive evaluation matrix, the smoothing level with the highest membership corresponding to each gray-level symbiosis matrix is screened out, and the smoothing level with the highest membership corresponding to each gray-level symbiosis matrix is used as the smoothing level of each gray-level symbiosis matrix;
[0053] Wherein, the formula is:
[0054] ;
[0055] in, is the fuzzy comprehensive evaluation matrix of the evaluation index, is the indicator weight of the evaluation indicator, is the membership matrix, " represents the multiplication of the weight of the evaluation index and the element at the corresponding position of the membership matrix, It is a weighted parameter for controlling the balance between the weight matrix and the membership matrix in the fuzzy comprehensive evaluation matrix of the evaluation index.
[0056] It should be further explained that, in the specific implementation process, the process of obtaining the global noise index of the grayscale image includes:
[0057] When the grayscale co-occurrence matrix of a pixel point is marked as a smooth grayscale co-occurrence matrix, the neighborhood range of the pixel point is determined. The neighborhood type of the neighborhood range of the pixel point used in the present invention is eight neighborhoods. According to the grayscale values of all pixels in the neighborhood range, the grayscale mean of the neighborhood range is obtained. According to the grayscale mean, each pixel point in the neighborhood range is traversed to obtain the grayscale variation coefficient of the neighborhood range;
[0058] According to the grayscale variation coefficients of each neighborhood range in the grayscale image, an average grayscale variation coefficient of the grayscale image is obtained, and the average grayscale variation coefficient is marked as a global noise index.
[0059] Among them, the calculation formula for obtaining the grayscale variation coefficient within the neighborhood range is:
[0060] ;
[0061] ;
[0062] Among them, ds represents the grayscale variation coefficient, u represents the grayscale mean, Represents pixel The grayscale value at , S represents the set of all pixel points in the neighborhood, and N represents the total number of pixel points in the neighborhood. Since the pixel value changes in the smooth area are mainly caused by noise, the noise intensity can be directly reflected by analyzing the grayscale change coefficient of the smooth area.
[0063] It should be further explained that, in a specific implementation process, based on the global noise index, the noise difference coefficient within the neighborhood of each pixel is obtained, and the grayscale image is adaptively filtered according to the noise difference coefficient to obtain the grayscale image after noise removal. The process includes:
[0064] Determine the neighborhood range of each pixel in the grayscale image, obtain the grayscale variation coefficient within the neighborhood range of each pixel, compare the grayscale variation coefficient within the neighborhood range of each pixel with the global noise index, and obtain the noise difference coefficient within the neighborhood range of each pixel;
[0065] An adaptive control model is preset, and the adaptive control model is used to determine the Gaussian kernel size of the pixel according to the grayscale variation coefficient, and determine the standard deviation of the pixel according to the noise difference coefficient. For example, if the pixel is located in a high-density area of the image (i.e., the grayscale variation coefficient is small), this means that the position may be a flat part of the image or a place with less noise. In this case, a larger Gaussian kernel width is applied through the adaptive control model to smooth out minor changes, thereby better eliminating noise without affecting the overall structure. On the contrary, in a low-density area (i.e., a larger grayscale variation coefficient), it means that important edges or other significant features may be contained here. At this time, a smaller Gaussian kernel width is adopted through the adaptive control model to avoid excessive blurring and loss of key information. At the same time, when the grayscale variation coefficient is close to the global noise When the grayscale variation coefficient is much larger than the global noise index (i.e., the noise difference coefficient is small), it means that this area is mainly composed of noise, and the standard deviation is increased through the adaptive control model to enhance the smoothing effect; on the contrary, if the grayscale variation coefficient is much larger than the global noise index (i.e., the noise difference coefficient is large), it indicates that there may be important image features such as edges here, and the standard deviation is reduced through the adaptive control model to reduce the impact on these features, and the grayscale variation coefficient and the noise difference coefficient within the neighborhood of each pixel are input into the adaptive control model, and the Gaussian filter parameters corresponding to each pixel are output according to the adaptive control model, and the Gaussian filter parameters include the Gaussian kernel size and the standard deviation. According to the Gaussian filter parameters corresponding to each pixel, the Gaussian filter is applied to each pixel for processing to obtain the grayscale image after noise removal.
[0066] It should be further explained that, in the specific implementation process, the grayscale variation coefficient analysis is performed on the grayscale image after noise removal, and the process of dividing the grayscale image into abnormal sliding windows or normal sliding windows includes:
[0067] A sliding window is preset, and the sliding window technology is used to move the sliding window in the grayscale image after noise removal, and the grayscale variation coefficient in each sliding window is obtained. A grayscale variation coefficient threshold is preset, and the grayscale variation coefficient in each sliding window is compared with the grayscale variation coefficient threshold. The sliding window whose grayscale variation coefficient is greater than the grayscale variation coefficient threshold is marked as an abnormal sliding window, and the sliding window whose grayscale variation coefficient is less than or equal to the grayscale variation coefficient threshold is marked as a normal sliding window.
[0068] It should be further explained that, in a specific implementation process, the process of performing a local feature merging operation on each abnormal sliding window in the grayscale image after noise removal includes:
[0069] If the sliding window adjacent to the abnormal sliding window is marked as an abnormal sliding window, the LBP algorithm is used to encode local texture information of the abnormal sliding window and the adjacent sliding window, and the LBP value of the abnormal sliding window and the LBP value of the adjacent sliding window are obtained. Since the operation of the LBP algorithm is very direct and only involves simple comparison operations, it can be quickly applied to large-scale data sets or real-time application scenarios. At the same time, the LBP algorithm uses relative grayscale differences rather than absolute grayscale values, so it is invariant to monotonous grayscale changes (such as overall brightening or darkening), which means that even if uniform brightness changes occur in the same area, the LBP value can still maintain a consistent result. Therefore, the present invention uses the LBP algorithm to obtain texture information in the sliding window, compares the LBP value of the abnormal sliding window with the LBP value of the adjacent sliding window, obtains the LBP deviation value between the abnormal sliding window and the adjacent sliding window, compares the LBP deviation value with a preset LBP deviation threshold, and if the LBP deviation value is less than the LBP deviation threshold, the abnormal sliding window is merged with the adjacent sliding window.
[0070] It should be further explained that, in the specific implementation process, the process of performing the local feature erosion operation on each abnormal sliding window in the grayscale image after noise removal includes:
[0071] If the sliding window adjacent to the abnormal sliding window is marked as a normal sliding window, then the pixels at the edge of the abnormal sliding window and the pixels at the edge of the normal sliding window are obtained, the pixels at the edge of the normal sliding window that are adjacent to the pixels at the edge of the abnormal sliding window are obtained, and the pixels are marked as pixels to be eroded, and the pixels at the edge of the abnormal sliding window that are adjacent to the pixels to be compared are marked as pixels to be compared, and several texture feature values of the pixels to be compared and the pixels to be eroded are obtained, that is, grayscale co-occurrence matrices of the pixels to be compared and the pixels to be eroded are constructed, texture features are extracted from the grayscale co-occurrence matrices of the pixels to be compared and the pixels to be eroded, and several texture feature values of the grayscale co-occurrence matrices of the pixels to be compared and the pixels to be eroded are obtained;
[0072] Compare the texture feature values of the pixel to be compared and the pixel to be eroded adjacent to the pixel to be compared, obtain the texture feature similarity between the pixel to be compared and the pixel to be eroded, compare the texture feature similarity with a preset texture feature similarity threshold, if the texture feature similarity is greater than or equal to the texture feature similarity threshold, mark the pixel to be eroded as an eroded pixel, and continue the erosion process of the pixel to be compared, if the texture feature similarity is less than the texture feature similarity threshold, end the erosion process of the pixel to be compared;
[0073] The pixels marked as eroded pixels in the normal sliding window are moved into the abnormal sliding window.
[0074] It should be further explained that, in a specific implementation process, the process of continuing the erosion process of the pixel to be compared includes:
[0075] The pixel points adjacent to the eroded pixel point in the normal sliding window are marked as the pixel points to be eroded, and several texture feature values of the pixel points to be eroded are obtained. The texture feature values of the pixel points to be eroded are compared with those of the pixel points to be compared, and the texture feature similarity between the pixel points to be compared and the pixel points to be eroded is obtained. The texture feature similarity is compared with a preset texture feature similarity threshold. If the texture feature similarity is greater than or equal to the texture feature similarity threshold, the pixel points to be eroded are marked as eroded pixels, and the erosion process of the pixel points to be compared is continued. If the texture feature similarity is less than the texture feature similarity threshold, the erosion process of the pixel points to be compared is terminated.
[0076] It should be further explained that, in the specific implementation process, the process of obtaining the stain type corresponding to the abnormal sliding window that completes the local feature merging and erosion operations includes:
[0077] Acquire the geometric features and LBP value of the abnormal sliding window that completes the local feature merging and erosion operations; the geometric features include length, width, shape, coverage area, etc.;
[0078] A stain type recognition model is built based on deep learning, the geometric features and LBP values of the abnormal sliding window are input into the stain type recognition model, and the stain type corresponding to the abnormal sliding window is output according to the stain type recognition model;
[0079] The specific process of building a stain type recognition model based on deep learning is as follows:
[0080] A simulator is used to generate several global images of the surfaces of titanium alloy bars containing different stain types. After performing steps s1, s2 and s3 on the global images of the surfaces of titanium alloy bars containing different stain types, geometric features and LBP values of abnormal sliding windows in the global images of the surfaces of titanium alloy bars with different stain types are obtained. The geometric features and LBP values of abnormal sliding windows in the global images of the surfaces of titanium alloy bars with different stain types are used as training data to train a stain type recognition model, and a trained stain type recognition model is obtained.
[0081] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.
Claims
1. A surface cleanliness identification method for titanium alloy bar rolling, characterized in that: The following steps are involved: Step s1: collecting a global image of the surface of the titanium alloy bar, graying the global image of the surface of the titanium alloy bar to generate a gray image, performing texture feature analysis on the gray image, and obtaining a global noise index of the gray image; Step s2: based on the global noise index, obtain the noise difference coefficient within the neighborhood of each pixel point, and perform adaptive filtering on the grayscale image according to the noise difference coefficient to obtain the grayscale image after noise removal; Step s3: performing grayscale variation coefficient analysis on the grayscale image after noise removal, dividing the grayscale image into abnormal sliding windows or normal sliding windows, and performing local feature merging and erosion operations on each abnormal sliding window in the grayscale image after noise removal; Step s4: obtaining the stain type corresponding to the abnormal sliding window that completes the local feature merging and erosion operations; The process of performing local feature merging operation on each abnormal sliding window in the grayscale image after noise removal includes: If the sliding window adjacent to the abnormal sliding window is marked as an abnormal sliding window, the LBP algorithm is used to encode local texture information of the abnormal sliding window and the adjacent sliding window, the LBP value of the abnormal sliding window and the LBP value of the adjacent sliding window are obtained, the LBP value of the abnormal sliding window is compared with the LBP value of the adjacent sliding window, the LBP deviation value between the abnormal sliding window and the adjacent sliding window is obtained, the LBP deviation value is compared with a preset LBP deviation threshold, and if the LBP deviation value is less than the LBP deviation threshold, the abnormal sliding window is merged with the adjacent sliding window; The process of performing local feature erosion operation on each abnormal sliding window in the grayscale image after noise removal includes: If the sliding window adjacent to the abnormal sliding window is marked as a normal sliding window, then the pixel points at the edge of the abnormal sliding window and the pixel points at the edge of the normal sliding window are obtained, the pixel points adjacent to the pixel points at the edge of the abnormal sliding window are obtained from the pixel points at the edge of the normal sliding window, and the pixel points are marked as pixels to be eroded, and the pixel points adjacent to the pixel points to be compared from the pixel points at the edge of the abnormal sliding window are marked as pixels to be compared, and several texture feature values of the pixels to be compared and the pixels to be eroded are obtained; Compare the texture feature values of the pixel to be compared and the pixel to be eroded adjacent to the pixel to be compared, obtain the texture feature similarity between the pixel to be compared and the pixel to be eroded, compare the texture feature similarity with a preset texture feature similarity threshold, if the texture feature similarity is greater than or equal to the texture feature similarity threshold, mark the pixel to be eroded as an eroded pixel, and continue the erosion process of the pixel to be compared, if the texture feature similarity is less than the texture feature similarity threshold, end the erosion process of the pixel to be compared; The pixels marked as eroded pixels in the normal sliding window are placed in the abnormal sliding window; The process of continuing the erosion process of the pixel to be compared includes: The pixel points adjacent to the eroded pixel point in the normal sliding window are marked as the pixel points to be eroded, and several texture feature values of the pixel points to be eroded are obtained. The texture feature values of the pixel points to be eroded are compared with those of the pixel points to be compared, and the texture feature similarity between the pixel points to be compared and the pixel points to be eroded is obtained. The texture feature similarity is compared with a preset texture feature similarity threshold. If the texture feature similarity is greater than or equal to the texture feature similarity threshold, the pixel points to be eroded are marked as eroded pixels, and the erosion process of the pixel points to be compared is continued. If the texture feature similarity is less than the texture feature similarity threshold, the erosion process of the pixel points to be compared is terminated.
2. The surface cleanliness identification method for titanium alloy bar rolling according to claim 1 is characterized in that: The process of texture feature analysis of grayscale images includes: Construct a grayscale co-occurrence matrix for each pixel in the grayscale image, extract texture features from each grayscale co-occurrence matrix, obtain a number of texture eigenvalues of each grayscale co-occurrence matrix, use the several texture eigenvalues of each grayscale co-occurrence matrix as evaluation indicators, preset the indicator weights and smoothness levels of the evaluation indicators, and obtain the membership matrix of each grayscale co-occurrence matrix for different smoothness levels through fuzzy comprehensive evaluation; The smoothness level of each gray-level symbiosis matrix is obtained according to the membership matrix and the indicator weight. The smoothness level of each gray-level symbiosis matrix is compared with a preset smoothness level threshold, and the gray-level symbiosis matrix with a smoothness level greater than the smoothness level threshold is screened out, and the gray-level symbiosis matrix is marked as a smoothed gray-level symbiosis matrix.
3. The surface cleanliness identification method for titanium alloy bar rolling according to claim 2 is characterized in that: The process of obtaining the global noise index of a grayscale image includes: When the grayscale co-occurrence matrix of the pixel point is marked as a smoothed grayscale co-occurrence matrix, the neighborhood range of the pixel point is determined, and the grayscale mean of the neighborhood range is obtained according to the grayscale values of all pixels in the neighborhood range, and each pixel in the neighborhood range is traversed according to the grayscale mean to obtain the grayscale variation coefficient of the neighborhood range; According to the grayscale variation coefficients of each neighborhood range in the grayscale image, an average grayscale variation coefficient of the grayscale image is obtained, and the average grayscale variation coefficient is marked as a global noise index.
4. The surface cleanliness identification method for titanium alloy bar rolling according to claim 3 is characterized in that: Based on the global noise index, the noise difference coefficient within the neighborhood of each pixel is obtained, and the grayscale image is adaptively filtered according to the noise difference coefficient to obtain the grayscale image after noise removal. The process includes: Determine the neighborhood range of each pixel in the grayscale image, obtain the grayscale variation coefficient within the neighborhood range of each pixel, compare the grayscale variation coefficient within the neighborhood range of each pixel with the global noise index, and obtain the noise difference coefficient within the neighborhood range of each pixel; An adaptive control model is preset, and the grayscale variation coefficient and the noise difference coefficient within the neighborhood of each pixel are input into the adaptive control model. The Gaussian filter parameters corresponding to each pixel are output according to the adaptive control model. According to the Gaussian filter parameters corresponding to each pixel, a Gaussian filter is applied to each pixel for processing to obtain a grayscale image after noise removal.
5. The surface cleanliness identification method for titanium alloy bar rolling according to claim 4 is characterized in that: The grayscale variation coefficient of the grayscale image after noise removal is analyzed, and the process of dividing the grayscale image into abnormal sliding windows or normal sliding windows includes: A sliding window is preset, and the sliding window technology is used to move the sliding window in the grayscale image after noise removal, and the grayscale variation coefficient in each sliding window is obtained. A grayscale variation coefficient threshold is preset, and the grayscale variation coefficient in each sliding window is compared with the grayscale variation coefficient threshold. The sliding window whose grayscale variation coefficient is greater than the grayscale variation coefficient threshold is marked as an abnormal sliding window, and the sliding window whose grayscale variation coefficient is less than or equal to the grayscale variation coefficient threshold is marked as a normal sliding window.
6. The surface cleanliness identification method for titanium alloy bar rolling according to claim 5 is characterized in that: The process of obtaining the stain type corresponding to the abnormal sliding window that completes the local feature merging and erosion operations includes: Obtain the geometric features and LBP values of the abnormal sliding window that completes the local feature merging and erosion operations; A stain type recognition model is constructed based on deep learning. The geometric features and LBP values of the abnormal sliding window are input into the stain type recognition model. The stain type corresponding to the abnormal sliding window is output according to the stain type recognition model.
Citation Information
Patent Citations
Titanium alloy surface defect treatment method
CN118941931A
Panax plant leaf identification method based on multi-feature extraction
CN115578603A
Steel wire rope damage detection method based on exponential weighting guide filtering
CN117710308A