Machine vision is to use machines to replace human eyes for measurement and judgment. Machine vision system refers to the software and hardware equipment that converts the captured target into image signals through machine vision products and then transmits them to special information processing devices for further processing. Since machine vision systems can quickly obtain a large amount of information, are easy to process automatically, and are easy to integrate with processing control information, in modern automated production processes, people use machine vision systems extensively in the fields of working condition monitoring, finished product inspection and quality control. The characteristics of machine vision systems are automatic, objective, non-contact, and high precision, which can easily improve the flexibility and automation of production. In some dangerous working environments that are not suitable for manual operations or where artificial vision is difficult to meet the requirements, machine vision is often used to replace artificial vision; in large-scale industrial production processes, the efficiency and accuracy of product quality inspection using artificial vision are low, and the use of machine vision detection methods can greatly improve production efficiency and the degree of automation of production. Since machine vision is easy to realize information integration, it is one of the basic technologies for realizing computer integrated manufacturing. In short, with the maturity and development of machine vision technology itself, it can be expected that it will be more and more widely used in modern and future manufacturing enterprises.
As we all know, industrial CT technology, as an advanced non-destructive testing technology, can not only be used for non-destructive testing, quality assessment, qualitative analysis and judgment of the internal structure and defects of workpieces, but also can measure and quantitatively analyze the internal structure size and defect size of workpieces by measuring industrial CT images, with high measurement accuracy and good repeatability. In recent years, the development from qualitative detection to quantitative measurement is an important research direction of industrial CT technology, and great progress has been made. However, at present, most of the measurement of industrial CT images at home and abroad still relies on manual methods, which not only has poor measurement repeatability but also low measurement accuracy, and it is increasingly difficult to adapt to the needs of large-scale image processing work. Therefore, combined with engineering practice, this article discusses some problems existing in manual measurement, and proposes an automatic measurement method based on edge extraction according to the characteristics of industrial CT images.
2 Canny's edge detection principle Introduction
The tomographic image of a large metal workpiece is obtained by an industrial CT machine and then transmitted to the central management system. The system uses image processing technology to analyze the acquired images, extract the size information related to the workpiece defects, and store it in the database for the image analysis system to accurately and objectively analyze the matrix structure, impurity content, tissue composition, defect size, etc. of the metal or other materials, providing a reliable basis for product quality.
From the perspective of signal acquisition, the photons transmitted through the workpiece are converted into analog signals by the detector and then converted into digital signals by A/D. In the above process, the edges of different material areas of the original workpiece [1], according to the point diffusion principle in the CT convolution back projection reconstruction algorithm [2], the real boundary is within the edge range of 3 pixels in the digital image.
Canny converts the edge detection problem into the problem of detecting the maximum value of the unit function [3]. In Gaussian noise, a typical edge represents a step intensity change.
(1) A good edge detection operator should have three indicators:
low error probability, that is, less chance of missing the real edge and less chance of judging non-edges as edges;
high positioning accuracy, the detected edge should be at the real edge position;
there should be a unique response for each edge, and the obtained edge should be single pixel wide.
(2) Canny proposed three criteria for determining edge detection operators [4]:
good signal-to-noise ratio: a good signal-to-noise ratio criterion means that the probability of judging non-edge points as edge points is low, and the probability of judging edge points as non-edge points is low. The mathematical expression of signal-to-noise ratio is:
(1)
Where f(x) is the filter impulse response with the boundary [-ω, +ω], G(-x) represents the edge function, and σ is the mean square error of Gaussian noise. If the signal-to-noise ratio is large, the edge extraction quality is good.Positioning accuracy criterion. Positioning accuracy means that the detected edge point should be as close to the center of the actual edge as possible. The mathematical expression of positioning accuracy is:
(2)
Among them, G\'(x) and f\'(x) represent the first-order derivatives of G(x) and f(x) respectively. The larger the Localization value, the higher the edge positioning accuracy.Unilateral response criterion. That is, to ensure that there is only one pixel response to a single edge, the average distance D(f\') of the zero crossing point of the impulse response derivative of the detection operator should satisfy f"(x) (which is the second-order derivative of f(x))
(3)
Finally, Canny uses the functional derivation method to derive the first-order derivative of the Gaussian function, which is the best approximation of the optimal function, and the calculation method is simple.3 Canny edge detection algorithm
The Canny algorithm actually uses a double threshold method to achieve edge extraction, where the two thresholds are h1 and h2. Canny recommends that h2 be 2 to 3 times h1. The algorithm flow is as follows [5]: [page]
Step1: Initialize the edge point position EdgeDot=(col, vol), col=0,vol=0. Define the edge map figureedge array, size is nWidth×nHeight, initialized to all 255 (non-edge);
Step2: Check the value of the EdgeDot point in the non-maximum suppression image and assign it to IfEdge;
Step3: if(IfEdge=noedge) then Step7;
Step4: Check the value of the EdgeDot point in the gradient map and assign it to magnetode;
Step5: if(magnitude
Step6: Record the EdgeDot point in the edge map of the recording result and set the corresponding point value of the non-maximum suppression map to noedge, then check the gradient magnitudenear of the eight neighborhood points of the EdgeDot point in the gradient map. If magnitudenear>h1, repeat Step6, otherwise execute Step7;
Step7:col++;
if(col>=nWidth) then vol++;
if(vol>=nHeight) then end; (the program ends)
execute Step2.
The choice of threshold in the algorithm directly affects the performance of the Canny operator.
The author implemented the algorithm using Visual C++ 6.0, which mainly includes: image smoothing (Gaussian filtering is used here), differentiation processing, non-maximum suppression), edge thresholding and other steps. Select a slice in the CT image sequence (as shown in Figure 1). The effect of this image segmentation algorithm in practical application is shown in Figure 1:
Figure 1 Edge extraction effect diagram
In industrial CT images, the grayscale values of materials in different areas are different from those of surrounding materials. Therefore, researchers often use edge detection technology and image segmentation technology to separate this area, making it an independent analysis object, and then accurately measure it. At present, most common area measurements rely on manual completion, mainly through users using the mouse to click around the measured area to obtain a closed area, approximate the area to be measured, and then calculate the area approximately by counting the number of pixels in the area. The common perimeter and polar diameter measurements can only obtain an approximate value like area measurement. Obviously, these measurement methods bring large errors to the measurement due to human factors or the shortcomings of the algorithm itself, and are not repeatable, making batch image measurement difficult to achieve.
Therefore, the following accurately segmented the industrial CT image to obtain the edge, and on this basis proposed an automatic measurement method for geometric dimensions such as CT image area, perimeter and polar diameter of large metal workpieces.
4.1 Area Measurement
Since the area of a region is independent of the change in the grayscale level inside it, but only related to the boundary of the region, as long as the coordinates of the boundary points of the region are determined, the area of the region can be calculated using the boundary coordinates. Green's theorem states that the area enclosed by a closed curve in the xy plane is given by its contour integral, that is,
(4)
The integral is performed along the closed curve. Green's formula shows that as long as the coordinates of each point of a closed curve are determined, the area of the region enclosed by the curve can be calculated based on these coordinate points.The method for area calculation can be obtained from the above principle as follows: Since industrial CT images are a discretized data form, the edge of the region is also a discrete point set, so it is necessary to discretize Green's theorem before calculating the area of the region. The discrete form of Green's theorem is as follows:
(5)
The discrete form expression essentially regards the area defined by the closed edge curve as a polygon, and divides it into multiple triangles with a point in the area as the center point, and then calculates the area of all triangles.4.2 Perimeter measurement
The perimeter of the area is the boundary length of the segmented area. The boundary can usually be represented by gap code, chain code and area. When the gap code method is used, many turns are included in the length measurement process, which exaggerates the actual perimeter value; when the area method is used, only the number of boundary points is counted, which ignores the boundary length of each pixel, thereby reducing the actual perimeter value; when the chain code method is used, it considers the boundary length of each pixel and turns into a straight line, so that the measurement accuracy of the perimeter is improved. The main idea of the boundary chain code measurement is as follows: The chain code starts from the coordinates of a starting point randomly selected on the boundary of the object. The starting point has 8 adjacent points, at least one of which is a boundary point. The boundary chain code specifies the direction that must be taken to go from the current boundary point to the next boundary point. Since there are 8 possible directions, they can be numbered from 0 to 7 [6], as shown in Figure 2. The boundary chain code contains the coordinates of the starting point and a code sequence that determines the direction of the path around the boundary.
Figure 2 Boundary chain code diagram
The method of perimeter calculation derived from this theory is: define the region boundary as a polygon with the center of each boundary pixel as the vertex. Therefore, the corresponding perimeter is the sum of a series of intervals in the horizontal and vertical directions (△p1=l) and the diagonal direction ( ) [7]. The perimeter of a defect can be expressed as:
(6)
Where Ne and No are respectively the number of even steps (0, 2, 4, 6) and odd steps (1, 3, 5, 7) agreed in the boundary chain code.4.3 Polar diameter measurement
The polar diameter is a description of the size specification of a specified area of the workpiece. The most direct polar diameter measurement method is as follows: Since the industrial CT image is a discrete data form, the polar diameter of each point on the area is the distance from the geometric center of the area to the boundary point of the area. The essence of calculating the polar diameter is to calculate the coordinates of the boundary point and the coordinates of the geometric center of the area. However, the coordinates of the boundary point can be obtained from the edge image obtained by edge extraction, and the geometric center coordinates of the area can be obtained by treating the area as the average value of all geometric center coordinates of the triangle formed by countless boundary points to the geometric center. Therefore, using Green's theorem and the algorithm of the geometric center of the triangle, the discrete form of the geometric center of any area can be obtained as follows:
(7)
(8)
4.4 Automatic measurement of area, perimeter and polar diameterBased on the above theory, the automatic measurement is divided into semi-automatic measurement of the area of interest of the workpiece and fully automatic measurement of all different areas of the workpiece.
The main idea of this method is to automatically identify different areas in the industrial CT image, define materials of different materials from the perspective of the area, and then perform regional measurement.
The specific implementation steps are: the first step is to automatically obtain the edge image of the industrial CT image; the second step is to automatically search for all closed curves and non-closed curve trajectories in the edge image; the third step is to use all closed curves to create all different material areas in the industrial CT image and mark all non-closed curve trajectories; finally, the different areas are automatically identified and the area, perimeter and polar diameter of these areas are measured.
Experimental demonstration: in the automatic measurement of industrial CT images, the average area measurement accuracy reaches 97.6%, the perimeter measurement accuracy reaches 98.2%, and the measurement accuracy in the polar diameter measurement of standard circle and ellipse images reaches 100%. The
automatic measurement time of the entire CT image is related to the area of each area of the image, that is, the larger the image area, the longer the image area creation time and the longer the total measurement time. In the measurement of a batch (1500) of CT images of a given workpiece, the total measurement time is 17 minutes.
5 Conclusion
From the above actual measurement results of the workpiece, it can be seen that the method proposed in this paper can not only achieve relatively ideal accuracy for the measurement of different material areas and defects in industrial CT images, but also has the characteristics of high repeatability. It is not only suitable for the measurement of geometric dimensions of areas of interest (such as defects) of workpieces, but also for the measurement of internal structural dimensions of industrial CT images of batch workpieces. Therefore, the application prospects of machine vision in automatic flaw detection of large workpieces are optimistic. (end)
Previous article:High-speed image acquisition technology based on USB camera
Next article:Rohde & Schwarz's broadcast test system BTC successfully integrates D-Book test suite
- Popular Resources
- Popular amplifiers
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- In what situations are non-contact temperature sensors widely used?
- How non-contact temperature sensors measure internal temperature
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- New version of MicroPython firmware for nRF52840
- EEWORLD University Hall ---- Introduction to Artificial Intelligence Zhejiang University of Technology
- GD32307E-START IO analog IIC lights up 0.96'' OLED (04)
- February 14th without flowers
- 【CH579M-R1】1. Unpacking, powering on, and setting up the development environment
- Human body impedance
- Hardware/Mechanical Design Engineer for Foreign Companies Annual Salary: 150,000-350,000 | Experience: 3 years or more | Work Location: Chaoyang, Beijing
- Delta-Sigma Analog-to-Digital Converter Basics: Understanding Delta-Sigma Modulators
- Enabling higher-performance front-end radar to make Vision Zero a reality
- Four design considerations for telematics hardware in connected cars