Surface detection method for polished workpiece

Through the CCD camera and feature enhancement model, the detection combined with image and texture features is solved, and the problem of identifying fine defects in surface detection of polished workpieces is improved, and the accuracy and reliability of the detection is improved. It is suitable for unstable lighting environments.

CN119313611AInactive Publication Date: 2025-01-14JIANGMEN HONGLIANG INTELLIGENT MFG CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411326552.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2025-01-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing surface detection methods for polishing workpieces are difficult to accurately detect subtle defects and defects hidden in light changes. Due to the limitations of optical environment instability and image detection algorithms, they affect the performance and life of the workpiece.

Method used

The CCD camera is used to take the surface image of the polished workpiece, and the feature enhancement feature image is generated through feature enhancement and feature extraction models, and the image features and texture features are combined for fusion detection to improve the accuracy and reliability of the detection.

Benefits of technology

Effectively enhance image details, highlight subtle defects, reduce the impact of uneven light, improve the accuracy and accuracy of surface detection, and accurately identify subtle defects in unstable lighting environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0005055571280000041
    Figure BDA0005055571280000041
  • Figure BDA0005055571280000046
    Figure BDA0005055571280000046
  • Figure BDA0005055571280000051
    Figure BDA0005055571280000051
Patent Text Reader

Abstract

The invention provides a surface detection method of a polished workpiece, which is applied to surface detection equipment of the polished workpiece, and the method comprises the following steps: obtaining a surface image of a to-be-detected polished workpiece, the surface image being obtained by shooting the polished surface of the to-be-detected polished workpiece through a CCD camera, and the to-be-detected polished workpiece corresponding to one or more surface images; preprocessing each surface image to obtain a preprocessed image corresponding to each surface image; and for each pre-processed image, inputting the pre-processed image into a surface detection model, performing feature enhancement processing on the pre-processed image through the surface detection model, performing feature extraction and surface detection, and determining and outputting a surface detection result. According to the scheme, feature enhancement is carried out on the preprocessed image, the enhanced feature image capable of better reflecting the tiny flaws is mined out for texture analysis, meanwhile, image features are extracted and fused, the recognition degree of the tiny flaws can be improved, and the accuracy and reliability of surface detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of surface detection, and in particular to a surface detection method for a polished workpiece. Background Art

[0002] In the manufacturing industry, polishing processes include mechanical polishing, electric polishing, CNC polishing, etc. As a key step to improve the surface quality and aesthetics of products, the importance of polishing process is self-evident. The surface quality of the workpiece after polishing directly affects the overall performance, service life and market acceptance of the product. Therefore, surface inspection of polished workpieces is also an important part of controlling product quality.

[0003] Based on the existing polishing equipment, the efficiency of polishing workpieces is getting higher and higher. The traditional surface detection solution relying on manpower can no longer meet the demand. CCD, as an important role widely used in various non-contact detection links in industry, also has a place in the surface detection of polished workpieces. However, due to the limitations of the factory production environment, it is generally difficult to provide an extremely stable lighting environment, so there is a certain optical environment error. In addition, the current CCD-based surface detection solution has unsatisfactory surface detection effect for polished workpieces. Limited by the current CCD-based machine vision image detection algorithm, it can accurately detect obvious defects (such as scratches, surface cracks, bumps, large-area abnormal patterns such as fish scales and chatter lines, etc.), but for relatively subtle surface defects, such as subtle undulations, or subtle unevenness, subtle chatter lines, fish scales, etc. hidden in transitional light (affected by unstable lighting conditions or compensation light source selection factors, resulting in the presence of some light or heavy highlight areas in the image, and when the light transitions from the highlight area to the outside, the brightness in the image will gradually change, thereby concealing certain defects to a certain extent), these defects that are not easily perceived by the naked eye or existing detection algorithms may be key factors affecting the performance and life of the workpiece. Moreover, the sudden appearance of flaws on the surface of the polished workpiece usually indicates that there are problems with one or more elements in the polishing process, such as vibration and wear of the polishing wheel, the amount and concentration of the polishing agent, polishing pressure, feed speed, polishing speed, cutting depth and other factors. Among them, excessive polishing pressure may cause scratches or damage to the surface of the workpiece, which is not conducive to the formation of a glossy surface; too fast polishing speed may cause excessive heat to be generated by the friction between the workpiece and the polishing wheel, thereby causing thermal deformation and chatter on the surface of the workpiece; too fast feed speed may lead to insufficient polishing, while too slow feed speed may reduce polishing efficiency; too large cutting depth may cause the surface of the workpiece to be over-cut, resulting in unevenness; improper selection of polishing wheels may lead to over-cutting or over-polishing, resulting in chatter or scratches; too high a concentration of polishing agent may cause a decrease in polishing speed, while too low a concentration may fail to achieve the expected polishing effect; insufficient polishing speed may lead to the formation of abnormal patterns such as fish scales.

[0004] Therefore, how to improve the effect of detecting the surface of polished workpieces is a technical problem that needs to be solved in this field. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a surface detection method for a polished workpiece, so as to provide feature information that can better reflect surface defects for surface detection by enhancing features, thereby improving the accuracy and reliability of surface detection.

[0006] In order to achieve the above purpose, the embodiments of the present application are implemented in the following manner:

[0007] In a first aspect, an embodiment of the present application provides a surface detection method for a polished workpiece, which is applied to a surface detection device for a polished workpiece, the method comprising: obtaining a surface image of the polished workpiece to be tested, wherein the surface image is obtained by photographing the polished surface of the polished workpiece to be tested by a CCD camera, and one polished workpiece to be tested corresponds to one or more surface images; preprocessing each surface image to obtain a preprocessed image corresponding to each surface image; for the preprocessed image corresponding to each surface image: inputting the preprocessed image into a surface detection model, performing feature enhancement processing on the preprocessed image through the surface detection model, and performing feature extraction and surface detection, determining and outputting a surface detection result.

[0008] In combination with the first aspect, in a first possible implementation method of the first aspect, a surface detection model is deployed in a surface detection device, including a feature enhancement unit, a feature extraction unit and a surface detection unit, wherein the feature enhancement unit is used to perform feature enhancement on an input preprocessed image to obtain an enhanced feature image, and input the preprocessed image and the enhanced feature image into the feature extraction unit; the feature extraction unit is used to perform feature extraction on the preprocessed image and the enhanced feature image respectively to obtain corresponding image features and texture features, and input the fused features obtained by fusing the image features and the texture features into the surface detection unit; the surface detection unit is used to perform surface detection based on the fused features, determine the surface detection results and output them.

[0009] In combination with the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the feature enhancement unit is specifically used to: determine internal pixels that are not at the edge of the image from the preprocessed image; for each internal pixel: with the internal pixel as the center, determine eight adjacent pixels surrounding the internal pixel, and use the pixel area formed by the internal pixel and the eight adjacent pixels as the pixel neighborhood corresponding to the internal pixel; based on the pixel neighborhood corresponding to each internal pixel, calculate the enhanced grayscale value corresponding to each internal pixel, and form an enhanced feature image corresponding to the preprocessed image.

[0010] In combination with the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, based on the pixel neighborhood corresponding to each internal pixel, the enhanced grayscale value corresponding to each internal pixel is calculated to form an enhanced feature image corresponding to the preprocessed image, including: for each internal pixel: based on the three adjacent pixels located on the left side of the center and the three adjacent pixels located on the right side of the center in the pixel neighborhood corresponding to the internal pixel, respectively calculate the left grayscale mean and the right grayscale mean, and then calculate the first enhanced grayscale value based on the left grayscale mean, the center grayscale value, and the right grayscale mean, so as to integrate the first enhanced grayscale value corresponding to each internal pixel. The grayscale value is converted into a first enhanced feature subgraph corresponding to the preprocessed image; for each internal pixel: based on the three adjacent pixels located above the center and the three adjacent pixels located below the center in the pixel neighborhood corresponding to the internal pixel, the upper grayscale mean and the lower grayscale mean are calculated respectively, and then based on the upper grayscale mean, the center grayscale value, and the lower grayscale mean, a second enhanced grayscale value is calculated to integrate the second enhanced grayscale value corresponding to each internal pixel to form a second enhanced feature subgraph corresponding to the preprocessed image; based on the first enhanced feature subgraph and the second enhanced feature subgraph corresponding to the preprocessed image, an enhanced feature image corresponding to the preprocessed image is generated.

[0011] In combination with the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, calculating the first enhanced grayscale value based on the left grayscale mean, the center grayscale value, and the right grayscale mean includes:

[0012] The first enhanced grayscale value corresponding to the internal pixel p(i,j) is calculated using the following formula:

[0013]

[0014] in, represents the first enhanced grayscale value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), Represents the left grayscale mean corresponding to the internal pixel p(i,j), Represents the right grayscale mean corresponding to the internal pixel p(i,j);

[0015] Correspondingly, based on the upper grayscale mean, the center grayscale value, and the lower grayscale mean, the second enhanced grayscale value is calculated, including:

[0016] The second enhanced grayscale value corresponding to the internal pixel p(i,j) is calculated using the following formula:

[0017]

[0018] in, represents the second enhanced grayscale value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), Represents the upper grayscale mean corresponding to the internal pixel p(i,j), Represents the lower grayscale mean corresponding to the internal pixel p(i,j).

[0019] In combination with the fourth possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, generating an enhanced feature image corresponding to the preprocessed image based on the first enhanced feature sub-image and the second enhanced feature sub-image corresponding to the preprocessed image includes:

[0020] For each interior pixel:

[0021] Based on the first enhanced grayscale value and the second enhanced grayscale value corresponding to the internal pixel, the fused enhanced grayscale value corresponding to the internal pixel is calculated using the following formula:

[0022]

[0023] in, is the fused enhanced gray value corresponding to the internal pixel p(i,j);

[0024] The fused enhanced gray values ​​corresponding to all internal pixels are integrated to form an enhanced feature image corresponding to the preprocessed image.

[0025] In combination with the third possible implementation manner of the first aspect, in a sixth possible implementation manner of the first aspect, the feature extraction unit includes an image feature extraction module and a texture feature extraction module, and the feature extraction unit is specifically used to: perform feature extraction on the preprocessed image through the image feature extraction module to obtain corresponding image features; perform feature extraction on the enhanced feature image through the texture feature extraction module to obtain corresponding texture features; and splice and fuse the image features and texture features to obtain fused features.

[0026] In combination with the second possible implementation manner of the first aspect, in a seventh possible implementation manner of the first aspect, based on the pixel neighborhood corresponding to each internal pixel, the enhanced grayscale value corresponding to each internal pixel is calculated to form an enhanced feature image corresponding to the preprocessed image, including: for each internal pixel: based on the pixel neighborhood corresponding to this internal pixel, a pixel group located on the same straight line and passing through the center point is determined from the pixel neighborhood, a total of four pixel groups, and the enhanced grayscale value of each pixel group is calculated respectively to obtain the third enhanced grayscale value, the fourth enhanced grayscale value, the fifth enhanced grayscale value, and the sixth enhanced grayscale value corresponding to this internal pixel, so as to integrate the third enhanced grayscale value, the fourth enhanced grayscale value, the fifth enhanced grayscale value, and the sixth enhanced grayscale value corresponding to each internal pixel to respectively form the third enhanced feature sub-graph, the fourth enhanced feature sub-graph, the fifth enhanced feature sub-graph, and the sixth enhanced feature sub-graph corresponding to the preprocessed image; the third enhanced feature sub-graph, the fourth enhanced feature sub-graph, the fifth enhanced feature sub-graph, and the sixth enhanced feature sub-graph corresponding to the preprocessed image are combined into the enhanced feature image corresponding to the preprocessed image.

[0027] In combination with the seventh possible implementation manner of the first aspect, in an eighth possible implementation manner of the first aspect, respectively calculating the enhanced grayscale value of each pixel group to obtain the third enhanced grayscale value, the fourth enhanced grayscale value, the fifth enhanced grayscale value, and the sixth enhanced grayscale value corresponding to the internal pixel, includes:

[0028] The third enhanced grayscale value corresponding to the internal pixel p(i,j) is calculated using the following formula:

[0029]

[0030] in, represents the third enhanced gray value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), Represents the grayscale mean of the starting pixel in the first pixel group corresponding to the internal pixel p(i,j), Represents the grayscale mean of the last pixel in the first pixel group corresponding to the internal pixel p(i,j);

[0031] The fourth enhanced grayscale value corresponding to the internal pixel p(i,j) is calculated using the following formula:

[0032]

[0033] in, represents the fourth enhanced grayscale value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), Represents the grayscale mean of the starting pixel in the second pixel group corresponding to the internal pixel p(i,j), Represents the grayscale mean of the last pixel in the second pixel group corresponding to the internal pixel p(i,j);

[0034] The fifth enhanced grayscale value corresponding to the internal pixel p(i,j) is calculated using the following formula:

[0035]

[0036] in, represents the fifth enhanced grayscale value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), Represents the grayscale mean of the starting pixel in the third pixel group corresponding to the internal pixel p(i,j), Represents the grayscale mean of the last pixel in the third pixel group corresponding to the internal pixel p(i,j);

[0037] The sixth enhanced grayscale value corresponding to the internal pixel p(i,j) is calculated using the following formula:

[0038]

[0039] in, represents the sixth enhanced grayscale value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), represents the grayscale mean of the starting pixel in the fourth pixel group corresponding to the internal pixel p(i,j), Represents the grayscale mean of the last pixel in the fourth pixel group corresponding to the internal pixel p(i,j).

[0040] In combination with the seventh possible implementation manner of the first aspect, in a ninth possible implementation manner of the first aspect, the feature extraction unit includes an image feature extraction module, a third texture feature module, a fourth texture feature module, a fifth texture feature module, and a sixth texture feature module, and the feature extraction unit is specifically used to: perform feature extraction on the preprocessed image through the image feature extraction module to obtain corresponding image features; perform feature extraction on the third enhanced feature sub-image in the enhanced feature image through the third texture feature module to obtain corresponding third texture features; perform feature extraction on the fourth enhanced feature sub-image in the enhanced feature image through the fourth texture feature module to obtain corresponding fourth texture features; perform feature extraction on the fifth enhanced feature sub-image in the enhanced feature image through the fifth texture feature module to obtain corresponding fifth texture features; perform feature extraction on the sixth enhanced feature sub-image in the enhanced feature image through the sixth texture feature module to obtain corresponding sixth texture features; and splice and fuse the image features, the third texture features, the fourth texture features, the fifth texture features, and the sixth texture features to obtain fused features.

[0041] Beneficial effects:

[0042] 1. This scheme uses a CCD camera to shoot the polished surface of the workpiece to be tested to obtain a surface image (one or more images, with different shooting schemes for different workpieces and polished surfaces), preprocesses each surface image to obtain a corresponding preprocessed image; inputs the preprocessed image into the surface detection model, and uses the feature enhancement unit of the surface detection model to enhance the input preprocessed image to obtain an enhanced feature image; the feature extraction unit extracts features from the preprocessed image and the enhanced feature image respectively to obtain corresponding image features and texture features, and the surface detection unit performs surface detection based on the fused features after fusion, determines the surface detection results and outputs them. In this way, the surface image (corresponding preprocessed image) can be feature enhanced, and an enhanced feature image that can better reflect subtle defects can be discovered for texture analysis. At the same time, image features can be analyzed and extracted, and then fused. This method can improve the recognition of subtle defects, thereby improving the accuracy and reliability of surface detection.

[0043] 2. By dividing the pixel neighborhood, the grayscale difference of each internal pixel in the horizontal and vertical directions is calculated respectively, and its characteristic enhanced grayscale value (i.e., the first enhanced grayscale value and the second enhanced grayscale value) is generated accordingly. This method can effectively enhance the detail information in the image, and can assign different grayscales according to the relationship between different intermediate grayscale values ​​and the grayscale mean on the left and the grayscale mean on the right (or the upper grayscale mean and the lower grayscale mean) (mainly distinguishing two categories, if the intermediate grayscale value belongs to the transition type, a grayscale value higher than 128 is assigned based on the mean difference, if the intermediate grayscale value does not belong to the transition type, that is, it is higher than the grayscale on both sides or lower than the grayscale on both sides at the same time, then a grayscale value lower than 128 is assigned based on the mean difference). This conditional judgment and absolute value operation will make the difference between the center pixel and its neighboring pixels significantly different in grayscale, and the difference will be amplified and reflected in the enhanced grayscale value. For the surface detection of polished workpieces, this means that even subtle defects (such as subtle undulations, chattering, etc.) can be clearly reflected in the enhanced feature image, which helps to highlight the defect area, making it easier to identify the defect in the subsequent texture detection process of the enhanced feature image, thereby improving the detection accuracy. However, the lighting conditions in the factory environment are often difficult to maintain absolute stability. In the first feature enhancement scheme (i.e., generating the first enhanced feature sub-graph and the second enhanced feature sub-graph), the local illumination changes are smoothed by calculating the partial grayscale mean in the pixel neighborhood, thereby reducing the impact of uneven illumination on the detection results to a certain extent. In addition, since the corresponding enhanced feature sub-graphs are calculated and generated in the horizontal and vertical directions respectively, the information loss caused by smoothing is effectively avoided. Therefore, this scheme can further weaken the interference of illumination changes on the accuracy of defect detection and improve the surface detection accuracy.

[0044] 3. When the first enhanced feature sub-graph and the second enhanced feature sub-graph are used to generate the enhanced feature image, not only the grayscale change information in the horizontal direction (left and right) is considered, but also the grayscale change information in the vertical direction (up and down) is integrated. This multi-dimensional feature fusion can more comprehensively reflect the local characteristics of pixels in the image, thereby enhancing the expressiveness of defects or important features in the image. In the specific fusion scheme, by calculating the enhanced grayscale values ​​in two directions and fusing them (differentiated fusion according to different conditions), the information loss or misleading that may exist in a single direction can be compensated: when the grayscale change in one direction is not obvious, the significant change in the other direction can still be retained to a greater extent, and when there are obvious changes in both directions, the part with more significant features will be effectively retained, and for the part without obvious changes in both directions, mean smoothing is performed, thereby further enhancing the features and smoothing the noise. The enhanced feature image obtained after such fusion can more effectively extract texture features when performing texture analysis, reduce the influence of unstable ring illumination, and is conducive to improving the accuracy of surface analysis.

[0045] 4. This scheme also designs another more fine-grained feature enhancement scheme, which calculates the enhanced grayscale values ​​from more directions (four directions) to achieve more refined feature enhancement. This scheme has a similar feature enhancement effect to the first scheme, but does not consider fusion during the enhancement process, so as to retain the enhanced feature information to a greater extent. After the texture feature extraction is completed, feature fusion is performed to better retain the enhanced feature information, which is beneficial to improving the detection accuracy. However, this scheme will sacrifice some performance, and the feature extraction process will take more time. It is less suitable for more stringent efficient surface detection scenarios (i.e., how short the time is required to complete the surface detection), but the detection accuracy is guaranteed.

[0046] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0048] Figure 1 This is a flow chart of a surface detection method for a polished workpiece provided in an embodiment of the present application.

[0049] Figure 2 A schematic diagram of the framework of the surface detection model provided in an embodiment of the present application.

[0050] Figure 3 A schematic diagram of calculating a first enhanced grayscale value based on a pixel neighborhood.

[0051] Figure 4 A schematic diagram of calculating the second enhanced grayscale value based on a pixel neighborhood.

[0052] Figure 5 Schematic diagram of dividing pixels into four groups based on pixel neighborhood. DETAILED DESCRIPTION

[0053] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0054] In order to realize the surface detection of the polished workpiece (defect detection of the polished surface), the embodiment of the present application provides a surface detection method of the polished workpiece, which is applied to the surface detection device of the polished workpiece (such as an industrial smart terminal, which can be understood as a computer used in industrial scenes), please refer to Figure 1 , Figure 1 Flow chart of the surface inspection method for a polished workpiece.

[0055] In this embodiment, the surface detection method of the polished workpiece may include step S10, step S20, and step S30.

[0056] First, the surface detection device communicates with a CCD camera (equipped with a compensation light source, which may be different depending on the type of workpiece, the type of polishing, etc., and commonly used ones include annular light, strip light, coaxial light, etc.) to obtain a surface image obtained by the CCD camera shooting the polished surface of the polished workpiece. Based on this, the surface detection device can run step S10.

[0057] Step S10: obtaining a surface image of the polished workpiece to be tested, wherein the surface image is obtained by photographing the polished surface of the polished workpiece to be tested with a CCD camera, and one polished workpiece to be tested corresponds to one or more surface images.

[0058] In this embodiment, for a polished workpiece to be tested, the surface inspection device can obtain a surface image (one or more) of the polished workpiece to be tested. Depending on different types of workpiece models, sizes, polished surfaces, etc., there may be different numbers of surface images during polishing inspection. Some polished workpieces may only require one surface image, while others may require multiple surface images. However, no matter whether it is one surface image or multiple surface images, as long as defects are detected, it can be determined that the polished workpiece has defects (multiple defect types can be detected).

[0059] After obtaining the surface image of the polished workpiece to be tested, the surface detection device may execute step S20.

[0060] Step S20: preprocess each surface image to obtain a preprocessed image corresponding to each surface image.

[0061] For each surface image, the surface detection device may perform preprocessing on the surface image, such as scaling, rotating, cropping, graying, etc., to obtain a preprocessed image corresponding to the surface image.

[0062] After obtaining the preprocessed image corresponding to the surface image, the surface detection device may execute step S30.

[0063] Step S30: For the preprocessed image corresponding to each surface image: input the preprocessed image into the surface detection model, perform feature enhancement processing on the preprocessed image through the surface detection model, perform feature extraction and surface detection, determine the surface detection result and output it.

[0064] In this embodiment, the surface detection device can input the preprocessed image into the surface detection model, perform feature enhancement processing on the preprocessed image through the surface detection model, perform feature extraction and surface detection, determine the surface detection result and output it.

[0065] The overall framework code is as follows:

[0066]

[0067] def detect_surface_defects(images,model):

[0068] """

[0069] Use the surface detection model to perform feature enhancement, feature extraction, and surface detection on the preprocessed image:

[0070] Args:

[0071] images (list of numpy.ndarray): preprocessed image array list

[0072] model(SurfaceDetectionModel): surface detection model instance

[0073] Returns:

[0074] list of dict: a list of detection results for each image, each result is a dictionary containing defect information

[0075] """

[0076] results = []

[0077] for image in images:

[0078] # Input the preprocessed image into the model

[0079] result = model.detect(image)

[0080] #model.detect returns a dictionary containing defect information

[0081] results.append(result)

[0082] return results

[0083] #Get the image path list

[0084] image_paths=['path_to_image1.jpg','path_to_image2.jpg','path_to_image3.jpg']

[0085] # Load the image

[0086] images=load_images(image_paths)

[0087] # Initialize the surface detection model (the model needs to be instantiated here, and the model will be described in detail later)

[0088] model = SurfaceDetectionModel() #This is an instance of the model class

[0089] #Preprocess each image

[0090] preprocessed_images=[preprocess_image(image)for image in images]

[0091] #Use the surface detection model to detect defects

[0092] defects_results=detect_surface_defects(preprocessed_images,model)

[0093] # Output or process the test results

[0094] for idx,result in enumerate(defects_results):

[0095] print(f"Detection result of image {image_paths[idx]}:{result}")

[0096] Since the implementation of step S30 mainly depends on the surface detection model, the surface detection model is introduced here. Figure 2 , Figure 2 A schematic diagram of the framework of the surface detection model provided in an embodiment of the present application.

[0097] In this embodiment, the surface detection model may include a feature enhancement unit, a feature extraction unit and a surface detection unit.

[0098] The feature enhancement unit is mainly used to enhance the features of the input preprocessed image to obtain an enhanced feature image, and input the preprocessed image and the enhanced feature image into the feature extraction unit. The feature extraction unit is mainly used to extract features from the preprocessed image and the enhanced feature image respectively to obtain corresponding image features and texture features, and input the fusion features obtained by fusing the image features and texture features into the surface detection unit. The surface detection unit is used to perform surface detection based on the fusion features, determine the surface detection results and output them.

[0099] The following will introduce each module in the surface detection model in this solution in detail. Since the various processing steps involved in model training are almost the same as the processing steps performed during operation (the difference is that during the training process, the data used is labeled, and the surface detection results are compared with the annotations during the training process, and the model parameters are updated based on the comparison information to achieve the training purpose; while the operation process is the surface detection process during application, the input pre-processed image is not labeled, and the model output is also the prediction result), therefore, this solution does not introduce the training process separately, but introduces the operation process during application.

[0100] First, after the preprocessed image corresponding to the surface image is input into the surface detection model, the feature enhancement unit can perform feature enhancement on the preprocessed image. First, internal pixels that are not at the edge of the image are determined from the preprocessed image, that is, each pixel in the preprocessed image except for a circle of pixels at the edge is an internal pixel.

[0101] For each internal pixel: the feature enhancement unit can determine eight adjacent pixels surrounding the internal pixel with the internal pixel as the center, and use the pixel area formed by the internal pixel and the eight adjacent pixels as the pixel neighborhood corresponding to the internal pixel.

[0102] Based on the pixel neighborhood corresponding to each internal pixel, the feature enhancement unit can calculate the enhanced grayscale value corresponding to each internal pixel to form an enhanced feature image corresponding to the preprocessed image. This embodiment provides two different solutions, one of which takes into account detection efficiency while enhancing features, and the other of which enhances features more finely at the expense of some detection efficiency.

[0103] Here we introduce the first solution:

[0104] Exemplarily, for each internal pixel: the feature enhancement unit can calculate the left grayscale mean and the right grayscale mean based on the three adjacent pixels located on the left side of the center and the three adjacent pixels located on the right side of the center in the pixel neighborhood corresponding to the internal pixel, such as Figure 3 As shown, the first enhanced grayscale value is calculated based on the left grayscale mean, the center grayscale value, and the right grayscale mean.

[0105] Specifically, for the internal pixel p(i, j), the feature enhancement unit may use the following formula to calculate the first enhanced grayscale value corresponding to the internal pixel p(i, j):

[0106]

[0107] in, represents the first enhanced grayscale value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), Represents the left grayscale mean corresponding to the internal pixel p(i,j), Represents the right grayscale mean corresponding to the internal pixel p(i,j).

[0108] At the same time, the feature enhancement unit can calculate the upper grayscale mean and the lower grayscale mean based on the three adjacent pixels located above the center and the three adjacent pixels located below the center in the pixel neighborhood corresponding to the internal pixel, respectively, as shown in Figure 4 As shown, the second enhanced grayscale value is calculated based on the upper grayscale mean, the central grayscale value, and the lower grayscale mean.

[0109] Specifically, for the internal pixel p(i, j), the feature enhancement unit may use the following formula to calculate the second enhanced grayscale value corresponding to the internal pixel p(i, j):

[0110]

[0111] in, represents the second enhanced grayscale value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), Represents the upper grayscale mean corresponding to the internal pixel p(i,j), Represents the lower grayscale mean corresponding to the internal pixel p(i,j).

[0112] After calculating the first enhanced grayscale value corresponding to each internal pixel, the feature enhancement unit can integrate these first enhanced grayscale values ​​to form a first enhanced feature sub-graph corresponding to the preprocessed image. Similarly, after calculating the second enhanced grayscale value corresponding to each internal pixel, the feature enhancement unit can integrate these second enhanced grayscale values ​​to form a second enhanced feature sub-graph corresponding to the preprocessed image.

[0113] After obtaining the first enhanced feature sub-graph and the second enhanced feature sub-graph corresponding to the preprocessed image, the feature enhancement unit may further generate an enhanced feature image corresponding to the preprocessed image based on the first enhanced feature sub-graph and the second enhanced feature sub-graph corresponding to the preprocessed image.

[0114] Exemplarily, for each internal pixel, the feature enhancement unit may calculate the fused enhanced grayscale value corresponding to the internal pixel based on the first enhanced grayscale value and the second enhanced grayscale value corresponding to the internal pixel using the following formula:

[0115]

[0116] in, is the fused enhanced gray value corresponding to the internal pixel p(i, j). In the judgment condition of each item in formula (3), the two parts are in an “and” relationship and must be satisfied at the same time.

[0117] After calculating the fused enhanced grayscale value corresponding to each internal pixel, the feature enhancement unit can integrate the fused enhanced grayscale values ​​corresponding to all internal pixels to form an enhanced feature image corresponding to the preprocessed image.

[0118] This is the first solution. Although the amount of data seems to be large, the blocks (i.e., pixel neighborhoods) are independent of each other and can be processed in parallel, so the processing efficiency is high. For this solution, the corresponding feature extraction unit is designed to include an image feature extraction module and a texture feature extraction module. Both the image feature extraction module and the texture feature extraction module can use a model architecture based on CNN, but due to the different focuses of the two, there are still some differences in the specific model selection. For the image feature extraction module, CNN models such as VGGNet or DenseNet with deeper convolution layers and powerful feature extraction capabilities can be selected to extract image features in the preprocessed image. For the texture feature extraction module, InceptionNet can be selected, which can capture multi-scale features in the enhanced feature image by using convolution kernels of different sizes and pooling operations in parallel. Of course, VGGNet can also be selected. In this embodiment, the image feature extraction module selects VGGNet and the texture feature extraction module selects InceptionNet as an example, but it is not limited, and the construction and training of these two modules can be completed in the deep learning framework TensorFlow.

[0119] The first solution logic code example is as follows:

[0120]

[0121]

[0122]

[0123] The sample code for the CNN-based model architecture (feature extraction module based on VGGNET) is as follows:

[0124]

[0125] The code example for building a texture feature extraction module based on InceptionNet is as follows:

[0126]

[0127]

[0128] After that, the image feature extraction module can be used to extract features from the preprocessed image to obtain corresponding image features, and the texture feature extraction module can be used to extract features from the enhanced feature image to obtain corresponding texture features. After obtaining the image features and texture features, the feature extraction unit can concatenate and fuse the image features and texture features to obtain fused features.

[0129] The surface detection unit (generally a classifier, this solution needs to realize multi-classification recognition, and classify surface defects while detecting them. Classifiers such as random forest and support vector machine can be used) is used to perform surface detection based on fused features (that is, mapping the fused features to the prediction space to obtain the probability of belonging to each category, such as "no defect", "scratch", "crack", "fish scale pattern", "chatter pattern", "unevenness", "bump", etc.), and finally determine the surface detection results and output them.

[0130] The above is an introduction to the first solution. Next, I will introduce the second solution:

[0131] Exemplarily, for each internal pixel: the feature enhancement unit can determine, based on the pixel neighborhood corresponding to the internal pixel, a pixel group located on the same straight line and passing through the center point from the pixel neighborhood, a total of four pixel groups (in terms of direction, either continuously taking the direction clockwise or continuously taking the direction counterclockwise to avoid misalignment), such as Figure 5 As shown ( Figure 5 ③, ④, ⑤, and ⑥ correspond to a group of pixels, respectively, and correspond to the calculated third enhanced grayscale value, fourth enhanced grayscale value, fifth enhanced grayscale value, and sixth enhanced grayscale value. Then, the enhanced grayscale value corresponding to each group of pixels can be calculated respectively to obtain the third enhanced grayscale value, fourth enhanced grayscale value, fifth enhanced grayscale value, and sixth enhanced grayscale value corresponding to the internal pixel.

[0132] Specifically, the feature enhancement unit may use the following formula to calculate the third enhanced grayscale value corresponding to the internal pixel p(i, j):

[0133]

[0134] in, represents the third enhanced gray value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), Represents the grayscale mean of the starting pixel in the first pixel group corresponding to the internal pixel p(i,j), Represents the grayscale mean of the last pixel in the first pixel group corresponding to the internal pixel p(i,j).

[0135] And, the feature enhancement unit may calculate the fourth enhanced grayscale value corresponding to the internal pixel p(i, j) using the following formula:

[0136]

[0137] in, represents the fourth enhanced grayscale value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), Represents the grayscale mean of the starting pixel in the second pixel group corresponding to the internal pixel p(i,j), Represents the grayscale mean of the last pixel in the second pixel group corresponding to the internal pixel p(i,j).

[0138] The feature enhancement unit may calculate the fifth enhanced grayscale value corresponding to the internal pixel p(i, j) using the following formula:

[0139]

[0140] in, represents the fifth enhanced grayscale value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), Represents the grayscale mean of the starting pixel in the third pixel group corresponding to the internal pixel p(i,j), Represents the grayscale mean of the last pixel in the third pixel group corresponding to the internal pixel p(i,j).

[0141] And, the feature enhancement unit may calculate the sixth enhanced grayscale value corresponding to the internal pixel p(i, j) using the following formula:

[0142]

[0143] in, represents the sixth enhanced grayscale value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), represents the grayscale mean of the starting pixel in the fourth pixel group corresponding to the internal pixel p(i,j), Represents the grayscale mean of the last pixel in the fourth pixel group corresponding to the internal pixel p(i,j).

[0144] After determining the third enhanced grayscale value (or the fourth enhanced grayscale value, or the fifth enhanced grayscale value, or the sixth enhanced grayscale value) corresponding to each internal pixel, the feature enhancement unit can integrate the third enhanced grayscale value (or the fourth enhanced grayscale value, or the fifth enhanced grayscale value, or the sixth enhanced grayscale value) corresponding to each internal pixel to form a third enhanced feature sub-image (or the fourth enhanced feature sub-image, or the fifth enhanced feature sub-image, or the sixth enhanced feature sub-image) corresponding to the preprocessed image.

[0145] After obtaining the third enhanced feature sub-graph, the fourth enhanced feature sub-graph, the fifth enhanced feature sub-graph, and the sixth enhanced feature sub-graph, the feature enhancement unit can combine the third enhanced feature sub-graph, the fourth enhanced feature sub-graph, the fifth enhanced feature sub-graph, and the sixth enhanced feature sub-graph corresponding to the pre-processed image into an enhanced feature image corresponding to the pre-processed image (no fusion is required, and richer enhanced feature information is retained).

[0146] Corresponding to this solution, the feature extraction unit is designed to include an image feature extraction module (using VGGNet), a third texture feature module (using InceptionNet), a fourth texture feature module (using InceptionNet), a fifth texture feature module (using InceptionNet), and a sixth texture feature module (using InceptionNet).

[0147] Then, the feature extraction unit can perform feature extraction on the preprocessed image through the image feature extraction module to obtain the corresponding image feature. And, perform feature extraction on the third enhanced feature sub-image in the enhanced feature image through the third texture feature module to obtain the corresponding third texture feature. Perform feature extraction on the fourth enhanced feature sub-image in the enhanced feature image through the fourth texture feature module to obtain the corresponding fourth texture feature. Perform feature extraction on the fifth enhanced feature sub-image in the enhanced feature image through the fifth texture feature module to obtain the corresponding fifth texture feature. Perform feature extraction on the sixth enhanced feature sub-image in the enhanced feature image through the sixth texture feature module to obtain the corresponding sixth texture feature. Finally, the feature extraction unit can splice and fuse the image feature, the third texture feature, the fourth texture feature, the fifth texture feature, and the sixth texture feature to obtain the fused feature.

[0148] The fused features are input to the final surface detection unit (random forest is used in this embodiment) for surface detection based on the fused features (i.e., the fused features are mapped to the prediction space to obtain the probabilities of belonging to each category, such as "no defect", "scratch", "crack", "fish scale pattern", "chatter pattern", "unevenness", "bump", etc.), and finally the surface detection results are determined and output. Of course, for the first and second schemes, the lengths of the fused features of the two schemes may be different, but in the same scheme, the lengths of the fused features need to be uniform.

[0149] In summary, the embodiment of the present application provides a surface detection method for a polished workpiece, using a CCD camera to shoot the polished surface of the polished workpiece to be tested to obtain a surface image (one or more images, with different shooting schemes for different workpieces and polished surfaces), preprocessing each surface image to obtain a corresponding preprocessed image; inputting the preprocessed image into a surface detection model, using the feature enhancement unit of the surface detection model to enhance the input preprocessed image to obtain an enhanced feature image; the feature extraction unit extracts features from the preprocessed image and the enhanced feature image respectively to obtain corresponding image features and texture features, and the surface detection unit performs surface detection based on the fused features after fusion, determines the surface detection result and outputs it. In this way, the surface image (corresponding preprocessed image) can be feature enhanced, and an enhanced feature image that can better reflect subtle defects can be discovered for texture analysis. At the same time, image feature analysis and extraction are also performed, and then fused. This method can improve the recognition of subtle defects, thereby improving the accuracy and reliability of surface detection.

[0150] By dividing the pixel neighborhood, calculating the grayscale difference of each internal pixel in the horizontal and vertical directions respectively, and generating its characteristic enhanced grayscale value (i.e., the first enhanced grayscale value and the second enhanced grayscale value) accordingly, this method can effectively enhance the detail information in the image, and can assign different grayscales according to the relationship between different intermediate grayscale values ​​and the grayscale mean on the left and the grayscale mean on the right (or the upper grayscale mean and the lower grayscale mean) (mainly distinguishing two categories, if the intermediate grayscale value is transitional, a grayscale value higher than 128 is assigned based on the mean difference, if the intermediate grayscale value is not transitional, that is, it is higher than the grayscale on both sides or lower than the grayscale on both sides at the same time, then a grayscale value lower than 128 is assigned based on the mean difference). This conditional judgment and absolute value operation will make the difference between the center pixel and its neighboring pixels significantly different in grayscale, and the difference will be amplified and reflected in the enhanced grayscale value. For the surface detection of polished workpieces, this means that even subtle defects (such as subtle undulations, chattering, etc.) can be clearly reflected in the enhanced feature image, which helps to highlight the defect area, making it easier to identify the defect in the subsequent texture detection process of the enhanced feature image, thereby improving the detection accuracy. However, the lighting conditions in the factory environment are often difficult to maintain absolute stability. In the first feature enhancement scheme (i.e., generating the first enhanced feature sub-graph and the second enhanced feature sub-graph), the local illumination changes are smoothed by calculating the partial grayscale mean in the pixel neighborhood, thereby reducing the impact of uneven illumination on the detection results to a certain extent. In addition, since the corresponding enhanced feature sub-graphs are calculated and generated in the horizontal and vertical directions respectively, the information loss caused by smoothing is effectively avoided. Therefore, this scheme can further weaken the interference of illumination changes on the accuracy of defect detection and improve the surface detection accuracy.

[0151] When the first enhanced feature sub-graph and the second enhanced feature sub-graph are used to generate the enhanced feature image, not only the grayscale change information in the horizontal direction (left and right) is considered, but also the grayscale change information in the vertical direction (up and down) is integrated. This multi-dimensional feature fusion can more comprehensively reflect the local characteristics of pixels in the image, thereby enhancing the expressiveness of defects or important features in the image. In the specific fusion scheme, by calculating the enhanced grayscale values ​​in two directions and fusing them (differentiated fusion according to different conditions), the information loss or misleading that may exist in a single direction can be compensated: when the grayscale change in one direction is not obvious, the significant change in the other direction can still be retained to a greater extent, and when there are obvious changes in both directions, the part with more significant features will be effectively retained, and for the part without obvious changes in both directions, mean smoothing is performed, thereby further enhancing the features and smoothing the noise. The enhanced feature image obtained after such fusion can more effectively extract texture features when performing texture analysis, reduce the influence of unstable ring illumination, and help improve the accuracy of surface analysis.

[0152] This scheme also designs another more fine-grained feature enhancement scheme, which calculates the enhanced grayscale values ​​from more directions (four directions) to achieve more refined feature enhancement. This scheme has a similar feature enhancement effect to the first scheme, but does not consider fusion during the enhancement process, so as to retain the enhanced feature information to a greater extent. After the texture feature extraction is completed, feature fusion is performed to better retain the enhanced feature information, which is beneficial to improving the detection accuracy. However, this scheme will sacrifice some performance, and the feature extraction process will take more time. It is less suitable for more stringent efficient surface detection scenarios (i.e., how short a time is required to complete surface detection), but the detection accuracy is guaranteed.

[0153] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A surface detection method for a polished workpiece, characterized in that: A surface detection device applied to a polished workpiece, the method comprising: Acquire a surface image of the polished workpiece to be tested, wherein the surface image is obtained by photographing the polished surface of the polished workpiece to be tested by a CCD camera, and one polished workpiece to be tested corresponds to one or more surface images; Preprocessing each surface image to obtain a preprocessed image corresponding to each surface image; For the preprocessed image corresponding to each surface image: the preprocessed image is input into the surface detection model, the surface detection model performs feature enhancement processing on the preprocessed image, and performs feature extraction and surface detection, and determines and outputs the surface detection result.

2. The surface detection method for a polished workpiece according to claim 1, characterized in that: The surface detection model is deployed in the surface detection device, including feature enhancement unit, feature extraction unit and surface detection unit. The feature enhancement unit is used to enhance the features of the input preprocessed image to obtain an enhanced feature image, and input the preprocessed image and the enhanced feature image to the feature extraction unit; The feature extraction unit is used to extract features from the preprocessed image and the enhanced feature image respectively to obtain corresponding image features and texture features, and input the fused features obtained by fusing the image features and the texture features into the surface detection unit; The surface detection unit is used to perform surface detection based on the fusion features, determine the surface detection result and output it.

3. The surface detection method for a polished workpiece according to claim 2, characterized in that: The feature enhancement unit is specifically used for: Determining interior pixels that are not at the edge of the image from the preprocessed image; For each internal pixel: taking the internal pixel as the center, eight adjacent pixels surrounding the internal pixel are determined, and a pixel area formed by the internal pixel and the eight adjacent pixels is used as a pixel neighborhood corresponding to the internal pixel; Based on the pixel neighborhood corresponding to each internal pixel, the enhanced grayscale value corresponding to each internal pixel is calculated to form an enhanced feature image corresponding to the preprocessed image.

4. The surface detection method for a polished workpiece according to claim 3, characterized in that: Based on the pixel neighborhood corresponding to each internal pixel, the enhanced grayscale value corresponding to each internal pixel is calculated to form an enhanced feature image corresponding to the preprocessed image, including: For each internal pixel: based on the three adjacent pixels located on the left side of the center and the three adjacent pixels located on the right side of the center in the pixel neighborhood corresponding to the internal pixel, the left grayscale mean and the right grayscale mean are calculated respectively, and then based on the left grayscale mean, the center grayscale value, and the right grayscale mean, a first enhanced grayscale value is calculated to integrate the first enhanced grayscale value corresponding to each internal pixel to form a first enhanced feature sub-image corresponding to the preprocessed image; For each internal pixel: based on the three adjacent pixels located above the center and the three adjacent pixels located below the center in the pixel neighborhood corresponding to the internal pixel, the upper grayscale mean and the lower grayscale mean are calculated respectively, and then based on the upper grayscale mean, the center grayscale value, and the lower grayscale mean, a second enhanced grayscale value is calculated to integrate the second enhanced grayscale value corresponding to each internal pixel to form a second enhanced feature sub-image corresponding to the preprocessed image; Based on the first enhanced feature sub-image and the second enhanced feature sub-image corresponding to the pre-processed image, an enhanced feature image corresponding to the pre-processed image is generated.

5. The surface detection method for a polished workpiece according to claim 4, characterized in that: Based on the left grayscale mean, the center grayscale value, and the right grayscale mean, a first enhanced grayscale value is calculated, including: The first enhanced grayscale value corresponding to the internal pixel p(i,j) is calculated using the following formula: in, represents the first enhanced grayscale value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), Represents the left grayscale mean corresponding to the internal pixel p(i,j), Represents the right grayscale mean corresponding to the internal pixel p(i,j); Correspondingly, based on the upper grayscale mean, the center grayscale value, and the lower grayscale mean, the second enhanced grayscale value is calculated, including: The second enhanced grayscale value corresponding to the internal pixel p(i,j) is calculated using the following formula: in, represents the second enhanced grayscale value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), Represents the upper grayscale mean corresponding to the internal pixel p(i,j), Represents the lower grayscale mean corresponding to the internal pixel p(i,j).

6. The surface detection method for a polished workpiece according to claim 5, characterized in that: Generating an enhanced feature image corresponding to the preprocessed image based on the first enhanced feature sub-image and the second enhanced feature sub-image corresponding to the preprocessed image includes: For each interior pixel: Based on the first enhanced grayscale value and the second enhanced grayscale value corresponding to the internal pixel, the fused enhanced grayscale value corresponding to the internal pixel is calculated using the following formula: in, is the fused enhanced gray value corresponding to the internal pixel p(i,j); The fused enhanced gray values ​​corresponding to all internal pixels are integrated to form an enhanced feature image corresponding to the preprocessed image.

7. The surface detection method for a polished workpiece according to claim 4, characterized in that: The feature extraction unit includes an image feature extraction module and a texture feature extraction module, and the feature extraction unit is specifically used for: Perform feature extraction on the preprocessed image through an image feature extraction module to obtain corresponding image features; The texture feature extraction module is used to extract features from the enhanced feature image to obtain corresponding texture features; The image features and texture features are concatenated and fused to obtain fused features.

8. The surface detection method for a polished workpiece according to claim 3, characterized in that: Based on the pixel neighborhood corresponding to each internal pixel, the enhanced grayscale value corresponding to each internal pixel is calculated to form an enhanced feature image corresponding to the preprocessed image, including: For each internal pixel: based on the pixel neighborhood corresponding to the internal pixel, a pixel group located in the same straight line and passing through the center point is determined from the pixel neighborhood, a total of four pixel groups are obtained, and the enhanced grayscale value of each pixel group is calculated respectively to obtain the third enhanced grayscale value, the fourth enhanced grayscale value, the fifth enhanced grayscale value, and the sixth enhanced grayscale value corresponding to the internal pixel, so as to integrate the third enhanced grayscale value, the fourth enhanced grayscale value, the fifth enhanced grayscale value, and the sixth enhanced grayscale value corresponding to each internal pixel to form a third enhanced feature sub-image, a fourth enhanced feature sub-image, a fifth enhanced feature sub-image, and a sixth enhanced feature sub-image corresponding to the preprocessed image respectively; The third enhanced feature sub-image, the fourth enhanced feature sub-image, the fifth enhanced feature sub-image, and the sixth enhanced feature sub-image corresponding to the pre-processed image are combined into an enhanced feature image corresponding to the pre-processed image.

9. The surface detection method for a polished workpiece according to claim 8, characterized in that: Calculate the enhanced grayscale value of each pixel group respectively to obtain the third enhanced grayscale value, the fourth enhanced grayscale value, the fifth enhanced grayscale value, and the sixth enhanced grayscale value corresponding to the internal pixel, including: The third enhanced grayscale value corresponding to the internal pixel p(i,j) is calculated using the following formula: in, represents the third enhanced gray value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), Represents the grayscale mean of the starting pixel in the first pixel group corresponding to the internal pixel p(i,j), Represents the grayscale mean of the last pixel in the first pixel group corresponding to the internal pixel p(i,j); The fourth enhanced grayscale value corresponding to the internal pixel p(i,j) is calculated using the following formula: in, represents the fourth enhanced grayscale value corresponding to the internal pixel p(i,i), Represents the central grayscale value corresponding to the internal pixel p(i,j), Represents the grayscale mean of the starting pixel in the second pixel group corresponding to the internal pixel p(i,j), Represents the grayscale mean of the last pixel in the second pixel group corresponding to the internal pixel p(i,j); The fifth enhanced grayscale value corresponding to the internal pixel p(i,j) is calculated using the following formula: in, represents the fifth enhanced grayscale value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), Represents the grayscale mean of the starting pixel in the third pixel group corresponding to the internal pixel p(i,j), Represents the grayscale mean of the last pixel in the third pixel group corresponding to the internal pixel p(i,j); The sixth enhanced grayscale value corresponding to the internal pixel p(i,j) is calculated using the following formula: in, represents the sixth enhanced grayscale value corresponding to the internal pixel p(i,j), Represents the central grayscale value corresponding to the internal pixel p(i,j), represents the grayscale mean of the starting pixel in the fourth pixel group corresponding to the internal pixel p(i,j), Represents the grayscale mean of the last pixel in the fourth pixel group corresponding to the internal pixel p(i,j).

10. The surface detection method for a polished workpiece according to claim 8, characterized in that: The feature extraction unit includes an image feature extraction module, a third texture feature module, a fourth texture feature module, a fifth texture feature module, and a sixth texture feature module, and the feature extraction unit is specifically used for: Perform feature extraction on the preprocessed image through an image feature extraction module to obtain corresponding image features; Extracting features of a third enhanced feature sub-image in the enhanced feature image by a third texture feature module to obtain corresponding third texture features; Extracting features of a fourth enhanced feature sub-image in the enhanced feature image by a fourth texture feature module to obtain a corresponding fourth texture feature; Extracting features of a fifth enhanced feature sub-image in the enhanced feature image by a fifth texture feature module to obtain a corresponding fifth texture feature; Extracting features of a sixth enhanced feature sub-image in the enhanced feature image by a sixth texture feature module to obtain a corresponding sixth texture feature; The image feature, the third texture feature, the fourth texture feature, the fifth texture feature, and the sixth texture feature are spliced ​​and fused to obtain a fused feature.

Citation Information

Patent Citations

  • Detection and polishing integrated intelligent equipment

    CN112025519A

  • Defect type identification method and system of multi-strategy fusion deep learning network model

    CN114419007A

  • Workpiece defect detection method based on deep neural network

    CN116071327A

  • Denoising enhancement system and method of 2CMOS camera based on deep learning

    CN116843582A