In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "the detection and analysis of highway crack cases in Matlab image processing". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "Matlab image processing of highway crack case detection and analysis" it!
First, brief introduction 1 case background
With the national investment in highway construction, the total mileage of highway opening in China has been in the forefront of the world, which has further promoted the development of China's economic construction. With the large number of highways put into operation, daily highway maintenance and management has become a bottleneck restricting the improvement of highway operation level, especially the road surface condition collection, detection and maintenance and other work has posed a challenge to the traditional highway operation and maintenance mode. Pavement crack is the most common pavement damage in daily highway maintenance management, and it is also an important factor affecting highway condition assessment and necessary highway maintenance. Generally speaking, if the pavement cracks can be repaired in time before they are deteriorated into potholes, the cost of highway maintenance can be greatly saved. The traditional highway crack detection is mainly manual detection, which needs to allocate a certain scale of manpower, equipment and other resources to carry out regular inspection. However, in the face of the growing demand for highway construction, manual detection has some shortcomings, such as low operational efficiency, great subjective influence, high risk and so on, which can not meet the requirements of rapid detection of highway damage.
With the development of computer hardware equipment and digital image processing technology, vision-based target location and detection technology has also made continuous progress. Because of its characteristics of accurate positioning, fast detection, automatic operation, easy installation and deployment, it has been widely used in industrial automatic detection process, especially in target surface quality detection, target measurement and other fields. Therefore, the pavement crack detection technology based on digital image can provide a safe, efficient and low-cost road state monitoring service. a variety of image processing methods have been applied to pavement crack detection and have been applied to some extent.
2 theoretical basis
Pavement crack detection is a typical linear target detection from a visual point of view, so the enhancement and location of pavement crack image belongs to the research field of linear target detection. Compared with general linear targets, pavement cracks have their own characteristics: relatively small target width, low image contrast, natural discontinuity, bifurcations and miscellaneous points, and road cracks only show linear characteristics in vision as a whole. Traditional automatic crack detection algorithms, such as threshold segmentation, edge detection and wavelet transform, often assume that pavement cracks have high contrast and good continuity in the whole image. however, this assumption is often not true in practical engineering projects. Due to the influence of shooting weather, pavement loss, crack degradation and other factors, a certain proportion of cracks have a very low contrast to the pavement background, which will also cause the failure of the traditional crack detection algorithm. therefore, it is necessary to add certain preprocessing steps before crack image processing. Image preprocessing is generally used in image recognition, image representation and other fields of pre-processing. In the process of image acquisition and transmission, the image quality is often reduced for some reasons.
For example, from the visual subjective observation of the object in the image, you may find that the outline position is too bright and abrupt: from the size and shape of the detected object, the image feature is blurred and difficult to locate; from the perspective of image contrast, it may be affected by some noise. From the overall point of view of the image, there may be some distortion, deformation and so on. Therefore, there may be a lot of interference in the visual visualization and processing feasibility of the image to be processed, which may be referred to as the image quality problem. Image preprocessing is used to improve image quality, through certain calculation steps to transform the input surface to highlight some interesting information in the image, to eliminate or reduce interference information. such as image contrast enhancement, image denoising or edge extraction and other processing printing, in general, because the crack image acquisition needs to involve outdoor operations It is inevitable that there will be some noise interference, distortion and other problems in the obtained images, and it is often difficult to detect and extract crack targets directly. Therefore, this case first preprocesses the crack image to improve the image quality, and then improve the optimization effect of the experiment. The basic methods of image preprocessing include image grayscale transformation, frequency domain transformation, histogram transformation, image denoising, image sharpening, image color transformation and so on. In this case, some of the methods will be selected to preprocess the crack image.
2.1 Image graying
Most of the visible spectrum in nature can be obtained by mixing red ®, green (G) and blue (B) light according to different proportions and intensities, which is called RGB color mode. This mode is based on the RGB model and assigns an intensity value of Uint 8 type (0,255) to the RGB component of each pixel value of the image. For example, pure red has an R value of 255, G value of 0, and B value of 0; magenta has an R value of 255, a G value of 0, and a B value of 255. The red, green and blue components of the RGB image account for 8 bits each, so it is a 24-bit image. When the primary colors of different luminance are mixed, 256x256x 256-16777216 colors will be produced. The graphical representation of the RGB model is shown in the figure.
Suppose F (I, j) is a pixel in the RGB model, if the luminance values of its three primary colors are equal, a grayscale color will be generated, and the value of the R=G=B will be called grayscale value (or intensity value, luminance value). Therefore, a grayscale image is an image that contains multiple quantized gray levels. Assuming that the grayscale is represented by a numerical value of type Uint 8, the grayscale of the image is 256 (that is, 2 °= 256). The grayscale of the grayscale image selected in this case is 256, and the pixel gray value is a value of 0255. pure white is produced when the luminance value is 255, and pure black is produced when the luminance value is 0. and the brightness increases gradually from 0 to 255. RGB image contains a large amount of color information composed of red, green and blue. Grayscale images have only luminance information but no color information. In order to meet the requirements of pavement crack image detection, it is generally necessary to remove unnecessary color information and convert the collected RGB image into grayscale image. There are several grayscale methods for RGB images.
(1) component value
Select one of the R, G, B components of pixel F (i.j) as the gray value of the pixel, that is,
In the formula, Fg is the grayscale value of the converted grayscale image at (i.j).
(2) maximum value
Select the maximum value of the R, G and B components of the pixel F as the gray value of the pixel, that is,
(3) average
Select the average luminance of R, G and B components of pixel F as the gray value of the pixel, that is,
(4) weighted average
The luminance weighted mean of R, G and B components of pixel F (iMagnej) is selected as the gray value of the pixel. The weight is generally selected according to the importance of the component and other indicators. The gray values of the three components are calculated in the way of weighted average. Subjectively, human eyes are generally more sensitive to the green component and lower to the blue component, so the weighted average of the three components of RGB can get a more reasonable grayscale image. The commonly used formulas are as follows:
F. (i.j) = 0.299R (iMagnej) + 0.587G (iMagnej) + 0.114cm B (iMagnej)
The weighted average method is used to calculate the gray image of the crack image, and the result is shown in the figure.
2.2 Image filtering
In the process of acquisition or transmission, the crack image is often disturbed by imaging equipment, transmission medium and other factors, so the crack image to be processed may have some problems, such as edge blur, black-and-white miscellaneous spots and so on. to a certain extent, this will affect the detection and recognition of crack targets and interfere with the judgment of experimental results, so it is necessary to filter and Denoise the crack image. This section will deal with image denoising from two aspects: mean filtering and median filtering. Mean filtering is also known as neighborhood average filtering. This method assumes that the image to be processed is composed of many small regions with constant gray values, and there is a high spatial correlation between the adjacent regions, while the noise is relatively independent. Therefore, the purpose of filtering and denoising can be achieved by calculating the average gray value of a single pixel and all pixels in its designated neighborhood according to a certain rule, and then as the corresponding pixel value in the new image. this process is called mean filtering. Neighborhood averaging method belongs to the category of unweighted neighborhood averaging and is the most commonly used mean filtering operation.
The edge of the image generally focuses on the details and high-frequency information of the image. if the denoising is carried out by the neighborhood averaging method, it will often cause the blur of the image edge, which will also adversely affect the crack target detection. Median filtering is a commonly used nonlinear filtering method, and its main idea is to filter the median of pixel neighborhood vectorization, which is simple and efficient, and can effectively remove impulse noise. it can also effectively protect the edge detail information of the image while denoising. Therefore, in this case, the median filtering method will be used to Denoise the crack image, and the processing steps are as follows.
(1) location
Move the template in the image to align the center of the template with a pixel in the image.
(2) calculation
Select the template corresponding to the gray value of each pixel of the image, vectorize it, and sort it.
(3) assignment
Select the middle value of the sequence and assign it to the corresponding pixel in the center of the template as the output.
As shown in figure 2, depending on the shape and dimension of the median filter, the template is wired, cross, square, diamond, etc., and windows with different shapes will produce different filtering effects. When the crack image is processed by median filtering, the key is to select the appropriate template shape and size.
2.3 Image enhancement
The acquisition of pavement crack images is generally carried out outdoors, which is easily affected by atmosphere, light, mechanical vibration and other factors. The collected crack images may be dark or bright as a whole, resulting in low contrast images. The characteristic of this kind of image is that the gray distribution range is small and concentrated in a small gray range, which also has a negative impact on the subsequent crack detection and recognition, so this kind of image needs to be enhanced to improve the contrast. As a statistical table of image grayscale distribution, histogram can reflect the details of image contrast to a certain extent. The gray histogram of the image represents the relative frequency of the pixels of different gray levels in the grayscale type to which the image belongs, and the Abscissa of the histogram represents the grayscale, and the ordinate represents the number or probability of the gray occurrence. Histogram equalization uses gray histogram to adjust image contrast in order to enhance the visual effect of the image. The basic idea of histogram equalization is to change the gray histogram of the original image from a smaller gray range to a uniform distribution in a larger gray range through some transformation, and get the gray level difference distribution, so as to achieve the goal of enhancing the overall contrast of the image. The crack image region usually belongs to the dark gray area, while the background region belongs to the relatively bright gray area. However, in the process of collecting fracture images, the overall image is dark due to weather interference, underexposure and other reasons, so that the brightness characteristics of the crack region and the background region are similar and difficult to distinguish, as shown in the figure. From the gray histogram of the original fracture image, we can see that the gray value distribution is mainly concentrated in the low-level gray range of 0100. Therefore, in order to improve the contrast between the crack and the background, it is necessary to expand the gray value range of the original image to form a more obvious gray level difference, and then increase the contrast of the crack image. After the gray histogram equalization processing, the gray range of the crack image is expanded to 0255, and the contrast enhanced crack image is obtained, which highlights the difference between the crack and the background.
2.4 Image binarization
The binarization of grayscale image refers to the segmentation of the target and the background by agreeing a grayscale threshold. The pixels within the threshold are recorded as 1 for the target, and 0 for the other background. In the process of crack target detection and recognition, features such as crack edge and area can be used to distinguish, and the gray difference between the crack target and the surrounding background can also be used as a discriminant basis. This requires the introduction of threshold for image binarization processing. Suppose a grayscale crack image is represented by f (x _ ()), where (x _ ()) represents the position coordinates of the pixels in the image, and T is the threshold, then the binary image b (x _ () _ y) after threshold segmentation satisfies:
The pixel grayscale of the crack target or background region is usually highly correlated, but the gray value between the crack target and the background region is usually quite different, which generally contains obvious edges and other features. Therefore, in order to segment the crack target and background to a greater extent, it is necessary to select the appropriate threshold by gray threshold segmentation. According to the calculation process, the threshold calculation method can be divided into two types: global threshold and basic adaptive threshold, as described below.
The main results are as follows: (1) the global threshold is the most common threshold calculation method, which is generally based on the image histogram or gray spatial distribution to determine a threshold, and then realize the binarization of the grayscale image. Especially when the gray histogram distribution of the image is bimodal, the global threshold method can obviously divide the target and background components, and get a more ideal image segmentation effect. However, the crack image generally has the characteristics of uneven illumination and noise interference, and its gray histogram often does not show bimodal distribution, so the effect of global threshold segmentation method is poor.
(2) the basic adaptive threshold is a relatively basic adaptive image segmentation method, which generally carries out threshold segmentation based on the gray changes of the image pixel itself and its neighborhood, and then realizes the binarization of the gray image. This method fully considers the characteristics of the neighborhood of each pixel, so it can better highlight the boundary of the target and the background.
The background of crack image is relatively fixed in most cases, such as road surface, bridge deck, wall and so on. However, because the image acquisition is generally carried out outdoors, it will be affected by shooting conditions, road debris and other factors, so the image is prone to degradation or noise interference. By analyzing the characteristics of the target and background of the crack image, this case adopts the method of combining self-definition and iterative optimization.
3 program realization
According to the characteristics of the crack image, it is necessary to carry out image preprocessing before target detection and recognition, including histogram equalization enhancement, median filtering denoising, contrast enhancement, binarization processing, binary image filtering and so on. Among them, in the process of binarization, the threshold is determined by the combination of the self-defined threshold method and the iterative adaptive method; the binary image filtering is mainly the area filtering of the connected area. filtering and denoising by removing small area noise. After the crack image is preprocessed, the binary image of the prominent crack target can be obtained, and then the crack target can be obtained and detected according to the morphological region features. The shape recognition of the crack can be determined by calculating the aspect ratio of the outer rectangle of the crack target in the image.
Part of the source code clc; close all; clear all;%% read picture I=imread ('1.jpg');%% judge image format and adjust image size, histogram equalization if (ndims (I) = = 3)% ndims is a function of array dimension img=rgb2gray (I); img=double (img);% convert to double precision else img=double (I) % convert to double-precision end if (max (size (img)) > 1024) scale=1/8;% image adjusted to the original image size 1and8i1 = imresize (img, scale);% zoom else I1img; end [mmaginn] = size (I1); f_size=max (mMagne n);% denoising, sharpening [Slog f2] = frequence_get (I1MagnefSize) %% notch filter to remove periodic noise%% modify the Fourier spectrum of the original image with notch filter template, filter high frequency periodic noise%% construct notch filter template Mask=Muban (Slog,f_size); vex=find (Mask==0); I_spec=im2uint8 (mat2gray (I_spec)) % matrix normalization, converting the image data type to unsigned 8-bit shaping I_spec (fancisizegraded size) = 0; Spectrum=fft2 (uint8 (I_spec));% 2-D discrete Fourier transform Spec=abs (Spectrum);% amplitude spectrum phi=angle (Spectrum);% phase spectrum Spec=fftshift (Spec); Spec1=Spec; Spec1 (vex) = 0; Spec2=ifftshift (Spec1); CJ=Spec2.*exp (i*phi) % reconstruct Fourier spectrum Re_fft2=ifft2 (CJ);% inverse Fourier transform, restore image Restore=uint8 (real (Re_fft2));%% Wiener filter%% Wiener filter K=wiener2 (Restore (1Restore=uint8), [3 3]);% Wiener filter (wiener filtering) is an optimal estimator for stationary processes based on the minimum mean square error criterion. The mean square error between the output and the expected output of this filter is minimum, so it is an optimal filtering system. It can be used to extract signals polluted by stationary noise. [result,threshold1] = edge;% if the original image is not equalized, the threshold uses 0.07 quotient Sobel operator to detect cracks [BW,thresh2] = bwfilter (K scene result);% binarization filter to de-interfere with figure, subplot (151); imshow (I1, []); title ('original image'); subplot (152); imshow (Restore (1 Restore) Title ('inverse Fourier transform image'); subplot (153); imshow (K, []); title ('Wiener filtering noise reduction'); subplot (154,154); imshow (result, []); title ('crack detection'); subplot (155); imshow (BW); title ('binary filter de-interference');% morphological operation Se0=strel ('line',3,0) % create a linear structural element Se90=strel ('line',3,90); bw_dialte=imdilate (BW, [Se0 Se90]);% inflated bw_fill=imfill (bw_dialte,'holes');% fill bw1=bwmorph (bw_fill,'thin',Inf);% refine bw2=bwmorph (bw1,'spur',3);% deburr bw3=bwareaopen (bw2,5);% remove small target figure, subplot (151) Imshow (bw_dialte); title ('bloat'); subplot (152'); imshow (bw_fill); title ('fill'); subplot '153'; imshow (bw1); title (' refine'); subplot (154th); imshow (bw2); title ('deburring'); subplot (155i); imshow (bw3); title ('remove small targets'); third, run results
At this point, I believe you have a deeper understanding of the "Matlab image processing of highway crack case detection and analysis", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.