Edge detection is an important part of image processing. Image edge is a reflection of the discontinuity of local characteristics of an image (grayscale mutation, color mutation, texture structure mutation, etc.), which marks the end of one area and the beginning of another area. In actual image processing problems, the edge of an image, as a basic feature of the image, is often applied to higher-level image applications. At the same time, it has a wide range of applications in image recognition, image segmentation, image enhancement, and image compression. There are many ways to detect image edges. There are two major frameworks: one is the traditional detection method based on edge detection operators; the other is the multi-scale edge detection algorithm based on wavelets. However, wavelet transform is not the best when used to process images, because the edge extracted by the image edge detection method based on wavelet transform has only limited directions, while the direction of the edge of a natural image may be arbitrary, so the edge extracted by the wavelet edge extraction method cannot best approximate the image edge; the traditional Robert, Sobel, Prewitt, Kirach, and Laplacian operators are sensitive to noise and are not ideal in processing actual images. Through research, this paper proposes a method based on the canny edge detection operator and combined with contour tracking. While enhancing the edge of the object, improving the contrast and effectively suppressing the noise, it also solves the problem of edge breakage caused by the traditional edge detection operator in the edge detection process, thereby ensuring that the detected edge is continuous, single and clear. It is a practical image processing method. Finally, the improved algorithm is applied to the edge detection of actual medical images, and the detection effect is compared with that of the traditional edge detection operator, so as to draw a conclusion.
1 Basic principles of Carmy operator
1.1 Smoothing image
The Canny operator selects a suitable one-dimensional Gaussian function to smooth and denoise the image f(x, y) by row and column, which is equivalent to the convolution of the image signal. The selected Gaussian function is:
Where: σ is the standard deviation of the Gaussian curve, which controls the degree of smoothing.
1.2 Calculating the amplitude and direction of the gradient
The Canny operator uses the finite difference of the first-order partial derivative of the 2×2 neighborhood to calculate the gradient amplitude and gradient direction of the smoothed data array I(x, y). The two arrays Px[i,j] and Py[i,j] of partial derivatives in the x and y directions are:
The gradient magnitude and gradient direction of the pixel are:
1.3 Obtaining edges
In order to extract single-pixel wide edges, the gradient amplitude map must be refined. In the gradient amplitude image, ridge bands will be generated near the location of the maximum value of M[i,j]. Only by refining these ridge bands can the location of the edge be accurately determined, and only the points with the largest local amplitude changes are retained. This process is called non-maximum suppression. In the non-maximum suppression process, the Canny operator uses a 3×3 size, 8-directional neighborhood to interpolate the gradient amplitude of all pixels in the gradient amplitude array M[i,j] along the gradient direction. At each point, the center pixel M[i,j] of the neighborhood is compared with the interpolation results of the two gradient amplitudes along the gradient direction. If the amplitude of the neighborhood center point M[i,j] is not greater than the two interpolation results in the gradient direction, the edge flag corresponding to M[i,j] is assigned to 0. This process refines the M[ij] wide ridge band to one pixel wide and retains the gradient amplitude of the ridge.
For the sub-image N[i,j] that has been subjected to non-maximum suppression and gradient histogram classification, two high and low thresholds thrA and thrl are used respectively, and the grayscale of pixels with gradients less than the threshold is set to 0, and two threshold edge images TH[i,j] and TL[i,j] are obtained by segmentation. Since the image TH[i,j] is obtained by a high threshold, there are few pseudo edges, but TL[i,j] retains more comprehensive edge information, but also contains some pseudo edges. Therefore, based on the image TH[i,j], the image TL[i,j] is used as a supplement to obtain a relatively comprehensive edge.
1.4 Contour tracking or contour extraction
After performing canny edge detection on an image, some detected edges may be broken or discontinuous. In order to solve this problem, the edges of the target detection objects can be continuous and the redundant pseudo edges can be removed. After edge detection, the image is then subjected to boundary tracking, which can improve this problem.
For binary images, the basic method of contour extraction is to hollow out internal points, that is, if there is a point in the original image that is black and the other 8 adjacent points are all black, then delete the point. [page]
circle has been made and the process ends; otherwise, continue to search from C0 until A0 is found; (2) Determine whether it is a boundary point: if none of its 8 adjacent points are white points, it is a boundary point. For boundary tracking, the contour edge width generated after tracking is only one pixel, which achieves a single and clear edge pixel point and well removes pseudo edge points.
2 Comparison of experimental results
To verify the algorithm in this paper, medical images are taken as an example to compare with traditional edge detection operators. The experiment shows that the method proposed in this paper has a good edge detection effect. The comparison results are shown in Figures 1 to 5.
3 Results Analysis
This paper adopts the processing method of performing Canny edge detection on the image first and then contour tracking. On the one hand, it can solve the edge break problem caused by the traditional edge detection algorithm, and it is easy to understand and implement, and has a good detection effect. On the other hand, the image is processed twice, which reduces the efficiency of image processing. In the application environment with high real-time processing requirements, this algorithm needs to be further improved.
Previous article:Software Design of a Multi-channel Image Acquisition System
Next article:Design of real-time image test device based on LVDS technology
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- 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?
- 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
- I have heard about common mode inductors many times, but do you really understand the principles behind them?
- For the new coronavirus vaccine, why is it injected into the arm and not the buttocks?
- Simple RISC processor design
- How to carry out secondary development of DWIN's 86 box or wire controller?
- 315——Let’s talk about how you “fall into traps” and “avoid traps” during the shopping process?
- GD32E230C-EVAL compilation error
- Countdown to registration for 2019 TI Industrial Seminar in Beijing/Shenzhen!
- Beijing listed companies/state-owned enterprises recruiting: embedded engineers
- Antenna basic element
- ATA-2021B high voltage amplifier, the current monitoring/voltage bias you want is here!