Stainless steel surface frosted process regulation and control method based on machine vision
The machine vision system is used to analyze the uneven lighting and vibration effects on the stainless steel surface during the frosting process, and the frosting parameters are dynamically adjusted using gamma correction and mapping relationships. This solves the problem of poor image quality caused by uneven lighting and vibration during the frosting process, and improves the control effect of the frosting process and the accuracy of surface roughness acquisition.
Patent Information
- Application Number
- CN202510895492.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-06-30
AI Technical Summary
The uneven illumination and mechanical vibration on the stainless steel surface during the frosting process lead to poor image quality, affecting the accuracy of surface roughness acquisition and reducing the effect of frosting process control.
The machine vision system is used to obtain images of the stainless steel surface at every moment during the frosting process, divide the connected areas, analyze the light-dark boundary effect and the influencing factors of uneven lighting, and dynamically adjust the frosting parameters using gamma correction and mapping relationships.
The effect of frosting process control is improved, the illumination uniformity of stainless steel surface images and the accuracy of surface roughness acquisition are guaranteed, and the dynamic adjustment of frosting parameters is optimized.
Smart Images

Figure CN120823162A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing, and in particular to a method for controlling a stainless steel surface frosting process based on machine vision. Background Art
[0002] A machine vision-based stainless steel surface grinding process control method aims to achieve real-time monitoring and optimization of stainless steel surface roughness through image processing and intelligent algorithms, thereby improving processing accuracy and production efficiency. This method uses a machine vision system to capture images of the stainless steel surface, extracts surface roughness features through image processing, and combines intelligent algorithms (such as neural networks and random forests) for classification and judgment, thereby dynamically adjusting grinding parameters to ensure that surface quality meets requirements.
[0003] Existing problems: However, during the frosting process, irregular tiny bumps will form on the surface of stainless steel. These uneven surfaces will reflect light at different angles, resulting in uneven lighting. The degree of frosting in different areas may not be completely consistent. Some areas may be ground finer, while others may be ground coarser. This uneven degree of frosting will also lead to different abilities of the surface to reflect light, thus affecting the uniformity of the image lighting. In addition, when the sander is working, the high-speed rotation of its motor and grinding wheel will generate mechanical vibrations. These vibrations may be transmitted to the stainless steel being processed, especially at the moment when the grinding wheel contacts the stainless steel surface, resulting in high-frequency vibration marks on the processed surface. This will further aggravate the uneven lighting in the collected stainless steel surface image, resulting in poor image quality, affecting the accuracy of surface roughness acquisition, and thus reducing the effect of regulating the stainless steel surface frosting process. Summary of the Invention
[0004] The present invention provides a method for controlling a stainless steel surface frosting process based on machine vision to solve existing problems.
[0005] The present invention provides a method for controlling a stainless steel surface frosting process based on machine vision, which adopts the following technical solutions:
[0006] An embodiment of the present invention provides a method for controlling a stainless steel surface frosting process based on machine vision, the method comprising the following steps:
[0007] Acquire images of the stainless steel surface at every moment of the grinding 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 the polishing effect values of different connected regions, the bright and dark boundary effect factors caused by different polishing effect regions in the stainless steel surface image at each moment are determined;
[0009] Based on the grayscale value differences of pixels in connected areas with similar polishing effect values, combined with the bright and dark boundary effect factors caused by different polishing effect areas in the stainless steel surface image at each moment, the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at each moment is determined;
[0010] Determining a gamma value required 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; performing gamma correction on the stainless steel surface image at each moment using the gamma value to obtain an enhanced image of the stainless steel surface;
[0011] The surface roughness of the stainless steel surface enhancement image is obtained, and a mapping relationship between the surface roughness and the frosting parameters is constructed to dynamically adjust the frosting parameters.
[0012] Furthermore, the step of dividing the stainless steel surface image at each moment into a plurality of connected regions and determining the polishing effect value of each connected region includes the following specific steps:
[0013] Preset window side length , in the stainless steel surface image at each moment, obtain the image with each pixel as the center and the size of , calculate the variance of the grayscale values of all pixels in the window of each pixel, record it as the polishing roughness of each pixel, and use the region growing algorithm according to the polishing roughness of each pixel to obtain several connected regions. The mean value of the polishing roughness of all pixels in each connected region is recorded as the polishing effect value of each connected region.
[0014] Furthermore, the specific steps of determining the bright and dark boundary effect factors caused by different polishing effect areas in the stainless steel surface image at each moment include the following:
[0015] In the stainless steel surface image at each moment, the absolute value of the difference between the polishing effect values of any two connected areas is used as the clustering distance. The K-means clustering algorithm is used to cluster all connected areas to obtain several clusters.
[0016] Calculate the normalized value of the mean of the polishing effect values of all connected areas 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 the clusters, and the difference in polishing effect values.
[0018] Determine the local brightness and darkness contrast prominence of each connected area based on the difference in polishing effect values of adjacent connected areas;
[0019] The normalized sum of the local brightness and darkness contrast prominence of all connected regions is obtained, and the product of the normalized sum of the local brightness and darkness contrast prominence and the complexity of the polishing effect in the stainless steel surface image at each moment is recorded as the brightness and darkness boundary effect factor caused by different polishing effect areas in the stainless steel surface image at each moment.
[0020] Furthermore, the method of determining the complexity of the polishing effect in the stainless steel surface image at each moment according to the number of clusters, the distance between connected regions within the clusters, and the difference in polishing effect values includes the following specific steps:
[0021] Obtain the mean of the shortest distances between any two connected areas in each cluster, which is recorded as the centrality of each cluster. Obtain the normalized value of the sum of the centralities of all clusters, which is recorded as the first sum. Then obtain the mean of the absolute values of the differences between the polishing effect values of any two clusters, which is recorded as the first mean. The product of the first sum, the first mean, and the number of clusters is recorded as the complexity of the polishing effect in the stainless steel surface image at each moment.
[0022] Furthermore, the method of determining the local brightness-darkness contrast prominence of each connected area according to the difference in polishing effect values of adjacent connected areas includes the following specific steps:
[0023] Obtain all connected areas adjacent to any connected area and record them as reference connected areas;
[0024] On the boundary of any one of the connected regions, the number of pixel points adjacent to any one of the reference connected regions is obtained, and recorded as the adhesion length of the any one of the reference connected regions;
[0025] Obtain the ratio of the adhesion length of each reference connected domain to the boundary length of any one of the connected regions, then obtain the product of the absolute value of the difference between the polishing effect values of any one of the connected regions and each reference connected region and the ratio, record it as the first product of each reference connected domain, and take the sum of the first products of all reference connected domains as the local light-dark contrast prominence of any one of the connected regions.
[0026] Furthermore, the determination of the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at each moment includes the following specific steps:
[0027] Get all connected areas in each cluster to form the polishing area;
[0028] Divide each polishing area into several small connected areas;
[0029] Divide the small connected area into a concave area and a convex area, and determine the relative concave depth of the concave area and the relative convex height of the convex area;
[0030] Determine the ability value of each small connected area to change the light reflection path based on the relative concave depth of the concave area and the relative convex height of the convex area;
[0031] The complexity of light reflection caused by irregular bumps in each polished area is determined based on the ability of all small connected areas in each polished area to change the light reflection path.
[0032] In the stainless steel surface image at each moment, the sum of the light reflection complexity caused by irregular bumps in all polished areas is obtained. The normalized value of The product of the normalized value of and the bright-dark boundary effect factor caused by different polishing effect areas in the stainless steel surface image at each moment is recorded as the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at each moment.
[0033] Furthermore, the dividing of the small connected areas into concave areas and convex areas, and determining the relative concave depths of the concave areas and the relative convex heights of the convex areas, includes the following specific steps:
[0034] For any small connected area, obtain the mean of the grayscale values of all pixels on the boundary of the small connected area, recorded as the first mean, and then obtain the mean of the grayscale values of all pixels in the small connected area, recorded as the second mean; when the first mean is greater than the second mean, the small connected area is recorded as a concave area, and the difference between the first mean and the second mean is recorded as the relative concave depth; when the first mean is less than or equal to the second mean, the small connected area is recorded as a convex area, and the difference between the second mean and the first mean is recorded as the relative convex height.
[0035] Furthermore, the method of determining the ability value of each small connected area to change the light reflection path according to the relative concave depth of the concave area and the relative convex height of the convex area includes the following specific steps:
[0036] For any concave area, obtain the maximum value of the relative convex heights of all convex areas adjacent to the concave area, and obtain the sum of the maximum value of the relative convex heights and the relative concave depth of the concave area. The normalized value of The product of the normalized value of and the relative depth of the concave area is recorded as the ability value of any concave area to change the light reflection path;
[0037] For any convex area, obtain the maximum value of the relative concave depths of all concave areas adjacent to the convex area, and obtain the sum of the maximum value of the relative concave depths and the relative convex height of the convex area. The normalized value of The product of the normalized value of and the relative protrusion height of the protrusion area is recorded as the ability value of any protrusion area to change the light reflection path.
[0038] Furthermore, the complexity of light reflection caused by irregular concavities and convexities in each polished area is determined based on the ability values of all small connected areas in each polished area to change the light reflection path, including the following specific steps:
[0039] In any polishing area, obtain the variance of the relative protrusion height of all protrusion areas, record it as the first variance, obtain the variance of the relative concave depth of all concave areas, record it as the second variance, and obtain the mean of the first variance and the second variance The normalized value of , and then obtain the sum of the ability values of all small connected areas to change the light reflection path, and the mean The product of the normalized value of and the sum of the capability values is recorded as the complexity of light reflection caused by the irregular concave-convex in any polishing area.
[0040] Furthermore, the specific steps of determining the gamma value required for the stainless steel surface image at each moment include the following:
[0041] Use Harris corner detection algorithm to obtain several characteristic corner points in the stainless steel surface image at each moment;
[0042] Using the inverse optical flow method, obtain the matching point of each characteristic corner point in the stainless steel surface image at each moment in the stainless steel surface image at the previous moment, and then obtain the Euclidean distance between the position coordinates of each characteristic corner point and the matching point as the vibration velocity of each characteristic corner point;
[0043] Obtaining a normalized value of the mean vibration velocity of all characteristic corner points in the stainless steel surface image at each moment, and multiplying 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, to obtain 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 degree of illumination unevenness caused by polishing in the stainless steel surface image at each moment and a preset gamma threshold is obtained, and the sum of the product of the normalized value of the degree of illumination unevenness and the preset gamma threshold and a 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 an embodiment of the present invention, an image of the stainless steel surface at each moment during the frosting process is obtained, and the factors of the light-dark boundary effect caused by different polishing effect areas in the stainless steel surface image at each moment are determined. Then, the factors affecting the uneven illumination caused by the polishing effect in the stainless steel surface image at each moment are determined. Thus, by analyzing the light-dark boundary effect between different polishing effect areas on the stainless steel surface, as well as the complexity of light reflection caused by irregular concavities and convexities within the same polishing effect area, combined with the high-frequency vibration mark characteristics that appear on the stainless steel surface due to polishing, the degree of uneven illumination caused by polishing is determined, so as to ensure that the stainless steel surface image is effective in removing the influence of uneven illumination, thereby obtaining an accurate and reliable enhanced image of the stainless steel surface and ensuring the effect of frosting process control. The gamma value required for the stainless steel surface image at each moment is obtained, and is used to perform gamma correction on the stainless steel surface image at each moment to obtain an enhanced image of the stainless steel surface, obtain the surface roughness of the enhanced image of the stainless steel surface, and construct a mapping relationship between the surface roughness and the frosting parameters to dynamically adjust the frosting parameters. Thus, through adaptive gamma values, gamma correction is performed on the stainless steel surface image with uneven illumination to obtain an enhanced image, thereby ensuring the accuracy of surface roughness acquisition, thereby ensuring the accuracy of subsequent construction of the mapping relationship between surface roughness and frosting parameters, and improving the effect of dynamic adjustment of frosting parameters. So far, the present invention analyzes the degree of uneven illumination caused by grinding in the stainless steel surface image, uses adaptive gamma values, performs gamma correction, obtains the enhanced image of the stainless steel surface, and thus improves the effect of frosting process control. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0048] Figure 1 This is a flow chart of the steps of a method for controlling a stainless steel surface frosting process based on machine vision according to the present invention;
[0049] Figure 2 Schematic diagram of the stainless steel surface image. DETAILED DESCRIPTION
[0050] To further illustrate the technical means and effectiveness of the present invention in achieving its intended objectives, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail the specific implementation, structure, features, and effectiveness of a machine vision-based stainless steel surface grinding process control method proposed by the present invention. In the following description, references to different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
[0051] Unless defined otherwise, 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 belongs.
[0052] The following describes in detail a method for controlling a stainless steel surface frosting process based on machine vision provided by the present invention with reference to the accompanying drawings.
[0053] See also Figure 1 , which shows a flowchart of a method for controlling a stainless steel surface frosting process based on machine vision according to an embodiment of the present invention, the method comprising the following steps:
[0054] Step S001: Acquire the stainless steel surface image at each moment during the frosting process.
[0055] It should be noted that in this embodiment, the stainless steel material is first secured to a workbench to ensure it does not move during the grinding process. The grinding wheel is kept parallel to the stainless steel surface and moves evenly in the same direction to avoid uneven marks caused by cross-grinding. An appropriate camera, such as a high-speed camera or a high-resolution camera, is then selected based on the inspection requirements. A suitable lens is selected to ensure coverage of the entire inspection area and provide sufficient magnification. A suitable light source, such as an LED or laser, is selected to provide uniform and stable illumination. The camera, lens, and light source are then installed in appropriate locations to ensure they capture the required information. During the grinding process, the grinding wheel may obscure portions of the surface, resulting in incomplete image capture. This can be addressed by adjusting the camera position or using a multi-angle camera. Furthermore, this embodiment of the present invention utilizes a segmentation neural network to identify and segment the background and stainless steel surface areas in the strong image captured by the camera. The relevant details regarding the segmentation neural network are as follows: The segmentation neural network used in this embodiment is the Mask R-CNN neural network; the dataset used is an enhanced image dataset. Mask R-CNN is a well-known technique, and the specific method is not described here. The full Chinese name of Mask R-CNN is "Mask Region-based Convolutional Neural Network", and the full English name is "Mask Region-based Convolutional Neural Network". The pixels that need to be segmented are divided into two categories, that is, the labeling process of the training set is: single-channel semantic label, the corresponding position pixel belongs to the background area is labeled as 0, and belongs to the stainless steel surface area is labeled as 1. The task of the network is classification, so the loss function used is the cross-entropy loss function. In this way, the stainless steel surface image is obtained. The acquisition frequency of the stainless steel surface image is 1 per second. Taking this as an example, the stainless steel surface image is grayscaled, which is a well-known technology. Schematic diagram of the stainless steel surface image, as shown Figure 2 shown.
[0056] Step S002: Divide the stainless steel surface image at each moment into several connected areas according to the difference in pixel grayscale values, and determine the polishing effect value of each connected area; and determine the bright and dark boundary effect factors caused by different polishing effect areas in the stainless steel surface image at each moment according to the difference between the polishing effect values of different connected areas.
[0057] It should be noted that as the grinding wheel moves across the stainless steel surface, different areas of the surface may have varying degrees of grit—some areas may be finer, others coarser. This uneven grit leads to varying light reflectivity, thus affecting the image's illumination uniformity. Therefore, this embodiment first divides the stainless steel surface image into areas with varying grit effects. Based on an analysis of these areas, the overall illumination unevenness of the stainless steel surface caused by these areas is determined.
[0058] Preferably, in one embodiment of the present invention, a 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 The value is 5, and this is used as an example for description.
[0060] In the stainless steel surface image at the xth moment, obtain the image with each pixel as the center and the size of Window. Calculate the variance of the grayscale values of all pixels within each pixel window, and record this as the polishing roughness of each pixel. Based on the polishing roughness of each pixel, use the region growing algorithm to obtain several connected regions. The mean of the polishing roughness of all pixels within each connected region is recorded as the polishing effect value of each connected region.
[0061] It should be noted that the region growing algorithm is a well-known technology and the specific method will not be introduced here. The grinding unevenness of the pixels in each connected area is similar. If the window is a locally flat area, the variance of the grayscale values of all pixels in the window is small. In this embodiment, the lighting environment is relatively stable. On the surface of the stainless steel, the areas with coarser grinding have higher surface roughness. When light hits these areas, diffuse reflection occurs, that is, the light scatters in all directions, causing these areas to appear dim. On the other hand, the areas with finer grinding have lower surface roughness. When light hits these areas, specular reflection occurs, that is, the light is reflected according to the rule that the angle of incidence is equal to the angle of reflection, making these areas appear brighter. Therefore, the greater the difference between areas with different grinding effects, the more obvious the contrast between light and dark, and the more discrete the distribution of different connected areas with similar grinding effects, the greater the impact on the uniformity of lighting on the entire stainless steel surface.
[0062] In the stainless steel surface image at the xth moment, the absolute value of the difference between the polishing effect values of any two connected areas is used as the clustering distance. The K-means clustering algorithm is used to cluster all connected areas to obtain several clusters. The mean of the polishing effect values of all connected areas in each cluster is calculated. The normalized value of is recorded as the polishing effect value of each cluster.
[0063] It should be noted that the K-means clustering algorithm is a well-known technology and the specific method will not be introduced here. The polishing effect of the connected areas in each cluster is similar. As the mean The normalized value of It is a linear normalization function used to normalize data values to between 0 and 1.
[0064] In the stainless steel surface image at the xth moment, obtain the mean of the shortest distances between any two connected regions in the jth cluster, record it as the centrality of the jth cluster, and obtain the sum of the centralities of all clusters The normalized value of is recorded as the first sum value, and then the mean of the absolute value of the difference between the polishing effect values of all arbitrary two clusters is obtained, recorded as the first mean value, and the product of the first sum value, the first mean value and the number of clusters is recorded as the complexity of the polishing effect in the stainless steel surface image at the xth moment.
[0065] It should be noted that: in this embodiment, As the sum value The normalized value of . The greater the number of clusters, the more diverse the areas with different polishing effects, resulting in greater illumination nonuniformity. The greater the difference in polishing effect values between clusters, the greater the difference in polishing effects between areas with different polishing effects, that is, the greater the difference in brightness and darkness. The greater the distance between connected areas within the same cluster, the more discrete connected areas with similar polishing effects are distributed across the stainless steel surface, which can easily lead to a more chaotic distribution of brightness and darkness across the entire stainless steel surface. Therefore, the product of the first sum, the first mean, and the number of clusters is used as the polishing effect complexity.
[0066] It should be further explained that the above analysis only analyzes the differences between areas with different polishing effects in the stainless steel surface image. Further analysis is needed to analyze the differences in polishing effect values between adjacent connected areas in the stainless steel surface image. The greater the difference, the more obvious changes in brightness and darkness will appear at the boundaries of adjacent areas, making the distribution of light in different connected areas more uneven.
[0067] In the stainless steel surface image at time x, all connected regions adjacent to the y-th connected region are obtained and recorded as reference connected regions. On the boundary of the y-th connected region, the number of pixels adjacent to any reference connected region is obtained and recorded as the adhesion length of any reference connected region. The ratio of the adhesion length of the ith reference connected region to the boundary length of the y-th connected region is obtained. The absolute value of the difference between the polishing effect values of the y-th connected region and the ith reference connected region is then obtained. The product of this ratio and the absolute value of the difference between the polishing effect values is recorded as the first product of the ith reference connected region. The sum of the first products of all reference connected regions is used as the local brightness contrast prominence of the y-th connected region.
[0068] It should be noted that: the larger the ratio is, the longer the boundary between the y-th connected area and the ith reference connected area is, and the larger the absolute value of the difference in the polishing effect value is, the greater the difference in brightness between the y-th connected area and the ith reference connected area is. Therefore, the ratio is used as the weight of the absolute value of the difference in the polishing effect value to determine the prominence of the local brightness and darkness contrast.
[0069] In the stainless steel surface image at the xth moment, obtain the sum of the local brightness and darkness contrast prominence of all connected areas The normalized value of The product of the normalized value of and the complexity of the polishing effect in the stainless steel surface image at the xth moment is recorded as the bright and dark boundary effect factor caused by different polishing effect areas in the stainless steel surface image at the xth moment.
[0070] It should be noted that: in this embodiment, As the sum value The more complex the polishing effect in the stainless steel surface image is and the greater the prominence of the local light-dark contrast in each connected area is, the stronger the light-dark boundary effect caused by different polishing effect areas in the stainless steel surface image is.
[0071] Step S003: Determine the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at each moment based on the grayscale value difference of pixels in the connected area with similar polishing effect values and the light-dark boundary effect factor caused by the different polishing effect areas in the stainless steel surface image at each moment.
[0072] It should be noted that the above analysis focuses on the bright-dark boundary effect caused by different polished areas in the stainless steel surface image. This is the difference between diffuse reflection in rough areas and specular reflection in smooth areas, which results in uneven light distribution across different areas. It does not consider the uneven illumination caused by diffuse reflection within rough areas or specular reflection within smooth areas. Further analysis is needed to analyze the uneven illumination caused by irregular micro-concavities and convexities within these rough or smooth areas.
[0073] Preferably, in one embodiment of the present invention, a method for obtaining an 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 the xth moment, all connected regions in each cluster are obtained to form the polishing region. In the zth polishing region, a watershed algorithm is used based on the grayscale value of the pixels to obtain several small connected regions.
[0075] It should be noted that the watershed algorithm is an image segmentation method based on topological theory. By simulating the watershed formation process in geography, the grayscale values in the image are regarded as terrain heights to achieve regional segmentation. That is, the image grayscale values are mapped to terrain heights, with high grayscale areas as peaks and low grayscale areas as valleys. The local minimum area is called a catchment basin, and its boundary is the watershed. Therefore, each small connected area can be represented as a raised peak area or a sunken valley area. This is a well-known technology, and the specific method will not be introduced here. The greater the degree of polishing, the rougher the polished area.
[0076] For any small connected region, the mean grayscale value of all pixels on the boundary of the small connected region is obtained, recorded as the first mean. Then, the mean grayscale value of all pixels within the small connected region is obtained, recorded as the second mean. When the first mean is greater than the second mean, the small connected region is recorded as a concave region, and the difference between the first mean and the second mean is recorded as the relative concave depth. When the first mean is less than or equal to the second mean, the small connected region is recorded as a convex region, and the difference between the second mean and the first mean is recorded as the relative convex height.
[0077] For any concave area, obtain the maximum value of the relative convex heights of all convex areas adjacent to the concave area, and obtain the sum of the maximum value of the relative convex heights and the relative concave depth of the concave area. The normalized value of The product of the normalized value of and the relative depth of the concave area is recorded as the ability value of any concave area to change the light reflection path.
[0078] For any convex area, obtain the maximum value of the relative concave depths of all concave areas adjacent to the convex area, and obtain the sum of the maximum value of the relative concave depth and the relative convex height of the convex area. The normalized value of The product of the normalized value of and the relative protrusion height of the protrusion area is recorded as the ability value of any protrusion area to change the light reflection path.
[0079] It should be noted that: in this embodiment, As the sum value The normalized value of As the sum value The normalized value of is used. Deeper bumps and depressions significantly alter the light's reflection path. Therefore, the greater the relative depth of the concave area and the greater the height difference with the adjacent raised area, or the greater the relative height of the raised area and the height difference with the adjacent concave area, the greater the ability to alter the light's reflection path. Furthermore, since a watershed is the boundary formed by the meeting of different water flows, one side of the boundary is necessarily high and the other is low, meaning that there must be adjacent concave and convex areas.
[0080] It's also worth noting that if the surface's concave and convex features exhibit a certain regularity, such as periodic ripples or textures, then light will reflect relatively evenly from these areas, as each concave and convex unit reflects light similarly. Conversely, if the surface's concave and convex features lack a clear regularity—that is, if the size, shape, depth, and spacing of the concave and convex surfaces vary—then light will reflect very complexly from these areas, resulting in varying directions and intensities of reflected light.
[0081] In the zth polishing area, obtain the variance of the relative protrusion height of all protrusion areas, recorded as the first variance, obtain the variance of the relative concave depth of all concave areas, recorded as the second variance, and obtain the mean of the first variance and the second variance The normalized value of , and then get the sum of the ability values of all small connected areas to change the light reflection path, and the mean The product of the normalized value of and the sum of the capability values is recorded as the complexity of light reflection caused by the irregular bumps in the z-th polishing area.
[0082] It should be noted that: in this embodiment, As the mean The smaller the variance, the more similar the reflection behavior of all convex or concave areas is to light. That is, the larger the variance, the more irregular the concave-convex features are, and the more complex the light reflection will be. The larger the sum of the ability values of all small connected areas to change the light reflection path, the stronger the ability of the concave-convex features in the zth polishing area to change the light reflection path. Therefore, the mean is used as the The normalized value of is used as the adjustment value for the sum of the capability values to obtain the complexity of light reflection caused by irregular bumps and depressions. When the raised or depressed areas within the polished area are unique, this embodiment adjusts the threshold value set in the watershed algorithm to divide more areas, making the raised or depressed areas within the polished area non-unique.
[0083] In the stainless steel surface image at the xth moment, obtain the sum of the light reflection complexity caused by irregular bumps in all polished areas The normalized value of The product of the normalized value of and the bright-dark boundary effect factor caused by different polishing effect areas in the stainless steel surface image at the xth moment is recorded as the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at the xth moment.
[0084] It should be noted that: in this embodiment, As the sum value In the stainless steel surface image, the stronger the bright and dark boundary effect caused by different polishing effect areas, and the more complex the light reflection caused by irregular concave and convex in each polishing area, the greater the impact of the polishing effect on the uneven illumination.
[0085] Step S004: Determine the gamma value required 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 an enhanced image of the stainless steel surface.
[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, which will aggravate the uneven lighting phenomenon in the stainless steel surface image. Therefore, it is necessary to further analyze the impact of high-frequency vibration marks on the stainless steel surface and determine the degree of uneven lighting in the stainless steel surface image under the analysis of the impact of the grinding effect on uneven lighting.
[0087] Preferably, in one embodiment of the present invention, the method for acquiring the surface enhancement image of stainless steel includes:
[0088] The Harris corner detection algorithm is used to obtain several characteristic corner points in the stainless steel surface image at the xth moment.
[0089] Using the inverse optical flow method, we obtain the matching point of each feature corner point in the stainless steel surface image at time x-1. We then obtain the Euclidean distance between the position coordinates of each feature corner point and its matching point as the vibration velocity of each feature corner point.
[0090] It should be noted that the Harris Corner Detection Algorithm and the inverse optical flow method are both well-known technologies, and their specific methods are not described here. If no matching points are found, subsequent analysis of that feature corner point is omitted, and the stainless steel surface image at the first moment is not analyzed. In this embodiment, a rectangular coordinate system is constructed with the vertex in the lower left corner of the stainless steel surface image at each moment as the origin, the horizontal axis pointing to the right as the horizontal axis, and the vertical axis pointing upward as the positive vertical axis. The position coordinates of each pixel in the stainless steel surface image at each moment are obtained on this rectangular coordinate system.
[0091] Get the mean vibration velocity of all characteristic corner points in the stainless steel surface image at the xth moment The normalized value of The product of the normalized value of and the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at the x-th moment is recorded as the uneven illumination degree caused by polishing in the stainless steel surface image at the x-th moment.
[0092] It should be noted that: in this embodiment, As the mean The normalized value of , where the faster the vibration, the greater the effect on the uneven lighting.
[0093] The preset constant is 1, and the preset gamma threshold is 0.4, which is used as an example for description.
[0094] Get the uneven illumination caused by polishing in the stainless steel surface image at the xth moment The product of the normalized value of and the preset gamma threshold value is used, and the sum of the product and the preset constant is used as the gamma value required for the stainless steel surface image at the x-th moment.
[0095] The gamma value required by the stainless steel surface image at the x-th moment is used to perform gamma correction on the stainless steel surface image at the x-th moment to obtain an enhanced image of the stainless steel surface.
[0096] It should be noted that: in this embodiment, As Gamma correction is a well-known technique, and the specific method is not 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, improving the clarity of dark areas, while the brightness of bright areas is reduced to reduce the impact of high reflections. In other words, the greater the degree of uneven illumination caused by polishing, the more and more obvious high-reflection areas and dark areas are present in the stainless steel surface image, and therefore a larger gamma value is required for correction.
[0097] Step S005: obtaining the surface roughness of the stainless steel surface enhancement image, and constructing a mapping relationship between the surface roughness and the frosting parameters to dynamically adjust the frosting parameters.
[0098] The surface roughness of each stainless steel surface enhancement image at each moment is extracted using a gray-level co-occurrence matrix. A random forest model is trained on the surface roughness of all stainless steel surface enhancement images at each moment to establish a mapping relationship between surface roughness and grinding parameters. Based on this mapping relationship, the real-time surface roughness of the stainless steel surface enhancement image is input into a fuzzy controller, which dynamically adjusts grinding 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 the specific methods are not 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. This ensures the accuracy of the surface roughness acquisition, thereby ensuring the accuracy of the subsequent mapping relationship between surface roughness and frosting parameters, and improving the effect of dynamic adjustment of frosting parameters.
[0100] So far, the present invention is completed.
[0101] In summary, in an embodiment of the present invention, an image of the stainless steel surface at each moment in the frosting process is obtained, the light and dark boundary effect factors caused by different polishing effect areas in the stainless steel surface image at each moment are determined, and then the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at each moment is determined, thereby obtaining the gamma value required for the stainless steel surface image at each moment, which is used to perform gamma correction on the stainless steel surface image at each moment to obtain an enhanced image of the stainless steel surface, obtain the surface roughness of the enhanced image of the stainless steel surface, and construct a mapping relationship between the surface roughness and the frosting parameters to dynamically adjust the frosting parameters. The present invention analyzes the degree of uneven illumination caused by polishing in the stainless steel surface image to adaptively adjust the gamma value, perform gamma correction, and obtain an enhanced image of the stainless steel surface, thereby improving the effect of frosting process control.
[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 in the scope of protection of the present invention.
Claims
1. A method for controlling the surface frosting process of stainless steel based on machine vision, characterized in that: The method comprises the following steps: Acquire images of the stainless steel surface at every moment of the grinding 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 the polishing effect values of different connected regions, the bright and dark boundary effect factors caused by different polishing effect regions in the stainless steel surface image at each moment are determined; Based on the grayscale value differences of pixels in connected areas with similar polishing effect values, combined with the bright and dark boundary effect factors caused by different polishing effect areas in the stainless steel surface image at each moment, the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at each moment is determined; Determining a gamma value required 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; performing gamma correction on the stainless steel surface image at each moment using the gamma value to obtain an enhanced image of the stainless steel surface; The surface roughness of the stainless steel surface enhancement image is obtained, and a mapping relationship between the surface roughness and the frosting parameters is constructed to dynamically adjust the frosting parameters.
2. The method for controlling the surface frosting process of stainless steel based on machine vision according to claim 1, characterized in that: The specific steps of dividing the stainless steel surface image at each moment into a plurality of connected regions and determining the polishing effect value of each connected region are as follows: Preset window side length , in the stainless steel surface image at each moment, obtain the image with each pixel as the center and the size of , calculate the variance of the grayscale values of all pixels in the window of each pixel, record it as the polishing roughness of each pixel, and use the region growing algorithm according to the polishing roughness of each pixel to obtain several connected regions. The mean value of the polishing roughness 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 frosting process of stainless steel based on machine vision according to claim 1, characterized in that: The specific steps of determining the bright and dark boundary effect factors caused by different polishing effect areas in the stainless steel surface image at each moment include the following: In the stainless steel surface image at each moment, the absolute value of the difference between the polishing effect values of any two connected areas is used as the clustering distance. The K-means clustering algorithm is used to cluster all connected areas to obtain several clusters. Calculate the normalized value of the mean of the polishing effect values of all connected areas 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 the clusters, and the difference in polishing effect values. According to the difference in polishing effect values of adjacent connected areas, the local light-dark contrast prominence of each connected area is determined; The normalized sum of the local brightness and darkness contrast prominence of all connected regions is obtained, and the product of the normalized sum of the local brightness and darkness contrast prominence and the complexity of the polishing effect in the stainless steel surface image at each moment is recorded as the brightness and darkness boundary effect factor caused by different polishing effect areas in the stainless steel surface image at each moment.
4. The method for controlling the surface frosting process of stainless steel based on machine vision according to claim 3, characterized in that: The method of determining the complexity of the polishing effect in the stainless steel surface image at each moment according to the number of clusters, the distance between connected regions within the clusters, and the difference in polishing effect values includes the following specific steps: Obtain the mean of the shortest distances between any two connected areas in each cluster, which is recorded as the centrality of each cluster. Obtain the normalized value of the sum of the centralities of all clusters, which is recorded as the first sum. Then obtain the mean of the absolute values of the differences between the polishing effect values of any two clusters, which is recorded as the first mean. The product of the first sum, the first mean, and the number of clusters is recorded as the complexity of the polishing effect in the stainless steel surface image at each moment.
5. The method for controlling the surface frosting process of stainless steel based on machine vision according to claim 3, characterized in that: The specific steps of determining the local light-dark contrast prominence of each connected area based on the difference in polishing effect values of adjacent connected areas are as follows: Obtain all connected areas adjacent to any connected area and record them as reference connected areas; On the boundary of any one of the connected regions, the number of pixel points adjacent to any one of the reference connected regions is obtained, and recorded as the adhesion length of the any one of the reference connected regions; Obtain the ratio of the adhesion length of each reference connected domain to the boundary length of any one of the connected regions, then obtain the product of the absolute value of the difference between the polishing effect values of any one of the connected regions and each reference connected region and the ratio, record it as the first product of each reference connected domain, and take the sum of the first products of all reference connected domains as the local light-dark contrast prominence of any one of the connected regions.
6. The method for controlling the surface frosting process of stainless steel based on machine vision according to claim 3, characterized in that: The specific steps of determining the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at each moment include the following: Get all connected areas in each cluster to form the polishing area; Divide each polishing area into several small connected areas; Divide the small connected area into a concave area and a convex area, and determine the relative concave depth of the concave area and the relative convex height of the convex area; Determine the ability value of each small connected area to change the light reflection path based on the relative concave depth of the concave area and the relative convex height of the convex area; The complexity of light reflection caused by irregular bumps in each polished area is determined based on the ability of all small connected areas in each polished area to change the light reflection path. In the stainless steel surface image at each moment, the sum of the light reflection complexity caused by irregular bumps in all polished areas is obtained. The normalized value of The product of the normalized value of and the bright-dark boundary effect factor caused by different polishing effect areas in the stainless steel surface image at each moment is recorded as the influence factor of the polishing effect on the uneven illumination in the stainless steel surface image at each moment.
7. The method for controlling the surface frosting process of stainless steel based on machine vision according to claim 6, characterized in that: The method of dividing the small connected area into a concave area and a convex area, and determining the relative concave depth of the concave area and the relative convex height of the convex area includes the following specific steps: For any small connected area, obtain the mean of the grayscale values of all pixels on the boundary of the small connected area, recorded as the first mean, and then obtain the mean of the grayscale values of all pixels in the small connected area, recorded as the second mean; when the first mean is greater than the second mean, the small connected area is recorded as a concave area, and the difference between the first mean and the second mean is recorded as the relative concave depth; when the first mean is less than or equal to the second mean, the small connected area is recorded as a convex area, and the difference between the second mean and the first mean is recorded as the relative convex height.
8. The method for controlling the surface frosting process of stainless steel based on machine vision according to claim 6, characterized in that: The specific steps of determining the ability value of each small connected area to change the light reflection path according to the relative concave depth of the concave area and the relative convex height of the convex area are as follows: For any concave area, obtain the maximum value of the relative convex heights of all convex areas adjacent to the concave area, and obtain the sum of the maximum value of the relative convex heights and the relative concave depth of the concave area. The normalized value of The product of the normalized value of and the relative depth of the concave area is recorded as the ability value of any concave area to change the light reflection path; For any convex area, obtain the maximum value of the relative concave depths of all concave areas adjacent to the convex area, and obtain the sum of the maximum value of the relative concave depths and the relative convex height of the convex area. The normalized value of The product of the normalized value of and the relative protrusion height of the protrusion area is recorded as the ability value of any protrusion area to change the light reflection path.
9. The method for controlling the surface frosting process of stainless steel based on machine vision according to claim 6, characterized in that: The method of determining the complexity of light reflection caused by irregular concavities and convexities in each polished area according to the ability values of all small connected areas in each polished area to change the light reflection path includes the following specific steps: In any polishing area, obtain the variance of the relative protrusion height of all protrusion areas, record it as the first variance, obtain the variance of the relative concave depth of all concave areas, record it as the second variance, and obtain the mean of the first variance and the second variance The normalized value of , and then obtain the sum of the ability values of all small connected areas to change the light reflection path, and the mean The product of the normalized value of and the sum of the capability values is recorded as the complexity of light reflection caused by the irregular concave-convex in any polishing area.
10. The method for controlling the surface frosting process of stainless steel based on machine vision according to claim 1, characterized in that: The specific steps of determining the gamma value required for the stainless steel surface image at each moment include the following: Use Harris corner detection algorithm to obtain several characteristic corner points in the stainless steel surface image at each moment; Using the inverse optical flow method, obtain the matching point of each characteristic corner point in the stainless steel surface image at each moment in the stainless steel surface image at the previous moment, and then obtain the Euclidean distance between the position coordinates of each characteristic corner point and the matching point as the vibration velocity of each characteristic corner point; Obtaining a normalized value of the mean vibration velocity of all characteristic corner points in the stainless steel surface image at each moment, and multiplying 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, to obtain the degree of uneven illumination caused by polishing in the stainless steel surface image at each moment; The product of the normalized value of the degree of illumination unevenness caused by polishing in the stainless steel surface image at each moment and a preset gamma threshold is obtained, and the sum of the product of the normalized value of the degree of illumination unevenness and the preset gamma threshold and a preset constant is used as the gamma value required for the stainless steel surface image at each moment.
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
Heat exchanger tube head welding quality visual detection method and system
CN117689662A
Image enhancement method and system based on illumination correction
CN118154487A
Road quality rapid detection method and system for traffic engineering
CN119067974A