Strain clamp forging flaw testing system and method based on optical means
The optical tension clamp forging defect testing system uses vibration detection and Fourier transform to remove image blur, combined with histogram equalization and dynamic threshold segmentation, to solve the problems of low efficiency and poor accuracy of traditional detection, and achieve efficient and accurate detection of tension clamp defects.
Patent Information
- Application Number
- CN202511021677.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-07-24
AI Technical Summary
Traditional manual visual inspection of tension clamp defects is inefficient and easily affected by subjective factors. Existing non-destructive testing methods are costly and not suitable for rapid detection. Optical inspection results in blurred images under forging vibration, affecting the accuracy of defect testing.
An optical-based tension clamp forging defect testing system is adopted, which includes a vibration detection unit, a fuzzy mapping unit and a segmentation test unit. The forging process is monitored by an optical vibration sensor, and image blur is removed using Fourier transform and deep learning models. The defect points are segmented by combining histogram equalization and dynamic threshold setting.
It improves the significance of the surface detail features of the tension clamp, enhances the accuracy of defect testing, can timely detect tiny defects and distinguish detail features from rough background, and improves detection efficiency and product quality reliability.
Smart Images

Figure CN120820546A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of defect testing, and in particular to a system and method for testing forging defects of a tension clamp based on optical means. Background Art
[0002] As a key hardware component used to secure conductors, withstand conductor tension, and connect conductors to insulator strings or towers, the quality of tension clamps directly affects the safety and reliability of power transmission. Therefore, accurate defect detection of tension clamps is crucial to ensuring stable operation of power systems.
[0003] Traditionally, defect detection for tension clamps relies primarily on manual visual inspection. However, this approach has significant drawbacks. Manual inspection efficiency is extremely low, making it difficult to meet the speed requirements of large-scale production. Furthermore, inspection results are susceptible to subjective factors, making accuracy and consistency uncertain. Minor defects often go undetected.
[0004] To compensate for the shortcomings of manual inspection, some non-destructive testing methods such as ultrasonic testing and X-ray testing have been introduced. Although these methods can detect internal defects in tension clamps, the equipment purchase cost is high, the testing process is complex, and professional operators are required. At the same time, their detection effect on surface defects is not as intuitive as optical inspection methods, and the detection speed is slow, making them unsuitable for rapid inspection on the production line.
[0005] Based on the above situation, optical detection methods have gradually attracted attention. However, in actual applications, the vibration generated by the tension clamp during the forging process will cause blurred optical imaging. Therefore, traditional deblurring methods are usually used to remove the blur kernel in the image and improve the image clarity. Although the clarity of the image is improved, the detailed features of the surface of the tension clamp are still not obvious enough. This is because the tiny surface defects caused by the vibration of the tension clamp during forging will be obscured by the rough background in the image, seriously affecting the accuracy and effectiveness of the defect test. Therefore, we provide a tension clamp forging defect test system and method based on optical means. Summary of the Invention
[0006] The object of the present invention is to provide a system and method for testing forging defects of tension clamps based on optical means, so as to solve the problems raised in the above-mentioned background technology.
[0007] To achieve the above objectives, one of the objectives of the present invention is to provide a tension clamp forging defect testing system based on optical means, comprising a vibration detection unit, a fuzzy mapping unit and a segmentation testing unit;
[0008] The vibration detection unit uses an optical vibration sensor to monitor the vibration data of the tension clamp during the forging process to trigger the image sensor, and obtains the image of the tension clamp through the image sensor to be regarded as a blurred image of the tension clamp;
[0009] The fuzzy mapping unit is used to generate an equalized image in response to the blurred tension clamp image in the vibration detection unit, and performs the following steps:
[0010] The blurred image of the tension clamp is first converted into a grayscale image, and then a two-dimensional Fourier transform is used to obtain the converted frequency domain blurred image of the tension clamp to analyze the amplitude spectrum characteristics of the blurred image of the tension clamp;
[0011] The deep learning model is used to combine the amplitude spectrum features of the blurred image of the tension clamp and output the fuzzy parameters. The fuzzy parameters are then combined with the known parameters in the fuzzy kernel to evaluate the fuzzy kernel of the blurred tension clamp image.
[0012] The blur kernel is converted into the frequency domain of the blur kernel using Fourier transform, the frequency domain of the blurred image of the tension clamp is extracted and divided by the frequency domain of the blur kernel, and then the deblurred image of the tension clamp is obtained using inverse Fourier transform.
[0013] The pixel frequencies of the grayscale values in the deblurred tension clamp image are counted, the cumulative distribution of the grayscale values is calculated, and the cumulative distribution of the grayscale values is linearly mapped to the target grayscale range. The new grayscale values are used to replace the grayscale values of the pixels in the deblurred tension clamp image, thereby generating a balanced image.
[0014] The segmentation test unit is used to receive the equalized image in the fuzzy mapping unit and perform segmentation to implement defect point testing, and implement the following test steps:
[0015] Traverse the pixels in the equalized image to obtain a grayscale histogram, and divide it into several sub-images to determine whether the marked sub-image is a background sub-image or a target sub-image, and record the grayscale values of the marked target sub-image and the marked background sub-image;
[0016] The grayscale values of the marked background sub-image and the grayscale values of the marked target sub-image are used to calculate the grayscale mean of the marked background sub-image and the grayscale mean of the marked target sub-image respectively, and then the relative contrast is calculated to test whether the marked target sub-image is an abnormal sub-image;
[0017] Dynamically set the grayscale threshold and tolerance error threshold of the marked background sub-image, then extract the grayscale value of the pixel point from the abnormal target sub-image and combine it with the grayscale threshold and tolerance error threshold of the marked background sub-image to test that the pixel point extracted from the abnormal target sub-image is a defect point;
[0018] The target sub-image of the splicing mark is a complete target image. The defect points in the target image are connected to form the defect shape to evaluate the quality of the tension clamp.
[0019] As a further improvement of the present technical solution, the conversion mapping module is used to receive the blur kernel and the converted frequency domain tension clamp blurred image in the blur kernel module, use Fourier transform to convert the blur kernel into the frequency domain of the blur kernel, and then extract the frequency domain of the tension clamp blurred image from the converted frequency domain tension clamp blurred image, divide the frequency domain of the tension clamp blurred image by the frequency domain of the blur kernel, and then perform inverse Fourier transform to convert the converted frequency domain tension clamp blurred image back to the spatial domain, thereby obtaining the deblurred tension clamp image.
[0020] As a further improvement of the present technical solution, the conversion mapping module further uses a histogram equalization method to implement image enhancement on the deblurred tension clamp image, and performs the following implementation steps:
[0021] First, the frequency of occurrence of pixel points of the deblurred tension clamp image is counted, and the total number of pixels is recorded. The cumulative distribution value of the gray value is calculated by the pixel frequency H, the total number of pixels N and the gray value k. Among them, H i Refers to the frequency of occurrence of the i-th pixel;
[0022] Linearly map the cumulative distribution value of the grayscale value to the target grayscale range to obtain the new grayscale value Here, round refers to the rounding operation, and then the grayscale values of the pixels in the deblurred tension clamp image are replaced with the corresponding new grayscale values to generate a balanced image.
[0023] As a further improvement of the present technical solution, the segmentation and marking module is used to receive the equalized image in the conversion mapping module, traverse the pixel points in the equalized image to obtain a grayscale histogram, divide the grayscale histogram into several sub-images, extract the number of pixels in the sub-image and mark the sub-image, and judge whether the marked sub-image is the main peak or the secondary peak based on the number of pixels corresponding to the marked sub-image. The main peak refers to the marked background sub-image, and the secondary peak refers to the marked target sub-image, and the grayscale values of the marked target sub-image and the marked background sub-image are recorded.
[0024] As a further improvement of the present technical solution, the defect point module is used to receive the grayscale value of the background sub-image marked in the segmentation and marking module and the grayscale value of the marked target sub-image to implement a test to determine whether the marked target sub-image is an abnormal sub-image, and implement the following test steps:
[0025] Calculate the grayscale mean of the marked background sub-image and the grayscale mean of the marked target sub-image respectively through the grayscale value of the marked background sub-image and the grayscale value of the marked target sub-image, and then calculate the grayscale variance of the marked background sub-image and the grayscale variance of the marked target sub-image respectively;
[0026] The relative contrast is calculated using the grayscale mean of the marked background sub-image and the grayscale mean of the marked target sub-image.
[0027] A relative contrast threshold is set, and the target sub-image marked as an abnormal sub-image is tested using the relative contrast and the relative contrast threshold.
[0028] As a further improvement of the present technical solution, the defect point module further tests the grayscale variance of the marked background sub-image, the grayscale variance of the marked target sub-image, the grayscale mean of the marked background sub-image, and the grayscale mean of the marked target sub-image to extract pixels as defect points and the defect shape in the abnormal target sub-image, and implements the following test steps:
[0029] According to the grayscale variance of the marked background sub-image and the grayscale variance of the marked target sub-image, the grayscale threshold and tolerance error threshold of the marked background sub-image are dynamically set, and then the grayscale value of the pixel point is extracted from the abnormal target sub-image;
[0030] The absolute value between the pixel and the background sub-image and the absolute value between the pixel and the target sub-image are calculated respectively using the gray value of the pixel, the gray mean of the marked background sub-image and the gray mean of the marked target sub-image;
[0031] When the absolute value of the pixel point and the background sub-image is greater than the grayscale threshold of the background sub-image, and the absolute value of the pixel point and the target sub-image is greater than the tolerance error threshold, the pixel point extracted from the abnormal target sub-image is tested as a defect point, and the position of the defect point is recorded;
[0032] The marked target sub-images are spliced into a target image, and then connected on the target image according to the location of the defect points to form the defect shape, and the quality of the tension clamp is evaluated based on the defect shape.
[0033] A second object of the present invention is to provide a method for operating a tension clamp forging defect testing system based on optical means as described above, comprising the following steps:
[0034] S1. The vibration detection unit uses an optical vibration sensor to monitor the vibration data of the tension clamp during the forging process to trigger the image sensor, and obtains an image of the tension clamp through the image sensor to be regarded as a blurred image of the tension clamp;
[0035] S2. The fuzzy mapping unit converts the blurred tension clamp image into a grayscale image, obtains the converted frequency domain blurred tension clamp image through two-dimensional Fourier transform, analyzes the amplitude spectrum characteristics, uses a deep learning model combined with the amplitude spectrum characteristics to output fuzzy parameters, evaluates the fuzzy kernel, and obtains the deblurred tension clamp image through inverse Fourier transform. It then generates an equalized image to make the grayscale values of the detailed features on the tension clamp surface different from those of the surrounding background.
[0036] S3. The segmentation test unit generates a grayscale histogram of the equalized image and divides it into several sub-images, then marks them, determines whether the marked sub-image is a background sub-image or a target sub-image, records the grayscale values of the target sub-image and the background sub-image to calculate the grayscale mean of the marked background and target sub-image, and simultaneously calculates the relative contrast to test whether the marked target sub-image is an abnormal sub-image, and then tests for defects by dynamically setting the marked background grayscale threshold and the tolerance error threshold.
[0037] Compared with the prior art, the present invention has the following beneficial effects:
[0038] 1. In the optical-based tension clamp forging defect testing system and method, the conversion mapping module performs grayscale histogram statistics on the deblurred tension clamp image, calculates the cumulative distribution value of the grayscale value, linearly maps the cumulative distribution value of the grayscale value to the target grayscale range, generates a new grayscale value after rounding, and then realizes image equalization by pixel grayscale replacement. Through image enhancement through image equalization, the detailed features of the tension clamp surface are more obvious in the equalized image, and the detailed features of the tension clamp surface are reduced from being obscured by the rough background in the deblurred tension clamp image, and the difference between the grayscale value of the detailed features on the tension clamp surface and the surrounding rough background area is increased. The accuracy of the defect test is increased by distinguishing the grayscale of the detailed features and the rough background.
[0039] 2. In the optical-based tension clamp forging defect testing system and method, the defect point module dynamically sets the marked background sub-image threshold and the tolerance error threshold based on the grayscale variance of the marked background and target sub-images, extracts the grayscale value of the pixel points in the abnormal target sub-image, calculates the absolute value of the pixel points and the background sub-image and the absolute value of the pixel points and the target sub-image, tests the extracted pixel points in the abnormal target sub-image as defect points, and records the defect point positions. By splicing into a complete target image and connecting the defect points to form the defect shape, the quality assessment of the tension clamp is completed. By comprehensively considering the grayscale differences between pixel points, background and target, and combining with dynamically set thresholds, it is possible to distinguish between tiny defects on the surface of the tension clamp and the rough background in the equalized image, reduce the masking of tiny defects on the surface of the tension clamp by the rough background in the equalized image, and highlight the real tiny defects from the rough background, thereby improving the accuracy of tiny surface defect testing. At the same time, defective products of the tension clamp can be detected through the shape of the defects, and can be repaired or scrapped in time to avoid unqualified defective products from entering the market and improve the overall quality and reliability of the tension clamp products. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a block diagram of the overall system framework of the present invention;
[0041] Figure 2 It is a block diagram of the overall module flow of the present invention;
[0042] Figure 3 A flowchart of the steps for generating an equalized image by the conversion mapping module of the present invention;
[0043] Figure 4 This is a flowchart of the defect point testing process of the defect point module of the present invention;
[0044] Figure 5 It is a flowchart of the overall method steps of the present invention.
[0045] The meaning of each number in the figure is:
[0046] 1. Vibration detection unit; 11. Vibration trigger module; 12. Variance detection module;
[0047] 2. Fuzzy mapping unit; 21. Fuzzy kernel module; 22. Transformation mapping module;
[0048] 3. Segmentation test unit; 31. Segmentation marking module; 32. Defect point module. DETAILED DESCRIPTION
[0049] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 making any creative efforts shall fall within the scope of protection of the present invention.
[0050] Example 1
[0051] See also Figure 1 As shown, one of the purposes of this embodiment is to provide a tension clamp forging defect testing system based on optical means, including a vibration detection unit 1, a fuzzy mapping unit 2 and a segmentation testing unit 3;
[0052] The invention comprises a vibration detection unit 1 which uses an optical vibration sensor to monitor the vibration data of the tension clamp during the forging process to trigger the image sensor, and obtains the tension clamp image through the image sensor to regard it as a blurred tension clamp image; a fuzzy mapping unit 2 is used to generate an equalized image in response to the blurred tension clamp image in the vibration detection unit 1, and first converts the blurred tension clamp image into a grayscale image, and then uses a two-dimensional Fourier transform to obtain the converted frequency domain tension clamp blurred image to analyze the amplitude spectrum characteristics of the blurred image of the tension clamp; through a deep learning model The model combines the amplitude spectrum characteristics of the fuzzy image of the tension clamp and outputs the fuzzy parameters, and then uses the fuzzy parameters combined with the known parameters in the fuzzy kernel to evaluate the fuzzy kernel of the fuzzy tension clamp image; uses Fourier transform to convert the fuzzy kernel into the frequency domain of the fuzzy kernel, extracts the frequency domain of the fuzzy image of the tension clamp and divides it by the frequency domain of the fuzzy kernel, and then uses inverse Fourier transform to obtain the deblurred tension clamp image; counts the pixel frequency of the grayscale value in the deblurred tension clamp image, calculates the cumulative distribution value of the grayscale value, and linearly maps the cumulative distribution value of the grayscale value to the target grayscale range The new grayscale value is obtained to replace the grayscale value of the pixel point in the deblurred tension clamp image, thereby generating an equalized image; the segmentation test unit 3 receives the equalized image in the fuzzy mapping unit 2 for segmentation to realize the test of defect points, traverses the pixel points in the equalized image to obtain a grayscale histogram, and divides it into several sub-images to determine whether the marked sub-image is a background sub-image or a target sub-image, and records the grayscale values of the marked target sub-image and the marked background sub-image; the grayscale mean of the marked background sub-image and the grayscale mean of the marked target sub-image are calculated by the grayscale value of the marked background sub-image and the grayscale value of the marked target sub-image respectively, and then the relative contrast is calculated to test whether the marked target sub-image is an abnormal sub-image; the grayscale threshold and the tolerance error threshold of the marked background sub-image are dynamically set, and then the grayscale value of the pixel point extracted from the abnormal target sub-image is combined with the grayscale threshold and the tolerance error threshold of the marked background sub-image to test that the pixel point extracted from the abnormal target sub-image is a defect point; the marked target sub-images are spliced into a complete target image, and the defect points are connected in the target image to form a defect shape to evaluate the quality of the tension clamp.
[0053] The following is a refinement of the above units, see Figure 2-Figure 4 shown
[0054] The vibration detection unit 1 includes a vibration trigger module 11 and a variance detection module 12;
[0055] The vibration trigger module 11 uses an optical vibration sensor with optical means to monitor the vibration data of the tension clamp during the forging process, and obtains the monitored vibration data. The monitored vibration data includes the vibration amplitude of the tension clamp during the forging process and the vibration frequency of the tension clamp during the forging process, and then sets the vibration amplitude threshold and the vibration frequency threshold. The vibration amplitude of the tension clamp during the forging process and the vibration frequency of the tension clamp during the forging process are respectively tested with the vibration amplitude threshold and the vibration frequency threshold to determine whether the image sensor is triggered. When the vibration amplitude of the tension clamp during the forging process is greater than the vibration amplitude threshold, and the vibration frequency of the tension clamp during the forging process is greater than the vibration frequency threshold, it indicates that the clarity of the optical imaging will be affected and the image sensor will be triggered. For example, when the vibration amplitude exceeds 0.5mm and the vibration frequency is higher than 50Hz, the possibility of optical imaging blur will be greatly increased;
[0056] The variance detection module 12 receives the trigger image sensor command from the vibration trigger module 11, obtains the image of the tension clamp during the forging process through the image sensor, obtains the tension clamp image, and then extracts the grayscale value f(x, y) and the number of pixels N at the pixel point (x, y) in the tension clamp image, and uses the four-neighborhood Laplace kernel to calculate the Laplace response value L of the i-th pixel point according to the grayscale value f(x, y) at the pixel point i , according to the Laplace response value L of the i-th pixel i The average value μ of the Laplace response value is calculated based on the number of pixels N, the average value μ of the Laplace response value and the Laplace response value L of the i-th pixel. i (x,y) calculates the Laplace variance Laplace variance is extremely sensitive to sudden grayscale changes in an image and can highlight the edges and details of the image. When the tension clamp image is blurred due to vibration, its edges and details will become blurred, and the grayscale changes will tend to be gentle. By calculating the Laplace variance and comprehensively considering the difference between the Laplace response value and the average value of each pixel in the tension clamp image, it can accurately capture the changes in pixel details in the tension clamp image.
[0057] A Laplace variance threshold is set, and the Laplace variance and the Laplace variance threshold are used to detect whether the vibration generated by the tension clamp during the forging process causes optical imaging blur. When the Laplace variance is lower than the Laplace variance threshold, it indicates that the clarity of the tension clamp image is low, and it is detected that the vibration generated by the tension clamp during the forging process causes optical imaging blur. The tension clamp image is regarded as a blurred tension clamp image. For example, for a normal and clear tension clamp image, the Laplace variance value is usually above 100. When the detected Laplace variance is only 30, it can be determined that the tension clamp image has an optical imaging blur problem.
[0058] The implementation process of calculating the Laplace response value of each pixel is as follows:
[0059] Determine the kernel matrix of the four-neighborhood Laplacian kernel:
[0060] The Laplace response value L of the i-th pixel is calculated according to the grayscale value f(x,y) at the pixel point through the kernel matrix of the four-neighborhood Laplace kernel i , the specific algorithm formula is:
[0061] L i =f(x+1,y)+f(x-1,y)+f(x,y-1)-4f(x,y);
[0062] Among them, this formula is used to calculate the Laplace response value of the pixel point. The structure of the tension clamp is relatively complex, and the image features of different parts may be different. When calculating the average value of the Laplace response value, all pixels in the tension clamp image are taken into account, and the image features of different areas can be comprehensively evaluated. Whether it is the main part of the clamp or the special areas of the edges and holes, they can all be reflected in the average value, ensuring that the blur detection of the entire tension clamp image is accurate and reliable.
[0063] The fuzzy mapping unit 2 includes a fuzzy kernel module 21 and a conversion mapping module 22;
[0064] The blur kernel module 21 receives the optical imaging blur command caused by the vibration generated by the tension wire clamp during the forging process in the variance detection module 12, and the blur kernel module 21 obtains the blurred tension wire clamp image from the variance detection module 12. Since the blurred tension wire clamp image is a color image, the blurred tension wire clamp image is first converted into a grayscale image to obtain a blurred tension wire clamp grayscale image, and then the blurred tension wire clamp grayscale image is applied with a two-dimensional Fourier transform to obtain a converted frequency domain tension wire clamp blurred image and analyze the amplitude spectrum characteristics of the tension wire clamp blurred image, wherein the amplitude spectrum characteristics of the tension wire clamp blurred image include motion blur, defocus blur and Gaussian blur, and the amplitude spectrum characteristics of the tension wire clamp blurred image are input into the deep learning model, and the deep learning model analyzes the blur parameters (such as the length / angle of motion blur, Gaussian blur) in combination with the amplitude spectrum characteristics of the tension wire clamp blurred image. The standard deviation of the blur is obtained and the blur parameters are output. Then, the blur kernel of the blurred tension clamp image is evaluated according to the blur parameters and the known parameters in the blur kernel (such as the motion blur kernel (length / angle), the Gaussian blur kernel (standard deviation), and the defocus blur kernel (radius)). The blur kernel describes the degradation mode of the blurred tension clamp image during the blurring process. It reflects the influence of vibration on the clamp image. By evaluating the blur kernel, the search space can be narrowed. The known blur kernel parameters provide a general direction. There is no need to blindly search in the entire parameter space. Instead, the optimization can be concentrated in the parameter area related to the evaluated blur kernel. This can greatly reduce the amount of calculation and running time, and improve the efficiency of deblurring. In particular, when processing a large number of blurred tension clamp images, the processing time can be significantly shortened, thereby improving the detection efficiency when processing a large number of blurred tension clamp images.
[0065] Analyze the frequency distribution of the fuzzy image of the tension clamp in the frequency domain to achieve the following process:
[0066] Extracting a spectrum from the transformed frequency domain tension clamp fuzzy image, calculating the zero-frequency component of the spectrum based on the spectrum, and moving the zero-frequency component of the spectrum to the center position to obtain a centralized complex spectrum;
[0067] Since the complex spectrum contains the amplitude and phase information of the spectrum, the amplitude of the spectrum is extracted from the centralized complex spectrum, and then the logarithm of the amplitude of the spectrum is taken to obtain the logarithmic amplitude spectrum;
[0068] When directional stripes appear in the logarithmic amplitude spectrum (the direction of the stripes is perpendicular to the blur direction), it is motion blur; when concentric rings appear in the logarithmic amplitude spectrum (the radius of the rings is related to the degree of blur), it is defocus blur; when the overall high-frequency attenuation of the logarithmic amplitude spectrum is observed (no significant geometric features), it is Gaussian blur.
[0069] Motion blur, defocus blur and Gaussian blur are considered as amplitude spectrum features of the blurred image of the tension clamp.
[0070] See also Figure 3 As shown, the conversion mapping module 22 receives the blur kernel and the converted frequency domain strain clamp blurred image in the blur kernel module 21, converts the blur kernel into the frequency domain of the blur kernel using Fourier transform, extracts the frequency domain of the strain clamp blurred image from the converted frequency domain strain clamp blurred image, divides the frequency domain of the strain clamp blurred image by the frequency domain of the blur kernel, and then performs inverse Fourier transform to convert the converted frequency domain strain clamp blurred image back into the spatial domain, thereby obtaining a deblurred strain clamp image. Although the clarity of the deblurred strain clamp image is improved, the detailed features of the strain clamp surface may still not be obvious enough;
[0071] The reason why it is not obvious is that the tension clamp will produce tiny surface defects due to vibration during the forging process. These tiny defects will be masked by the rough background in the deblurred tension clamp image, affecting the detection of defects.
[0072] Therefore, we use the histogram equalization method to enhance the image of the deblurred tension clamp. First, we count the occurrence frequency H of each pixel with a gray value k (such as 0 to 255) in the deblurred tension clamp image and record the total number of pixels N. Then, we calculate the cumulative distribution value of the gray value by the pixel occurrence frequency H, the total number of pixels N and the gray value k. Among them, H i Refers to the frequency of occurrence of the i-th pixel;
[0073] Linearly map the cumulative distribution value of the grayscale value to the target grayscale range (such as 0 to 255) to obtain the new grayscale value Among them, round refers to the rounding operation. The essence of this operation is to stretch the grayscale range of the deblurred tension clamp image. The originally concentrated grayscale distribution will become more dispersed after linear mapping, covering a wider grayscale range (for example, pixels with grayscale values originally concentrated between 50-150 may be distributed in a wider range of 0-255 after mapping). This stretching of the grayscale range increases the grayscale difference between different areas in the deblurred tension clamp image. The detailed features on the tension clamp surface (such as tiny scratches and textures) are not obvious in the deblurred tension clamp image because of the small grayscale difference. However, after the grayscale range is stretched, the grayscale values of the areas where these detailed features are located become more different from those of the surrounding areas, thereby improving the accuracy of visual inspection;
[0074] The grayscale value of each pixel in the deblurred tension clamp image is replaced with the corresponding new grayscale value to generate an equalized image. Image enhancement is performed through histogram equalization. The detailed features of the tension clamp surface are more obvious in the equalized image, reducing the chance that minor defects on the tension clamp surface are masked by the rough background in the deblurred tension clamp image, which is beneficial for subsequent defect testing.
[0075] The segmentation test unit 3 includes a segmentation marking module 31 and a defect point module 32;
[0076] The segmentation and labeling module 31 receives the equalized image from the conversion mapping module 22, traverses all pixels in the equalized image, and counts the frequency of occurrence of each grayscale value (0-255) in the equalized image. By counting the frequency of occurrence of each grayscale value, discrete data (discrete grayscale values) is obtained. The discrete data is converted into a visual chart to obtain a grayscale histogram. The grayscale histogram is segmented into a number of sub-images (e.g., α sub-images), and the number of pixels in the sub-images is extracted. The sub-images are then labeled differently (e.g., labeling sub-image 1, sub-image 2, etc.). ., sub-image α), obtain the marked sub-image, judge whether the marked sub-image is the main peak or the secondary peak by the number of pixels corresponding to the marked sub-image, set the pixel number threshold, when the number of pixels corresponding to the marked sub-image is greater than the pixel number threshold, it means that the number of pixels is large and the distribution is concentrated, and the marked sub-image is judged to be the main peak (background sub-image), and the grayscale value of the marked background sub-image is recorded. When the number of pixels corresponding to the marked sub-image is less than the pixel number threshold, the marked sub-image is judged to be the secondary peak (target sub-image), and the grayscale value of the marked target sub-image is recorded;
[0077] The defect point module 32 receives the grayscale value of the marked background sub-image, the grayscale value of the marked target sub-image, and the number of pixels of the sub-image in the segmentation and marking module 31, and calculates the grayscale mean of the marked background sub-image and the grayscale mean of the marked target sub-image according to the grayscale value of the marked background sub-image, the grayscale value of the marked target sub-image, and the number of pixels of the sub-image, and then calculates the grayscale variance σ of the marked background sub-image according to the grayscale value of the marked background sub-image, the grayscale value of the marked target sub-image, the number of pixels of the sub-image, the grayscale mean of the marked background sub-image, and the grayscale mean of the marked target sub-image. bg and the grayscale variance σ of the marked target sub-image target , using the gray mean μ of the marked background sub-image bg and the grayscale mean μ of the marked target sub-image target Calculating relative contrast Then, a relative contrast threshold is set, and the relative contrast and the relative contrast threshold are used to test whether the marked target sub-image is an abnormal sub-image. When the relative contrast is greater than the relative contrast threshold, the marked target sub-image is tested to be an abnormal sub-image and recorded as an abnormal target sub-image.
[0078] When the marked target sub-image is tested to have an abnormal defect, the grayscale variance σ of the marked background sub-image is used to determine the abnormal defect. bg Dynamically set the grayscale threshold of the marked background sub-image T = β × σ bg , where β is a coefficient, usually 2 or 3, and then according to the grayscale variance σ of the marked target sub-image target Dynamically set the tolerance error threshold ∈=γ×σ target , γ is a coefficient, usually 1 or 2, and the gray value I of a pixel is extracted from the abnormal target sub-image. The gray value of the pixel, the gray mean of the marked background sub-image, and the gray mean of the marked target sub-image are used to calculate the absolute value of the pixel and the background sub-image |I-μ bg |The absolute value of the pixel and the target sub-image|I-μ target |, then use the absolute value of the pixel point and the background sub-image, the absolute value of the pixel point and the target sub-image, the grayscale threshold of the marked background sub-image, and the tolerance error threshold to test whether the pixel point extracted from the abnormal target sub-image is a defect point. When the absolute value of the pixel point and the background sub-image is greater than the grayscale threshold of the marked background sub-image, and the absolute value of the pixel point and the target sub-image is greater than the tolerance error threshold, the pixel point extracted from the abnormal target sub-image is tested to be a defect point, and the defect point position (that is, the pixel point position) is recorded. The marked target sub-image is spliced into a target image (tension clamp), and then connected on the target image according to the defect point position to form Defect shape: The quality of the tension clamp is evaluated by the defect shape. By comprehensively considering the grayscale differences between the pixel points and the background and target, and combining with the dynamic setting of the threshold, it is possible to distinguish between the tiny defects on the surface of the tension clamp and the rough background in the equalized image, reduce the tiny defects on the surface of the tension clamp being masked by the rough background in the equalized image, and highlight the real tiny defects from the rough background, thereby improving the accuracy of the tiny surface defect test. At the same time, the defective products of the tension clamp can be detected by the defect shape, and can be repaired or scrapped in time to avoid unqualified defective products from entering the market and improve the overall quality and reliability of the tension clamp products.
[0079] See also Figure 5 As shown, the second object of the present invention is to provide a method for operating the above-mentioned tension clamp forging defect testing system based on optical means, comprising the following method steps:
[0080] S1. The vibration detection unit 1 uses an optical vibration sensor to monitor the vibration data of the tension clamp during the forging process to trigger the image sensor, and obtains an image of the tension clamp through the image sensor to be regarded as a blurred image of the tension clamp;
[0081] S2, fuzzy mapping unit 2 converts the blurred tension clamp image into a grayscale image, obtains the converted frequency domain tension clamp blurred image through two-dimensional Fourier transform and analyzes the amplitude spectrum characteristics, uses a deep learning model combined with the amplitude spectrum characteristics to output fuzzy parameters, evaluates the fuzzy kernel, obtains the deblurred tension clamp image through inverse Fourier transform, and regenerates the equalized image so that the grayscale value of the detailed features on the surface of the tension clamp is different from that of the surrounding background;
[0082] S3, the segmentation test unit 3 generates a grayscale histogram of the equalized image and divides it into several sub-images, then marks them, determines whether the marked sub-image is a background sub-image or a target sub-image, records the grayscale values of the target sub-image and the background sub-image to calculate the grayscale mean of the marked background and target sub-image, and simultaneously calculates the relative contrast to test whether the marked target sub-image is an abnormal sub-image, and then tests out defect points by dynamically setting the marked background grayscale threshold and the tolerance error threshold.
[0083] The above shows and describes the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely preferred examples of the present invention and are not intended to limit the present invention. Various changes and improvements may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and improvements fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.
Claims
1. The optical-based tension clamp forging defect testing system is characterized by: The invention comprises a vibration detection unit (1), wherein the vibration detection unit (1) uses an optical vibration sensor to monitor vibration data of a tension clamp during a forging process to trigger an image sensor, and obtains an image of the tension clamp through the image sensor to be regarded as a blurred image of the tension clamp; and is characterized in that it further comprises: The fuzzy mapping unit (2) is used to generate an equalized image in response to the blurred tension clamp image in the vibration detection unit (1), and performs the following steps: The blurred image of the tension clamp is first converted into a grayscale image, and then a two-dimensional Fourier transform is used to obtain the converted frequency domain blurred image of the tension clamp to analyze the amplitude spectrum characteristics of the blurred image of the tension clamp; The deep learning model is used to combine the amplitude spectrum features of the blurred image of the tension clamp and output the fuzzy parameters. The fuzzy parameters are then combined with the known parameters in the fuzzy kernel to evaluate the fuzzy kernel of the blurred tension clamp image. The blur kernel is converted into the frequency domain of the blur kernel using Fourier transform, the frequency domain of the blurred image of the tension clamp is extracted and divided by the frequency domain of the blur kernel, and then the deblurred image of the tension clamp is obtained using inverse Fourier transform. The pixel frequencies of the grayscale values in the deblurred tension clamp image are counted, the cumulative distribution of the grayscale values is calculated, and the cumulative distribution of the grayscale values is linearly mapped to the target grayscale range. The new grayscale values are used to replace the grayscale values of the pixels in the deblurred tension clamp image, thereby generating a balanced image. The segmentation test unit (3) is used to receive the equalized image in the fuzzy mapping unit (2) and perform segmentation to implement defect point testing, and implement the following test steps: Traverse the pixels in the equalized image to obtain a grayscale histogram, and divide it into several sub-images to determine whether the marked sub-image is a background sub-image or a target sub-image, and record the grayscale values of the marked target sub-image and the marked background sub-image; The grayscale values of the marked background sub-image and the grayscale values of the marked target sub-image are used to calculate the grayscale mean of the marked background sub-image and the grayscale mean of the marked target sub-image respectively, and then the relative contrast is calculated to test whether the marked target sub-image is an abnormal sub-image; Dynamically set the grayscale threshold and tolerance error threshold of the marked background sub-image, then extract the grayscale value of the pixel point from the abnormal target sub-image and combine it with the grayscale threshold and tolerance error threshold of the marked background sub-image to test that the pixel point extracted from the abnormal target sub-image is a defect point; The target sub-image of the splicing mark is a complete target image. The defect points in the target image are connected to form the defect shape to evaluate the quality of the tension clamp.
2. The optical-based tension clamp forging defect testing system according to claim 1, characterized in that: The vibration detection unit (1) comprises a vibration trigger module (11) and a variance detection module (12); The vibration trigger module (11) uses an optical vibration sensor with optical means to monitor the vibration data of the tension clamp during the forging process, wherein the vibration data includes vibration amplitude and vibration frequency, and the vibration amplitude and vibration frequency are used to test whether the image sensor is triggered.
3. The optical-based tension clamp forging defect testing system according to claim 2, characterized in that: The variance detection module (12) is used to receive a command to trigger an image sensor in the vibration trigger module (11), obtain an image of the tension wire clamp during the forging process through the image sensor, extract the grayscale value of the pixel point in the tension wire clamp image, and calculate the Laplace variance based on the grayscale value of the pixel point using a four-neighborhood Laplace kernel; Laplace variance is used to detect whether the vibration of the tension clamp during the forging process causes optical imaging blur. When the vibration causes optical imaging blur, the tension clamp image is regarded as a blurred tension clamp image.
4. The optical-based tension clamp forging defect testing system according to claim 3, characterized in that: The fuzzy mapping unit (2) includes a fuzzy kernel module (21) and a conversion mapping module (22); The fuzzy kernel module (21) is used to receive the optical imaging fuzzy command caused by the vibration of the tension clamp during the forging process in the variance detection module (12). The fuzzy kernel module (21) responds to the fuzzy tension clamp image obtained in the variance detection module (12) to implement the evaluation of the fuzzy kernel and implement the following evaluation steps: The blurred image of the tension clamp is first converted into a grayscale image, and then the blurred grayscale image of the tension clamp is subjected to a two-dimensional Fourier transform to obtain a frequency domain blurred image of the tension clamp. The amplitude spectrum characteristics of the blurred image of the tension clamp are analyzed. The amplitude spectrum characteristics of the blurred image of the tension clamp include motion blur, defocus blur and Gaussian blur. The deep learning model is combined with the amplitude spectrum characteristics of the blurred image of the tension clamp to analyze the blur parameters and output the blur parameters, which include the length and angle of motion blur and the standard deviation of Gaussian blur. The blur kernel of the blurred tension clamp image is evaluated using the blur parameter and known parameters in the blur kernel. The known parameters in the blur kernel include a motion blur kernel and a Gaussian blur kernel.
5. The optical-based tension clamp forging defect testing system according to claim 4, characterized in that: The conversion mapping module (22) is used to receive the blur kernel and the converted frequency domain tension clamp blurred image in the blur kernel module (21), use Fourier transform to convert the blur kernel into the frequency domain of the blur kernel, then extract the frequency domain of the tension clamp blurred image from the converted frequency domain tension clamp blurred image, divide the frequency domain of the tension clamp blurred image by the frequency domain of the blur kernel, and then perform inverse Fourier transform to convert the converted frequency domain tension clamp blurred image back into the spatial domain, thereby obtaining a deblurred tension clamp image.
6. The optical-based tension clamp forging defect testing system according to claim 5, characterized in that: The conversion mapping module (22) further implements image enhancement on the deblurred tension clamp image using a histogram equalization method, and performs the following implementation steps: First, the frequency of occurrence of pixel points of the deblurred tension clamp image is counted, and the total number of pixels is recorded. The cumulative distribution value of the gray value is calculated by the pixel frequency H, the total number of pixels N and the gray value k. Among them, H i Refers to the frequency of occurrence of the i-th pixel; Linearly map the cumulative distribution value of the grayscale value to the target grayscale range to obtain the new grayscale value Here, round refers to the rounding operation, and then the grayscale values of the pixels in the deblurred tension clamp image are replaced with the corresponding new grayscale values to generate a balanced image.
7. The optical-based tension clamp forging defect testing system according to claim 6, characterized in that: The segmentation test unit (3) includes a segmentation marking module (31) and a defect point module (32); The segmentation and marking module (31) is used to receive the equalized image in the conversion mapping module (22), traverse the pixel points in the equalized image to obtain a grayscale histogram, divide the grayscale histogram into a plurality of sub-images, extract the number of pixel points of the sub-image and mark the sub-image, judge whether the marked sub-image is a main peak or a secondary peak based on the number of pixel points corresponding to the marked sub-image, the main peak refers to the marked background sub-image, and the secondary peak refers to the marked target sub-image, and record the grayscale values of the marked target sub-image and the marked background sub-image.
8. The optical-based tension clamp forging defect testing system according to claim 7, characterized in that: The defect point module (32) is used to receive the grayscale value of the background sub-image marked in the segmentation and marking module (31) and the grayscale value of the marked target sub-image to implement a test to determine whether the marked target sub-image is an abnormal sub-image, and to implement the following test steps: Calculate the grayscale mean of the marked background sub-image and the grayscale mean of the marked target sub-image respectively through the grayscale value of the marked background sub-image and the grayscale value of the marked target sub-image, and then calculate the grayscale variance of the marked background sub-image and the grayscale variance of the marked target sub-image respectively; The relative contrast is calculated using the grayscale mean of the marked background sub-image and the grayscale mean of the marked target sub-image. A relative contrast threshold is set, and the target sub-image marked as an abnormal sub-image is tested using the relative contrast and the relative contrast threshold.
9. The optical-based tension clamp forging defect testing system according to claim 8, characterized in that: The defect point module (32) then tests the grayscale variance of the marked background sub-image, the grayscale variance of the marked target sub-image, the grayscale mean of the marked background sub-image, and the grayscale mean of the marked target sub-image, thereby extracting pixels from the abnormal target sub-image as defect points and the defect shape, and implementing the following test steps: According to the grayscale variance of the marked background sub-image and the grayscale variance of the marked target sub-image, the grayscale threshold and tolerance error threshold of the marked background sub-image are dynamically set, and then the grayscale value of the pixel point is extracted from the abnormal target sub-image; The absolute value between the pixel and the background sub-image and the absolute value between the pixel and the target sub-image are calculated respectively using the gray value of the pixel, the gray mean of the marked background sub-image and the gray mean of the marked target sub-image; When the absolute value of the pixel point and the background sub-image is greater than the grayscale threshold of the background sub-image, and the absolute value of the pixel point and the target sub-image is greater than the tolerance error threshold, the pixel point extracted from the abnormal target sub-image is tested as a defect point, and the position of the defect point is recorded; The marked target sub-images are spliced into a target image, and then connected on the target image according to the location of the defect points to form the defect shape, and the quality of the tension clamp is evaluated based on the defect shape.
10. A method for operating the optically-based tension clamp forging defect testing system according to any one of claims 1 to 9, characterized in that: The method comprises the following steps: S1, a vibration detection unit (1) uses an optical vibration sensor to monitor vibration data of the tension clamp during the forging process to trigger an image sensor, and obtains an image of the tension clamp through the image sensor to be regarded as a blurred image of the tension clamp; S2, a fuzzy mapping unit (2) converts the blurred image of the tension clamp into a grayscale image, obtains the converted frequency domain blurred image of the tension clamp by two-dimensional Fourier transform and analyzes the amplitude spectrum characteristics, uses a deep learning model combined with the amplitude spectrum characteristics to output fuzzy parameters, evaluates the fuzzy kernel, obtains the deblurred image of the tension clamp by inverse Fourier transform, and regenerates an equalized image so that the grayscale value of the detailed features on the surface of the tension clamp is different from that of the surrounding background; S3, the segmentation test unit (3) generates a grayscale histogram of the equalized image and segments it into several sub-images, then marks them, determines whether the marked sub-image is a background sub-image or a target sub-image, records the grayscale values of the target sub-image and the background sub-image to calculate the grayscale mean of the marked background and target sub-image, and calculates the relative contrast to test whether the marked target sub-image is an abnormal sub-image, and then tests for defect points by dynamically setting the marked background grayscale threshold and the tolerance error threshold.
Citation Information
Patent Citations
Automobile surface defect rapid detection method based on neural network
CN112581423A
Textile blending ratio flaw detection method
CN119516242A
Deep foundation pit crack detection method and equipment for deep foundation pit tunneling
CN119863397A
Picture processor
JP1999031214A
Structure inspection system using image deblurring technique and method of thereof
KR1020100034500A