introduction
In the construction industry, evaluating wall cracks and ground cracks is an important indicator for evaluating the quality of a house. An embedded system device is generally composed of an embedded computer system and an execution device. The embedded computer system is the core of the entire embedded system, which consists of a hardware layer, an intermediate layer, a system software layer, and an application software layer. The execution device is also called the controlled object. It can accept control commands issued by the embedded computer system and perform the specified operations or tasks. The execution device can be very simple, such as a micro motor on a mobile phone, which turns on when the mobile phone is in a vibration receiving state; it can also be very complex, such as the SONY smart robot dog, which integrates multiple micro control motors and multiple sensors, so that it can perform various complex actions and sense various status information. The core of the embedded system hardware layer is the embedded microprocessor. The biggest difference between the embedded microprocessor and the general CPU is that the embedded microprocessor mostly works in a system designed specifically for a specific user group. It integrates many tasks of the general CPU that are completed by the board into the chip, which is conducive to the miniaturization of the embedded system in design, and it also has high efficiency and reliability.
This study divides the problem into the following two parts:
(1) Crack width measurement algorithm;
(2) Port the software developed above to the ARM development board and optimize the algorithm to improve the software running speed.
1 Crack width measurement algorithm
The key to calculating the crack width is to use image segmentation technology to obtain the true edge of the crack. Although the existing literature has introduced a variety of segmentation methods, there is no method for processing the crack image collected by the crack tester.
1.1 Image acquisition
The image acquisition process is shown in Figure 1: The detected crack is imaged on the CMOS image sensor through the optical system, and then the crack image is output to the ARM through the USB interface for processing. ARM (Advanced RISC Machines) is a well-known company in the microprocessor industry. It has designed a large number of high-performance, low-cost, low-energy RISC processors, related technologies and software. The technology has the characteristics of high performance, low cost and low energy consumption. It is suitable for a variety of fields, such as embedded control, consumer/educational multimedia, DSP and mobile applications.
The crack image is shown in Figure 2. The crack width distribution range is wide, ranging from tens to hundreds of pixels, but it is much smaller than the image width. There is some noise around the crack, and some images contain a large amount of contaminated areas, which makes it difficult to locate the crack position.
1.2 OTSU Image Segmentation
By comparing with existing image segmentation methods such as histogram method, OTSU method, region segmentation method, etc., it is found that OTSU has a clear advantage in the final effect.
The result of image segmentation is shown in Figure 3. By observing the results, it is easy to find that a large area on the edge of the image is misclassified as a crack. Therefore, directly calculating the crack width will result in calculating the misclassified area as a crack. Therefore, in addition to calculating the crack width, effectively eliminating the candidate crack set is another important task.
After the image is segmented, the width of all possible cracks is calculated. The crack width is calculated from the starting position of a given row of the image. When the pixel grayscale changes from 0 to 255, it is recorded as the starting position of the left edge of a crack; when the pixel grayscale changes from 255 to 0, it is recorded as the end position of the right edge of a crack. This method can obtain all possible crack widths of a given row. However, in specific experiments, it was found that there is still a relatively large error in calculating the width measurement of a single row of cracks. Therefore, the method of finding the average value of 10 rows, 5 rows above and below a given row, is adopted.
1.3 Sobel edge detection
The above section obtained a candidate set of cracks, but in fact this candidate set contains a large number of non-crack areas. The main content of this section is to design an algorithm to remove these interfering cracks and obtain a smaller candidate set of cracks. In the experiment, since the cracks have obvious edges, and the interfering image areas have relatively fuzzy edges or only one edge, through analysis, it is proposed to use the Sobel edge detection method to lock the crack position. The Sobel operator consists of two convolution kernels, as shown in Figure 4.
By using Sobel edge detection on the original image, the result shown in Figure 5 is obtained.
However, this result obviously has many tiny interferences, which must be eliminated, otherwise it will have no effect on locking the crack edge. Through careful analysis of the edge detection result image, it is found that although there are tiny interferences, their grayscale values are generally small. In view of this finding, the edge detection result image is segmented in the same way as in the previous section, which will effectively eliminate the tiny interferences. As shown in Figure 6.
By observing the segmented edge image, there are still some tiny interferences in the image, but these interferences are very small compared to the unprocessed edge detection result image. In the subsequent processing, additional constraints will be added to the image cracks to remove the influence of these interferences.
1.4 Additional constraints based on crack characteristics
By analyzing a large number of crack images, it is found that image cracks have the following characteristics:
(1) The gray value of the crack is lower than that of the wall.
(2) The width of the crack relative to the entire image does not exceed 1/3 of the image width.
(3) The contaminated wall areas generally appear in large blocks, and many of them only have one boundary, with the other boundary extending outside the image.
(4) Some minor disturbances in the wall appear as small blocks.
(5) The cracks are generally band-shaped.
Using ARM processor to process images cannot process the entire image due to its slow speed and real-time requirements. In other words, it must process a partial image. This obviously increases the difficulty of eliminating candidate cracks. This system is obviously unable to use features (4) and (5).
By adding the above constraints, the experimental results are significantly improved.
Figure 7 is the result of the PC, which has a better effect because five constraints are used at the same time. Figure 8 is a screenshot of the ARM system operation. Since it is not convenient to calculate each step step by step on the ARM, a screenshot with measurement results is directly given.
2 QT interface design algorithm based on Linux
The previous article discussed the main algorithm part. The complete crack measurement system also includes the user interface part, that is, the graphical interface. The use of QT for interface design on ARM is relatively mature, and it has the following main features:
(1) Easy to get started and low learning cost. Once you understand the basic concepts, you can write programs while consulting documents.
(2) Good cross-platform effect. Originally, it was a tool library under Linux, which is a general term for a type of Unix computer operating system. The name of the kernel of the Linux operating system is also "Linux". The Linux operating system is also the most famous example of the development of free software and open source code. Strictly speaking, the word Linux itself only refers to the Linux kernel, but in fact people have become accustomed to using Linux to describe the entire operating system based on the Linux kernel and using various tools and databases of the GNU project. Linux is named after computer amateur Linus Torvalds.
3 Software Migration and Program Optimization
Since the final program runs on the ARM system, and due to the slow speed of ARM in processing images and the real-time requirements of the crack measurement instrument, the program must be optimized and the algorithm must be ported to the ARM system so that it can run correctly.
Program optimization is a problem. Although the speed of ARM has been greatly improved, it is still very difficult to process images. In addition, the algorithm needs to process the original image twice independently, which is equivalent to doubling the burden on ARM. Through the analysis of a large number of crack images, according to the crack characteristics mentioned in the previous article and combined with the calculation speed conditions of ARM itself, an algorithm for eliminating all images is proposed. Only the area 10 lines above and below the given row position is processed. By processing only these 20 lines of images, the running speed of the program is greatly improved. The above methods are parallel, and multi-threaded programming methods are also used. By dividing image sampling and image processing into two processes, the running speed of the program is effectively improved.
4 Experimental results analysis
The program runs on a PC and an ARM development board respectively, and the results are shown in Figures 7 and 8.
Through a large number of experiments, it is found that the algorithm can detect the distribution and width of cracks well. In the algorithm, a hybrid algorithm combining OTSU image segmentation and Sobel edge detection is used for crack detection and width measurement. This algorithm can effectively utilize the advantages of both edge detection and image segmentation.
5 Conclusion
Aiming at the measurement of wall cracks, a set of algorithms suitable for crack width detection is designed. The algorithm can detect the distribution and width of cracks well. By adopting the mixed method of edge detection and image segmentation and analyzing a large number of images, a series of constraints that meet the characteristics of image cracks are added to the algorithm, which greatly improves the accuracy and robustness of the algorithm. The program is run on PC system and ARM system respectively, and a series of optimizations are made to the algorithm according to the characteristics of ARM system, and parallel processing technology is introduced. While improving the running speed of ARM, the detection results of ARM system are almost the same as those of PC system.
Previous article:Samsung SAM8 Series S3C825A Single Chip Microcomputer and Its Software Design
Next article:Application of ARM in Embedded Linux Kernel Cutting and Transplantation
Recommended ReadingLatest update time:2024-11-16 16:20
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Buck-boost DCDC TPS63810 application in TWS earphones
- Purgatory Legend-IIC Battle
- CC3235S and CC3235SF SimpleLink Wi-Fi dual-band single-chip solutions
- Design of ESD protection structure for CMOS circuits
- 8 Common Uses of Diodes
- TMS320C6655 Fixed and Floating Point Digital Signal Processor
- [Digi-Key KOL Lecture] Common Techniques for Designing Low-Power DC-DC Converters
- Problems encountered in B-U585I-IOT02A test
- [FS-IR02 + D1CS-D54] - 4: Linking with MCU (FS-IR02)
- [Atria Development Board AT32F421 Review] TEST06 CFFT related tests