Vision-based detection method for mold surface polishing degree

Through computer vision and image processing technology, the surface spectrogram of the mold before and after polishing is analyzed, and the energy and component variation coefficients of the high-frequency region are calculated, which solves the problems of low detection efficiency and low accuracy of the surface polishing degree of existing molds, and achieves high efficiency, Accurate polishing degree detection and adjustment.

CN114998343BActive Publication Date: 2024-12-10LIANGSHAN SHUIHU PRECISION ELECTRONICS CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210929632.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-04
Publication Date
2024-12-10
Estimated Expiration
2042-08-04

AI Technical Summary

Technical Problem

The existing mold surface polishing degree detection methods are subjective, low efficiency and low accuracy, and a method is needed to improve detection efficiency and accuracy.

Method used

Using computer vision and image processing methods, the mold surface edge map and spectrum map before polishing are obtained, and the energy change coefficient and component change coefficient of the high-frequency region are calculated through Fourier transform and grayscale histogram analysis, and then the polishing is determined. and adjust the polishing machine.

Benefits of technology

It effectively improves the efficiency and accuracy of the polishing degree detection of mold surface, reduces the subjectivity of manual inspection, and achieves accurate adjustment of the polishing degree.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114998343B_ABST
    Figure CN114998343B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing, and specifically to a method for detecting the polishing degree of a mold surface based on vision, comprising: obtaining a mold edge image before polishing, a spectrum image, and a spectrum image during polishing; determining a low-frequency area and a high-frequency area in the spectrum image before polishing; obtaining a spectrum image before polishing and a spectrum image during polishing containing only a high-frequency area, and using the grayscale histograms of the two spectrum images to obtain an energy variation coefficient in the high-frequency area of ​​the spectrum image during polishing; using the grayscale value of a pixel point in the spectrum image before polishing containing only a high-frequency area, the grayscale value of the pixel point in the spectrum image during polishing containing only a high-frequency area, and the minimum positive period of the trigonometric function corresponding to the pixel point, to obtain a component variation coefficient of each pixel point in the high-frequency area of ​​the spectrum image during polishing; using the energy variation coefficient and the component variation coefficient to obtain the polishing degree, and then adjusting the polishing machine. The above method is used to detect the polishing degree of the mold surface, and can improve the detection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of image processing, and in particular to a method for detecting the polishing degree of a mold surface based on vision. Background Art

[0002] Polishing is a surface treatment process that is widely used in mechanical manufacturing. Polishing refers to a processing method that uses mechanical, chemical or electrochemical effects to reduce the surface roughness of the mold to obtain a bright and smooth surface. Different molds have different requirements for the degree of polishing. Therefore, it is necessary to test the polishing degree of the polished mold.

[0003] At present, the main means of testing the polishing degree of the polished mold is manual testing, which relies on the existing experience of the tester to test the surface polishing degree of the mold.

[0004] However, the existing means of testing the polishing degree of the polished mold are highly subjective, inefficient and inaccurate. Therefore, a method is urgently needed to improve the efficiency and accuracy of testing the polishing degree of the mold surface. Summary of the invention

[0005] The invention provides a method for detecting the polishing degree of a mold surface based on vision, so as to solve the problems of low efficiency and low accuracy of the existing method for detecting the polishing degree of a mold surface.

[0006] The present invention provides a method for detecting the polishing degree of a mold surface based on vision, comprising: obtaining a mold edge map before polishing, a spectrum map and a spectrum map during polishing; determining a low-frequency area and a high-frequency area in the spectrum map before polishing; obtaining a spectrum map before polishing containing only the high-frequency area and a spectrum map during polishing, and obtaining an energy variation coefficient in the high-frequency area of ​​the spectrum map during polishing by using grayscale histograms of the two spectrum maps; obtaining a component variation coefficient of each pixel point in the high-frequency area of ​​the spectrum map during polishing by using the grayscale value of a pixel point in the spectrum map before polishing containing only the high-frequency area, the grayscale value of the pixel point in the spectrum map during polishing containing only the high-frequency area, and the minimum positive period of a trigonometric function corresponding to the pixel point; obtaining the polishing degree by using the energy variation coefficient and the component variation coefficient, and then adjusting a polishing machine. Compared with the prior art, the present invention processes the mold surface images before and after polishing based on computer vision and image processing to obtain the mold surface spectrum map before and after polishing, obtains the polishing degree of the mold surface by using the characteristics of the mold surface spectrum map before and after polishing, and then adjusts the polishing machine, thereby effectively improving the detection efficiency and accuracy.

[0007] To achieve the above object, the present invention adopts the following technical solution, a method for detecting the polishing degree of a mold surface based on vision, comprising:

[0008] Obtaining a mold surface edge image before polishing, a mold surface spectrum image, and a mold surface spectrum image at the current moment during the polishing process;

[0009] Covering the low-frequency region in the spectrum of the mold surface before polishing, and performing inverse Fourier transformation on the covered spectrum to obtain an inversely transformed binary image of the mold surface before polishing;

[0010] Determine the low-frequency region and the high-frequency region in the spectrum map of the mold surface before polishing by using the grayscale values ​​of the pixels in the binary map of the mold surface before polishing and the edge map of the mold surface before polishing;

[0011] The low-frequency region in the mold surface spectrum before polishing is used to obtain the mold surface spectrum before polishing containing only the high-frequency region and the mold surface spectrum at the current moment during the polishing process;

[0012] Obtaining grayscale histograms of the mold surface spectrum before polishing that only contains the high-frequency area and the mold surface spectrum at the current moment during the polishing process, respectively, and calculating the energy change coefficient of the high-frequency area in the mold surface spectrum at the current moment during the polishing process by using the grayscale value of the peak value in the two grayscale histograms and the ratio of the peak grayscale value;

[0013] Performing inverse Fourier transform on the mold surface spectrum before polishing that only includes the high-frequency region, and obtaining the minimum positive period of the trigonometric function corresponding to each pixel point in the mold surface spectrum before polishing that only includes the high-frequency region;

[0014] The component variation coefficient of each pixel point in the high-frequency area of ​​the mold surface spectrum diagram at the current moment during the polishing process is calculated by using the gray value of the pixel point in the mold surface spectrum diagram before polishing that only contains the high-frequency area, the gray value of the pixel point in the mold surface spectrum diagram at the current moment during the polishing process that only contains the high-frequency area, and the minimum positive period of the trigonometric function corresponding to the pixel point;

[0015] The polishing degree of the mold surface at the current moment in the polishing process is calculated by using the energy variation coefficient of the high-frequency region in the spectrum diagram of the mold surface at the current moment in the polishing process and the component variation coefficient of each pixel point in the high-frequency region in the spectrum diagram;

[0016] The polishing machine is adjusted according to the polishing degree of the mold surface at the current moment in the polishing process.

[0017] Furthermore, in the vision-based mold surface polishing degree detection method, the mold surface edge map before polishing, the mold surface spectrum map and the mold surface spectrum map at the current moment during the polishing process are obtained in the following manner:

[0018] Collecting mold surface images before polishing and at the current moment during polishing;

[0019] Grayscale processing is performed on the mold surface images before polishing and at the current moment during the polishing process to obtain grayscale images of the mold surface before polishing and at the current moment during the polishing process;

[0020] Perform edge detection on the grayscale image of the mold surface before polishing to obtain an edge image of the mold surface before polishing;

[0021] Fourier transform is performed on the grayscale image of the mold surface before polishing and at the current moment during the polishing process to obtain the spectrum image of the mold surface before polishing and at the current moment during the polishing process.

[0022] Furthermore, in the vision-based mold surface polishing degree detection method, the inverse-transformed binary image of the mold surface before polishing is obtained in the following manner:

[0023] Set the center of the spectrum of the mold surface before polishing as the center of the circle. A circular area with a radius of 0 is set, and the pixel values ​​of all the pixels in the circular area of ​​the spectrum of the mold surface before polishing are set to 0, so as to obtain the spectrum of the mold surface before polishing after covering;

[0024] Performing inverse Fourier transformation on the spectrum of the mold surface before polishing after covering to obtain an inverse transformed image of the mold surface before polishing;

[0025] The inverse transformed surface image of the mold before polishing is binarized to obtain an inverse transformed binary image of the surface of the mold before polishing.

[0026] Furthermore, in the vision-based mold surface polishing degree detection method, the low-frequency area and the high-frequency area in the mold surface spectrum before polishing are determined in the following manner:

[0027] Subtract the grayscale value of the pixel in the inverse transformed binary image of the mold surface before polishing from the grayscale value of the corresponding pixel in the edge image of the mold surface before polishing, to obtain the grayscale value difference of all the pixels in the inverse transformed binary image of the mold surface before polishing;

[0028] Count the gray value difference of each pixel in the binary image of the mold surface before polishing after inverse transformation;

[0029] The matching degree between the binary image of the mold surface before polishing and the edge image of the mold surface before polishing after inverse transformation is calculated by using the number of pixels corresponding to each gray value difference and the number of pixels in the mold surface image before polishing;

[0030] Setting a threshold value to judge the matching degree between the inverse transformed binary image of the mold surface before polishing and the edge image of the mold surface before polishing;

[0031] When the matching degree between the inverse transformed binary image of the mold surface before polishing and the edge image of the mold surface before polishing is less than or equal to the threshold, the center of the spectrum image of the mold surface before polishing is taken as the center of the circle. The circular area with the radius is the low-frequency area of ​​the spectrum of the mold surface before polishing, and the other areas are the high-frequency areas of the spectrum of the mold surface before polishing;

[0032] When the matching degree between the inverse transformed binary image of the mold surface before polishing and the edge image of the mold surface before polishing is greater than the threshold, the arithmetic difference increases. The above steps are repeated for iterative matching until the matching degree between the inverse transformed binary image of the mold surface before polishing and the edge image of the mold surface before polishing is less than or equal to the threshold value, the iteration stops, and the low-frequency area and the high-frequency area in the spectrum image of the mold surface before polishing are determined.

[0033] Furthermore, in the vision-based mold surface polishing degree detection method, the energy variation coefficient of the high-frequency area in the mold surface spectrum diagram at the current moment during the polishing process is obtained in the following manner:

[0034] The low-frequency region in the spectrum diagram of the mold surface before polishing is covered to obtain the spectrum diagram of the mold surface before polishing containing only the high-frequency region;

[0035] Overlaying the same region of the low-frequency region in the spectrum diagram of the mold surface at the current moment during the polishing process as that in the spectrum diagram of the mold surface before polishing, to obtain the spectrum diagram of the mold surface at the current moment during the polishing process that only includes the high-frequency region;

[0036] The grayscale histogram of the mold surface spectrum before polishing containing only the high-frequency area and the mold surface spectrum at the current moment during the polishing process is obtained. The energy change coefficient of the high-frequency area in the mold surface spectrum at the current moment during the polishing process is calculated using the grayscale value of the peak in the two grayscale histograms and the ratio of the peak grayscale value.

[0037] Furthermore, in the vision-based method for detecting the polishing degree of the mold surface, the expression of the polishing degree of the mold surface at the current moment during the polishing process is specifically as follows:

[0038]

[0039] In the formula, Indicates the polishing degree of the mold surface at the current moment in the polishing process. Indicates the energy variation coefficient of the high-frequency area in the mold surface spectrum at the current moment during the polishing process. represents the component variation coefficient of the i-th pixel point in the high-frequency area of ​​the mold surface spectrum at the current moment in the polishing process, and n represents the number of pixels in the high-frequency area of ​​the mold surface spectrum at the current moment in the polishing process.

[0040] Furthermore, in the method for detecting the degree of polishing of a mold surface based on vision, the process of adjusting the polishing machine is as follows:

[0041] The polishing degree of the mold surface at the current moment in the polishing process is judged: when the polishing degree of the mold surface at this moment has reached the polishing degree requirement of the mold, the polishing is stopped and a new mold is replaced for polishing; when the polishing degree of the mold surface at this moment does not reach the polishing degree requirement of the mold, the polishing is continued.

[0042] The beneficial effects of the present invention are as follows: the present invention processes the mold surface images before and after polishing based on computer vision and image processing to obtain the mold surface spectrum before and after polishing, and uses the characteristics of the mold surface spectrum before and after polishing to obtain the polishing degree of the mold surface, and then adjusts the polishing machine, thereby effectively improving the detection efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 creative work.

[0044] Figure 1 A schematic flow chart of a method for detecting the degree of polishing of a mold surface provided in Example 1 of the present invention;

[0045] Figure 2 A schematic flow chart of a method for detecting the degree of polishing of a mold surface provided in Example 2 of the present invention;

[0046] Figure 3 A schematic diagram of a spectrum diagram of a mold surface before polishing provided in Example 2 of the present invention. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] Example 1

[0049] The embodiment of the present invention provides a method for detecting the polishing degree of a mold surface based on vision, such as Figure 1 As shown, including:

[0050] S101, obtaining a mold surface edge image before polishing, a mold surface spectrum image, and a mold surface spectrum image at a current moment during the polishing process.

[0051] Wherein, canny edge detection is performed on the grayscale image of the mold surface before polishing to obtain the edge image of the mold surface before polishing.

[0052] S102, covering the low-frequency region in the spectrum diagram of the mold surface before polishing, and performing inverse Fourier transformation on the covered spectrum diagram to obtain an inversely transformed binary image of the mold surface before polishing.

[0053] Among them, in the spectrum diagram obtained by Fourier transform, the high-frequency area is located at the periphery and the low-frequency area is located at the center.

[0054] S103, determining the low-frequency region and the high-frequency region in the spectrum map of the mold surface before polishing by using the grayscale values ​​of the pixels in the binary map of the mold surface before polishing and the edge map of the mold surface before polishing.

[0055] Among them, the high-frequency area reflects the parts of the image where the grayscale changes dramatically, mostly contours and edges.

[0056] S104, using the low-frequency region in the spectrum diagram of the mold surface before polishing, to obtain the spectrum diagram of the mold surface before polishing that only includes the high-frequency region and the spectrum diagram of the mold surface at the current moment during the polishing process.

[0057] The low-frequency region in the spectrum diagram of the mold surface before polishing is covered to obtain the spectrum diagram of the mold surface before polishing that only includes the high-frequency region.

[0058] S105. Obtain the grayscale histogram of the mold surface spectrum before polishing that only contains the high-frequency area and the mold surface spectrum at the current moment during the polishing process, respectively, and use the grayscale value of the peak value in the two grayscale histograms and the ratio of the peak grayscale value to calculate the energy change coefficient of the high-frequency area in the mold surface spectrum at the current moment during the polishing process.

[0059] Among them, the greater the energy variation coefficient of the high-frequency region in the spectrum diagram of the mold surface at the current moment during the polishing process, the greater the polishing degree of the mold surface.

[0060] S106, performing inverse Fourier transform on the spectrum of the mold surface before polishing that only includes the high-frequency region, to obtain the minimum positive period of the trigonometric function corresponding to each pixel point in the spectrum of the mold surface before polishing that only includes the high-frequency region.

[0061] The minimum positive period of the trigonometric function corresponding to each pixel point represents the distance between the pixel point and the central pixel point of the low-frequency area.

[0062] S107, using the grayscale value of the pixel point in the mold surface spectrum diagram before polishing that only contains the high-frequency area, the grayscale value of the pixel point in the mold surface spectrum diagram at the current moment during the polishing process that only contains the high-frequency area, and the minimum positive period of the trigonometric function corresponding to the pixel point, calculate the component variation coefficient of each pixel point in the high-frequency area of ​​the mold surface spectrum diagram at the current moment during the polishing process.

[0063] Among them, the closer the pixel is to the center pixel of the low-frequency area, the lower the frequency is and the larger the minimum positive period is.

[0064] S108, calculating the polishing degree of the mold surface at the current moment in the polishing process by using the energy variation coefficient of the high frequency region in the spectrum diagram of the mold surface at the current moment in the polishing process and the component variation coefficient of each pixel point in the high frequency region in the spectrum diagram.

[0065] Among them, the polishing degree of the mold surface is used to adjust the polishing machine.

[0066] S109, adjusting the polishing machine according to the polishing degree of the mold surface at the current moment during the polishing process.

[0067] The polishing degree of the mold surface at the current moment in the polishing process is judged: when the polishing degree of the mold surface at the current moment has reached the polishing degree requirement of the mold, the polishing is stopped and a new mold is replaced for polishing.

[0068] The beneficial effects of this embodiment are as follows: this embodiment processes the mold surface images before and after polishing based on computer vision and image processing to obtain the mold surface spectrum before and after polishing, and uses the characteristics of the mold surface spectrum before and after polishing to obtain the polishing degree of the mold surface, and then adjusts the polishing machine, effectively improving the detection efficiency and accuracy.

[0069] Example 2

[0070] The main purpose of this embodiment is to use image processing technology to quickly detect the polishing degree of the mold surface by utilizing the change in grayscale distribution, and at the same time adjust the polishing machine to improve work efficiency and avoid possible over-polishing or under-polishing.

[0071] The embodiment of the present invention provides a method for detecting the polishing degree of a mold surface based on vision, such as Figure 2 As shown, including:

[0072] S201, collecting mold surface images.

[0073] The degree of polishing needs to be determined by comparing the data before and after polishing. Therefore, before the mold enters the machine and begins processing, it is photographed and grayscaled. Since the mold surface before polishing is rough, there are many high-frequency areas in the spectrum diagram obtained from its grayscale diagram. These are the parts where the grayscale changes dramatically due to the rough surface of the mold. At the same time, due to the uneven grayscale distribution on the mold surface, edge detection can be used to extract the contour edge features of the image, that is, the parts where the grayscale changes dramatically.

[0074] In this embodiment, a camera is required to capture images of the mold surface. The camera is installed at an appropriate position to capture images of the mold surface before and during polishing.

[0075] S202, obtaining a mold surface edge image before polishing.

[0076] The mold surface image before polishing is grayed to obtain a grayscale image of the mold surface before polishing, and the mold surface grayscale image before polishing is subjected to canny edge detection to obtain an edge image of the mold surface before polishing.

[0077] S203: Obtain a spectrum diagram.

[0078] Polishing is to process the rough surface of the mold to obtain a smooth or mirror-like surface, that is, to reduce the surface roughness. The grayscale of the rough part of the surface changes dramatically, which is reflected in the high-frequency area in the spectrum diagram; while the grayscale of the smooth part changes more slowly, which is reflected in the low-frequency area in the spectrum diagram. In the spectrum diagram, the low-frequency area contains a lot of energy, the change is not obvious and difficult to analyze, so the energy change of the high-frequency area in the spectrum diagram of the mold surface image during polishing and the mold surface image before polishing is analyzed. As for the division of high-frequency and low-frequency areas, the image obtained by Fourier inverse transformation of the mold surface edge image before polishing and the spectrum diagram of the mold surface image before polishing can be compared, and finally the high-frequency area with obvious changes in the spectrum diagram can be obtained.

[0079] After the collected mold surface images before and during polishing are grayed out, each pixel on the grayscale image has a corresponding grayscale value. The grayscale value distribution of each pixel on the entire image can be regarded as a grayscale distribution function. The frequency spectrum can be obtained by Fourier transforming the grayscale image, which reflects the distribution and change relationship of the grayscale in the image.

[0080] In the spectrum obtained by Fourier transform, the high-frequency area is located around and the low-frequency area is located in the center. The high-frequency area reflects the parts of the image where the grayscale changes dramatically, mostly the contours and edges, and the distance between the pixel point in the high-frequency area and the central pixel point in the low-frequency area reflects the frequency of the grayscale change of the pixel point in the high-frequency area. The farther the distance, the faster the change. For the spectrum of the mold surface image before polishing, the mold surface before polishing is rough, the grayscale distribution is uneven, and the surface grayscale value changes a lot. As the polishing continues, the smoothness of the mold surface increases, which is reflected in the spectrum as a reduction in the high-frequency area and a decrease in the energy of the entire high-frequency area.

[0081] S204: Obtain a high-frequency region in the spectrum graph.

[0082] In the analysis of the spectrum graph, the dividing line between the high-frequency area and the low-frequency area is always difficult to determine. In this embodiment, the low-frequency area in the spectrum graph of the mold surface image before polishing is first covered, and then the remaining part of the spectrum graph is inverse Fourier transformed to obtain an image close to the edge of the contour, and this image is compared with the edge image of the mold surface before polishing to find the image with the closest matching effect. At this time, the covered part in the spectrum graph is the low-frequency area, and the remaining part is the high-frequency area to be analyzed. The specific operation process is as follows:

[0083] 1. Select the radius of the low-frequency part of the center of the spectrum of the mold surface before polishing. The circle is covered with the corresponding area of ​​the circle, and the pixel value of each pixel in the circle is set to 0, such as Figure 3 shown.

[0084] 2. Perform inverse Fourier transform on the spectrum after the above operation, that is, obtain the original image after special processing from the spectrum, and the obtained image retains the details of the original image, that is, the edge contour part. Since the edge image of the mold surface before polishing is binarized after canny operator recognition, in order to reduce the influence of pixel values ​​during comparison, the image obtained by inverse Fourier transform is also binarized.

[0085] 3. Compare the mold surface edge image before polishing with the image obtained by inverse Fourier transform. The specific process is as follows:

[0086] Assume that there are a total of Pixels, while in the mold surface edge image before polishing and the image obtained after Fourier inverse transform, each pixel is either black or white, that is, the grayscale value of each pixel is 0 or 255.

[0087] Compare the two images, that is, subtract the grayscale value of each pixel in the image obtained after inverse Fourier transform from the grayscale value of the pixel in the edge image of the mold surface before polishing. The result is 255, 0 or -255. The number of pixels with a result of 255 is recorded as , the number of pixels with a result of -255 is , then:

[0088]

[0089] in, Indicates Second processing, when Value 0.001, i.e. one thousandth, it is considered that the image obtained by the inverse Fourier transform at this time matches the edge image of the mold surface before polishing, and the edge at this time is recorded. value. It indicates the matching degree between the image obtained by inverse Fourier transform at this time and the edge image of the mold surface before polishing.

[0090] According to the above steps, if Value 0.001, it means that the selected high-frequency area still has some overall characteristics, and the arithmetic increase Repeat the above steps until the value is satisfied. , ending this step, indicating that the appropriate high- and low-frequency area division boundary has been found.

[0091] S205. Calculate the energy variation coefficient.

[0092] From the high-frequency area obtained in the previous step, a grayscale histogram is obtained based on the grayscale value of each pixel in this part. Since the low-frequency area has been filtered out, this part of the grayscale histogram should only contain one peak, which is the peak value of the pixel statistics in the high-frequency area. According to the positional relationship of the peak on the grayscale histogram, the energy changes of the spectrum diagram of the mold surface image before and during polishing are analyzed.

[0093] The analysis steps are as follows:

[0094] 1. Radius of the coverage area based on the spectrum of the mold surface image before polishing , the spectrum diagram of the mold surface image during the polishing process is also covered with equal area, that is, the high-frequency area in the spectrum diagram of the mold surface image before and during polishing is retained.

[0095] 2. Obtain the grayscale histogram of the frequency spectrum of the mold surface image before and during polishing, which only contains the high-frequency area.

[0096] 3. The grayscale changes of the mold surface image before polishing are more drastic, so there are many high-frequency bright pixels in its spectrum diagram, and the overall energy of the high-frequency area is large, which is reflected in the grayscale histogram as a peak close to 255; while the mold surface image during the polishing process becomes gradually smoother and the grayscale distribution becomes more uniform as a whole, so the high-frequency area becomes less and the energy of the high-frequency area becomes smaller, so the number of black pixels in the high-frequency area increases, and the peak gradually approaches 0.

[0097] 4. According to the distribution position and proportion of the peak value, an energy variation coefficient is obtained ,as follows:

[0098]

[0099] in, The gray value corresponding to the peak of the gray histogram of the spectrum diagram of the mold surface image before polishing, It represents the ratio of the gray value, that is, the ratio of the number of pixels corresponding to the gray value to the number of all pixels in the gray histogram; It represents the gray value corresponding to the peak value of the gray histogram of the spectrum diagram of the mold surface image during the polishing process. Indicates the ratio of the gray value.

[0100] S206. Calculate the component variation coefficient.

[0101] For each pixel in the high-frequency area, since its distance from the central pixel in the low-frequency area reflects the speed of the pixel's change frequency, the change in the high-frequency highlight pixel and the reduction in the change frequency of the entire high-frequency area can be reflected according to the change in the grayscale value of each pixel.

[0102] The specific process is as follows:

[0103] Assume that there are pixel points, record the The gray value of the pixel before polishing is , the gray value obtained during polishing is , because each pixel in the spectrum diagram can be transformed into a trigonometric function through inverse Fourier transform.

[0104] The closer the pixel is to the center pixel of the low-frequency area, the lower the frequency is and the larger the minimum positive period is. On the contrary, the farther the pixel is from the center pixel of the low-frequency area, the higher the frequency is and the smaller the minimum positive period is. The minimum positive period of the trigonometric function corresponding to pixels To represent the distance between the pixel and the center pixel of the low-frequency area.

[0105] In the high frequency region The gray value of the pixel before polishing is As polishing continues, the gray value of the pixel whose distance from the center pixel of the low-frequency area remains unchanged due to the reduction of high-frequency components. It will also decrease.

[0106] According to the polishing process The change of The coefficient of variation of the component of each pixel ,as follows:

[0107]

[0108] In the formula, Indicates The minimum positive period of the trigonometric function corresponding to pixels.

[0109] S207, calculating the polishing degree of the mold surface and adjusting the polishing machine.

[0110] The degree of polishing of the mold surface can be analyzed by the energy change in the high-frequency area of ​​the spectrum. The greater the energy change in the high-frequency area and the greater the reduction, the fewer areas with uneven grayscale distribution on the mold surface, that is, the higher the degree of polishing. The degree of polishing of the mold surface can be obtained based on the energy variation coefficient obtained from the grayscale histogram and the component variation coefficient of each pixel point in the high-frequency area.

[0111] The energy variation coefficient obtained from the grayscale histogram is , the component variation coefficient of each pixel in the high-frequency area is , then:

[0112]

[0113] in, Indicates the degree of polishing of the mold surface. The larger the value is, the greater the overall energy change in the high-frequency area is, which reflects the higher degree of polishing of the mold surface. Indicates the number of pixels in the high-frequency area.

[0114] Adjust the polishing machine according to the polishing degree. If the mold requirements are met, replace the processing mold; if the mold requirements are not met, continue polishing.

[0115] The beneficial effects of this embodiment are as follows: this embodiment processes the mold surface images before and after polishing based on computer vision and image processing to obtain the mold surface spectrum before and after polishing, and uses the characteristics of the mold surface spectrum before and after polishing to obtain the polishing degree of the mold surface, and then adjusts the polishing machine, effectively improving the detection efficiency and accuracy.

[0116] 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 spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for detecting the degree of polishing of mold surface based on vision, It is characterized in that include: Obtaining a mold surface edge image before polishing, a mold surface spectrum image, and a mold surface spectrum image at the current moment during the polishing process; Covering the low-frequency region in the spectrum of the mold surface before polishing, and performing inverse Fourier transformation on the covered spectrum to obtain an inversely transformed binary image of the mold surface before polishing; Determine the low-frequency region and the high-frequency region in the spectrum map of the mold surface before polishing by using the grayscale values ​​of the pixels in the binary map of the mold surface before polishing and the edge map of the mold surface before polishing; The low-frequency region in the mold surface spectrum before polishing is used to obtain the mold surface spectrum before polishing containing only the high-frequency region and the mold surface spectrum at the current moment during the polishing process; The grayscale histograms of the mold surface spectrum before polishing containing only the high-frequency area and the mold surface spectrum at the current moment during the polishing process are respectively obtained, and the energy variation coefficient of the high-frequency area in the mold surface spectrum at the current moment during the polishing process is calculated by using the grayscale values ​​of the peaks in the two grayscale histograms and the ratio of the peak grayscale values; the ratio of the peak grayscale value refers to: the ratio of the number of pixel points corresponding to the peak grayscale value to the number of all pixel points in the grayscale histogram, that is, the frequency of occurrence of the peak grayscale value; Performing inverse Fourier transform on the mold surface spectrum before polishing that only includes the high-frequency region, and obtaining the minimum positive period of the trigonometric function corresponding to each pixel point in the mold surface spectrum before polishing that only includes the high-frequency region; The component variation coefficient of each pixel point in the high-frequency area of ​​the mold surface spectrum diagram at the current moment during the polishing process is calculated by using the gray value of the pixel point in the mold surface spectrum diagram before polishing that only contains the high-frequency area, the gray value of the pixel point in the mold surface spectrum diagram at the current moment during the polishing process that only contains the high-frequency area, and the minimum positive period of the trigonometric function corresponding to the pixel point; The polishing degree of the mold surface at the current moment in the polishing process is calculated by using the energy variation coefficient of the high-frequency region in the spectrum diagram of the mold surface at the current moment in the polishing process and the component variation coefficient of each pixel point in the high-frequency region in the spectrum diagram; The polishing machine is adjusted according to the polishing degree of the mold surface at the current moment in the polishing process; The low-frequency area and the high-frequency area in the spectrum diagram of the mold surface before polishing are determined as follows: Subtract the grayscale value of the pixel in the inverse transformed binary image of the mold surface before polishing from the grayscale value of the corresponding pixel in the edge image of the mold surface before polishing, to obtain the grayscale value difference of all the pixels in the inverse transformed binary image of the mold surface before polishing; Count the gray value difference of each pixel in the binary image of the mold surface before polishing after inverse transformation; The matching degree between the binary image of the mold surface before polishing and the edge image of the mold surface before polishing after inverse transformation is calculated by using the number of pixels corresponding to each gray value difference and the number of pixels in the mold surface image before polishing; Setting a threshold value to judge the matching degree between the inverse transformed binary image of the mold surface before polishing and the edge image of the mold surface before polishing; When the matching degree between the inverse transformed binary image of the mold surface before polishing and the edge image of the mold surface before polishing is less than or equal to the threshold, the center of the spectrum image of the mold surface before polishing is taken as the center of the circle. The circular area with the radius is the low-frequency area of ​​the spectrum of the mold surface before polishing, and the other areas are the high-frequency areas of the spectrum of the mold surface before polishing; When the matching degree between the inverse transformed binary image of the mold surface before polishing and the edge image of the mold surface before polishing is greater than the threshold, the arithmetic difference increases. The above steps are repeated for iterative matching until the matching degree between the inverse transformed binary image of the mold surface before polishing and the edge image of the mold surface before polishing is less than or equal to the threshold value, the iteration stops, and the low-frequency area and the high-frequency area in the spectrum image of the mold surface before polishing are determined; The energy variation coefficient is: in, The gray value corresponding to the peak of the gray histogram of the spectrum diagram of the mold surface image before polishing, It represents the ratio of the gray value, that is, the ratio of the number of pixels corresponding to the gray value to the number of all pixels in the gray histogram; It represents the gray value corresponding to the peak value of the gray histogram of the spectrum diagram of the mold surface image during the polishing process. Indicates the ratio of the gray value; The component variation coefficient is: in, Indicates The minimum positive period of the trigonometric function corresponding to the pixel points, In the high frequency region The gray value of each pixel during polishing. In the high frequency region Gray value of each pixel before polishing; The expression of the polishing degree of the mold surface at the current moment in the polishing process is specifically as follows: In the formula, Indicates the polishing degree of the mold surface at the current moment in the polishing process. Indicates the energy variation coefficient of the high-frequency area in the mold surface spectrum at the current moment during the polishing process. represents the component variation coefficient of the i-th pixel point in the high-frequency area of ​​the mold surface spectrum at the current moment during the polishing process, and n represents the number of pixels in the high-frequency area of ​​the mold surface spectrum at the current moment during the polishing process; The mold surface edge map before polishing, the mold surface spectrum map and the mold surface spectrum map at the current moment during the polishing process are obtained in the following manner: Collecting mold surface images before polishing and at the current moment during polishing; Grayscale processing is performed on the mold surface images before polishing and at the current moment during the polishing process to obtain grayscale images of the mold surface before polishing and at the current moment during the polishing process; Perform edge detection on the grayscale image of the mold surface before polishing to obtain an edge image of the mold surface before polishing; Performing Fourier transform on the grayscale image of the mold surface before polishing and at the current moment during polishing to obtain the spectrum image of the mold surface before polishing and at the current moment during polishing; The binary image of the mold surface before polishing after the inverse transformation is obtained as follows: Set the center of the spectrum of the mold surface before polishing as the center of the circle. A circular area with a radius of 0 is set, and the pixel values ​​of all the pixels in the circular area of ​​the spectrum of the mold surface before polishing are set to 0, so as to obtain the spectrum of the mold surface before polishing after covering; Performing inverse Fourier transformation on the spectrum of the mold surface before polishing after covering to obtain an inverse transformed image of the mold surface before polishing; Binarization is performed on the inverse transformed surface image of the mold before polishing to obtain an inverse transformed binary image of the surface of the mold before polishing; The energy variation coefficient of the high frequency region in the mold surface spectrum at the current moment during the polishing process is obtained as follows: The low-frequency region in the spectrum diagram of the mold surface before polishing is covered to obtain the spectrum diagram of the mold surface before polishing containing only the high-frequency region; Overlaying the same region of the low-frequency region in the spectrum diagram of the mold surface at the current moment during the polishing process as that in the spectrum diagram of the mold surface before polishing, to obtain the spectrum diagram of the mold surface at the current moment during the polishing process that only includes the high-frequency region; A grayscale histogram of a mold surface spectrum before polishing containing only high-frequency areas and a mold surface spectrum at the current moment during the polishing process is obtained, and the energy variation coefficient of the high-frequency area in the mold surface spectrum at the current moment during the polishing process is calculated using the grayscale values ​​of the peaks in the two grayscale histograms and the ratio of the peak grayscale values; the ratio of the peak grayscale value refers to: the ratio of the number of pixels corresponding to the peak grayscale value to the number of all pixels in the grayscale histogram, that is, the frequency of occurrence of the peak grayscale value.

2. A method for detecting the degree of polishing of a mold surface based on vision according to claim 1, It is characterized in that The process of adjusting the polishing machine is as follows: The polishing degree of the mold surface at the current moment in the polishing process is judged: when the polishing degree of the mold surface at this moment has reached the polishing degree requirement of the mold, the polishing is stopped and a new mold is replaced for polishing; when the polishing degree of the mold surface at this moment does not reach the polishing degree requirement of the mold, the polishing is continued.

Citation Information

Patent Citations

  • Polished surface detection method and system based on image processing

    CN106530291A

  • Time-frequency spectrum application method and device

    CN108416674A

  • Thread defect analysis method and system based on computer vision

    CN113971670A

  • Edge detection method and system based on image multi-dimensional analysis

    CN113989313A

  • Metal part surface scratch detection method based on image enhancement

    CN115359044A