A stainless steel surface frosted process regulation method based on machine vision
By analyzing the uneven illumination and mechanical vibration of stainless steel surface images using a machine vision system, and employing gamma correction and dynamic adjustment of grinding parameters, the problem of poor image quality caused by uneven illumination and vibration during the grinding process was solved, thereby improving the control effect of the grinding process and the accuracy of surface roughness acquisition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG ZEYANG METAL MATERIALS CO LTD
- Filing Date
- 2025-06-30
- Publication Date
- 2026-04-21
AI Technical Summary
Uneven illumination and mechanical vibration on the stainless steel surface during the sanding process result in poor image quality, affecting the accuracy of surface roughness acquisition and reducing the control effect of the sanding process.
The stainless steel surface image at each moment during the sanding process is acquired by a machine vision system. Connected regions are divided, and the effects of light and dark boundary effects and uneven illumination are analyzed. Gamma correction and dynamic adjustment of sanding parameters are used to construct the mapping relationship between surface roughness and sanding parameters.
It improves the accuracy and efficiency of the grinding process control, ensures the uniformity of illumination and the accuracy of obtaining surface roughness in stainless steel surface images, and dynamically adjusts grinding parameters to optimize surface quality.
Smart Images

Figure CN120823162B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image data processing technology, and specifically to a method for controlling the surface sanding process of stainless steel based on machine vision. Background Technology
[0002] A machine vision-based method for controlling the surface grinding process of stainless steel aims to improve processing accuracy and production efficiency by using image processing and intelligent algorithms to achieve real-time monitoring and optimization of stainless steel surface roughness. This method utilizes a machine vision system to acquire images of the stainless steel surface, extracts surface roughness features through image processing techniques, and combines intelligent algorithms (such as neural networks and random forests) for classification and judgment, thereby dynamically adjusting grinding parameters to ensure that the surface quality meets requirements.
[0003] Existing problems: However, during the sanding process, irregular micro-undulations form on the stainless steel surface. These uneven surfaces reflect light at different angles, causing uneven illumination. Furthermore, the degree of sanding may not be entirely consistent across different areas; some areas may be sanded finer, while others may be coarser. This uneven sanding degree also leads to variations in the surface's ability to reflect light, thus affecting the uniformity of illumination in the image. Additionally, the high-speed rotation of the motor and sanding wheel during operation generates mechanical vibrations. These vibrations may be transmitted to the stainless steel being processed, especially at the moment of contact between the sanding wheel and the stainless steel surface. This results in high-frequency vibration marks on the processed surface, further exacerbating the uneven illumination in the acquired stainless steel surface image. This leads to poor image quality, affects the accuracy of surface roughness acquisition, and ultimately reduces the controllability of the stainless steel surface sanding process. Summary of the Invention
[0004] This invention provides a machine vision-based method for controlling the surface sanding process of stainless steel to solve existing problems.
[0005] The present invention provides a method for controlling the surface sanding process of stainless steel based on machine vision, which adopts the following technical solution:
[0006] One embodiment of the present invention provides a method for controlling the surface sanding process of stainless steel based on machine vision, the method comprising the following steps:
[0007] Acquire images of the stainless steel surface at every moment during the sanding process;
[0008] Based on the differences in pixel grayscale values, the stainless steel surface image at each moment is divided into several connected regions, and the polishing effect value of each connected region is determined; based on the differences in polishing effect values between different connected regions, the bright and dark boundary effect factor caused by different polishing effect areas in the stainless steel surface image at each moment is determined.
[0009] Based on the difference in grayscale values of pixels within connected regions with similar polishing effect values, and combined with the bright and dark boundary effect factor caused by different polishing effect regions in the stainless steel surface image at each moment, the influence factor of polishing effect on uneven illumination in the stainless steel surface image at each moment is determined.
[0010] Based on the magnitude of the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at each moment, the required gamma value for the stainless steel surface image at each moment is determined; using the gamma value, gamma correction is performed on the stainless steel surface image at each moment to obtain an enhanced stainless steel surface image.
[0011] The surface roughness of the stainless steel surface enhancement image is obtained, and a mapping relationship between the surface roughness and the matting parameters is constructed to dynamically adjust the matting parameters.
[0012] Furthermore, the specific steps involved in dividing the stainless steel surface image at each moment into several connected regions and determining the polishing effect value for each connected region are as follows:
[0013] Preset window side length In the stainless steel surface image at each time step, obtain an image centered on each pixel with a size of [missing information]. For each pixel, the variance of the grayscale values of all pixels within the window is calculated and recorded as the polishing unevenness of each pixel. Based on the polishing unevenness of each pixel, a region growing algorithm is used to obtain several connected regions. The mean of the polishing unevenness of all pixels in each connected region is recorded as the polishing effect value of each connected region.
[0014] Furthermore, the specific steps for determining the bright-dark boundary effect factor caused by different polishing effect areas in the stainless steel surface image at each moment are as follows:
[0015] In the stainless steel surface image at each time step, the absolute value of the difference between the polishing effect values of any two connected regions is used as the clustering distance. The K-means clustering algorithm is used to cluster all connected regions to obtain several clusters.
[0016] Calculate the normalized value of the mean polishing effect value of all connected regions in each cluster, and record it as the polishing effect value of each cluster.
[0017] The complexity of the polishing effect in the stainless steel surface image at each moment is determined based on the number of clusters, the distance between connected regions within clusters, and the difference in polishing effect values.
[0018] Based on the difference in polishing effect values between adjacent connected regions, determine the local brightness and darkness contrast of each connected region;
[0019] Obtain the normalized sum of the local brightness contrast salience of all connected regions, and multiply the normalized sum of the local brightness contrast salience with the complexity of the polishing effect in the stainless steel surface image at each time moment. This product is recorded as the brightness boundary effect factor caused by different polishing effect areas in the stainless steel surface image at each time moment.
[0020] Furthermore, the specific steps for determining the complexity of the polishing effect in the stainless steel surface image at each moment based on the number of clusters, the distance between connected regions within clusters, and the difference in polishing effect values are as follows:
[0021] The mean of the shortest distance between any two connected regions in each cluster is obtained and denoted as the centrality of each cluster. The normalized sum of the centralities of all clusters is obtained and denoted as the first sum. The mean of the absolute values of the differences between the polishing effect values of any two clusters is obtained and denoted as the first mean. The product of the first sum, the first mean, and the number of clusters is denoted as the complexity of the polishing effect in the stainless steel surface image at each time step.
[0022] Furthermore, the specific steps for determining the local brightness contrast of each connected region based on the difference in polishing effect values between adjacent connected regions are as follows:
[0023] All connected regions adjacent to any given connected region are denoted as reference connected regions;
[0024] On the boundary of any connected region, obtain the number of pixels adjacent to any reference connected region, and record it as the adhesion length of the reference connected region.
[0025] Obtain the ratio of the adhesion length of each reference connected region to the boundary length of any connected region. Then, obtain the product of the absolute value of the difference between the polishing effect value of any connected region and each reference connected region and the ratio, and record it as the first product of each reference connected region. The sum of the first products of all reference connected regions is used as the local brightness contrast of any connected region.
[0026] Furthermore, the specific steps for determining the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at each moment are as follows:
[0027] Obtain all connected regions in each cluster, forming the polished region;
[0028] Each polishing area is divided into several small connected regions;
[0029] The small connected regions are divided into concave regions and convex regions, and the relative concave depth of the concave regions and the relative convex height of the convex regions are determined.
[0030] The ability of each small connected region to change the path of light reflection is determined based on the relative depth of the concave region and the relative height of the convex region.
[0031] The complexity of light reflection caused by irregular bumps and depressions in each polishing area is determined based on the ability of all small connected regions in each polishing area to change the light reflection path.
[0032] In the stainless steel surface image at each moment, obtain the sum of the light reflection complexity caused by irregularities and unevenness in all polished areas. The normalized value, the sum value The product of the normalized value and the bright-dark boundary effect factor caused by different polishing effect areas in the stainless steel surface image at each time moment is denoted as the influence factor of polishing effect on uneven illumination in the stainless steel surface image at each time moment.
[0033] Furthermore, the specific steps for dividing the small connected regions into concave regions and convex regions, and determining the relative concave depth of the concave regions and the relative convex height of the convex regions, are as follows:
[0034] For any small connected region, obtain the average gray value of all pixels on the boundary of the small connected region, and record it as the first average. Then obtain the average gray value of all pixels within the small connected region, and record it as the second average. When the first average is greater than the second average, the small connected region is recorded as a concave region, and the difference between the first average and the second average is recorded as the relative concave depth. When the first average is less than or equal to the second average, the small connected region is recorded as a convex region, and the difference between the second average and the first average is recorded as the relative convex height.
[0035] Furthermore, the specific steps for determining the ability of each small connected region to change the light reflection path based on the relative depth of the recessed region and the relative height of the raised region are as follows:
[0036] For any concave region, obtain the maximum value among the relative protrusion heights of all adjacent protrusion regions, and then obtain the sum of the maximum value among the relative protrusion heights and the relative concavity depth of the concave region. The normalized value, the sum value The product of the normalized value and the relative depth of the depression region is denoted as the ability value of any depression region to change the light reflection path.
[0037] For any raised region, obtain the maximum value among the relative depression depths of all adjacent depressed regions, and then obtain the sum of the maximum value among the relative depression depths and the relative protrusion height of the raised region. The normalized value, the sum value The product of the normalized value and the relative protrusion height of the protrusion region is denoted as the ability value of any protrusion region to change the light reflection path.
[0038] Furthermore, the specific steps for determining the complexity of light reflection caused by irregular unevenness in each polishing area based on the ability of all small connected regions within each polishing area to change the light reflection path are as follows:
[0039] Within any given polishing area, obtain the variance of the relative protrusion heights of all raised areas, denoted as the first variance; obtain the variance of the relative depression depths of all recessed areas, denoted as the second variance; and calculate the mean of the first and second variances. The normalized value is then obtained, followed by the sum of the values of the ability of all small connected regions to change the light reflection path, and the mean value is then calculated. The product of the normalized value and the sum of the capability values is denoted as the light reflection complexity caused by the irregular unevenness in any one of the polishing areas.
[0040] Furthermore, the specific steps for determining the gamma value required for the stainless steel surface image at each moment are as follows:
[0041] The Harris corner detection algorithm is used to obtain several feature corners in the stainless steel surface image at each time step.
[0042] Using the reverse optical flow method, the matching point of each feature corner point in the stainless steel surface image at each time moment is obtained in the stainless steel surface image at the previous time moment. Then, the Euclidean distance between the position coordinates of each feature corner point and the matching point is obtained as the vibration velocity of each feature corner point.
[0043] Obtain the normalized value of the mean vibration velocity of all feature corner points in the stainless steel surface image at each moment. Multiply the normalized value of the mean vibration velocity by the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at each moment, and record it as the degree of uneven illumination caused by polishing in the stainless steel surface image at each moment.
[0044] The product of the normalized value of the uneven illumination caused by grinding in the stainless steel surface image at each moment and the preset gamma threshold is obtained. The sum of the product of the normalized value of the uneven illumination and the preset gamma threshold and the preset constant is used as the gamma value required for the stainless steel surface image at each moment.
[0045] The beneficial effects of the technical solution of the present invention are:
[0046] In this embodiment of the invention, images of the stainless steel surface at each moment during the sanding process are acquired. The bright-dark boundary effect factor caused by different sanding effect areas in the stainless steel surface image at each moment is determined. Then, the influence factor of the sanding effect on the uneven illumination in the stainless steel surface image at each moment is determined. By analyzing the bright-dark boundary effect between different sanding effect areas on the stainless steel surface, as well as the complexity of light reflection caused by irregular concavity and convexity in the same sanding effect area, and combining the high-frequency vibration characteristics of the stainless steel surface caused by sanding, the degree of uneven illumination caused by sanding is determined. This is used to ensure the effect of removing the influence of uneven illumination from the stainless steel surface image, thereby obtaining an accurate and reliable stainless steel surface enhancement image and ensuring the effect of sanding process control. The invention acquires the required gamma value for each moment's stainless steel surface image, performs gamma correction on the image, and obtains an enhanced stainless steel surface image. The surface roughness of this enhanced image is then obtained, and a mapping relationship between surface roughness and abrasion parameters is established. This mapping relationship is used to dynamically adjust the abrasion parameters. By using an adaptive gamma value, gamma correction is performed on the stainless steel surface image with uneven illumination, resulting in an enhanced image. This ensures the accuracy of surface roughness acquisition, thereby guaranteeing the accuracy of the subsequent mapping relationship between surface roughness and abrasion parameters, and improving the dynamic adjustment effect of abrasion parameters. In conclusion, this invention improves the control effect of the abrasion process by analyzing the uneven illumination caused by grinding in the stainless steel surface image, using adaptive gamma values for gamma correction, and obtaining an enhanced stainless steel surface image. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 This is a flowchart illustrating the steps of a machine vision-based method for controlling the surface sanding process of stainless steel according to the present invention.
[0049] Figure 2 This is a schematic diagram of a stainless steel surface. Detailed Implementation
[0050] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a machine vision-based method for controlling the surface sanding process of stainless steel according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0052] The following description, in conjunction with the accompanying drawings, details a specific scheme for controlling the surface sanding process of stainless steel based on machine vision, provided by the present invention.
[0053] Please see Figure 1 The diagram illustrates a flowchart of a machine vision-based method for controlling the surface sanding process of stainless steel, according to an embodiment of the present invention. The method includes the following steps:
[0054] Step S001: Obtain images of the stainless steel surface at each moment during the sanding process.
[0055] It should be noted that in this embodiment, the stainless steel material is first fixed on the worktable to ensure it does not move during the grinding process, and the grinding wheel is kept parallel to the stainless steel surface and moved uniformly in the same direction to avoid uneven marks caused by cross-grinding. Then, a suitable camera, such as a high-speed camera or a high-resolution camera, is selected according to the detection requirements. A suitable lens is selected to ensure coverage of the entire detection area and provide sufficient magnification. A suitable light source, such as an LED light source or a laser light source, is selected to provide uniform and stable illumination. The camera, lens, and light source are then installed in appropriate positions to ensure that the required information can be captured. During the grinding process, the grinding wheel may obscure part of the surface, resulting in incomplete image acquisition. This can be solved by adjusting the camera position or using a multi-angle camera. Furthermore, this embodiment of the invention uses a segmentation neural network to identify the background area and the stainless steel surface area in the strong image captured by the segmentation camera. The relevant content of the segmentation neural network is as follows: the segmentation neural network used in this embodiment is a Mask R-CNN neural network; the dataset used is an augmented image dataset. Mask R-CNN is a well-known technology, and its specific method will not be described here. Mask R-CNN stands for "Mask Region-based Convolutional Neural Network". The pixels to be segmented are divided into two categories, labeled in the training set as follows: single-channel semantic labels, with pixels belonging to the background region labeled as 0 and those belonging to the stainless steel surface region labeled as 1. The network's task is classification, so the cross-entropy loss function is used. This yields a stainless steel surface image, captured once per second. The image undergoes grayscale conversion, a well-known technique. A schematic diagram of the stainless steel surface image is shown below. Figure 2 As shown.
[0056] Step S002: Based on the difference in pixel grayscale values, divide the stainless steel surface image at each moment into several connected regions and determine the polishing effect value of each connected region; based on the difference in polishing effect values between different connected regions, determine the bright and dark boundary effect factor caused by different polishing effect areas in the stainless steel surface image at each moment.
[0057] It should be noted that as the grinding wheel moves across the stainless steel surface, the degree of abrasion varies across different areas. Some areas may be finer, while others may be coarser. This uneven abrasion results in varying light reflection capabilities, thus affecting the uniformity of illumination in the image. Therefore, this embodiment first divides the stainless steel surface image into areas with different grinding effects. Based on the analysis of these areas, the overall illumination non-uniformity of the stainless steel surface caused by the different grinding effects is determined.
[0058] Preferably, in one embodiment of the present invention, the method for obtaining the bright-dark boundary effect factor caused by different polishing effect areas in the stainless steel surface image at each moment includes:
[0059] Preset window side length Let's take 5 as an example.
[0060] In the stainless steel surface image at time x, obtain an image centered at each pixel with a size of [value missing]. The window is defined. The variance of the grayscale values of all pixels within the window for each pixel is calculated and denoted as the smoothing unevenness of each pixel. Based on the smoothing unevenness of each pixel, a region growing algorithm is used to obtain several connected regions. The mean of the smoothing unevenness of all pixels within each connected region is denoted as the smoothing effect value for each connected region.
[0061] It should be noted that the region growing algorithm is a well-known technique, and the specific method will not be described here. The unevenness of the polishing of pixels within each connected region is similar. However, if the window contains locally smooth areas, the variance of the grayscale values of all pixels within the window is relatively small. In this embodiment, the lighting environment is relatively stable. On the stainless steel surface, areas with coarser polishing have higher surface roughness, and when light shines on these areas, diffuse reflection occurs, meaning the light scatters in all directions, making these areas appear darker. Conversely, areas with finer polishing have lower surface roughness, and when light shines on these areas, specular reflection occurs, meaning the light is reflected according to the law that the angle of incidence equals the angle of reflection, making these areas appear brighter. Therefore, the greater the difference between areas with different polishing effects, the more pronounced the contrast between light and dark, and the more dispersed the distribution of different connected regions with similar polishing effects, the greater the impact on the uniformity of lighting on the entire stainless steel surface.
[0062] In the stainless steel surface image at time x, the absolute difference between the polishing effect values of any two connected regions is used as the clustering distance. The K-means clustering algorithm is then applied to cluster all connected regions, resulting in several clusters. The mean of the polishing effect values for all connected regions within each cluster is calculated. The normalized value is denoted as the polishing effect value for each cluster.
[0063] It should be noted that the K-means clustering algorithm is a well-known technique, and its specific method will not be described here. The smoothing effect of connected regions within each cluster is similar. In this embodiment, using... As the mean The normalized value, This is a linear normalization function used to normalize data values to a range between 0 and 1.
[0064] In the stainless steel surface image at time x, obtain the mean of the shortest distances between any two connected regions in the j-th cluster, denoted as the centrality of the j-th cluster, and obtain the sum of the centralities of all clusters. The normalized value is denoted as the first sum. Then, the mean of the absolute values of the differences between the polishing effect values of any two clusters is obtained and denoted as the first mean. The product of the first sum, the first mean, and the number of clusters is denoted as the complexity of the polishing effect in the stainless steel surface image at time x.
[0065] It should be noted that in this embodiment, the following is used: As a sum The more clusters there are, the more diverse the types of polishing effect regions, resulting in greater uneven lighting. The greater the difference in polishing effect values between different clusters, the greater the difference in polishing effect between different polishing effect regions, i.e., the greater the difference in brightness. The greater the distance between different connected regions within the same cluster, the more dispersed the different connected regions with similar polishing effects are on the stainless steel surface, leading to a more chaotic distribution of brightness across the entire stainless steel surface. Therefore, the product of the first sum, the first mean, and the number of clusters is used to represent the complexity of the polishing effect.
[0066] It should be further noted that: the above analysis analyzed the differences between different polishing effect areas in the stainless steel surface image. Further analysis is needed to analyze the differences in polishing effect values between adjacent connected regions in the stainless steel surface image. The greater the difference, the more obvious the brightness and darkness changes will appear at the boundary of adjacent regions, thus making the distribution of light in different connected regions more uneven.
[0067] In the stainless steel surface image at time x, all connected regions adjacent to the y-th connected region are identified and denoted as reference connected regions. On the boundary of the y-th connected region, the number of pixels adjacent to any reference connected region is identified and denoted as the adhesion length of that reference connected region. The ratio of the adhesion length of the i-th reference connected region to the boundary length of the y-th connected region is calculated. Then, the absolute value of the difference between the polishing effect values of the y-th connected region and the i-th reference connected region is calculated. The product of this ratio and the absolute value of the difference in polishing effect values is denoted as the first product of the i-th reference connected region. The sum of the first products of all reference connected regions is used as the local brightness contrast of the y-th connected region.
[0068] It should be noted that: the larger the ratio, the longer the boundary between the y-th connected region and the i-th reference connected region; and the larger the absolute value of the difference in the polishing effect value, the greater the difference in brightness between the y-th connected region and the i-th reference connected region. Therefore, this ratio is used as the weight of the absolute value of the difference in the polishing effect value to determine the local brightness contrast.
[0069] In the stainless steel surface image at time x, obtain the sum of the local brightness contrast of all connected regions. The normalized value, the sum value The product of the normalized value and the complexity of the polishing effect in the stainless steel surface image at time x is denoted as the bright and dark boundary effect factor caused by different polishing effect areas in the stainless steel surface image at time x.
[0070] It should be noted that in this embodiment, the following is used: As a sum The more complex the polishing effect in the stainless steel surface image, and the greater the local brightness and darkness contrast of each connected region, the stronger the brightness and darkness boundary effect caused by different polishing effect areas in the stainless steel surface image.
[0071] Step S003: Based on the difference in grayscale values of pixels within connected regions with similar polishing effect values, and combined with the bright and dark boundary effect factor caused by different polishing effect regions in the stainless steel surface image at each moment, determine the influence factor of polishing effect on uneven illumination in the stainless steel surface image at each moment.
[0072] It should be noted that the above analysis addressed the light-dark boundary effect caused by different polishing effects in stainless steel surface images, specifically the difference between diffuse reflection in rough polished areas and specular reflection in smooth polished areas, resulting in uneven light distribution across different regions. However, it did not consider the uneven lighting caused by diffuse reflection within rough polished areas or specular reflection within smooth polished areas. Further analysis is needed to address the uneven lighting effect caused by irregular micro-undulations within either rough or smooth polished areas.
[0073] Preferably, in one embodiment of the present invention, the method for obtaining the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at each moment includes:
[0074] In the stainless steel surface image at time x, obtain all connected regions in each cluster, forming the polishing region. Within the z-th polishing region, use the watershed algorithm based on the grayscale values of the pixels to obtain several smaller connected regions.
[0075] It should be noted that the watershed algorithm is an image segmentation method based on topological theory. By simulating the formation process of watersheds in geography, it treats the grayscale values in an image as terrain height to achieve region segmentation. In other words, it maps image grayscale values to terrain height, with high grayscale areas representing peaks and low grayscale areas representing valleys. Local minima are called catchment basins, and their boundaries are the watersheds. Therefore, each small connected region can be represented as a convex peak region or a concave valley region. This is a well-known technique, and the specific method will not be described here. The greater the degree of polishing, the coarser the polished region.
[0076] For any small connected region, obtain the average grayscale value of all pixels on the boundary of the small connected region, denoted as the first average. Then, obtain the average grayscale value of all pixels within the small connected region, denoted as the second average. When the first average is greater than the second average, the small connected region is designated as a concave region, and the difference between the first and second averages is designated as the relative concave depth. When the first average is less than or equal to the second average, the small connected region is designated as a convex region, and the difference between the second and first averages is designated as the relative convex height.
[0077] For any concave region, obtain the maximum value among the relative convex heights of all adjacent convex regions, and then obtain the sum of this maximum relative convex height and the relative concave depth of the concave region. The normalized value, the sum value The product of the normalized value and the relative depth of the depression region is denoted as the ability of any depression region to change the path of light reflection.
[0078] For any raised region, obtain the maximum value among the relative depression depths of all adjacent depressed regions, and then obtain the sum of this maximum value and the relative raised height of the raised region. The normalized value, the sum value The product of the normalized value and the relative height of the convex region is denoted as the ability of any convex region to change the path of light reflection.
[0079] It should be noted that in this embodiment, the following is used: As a sum The normalized value, in As a sum The normalized value of the convexity / concave region is determined by the fact that deeper convex / concave areas more significantly alter the light reflection path. Therefore, the greater the relative depth of a concave region and the greater the height difference between it and an adjacent convex region, or the greater the relative height of a convex region and the greater the height difference between it and an adjacent concave region, the stronger its ability to alter the light reflection path. Furthermore, since a watershed is a boundary formed when different water flows meet, the two sides of the boundary must be of different heights, meaning that concave and convex regions must be adjacent.
[0080] It should be further noted that if the unevenness of the stainless steel surface exhibits a certain regularity, such as periodic ripples or textures, then the reflection of light in these areas will be relatively uniform because each uneven unit reflects light in a similar manner. Conversely, if the unevenness of the stainless steel surface does not have an obvious regularity, that is, the size, shape, depth, and spacing of the unevenness vary, then the reflection of light in these areas will be very complex, resulting in different directions and intensities of reflected light.
[0081] Within the z-th polishing area, obtain the variance of the relative protrusion height of all raised areas, denoted as the first variance; obtain the variance of the relative depression depth of all depressed areas, denoted as the second variance; and calculate the mean of the first and second variances. The normalized value is then used to obtain the sum of the values of the ability of all small connected regions to change the light reflection path, and the mean value is then calculated. The product of the normalized value and the sum of the capability values is denoted as the complexity of light reflection caused by irregular unevenness in the z-th polishing region.
[0082] It should be noted that in this embodiment, the following is used: As the mean The smaller the normalized value and variance, the more similar the light reflection behavior of all raised or recessed regions. Conversely, the larger the variance, the more irregular the raised / recessed features, resulting in more complex light reflection. The larger the sum of the abilities of all small connected regions to change the light reflection path, the stronger the ability of the raised / recessed features in the z-th polished region to change the light reflection path. Therefore, this mean value is used... The normalized value is used as the adjustment value of the sum of the capability values to obtain the complexity of light reflection caused by irregular concavity and convexity. When the raised or recessed area within the polishing area is unique, this embodiment divides more areas by adjusting the set threshold in the watershed algorithm, so that the raised or recessed area within the polishing area is not unique.
[0083] In the stainless steel surface image at time x, obtain the sum of the light reflection complexity caused by irregularities and unevenness in all polished areas. The normalized value, the sum value The product of the normalized value and the bright-dark boundary effect factor caused by different polishing effect areas in the stainless steel surface image at time x is denoted as the influence factor of polishing effect on uneven illumination in the stainless steel surface image at time x.
[0084] It should be noted that in this embodiment, the following is used: As a sum The normalized value of the polishing effect is that in the stainless steel surface image, the stronger the light-dark boundary effect caused by different polishing effects, and the more complex the light reflection caused by the irregular concavity and convexity in each polishing area, the greater the impact of the polishing effect on the uneven lighting.
[0085] Step S004: Determine the required gamma value for the stainless steel surface image at each moment based on the magnitude of the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at each moment; use the gamma value to perform gamma correction on the stainless steel surface image at each moment to obtain the stainless steel surface enhancement image.
[0086] It should be noted that the high-speed rotation of the grinding wheel will generate mechanical vibration, resulting in high-frequency vibration marks on the stainless steel surface. This will exacerbate the uneven lighting in the stainless steel surface image. Therefore, in the analysis of the impact of grinding effect on uneven lighting, it is necessary to further analyze the influence of high-frequency vibration marks on the stainless steel surface to determine the degree of uneven lighting in the stainless steel surface image.
[0087] Preferably, in one embodiment of the present invention, the method for obtaining a stainless steel surface enhancement image includes:
[0088] The Harris corner detection algorithm is used to obtain several feature corners in the stainless steel surface image at time x.
[0089] Using the reverse optical flow method, the matching point of each feature corner point in the stainless steel surface image at time x is obtained in the stainless steel surface image at time x-1. Then, the Euclidean distance between the position coordinates of each feature corner point and its matching point is obtained as the vibration velocity of each feature corner point.
[0090] It should be noted that both the Harris Corner Detection Algorithm and the reverse optical flow method are well-known techniques, and their specific methods will not be described here. If no matching point is found, the feature corner will not be analyzed subsequently, and the stainless steel surface image at the first moment will not be analyzed. In this embodiment, a Cartesian coordinate system is constructed with the lower left corner of the stainless steel surface image at each moment as the origin, the horizontal axis pointing to the right as a square, and the vertical axis pointing upwards as the positive direction. The position coordinates of each pixel in the stainless steel surface image at each moment are obtained on the Cartesian coordinate system.
[0091] Obtain the mean vibration velocity of all feature corner points in the stainless steel surface image at time x. The normalized value, the mean The product of the normalized value of the image and the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at time x is denoted as the degree of uneven illumination caused by polishing in the stainless steel surface image at time x.
[0092] It should be noted that in this embodiment, the following is used: As the mean The normalized value of , where the faster the vibration, the greater the aggravation effect on uneven illumination.
[0093] The preset constant is 1, and the preset gamma threshold is 0.4. This will be used as an example for the description.
[0094] Obtain the degree of uneven lighting caused by grinding in the stainless steel surface image at time x. The product of the normalized value and the preset gamma threshold is used as the sum of the product and the preset constant as the gamma value required for the stainless steel surface image at time x.
[0095] Using the required gamma value from the stainless steel surface image at time x, gamma correction is performed on the stainless steel surface image at time x to obtain an enhanced stainless steel surface image.
[0096] It should be noted that in this embodiment, the following is used: As The normalized value of the image is used. Gamma correction is a well-known technique, and the specific method will not be described here. In this embodiment, gamma correction is performed on the image with uneven illumination. By adaptively selecting a gamma value greater than 1, the brightness of dark areas is enhanced, and the clarity of dark areas is improved, while the brightness of bright areas is reduced, thus reducing the impact of high reflectivity. That is, the greater the degree of uneven illumination caused by polishing, the more and more obvious high-reflectivity areas and dark areas exist in the stainless steel surface image, and therefore a larger gamma value is required for correction.
[0097] Step S005: Obtain the surface roughness of the stainless steel surface enhancement image and construct the mapping relationship between surface roughness and abrasion parameters to dynamically adjust the abrasion parameters.
[0098] The surface roughness of the stainless steel surface enhancement image at each time step was extracted using a gray-level co-occurrence matrix. A random forest model was used to train the surface roughness of the stainless steel surface enhancement image at all time steps, establishing a mapping relationship between surface roughness and abrasion parameters. Based on this mapping relationship, the surface roughness of the real-time stainless steel surface enhancement image was input into a fuzzy controller to dynamically adjust abrasion parameters (such as grinding wheel speed, feed rate, and grinding wheel pressure) to optimize the stainless steel surface quality.
[0099] It should be noted that the gray-level co-occurrence matrix, random forest model, and fuzzy controller are all well-known technologies, and their specific methods will not be described here. In this embodiment, gamma correction is performed on the image of the stainless steel surface with uneven illumination to obtain an enhanced image, thereby ensuring the accuracy of the surface roughness acquisition. This, in turn, ensures the accuracy of the subsequent mapping relationship between surface roughness and abrasion parameters, and improves the effect of dynamic adjustment of abrasion parameters.
[0100] This invention is now complete.
[0101] In summary, in this embodiment of the invention, images of the stainless steel surface at each moment during the sanding process are acquired. The bright-dark boundary effect factor caused by different sanding effect areas in the stainless steel surface image at each moment is determined. Then, the influence factor of the sanding effect on the uneven illumination in the stainless steel surface image at each moment is determined. This allows for the acquisition of the required gamma value for the stainless steel surface image at each moment, which is then used to perform gamma correction on the stainless steel surface image at each moment, resulting in an enhanced stainless steel surface image. The surface roughness of the enhanced stainless steel surface image is obtained, and a mapping relationship between surface roughness and sanding parameters is constructed to dynamically adjust the sanding parameters. This invention improves the effectiveness of sanding process control by analyzing the degree of uneven illumination caused by sanding in the stainless steel surface image, adaptively adjusting the gamma value, performing gamma correction, and acquiring an enhanced stainless steel surface image.
[0102] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for controlling the surface sanding process of stainless steel based on machine vision, characterized in that, The method includes the following steps: Acquire images of the stainless steel surface at every moment during the sanding process; Based on the differences in pixel grayscale values, the stainless steel surface image at each moment is divided into several connected regions, and the polishing effect value of each connected region is determined; based on the differences in polishing effect values between different connected regions, the bright and dark boundary effect factor caused by different polishing effect areas in the stainless steel surface image at each moment is determined. Based on the difference in grayscale values of pixels within connected regions with similar polishing effect values, and combined with the bright and dark boundary effect factor caused by different polishing effect regions in the stainless steel surface image at each moment, the influence factor of polishing effect on uneven illumination in the stainless steel surface image at each moment is determined. Based on the magnitude of the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at each moment, the required gamma value for the stainless steel surface image at each moment is determined, including: using the Harris corner detection algorithm to obtain several feature corners in the stainless steel surface image at each moment; using the reverse optical flow method to obtain the matching point of each feature corner in the stainless steel surface image at each moment in the stainless steel surface image at the previous moment, and then obtaining the Euclidean distance between the position coordinates of each feature corner and the matching point as the vibration velocity of each feature corner; obtaining the stainless steel surface image at each moment... The normalized value of the mean vibration velocity of all feature corner points in the steel surface image is used as the product of the normalized value of the mean vibration velocity and the influence factor of the grinding effect on the uneven illumination in the stainless steel surface image at each time moment. This product is recorded as the degree of uneven illumination caused by grinding in the stainless steel surface image at each time moment. The normalized value of the degree of uneven illumination caused by grinding in the stainless steel surface image at each time moment is obtained and multiplied by a preset gamma threshold. The sum of the normalized value of the degree of uneven illumination caused by grinding and the preset gamma threshold and a preset constant is used as the gamma value required for the stainless steel surface image at each time moment. Using the gamma value, gamma correction is performed on the stainless steel surface image at each moment to obtain an enhanced stainless steel surface image. The surface roughness of the stainless steel surface enhancement image is obtained, and a mapping relationship between the surface roughness and the matting parameters is constructed to dynamically adjust the matting parameters.
2. The method for controlling the surface sanding process of stainless steel based on machine vision according to claim 1, characterized in that, The specific steps involved in dividing the stainless steel surface image at each moment into several connected regions and determining the polishing effect value for each connected region are as follows: Preset window side length In the stainless steel surface image at each time step, obtain an image centered on each pixel with a size of [missing information]. For each pixel, the variance of the grayscale values of all pixels within the window is calculated and recorded as the polishing unevenness of each pixel. Based on the polishing unevenness of each pixel, a region growing algorithm is used to obtain several connected regions. The mean of the polishing unevenness of all pixels in each connected region is recorded as the polishing effect value of each connected region.
3. The method for controlling the surface sanding process of stainless steel based on machine vision according to claim 1, characterized in that, The specific steps for determining the bright-dark boundary effect factor caused by different polishing effect areas in the stainless steel surface image at each moment are as follows: In the stainless steel surface image at each time step, the absolute value of the difference between the polishing effect values of any two connected regions is used as the clustering distance. The K-means clustering algorithm is used to cluster all connected regions to obtain several clusters. Calculate the normalized value of the mean polishing effect value of all connected regions in each cluster, and record it as the polishing effect value of each cluster. The complexity of the polishing effect in the stainless steel surface image at each moment is determined based on the number of clusters, the distance between connected regions within clusters, and the difference in polishing effect values. Based on the difference in polishing effect values between adjacent connected regions, determine the local brightness and darkness contrast of each connected region; Obtain the normalized sum of the local brightness contrast salience of all connected regions, and multiply the normalized sum of the local brightness contrast salience with the complexity of the polishing effect in the stainless steel surface image at each time moment. This product is recorded as the brightness boundary effect factor caused by different polishing effect areas in the stainless steel surface image at each time moment.
4. The method for controlling the surface sanding process of stainless steel based on machine vision according to claim 3, characterized in that, The process of determining the complexity of the polishing effect in the stainless steel surface image at each moment based on the number of clusters, the distance between connected regions within clusters, and the difference in polishing effect values includes the following specific steps: The mean of the shortest distance between any two connected regions in each cluster is obtained and denoted as the centrality of each cluster. The normalized sum of the centralities of all clusters is obtained and denoted as the first sum. The mean of the absolute values of the differences between the polishing effect values of any two clusters is obtained and denoted as the first mean. The product of the first sum, the first mean, and the number of clusters is denoted as the complexity of the polishing effect in the stainless steel surface image at each time step.
5. The method for controlling the surface sanding process of stainless steel based on machine vision according to claim 3, characterized in that, The specific steps for determining the local light-dark contrast of each connected region based on the difference in polishing effect values between adjacent connected regions are as follows: All connected regions adjacent to any given connected region are denoted as reference connected regions; On the boundary of any connected region, obtain the number of pixels adjacent to any reference connected region, and record it as the adhesion length of the reference connected region. Obtain the ratio of the adhesion length of each reference connected region to the boundary length of any connected region. Then, obtain the product of the absolute value of the difference between the polishing effect value of any connected region and each reference connected region and the ratio, and record it as the first product of each reference connected region. The sum of the first products of all reference connected regions is used as the local brightness contrast of any connected region.
6. The method for controlling the surface sanding process of stainless steel based on machine vision according to claim 3, characterized in that, The specific steps for determining the influence factor of polishing effect on uneven illumination in the stainless steel surface image at each moment are as follows: Obtain all connected regions in each cluster, forming the polished region; Each polishing area is divided into several small connected regions; The small connected regions are divided into concave regions and convex regions, and the relative concave depth of the concave regions and the relative convex height of the convex regions are determined. The ability of each small connected region to change the path of light reflection is determined based on the relative depth of the concave region and the relative height of the convex region. The complexity of light reflection caused by irregular bumps and depressions in each polishing area is determined based on the ability of all small connected regions in each polishing area to change the light reflection path. In the stainless steel surface image at each moment, obtain the sum of the light reflection complexity caused by irregularities and unevenness in all polished areas. The normalized value, the sum value The product of the normalized value and the bright-dark boundary effect factor caused by different polishing effect areas in the stainless steel surface image at each time moment is denoted as the influence factor of polishing effect on uneven illumination in the stainless steel surface image at each time moment.
7. The method for controlling the surface sanding process of stainless steel based on machine vision according to claim 6, characterized in that, The specific steps involved in dividing the small connected regions into concave and convex regions, and determining the relative concave depth of the concave regions and the relative convex height of the convex regions, are as follows: For any small connected region, obtain the average gray value of all pixels on the boundary of the small connected region, and record it as the first average. Then obtain the average gray value of all pixels within the small connected region, and record it as the second average. When the first average is greater than the second average, the small connected region is recorded as a concave region, and the difference between the first average and the second average is recorded as the relative concave depth. When the first average is less than or equal to the second average, the small connected region is recorded as a convex region, and the difference between the second average and the first average is recorded as the relative convex height.
8. The method for controlling the surface sanding process of stainless steel based on machine vision according to claim 6, characterized in that, The specific steps for determining the ability of each small connected region to change the light reflection path based on the relative depth of the concave region and the relative height of the convex region are as follows: For any concave region, obtain the maximum value among the relative protrusion heights of all adjacent protrusion regions, and then obtain the sum of the maximum value among the relative protrusion heights and the relative concavity depth of the concave region. The normalized value, the sum value The product of the normalized value and the relative depth of the depression region is denoted as the ability value of any depression region to change the light reflection path. For any raised region, obtain the maximum value among the relative depression depths of all adjacent depressed regions, and then obtain the sum of the maximum value among the relative depression depths and the relative protrusion height of the raised region. The normalized value, the sum value The product of the normalized value and the relative protrusion height of the protrusion region is denoted as the ability value of any protrusion region to change the light reflection path.
9. The method for controlling the surface sanding process of stainless steel based on machine vision according to claim 6, characterized in that, The process of determining the complexity of light reflection caused by irregular unevenness in each polishing area, based on the ability of all small connected regions within each polishing area to change the light reflection path, includes the following specific steps: Within any given polishing area, obtain the variance of the relative protrusion heights of all raised areas, denoted as the first variance; obtain the variance of the relative depression depths of all recessed areas, denoted as the second variance; and calculate the mean of the first and second variances. The normalized value is then obtained, followed by the sum of the values of the ability of all small connected regions to change the light reflection path, and the mean value is then calculated. The product of the normalized value and the sum of the capability values is denoted as the light reflection complexity caused by the irregular unevenness in any one of the polishing areas.
Citation Information
Patent Citations
Visual detection method for grinding quality of constant-force floating grinding head
CN116630312A
Printed circuit board quality intelligent detection method based on vision assistance
CN117115153A