A smart city road intelligent monitoring system
By optimizing the fuzzy angle and distance estimation of the license plate image through neural network and transformation technology, the PSF point spread function is constructed, which solves the problem of poor blur enhancement effect of the license plate image in the existing technology and improves the image restoration effect of the smart city road monitoring system.
Patent Information
- Application Number
- CN202410215706.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-27
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-02-27
AI Technical Summary
The existing image blur enhancement algorithm ignores the shape characteristics of the license plate when estimating the point spread function, resulting in multiple extreme values of the same size appearing in the Radon transform, which affects the image restoration effect.
Segment the license plate area through the neural network, use Fourier transform and Radon transform to obtain the spectrogram and projection matrix, calculate the motion blur angle and distance of the license plate, construct the PSF point spread function, combine the LBP eigenvalue and Euclidean distance, optimize the point spread function to Improve the image restoration effect.
It improves the restoration effect of the license plate image, reduces the error of motion blur angle estimation, enhances the clarity of the image, and ensures the effectiveness of traffic safety management.
Smart Images

Figure CN118155149B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image enhancement, and in particular to an intelligent monitoring system for smart city roads. Background Art
[0002] Smart city refers to the realization of intelligent, efficient and sustainable urban management and urban services through information technology, the Internet of Things and other technical means. With the increase in transportation, traffic safety issues on the road have attracted more and more attention. In order to ensure the traffic safety of residents, surveillance cameras are installed at various road intersections in the city to monitor roads and vehicles. However, due to the influence of excessive vehicle speed and insufficient light, the license plates captured by the surveillance cameras are often blurred and difficult to identify, which brings some potential hazards to traffic safety. The license plate is a key identifier for tracking the identity of the vehicle. Blurred license plate information will make it difficult for traffic police or relevant departments to effectively supervise and punish illegal vehicles, allowing some drivers to evade legal responsibility after violating the law. Therefore, it is very necessary to enhance the image of the blurred license plate so that the image can clearly display the license plate number. Although there are already a large number of enhancement algorithms in the field of blurred image enhancement, the existing image blur enhancement algorithms ignore a problem when estimating the point spread function (PSF), that is, when using Radon transform to project a standard rectangular object with a stable direction, multiple extreme values of the same size may appear, which will cause errors in the calculation of the motion angle of the blurred image and affect the subsequent image restoration effect. Summary of the invention
[0003] In order to solve the above technical problems, the purpose of the present invention is to provide a smart city road intelligent monitoring system, and the technical solutions adopted are as follows:
[0004] The present invention proposes a smart city road intelligent monitoring system, the system comprising:
[0005] An image acquisition module collects road images and uses a neural network to segment the license plate area of the road image to obtain a grayscale license plate image;
[0006] The license plate area image processing module uses Fourier transform to obtain the spectrum of the grayscale license plate image, converts the spectrum into a binary image, performs edge detection on the binary image to obtain a binary edge spectrum image, and uses Radon transform to obtain the projection matrix of the binary edge spectrum image; obtains the fuzzy motion direction of each column with extreme values through the extreme values in the projection matrix and the angles corresponding to each column with extreme values; obtains the motion blur angle of the license plate based on the fuzzy motion direction of the column with extreme values; randomly constructs a motion direction straight line consistent with the motion blur angle direction in the grayscale license plate image, and obtains the Euclidean distance between each pixel in the grayscale license plate image and the pixel on the motion direction straight line. Project pixel points; obtain the font remoteness index of each pixel point according to the Euclidean distance between each pixel point and the font pixel point; obtain the spatial fuzzy similarity coefficient between any two pixel points according to the font remoteness index of any two pixel points and the projected pixel point; take each pixel point as the sampling center and perform sampling along the straight line in the motion direction to obtain the sampled pixel point of each pixel point, and obtain the fuzzy similarity coefficient between each pixel point and the sampled pixel point according to the spatial fuzzy similarity coefficient between each pixel point and the sampled pixel point and the LBP feature value; obtain the motion fuzzy distance of the license plate according to the fuzzy similarity coefficient between each pixel point and the sampled pixel point; construct the PSF point spread function based on the motion fuzzy angle and motion fuzzy distance of the license plate;
[0007] The license plate area image restoration module uses the Wiener filter algorithm according to the PSF point spread function to restore the license plate area image, achieving the purpose of intelligent monitoring of smart city roads.
[0008] Furthermore, the method of obtaining the projection matrix of the binary edge spectrum image by using Radon transform includes:
[0009] The binary edge spectrum image is used as the input of Radon transform, and the output of Radon transform is the projection matrix.
[0010] Further, obtaining the blur motion direction of each column having the extreme value through the extreme value in the projection matrix and the angle corresponding to each column having the extreme value includes:
[0011] Get the extreme values in the projection matrix, for each column with extreme values, calculate the mean of the angles corresponding to all columns with extreme values, calculate the absolute value of the difference between the angle corresponding to the column with extreme values and the mean, calculate the ratio of the absolute value of the difference of the column with extreme values to the number of extreme values in the column with extreme values, and use the ratio as the blurred motion direction of the column with extreme values.
[0012] Furthermore, the obtaining of the motion blur angle of the license plate according to the blur motion direction of the column with the extreme value is specifically: taking the angle corresponding to the column with the smallest blur motion direction as the motion blur angle of the license plate.
[0013] Furthermore, the step of obtaining the projected pixel point of each pixel point in the grayscale license plate image according to the Euclidean distance between each pixel point in the grayscale license plate image and the pixel point on the straight line of the moving direction includes:
[0014] The pixel point on the straight line of the moving direction with the closest Euclidean distance to each pixel point in the grayscale license plate image is used as the projection pixel point of each pixel point in the grayscale license plate image, where the grayscale value of the pixel point on the straight line of the moving direction is the average grayscale value of all pixels in the grayscale license plate image.
[0015] Furthermore, the obtaining of the font remoteness index of each pixel point according to the Euclidean distance between each pixel point and the font pixel point includes:
[0016] For each pixel point, a rectangular coordinate system is constructed with the pixel point as the starting point, wherein the x-axis is perpendicular to the straight line of the motion direction, and the y-axis is parallel to the straight line of the motion direction. The font pixel point is searched in four directions, namely, the positive direction and negative direction of the y-axis and the positive direction and negative direction of the x-axis. The Euclidean distance between the pixel point and the first font pixel point found in the four directions is calculated. If the font pixel point cannot be found in one of the four directions, the Euclidean distance is 0. The expression of the font remoteness index of the r-th pixel point is:
[0017]
[0018] Where D r is the font remoteness index of the rth pixel, τ is the parameter adjustment coefficient preset to be greater than zero, y1 r ,y2 r 、x1 r , x2 r Respectively represent the Euclidean distance between the rth pixel and the first font pixel found in the positive direction of the y-axis, the negative direction of the y-axis, the positive direction of the x-axis, and the negative direction of the x-axis.
[0019] Furthermore, the obtaining of the spatial fuzzy similarity coefficient between any two pixels according to the font remoteness index of any two pixels and the projected pixel point includes:
[0020] For any two pixel points, obtain the opposite of the Euclidean distance between the projected pixel points of the two pixel points, use the opposite number as the exponent of an exponential function with a natural constant as the base, calculate the absolute value of the difference in the font remoteness index of the two pixel points, calculate the sum of a preset adjustment parameter coefficient greater than zero and the absolute value of the difference, and use the ratio of the calculation result of the exponential function to the sum as the spatial fuzzy similarity coefficient between the two pixel points.
[0021] Further, the fuzzy similarity coefficient between each pixel point and the sampling pixel point is obtained according to the spatial fuzzy similarity coefficient between each pixel point and the sampling pixel point and the LBP feature value, including:
[0022] For each pixel point, the projection pixel point of each sampling pixel point of the pixel point is obtained, a square window is constructed with each projection pixel point as the center, and the LBP eigenvalue of the pixel point at the center of each window is used as the fuzzy index of each projection pixel point in the motion direction;
[0023] Calculate the absolute value of the difference between the fuzzy index of the projected pixel point of the pixel point and the projected pixel points of each sampling pixel point of the pixel point, calculate the sum of the preset adjustment parameter coefficient greater than zero and the absolute value of the difference, obtain the ratio of the spatial fuzzy similarity coefficient between the pixel point and each of its sampling pixel points and the sum, and use the ratio as the fuzzy similarity coefficient between the pixel point and each of its sampling pixel points.
[0024] Furthermore, the step of obtaining the motion blur distance of the license plate according to the blur similarity coefficient between each pixel point and the sampling pixel point includes:
[0025] For each pixel point, obtain the normalized value of the blur similarity coefficient between the pixel point and each sampling pixel point of the pixel point, count the number of the normalized values greater than the preset blur similarity threshold, use the number as the motion blur distance of the pixel point in the motion blur direction, and randomly select the motion blur distance of a pixel point in the motion blur direction as the motion blur distance of the license plate.
[0026] Furthermore, the PSF point spread function is constructed based on the motion blur angle and motion blur distance of the license plate, and the expression is:
[0027]
[0028] Where h() is the PSF point spread function, U is the motion blur distance of the license plate, β is the motion blur angle of the license plate, x is the horizontal coordinate of the pixel in the grayscale license plate image, and y is the vertical coordinate of the pixel in the grayscale license plate image.
[0029] The present invention has the following beneficial effects:
[0030] The invention aims at the problem that when estimating the motion blur angle of a license plate, the shape characteristics of the license plate are not considered, which may cause multiple extreme values to appear in the projection matrix of the Radon transform, thereby reducing the accuracy of the motion blur angle. The invention optimizes the estimation method of the motion blur angle according to prior knowledge and a blur motion direction index, thereby improving the accuracy of estimating the motion blur angle of the license plate; obtains the font remoteness index of the pixel point through the Euclidean distance between the pixel point and the font pixel point, and analyzes the possibility of whether the pixel point is located in a blur area or a font edge; constructs the spatial blur similarity coefficient between the pixel points according to the font remoteness index of the pixel point and the spatial distance in the motion blur direction, and analyzes the probability of the pixel points being in the same blur area from the distance aspect; constructs the blur similarity coefficient between the pixel points according to the spatial blur similarity coefficient between the pixel points and the blur index of the pixel points, further analyzes the similarity of the characteristic values of the pixel points, and improves the accuracy of judging whether the pixel points are located in the same blur area; obtains the motion blur distance of the license plate according to the blur similarity coefficient of the pixel points, and constructs a PSF point spread function based on the motion blur angle and the motion blur distance of the license plate, and then restores the license plate area image according to the PSF point spread function, thereby improving the restoration effect of the license plate area image. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 A block diagram of a smart city road intelligent monitoring system provided by an embodiment of the present invention;
[0033] Figure 2 Schematic diagram of denoised spectrum image B;
[0034] Figure 3 is a schematic diagram of a binary edge spectrum image C;
[0035] Figure 4 It is a schematic diagram of fuzzy distance;
[0036] Figure 5 Schematic diagram of the process of obtaining the PSF point spread function. DETAILED DESCRIPTION
[0037] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a smart city road intelligent monitoring system proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0038] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0039] The specific scheme of a smart city road intelligent monitoring system provided by the present invention is described in detail below with reference to the accompanying drawings.
[0040] See also Figure 1 , which shows a block diagram of a smart city road intelligent monitoring system provided by an embodiment of the present invention. The system includes: an image acquisition module 101, a license plate area image processing module 102, and a license plate area image restoration module 103.
[0041] The image acquisition module 101 uses the road monitoring of the smart city to capture road images and pre-processes the obtained images.
[0042] The images of vehicles on the road are obtained through surveillance cameras at road intersections. Due to the complex road traffic environment, wide surveillance shooting range, and high speed of cars, there is more vehicle information and more noise in the captured images, so the images need to be preprocessed. First, the surveillance image and label data are one-hot encoded and sent to the network for training to segment the vehicle area. The label data is manually annotated, and the vehicle area and non-vehicle area are represented by the numbers 0 and 1 respectively. The neural network adopts the ResNet18 network structure. The training of the neural network is a well-known technology and will not be repeated in this embodiment. The output of the neural network is a surveillance image with marked vehicle areas. At this point, each vehicle area in the surveillance image can be obtained.
[0043] Similarly, by encoding a single vehicle area with label data and using a neural network to perform image segmentation, the license plate area image in the vehicle area can be obtained. The method of pre-segmenting the license plate area can not only reduce the amount of calculation for subsequent processing, but also reduce the error of subsequent image detection. The license plate area image is denoised using the Gaussian filtering method, and the implementer may also adopt other denoising methods. The denoised license plate area image is converted into a grayscale image, recorded as grayscale license plate image A, to complete the preprocessing of the license plate image. The Gaussian filtering method is a well-known technology and will not be described in detail in this embodiment.
[0044] The license plate area image processing module 102 first obtains the binary edge spectrum image C of the grayscale license plate image, then optimizes the angle selection method in the Radon transform projection matrix to obtain the motion blur angle of the license plate, and then obtains the fuzzy similarity coefficient between pixels by calculating the spatial fuzzy similarity coefficient and the fuzzy index, and finally obtains the motion blur distance of the license plate.
[0045] The grayscale license plate image A is converted from the air domain to the frequency domain using Fourier transform. In the spectrum diagram of the grayscale license plate image A, light and dark stripes alternate, and the motion blur angle can be calculated by the angle of the alternating stripes. Performing homomorphic transformation on the spectrum image and compressing the grayscale value of the image can make the stripe features after Fourier transform more obvious. Although the stripe features can be more clearly reflected after homomorphic transformation, since the camera is affected by external weather factors when shooting the vehicle and the captured image contains noise, the spectrum diagram obtained by Fourier transforming the image will have a large amount of burrs and noise, which will have a certain error effect on the estimated motion blur angle. Therefore, in order to reduce the impact of noise on the motion blur angle estimation, the corrosion and expansion operations in morphology are used to remove the burrs and noise in the stripes, so that the stripe contrast in the spectrum diagram is more obvious, and the impact of the cross bright lines in the spectrum diagram can also be reduced. Fourier transform, homomorphic transformation and morphological operations are well-known technologies and will not be repeated in this embodiment. The spectrum image after the above operations is recorded as denoised spectrum image B. The schematic diagram of denoised spectrum image B is shown in FIG. Figure 2 shown.
[0046] Depend on Figure 2 It can be seen that the grayscale license plate image A under the influence of motion blur has light and dark stripes in its direction of motion, and the direction of the stripes is perpendicular to the direction of motion of the license plate. Since each intersection has a dedicated camera for license plate recognition, one camera corresponds to one direction, so after the car passes the camera, it continues to move forward, and the forward direction is perpendicular to the monitoring pole where the camera is located. This is because the monitoring pole in normal life is placed horizontally above the lane, perpendicular to the lane driving line, and the vehicle is driving along the lane, so the vehicle's direction of travel is perpendicular to the objects on the monitoring pole. Therefore, the grayscale license plate image A changes more in the vertical direction, which is motion blur in the vertical direction. The alternating stripes in the spectrum diagram of the grayscale license plate image A are horizontal.
[0047] Since the spectrum graph after Fourier transformation inevitably has a central cross bright line, errors will occur in the subsequent straight line detection and motion direction calculation. Therefore, the denoised spectrum image B is converted into a binary image to make the bright and dark stripes more obvious and less redundant information. Then, the morphological corrosion operation is used to eliminate the burrs of the stripes, and then the Canny edge detection is performed on the binary image after the burrs are eliminated, which is recorded as the binary edge spectrum image C. The schematic diagram of the binary edge spectrum image C is shown in Figure 3 Binary image conversion and Canny edge detection are well-known technologies and will not be described in detail in this embodiment.
[0048] It can be seen from the binary edge spectrum image C that after the corrosion operation and edge detection, the central cross bright line generated by the Fourier transform has been eliminated and will not affect the subsequent motion direction detection. Radon transform is to perform linear integration on a specified angle on the spectrum graph. By default, a matrix R with 180 columns is obtained by calculating the angle in the range of 1° to 180°. Each column vector is the integral projection of the image along a cluster of straight lines at an angle, that is, a straight line determined by a unique angle and a unique length. After Radon transform, a unique R value can be obtained, and the number of columns of the vector where the R value is located is the transformed angle. According to the prior knowledge that the car is perpendicular to the camera when driving, the calculation angle range of Radon transform is optimized to eliminate the influence of the horizontal direction and improve the calculation efficiency and accuracy of Radon transform. The binary edge spectrum image C is used as the input of Radon transform, the angle range is 80° to 100°, and the step size of each Radon transform is 0.2°. After Radon transform, a projection matrix R with 100 columns can be obtained. Radon transform is a well-known technology and will not be repeated in this embodiment.
[0049] The way Radon calculates the motion blur angle through the projection matrix R is to find the maximum value of the projection in the projection matrix R. The angle corresponding to the column where the maximum value is located is the motion blur angle θ. If the moving object is an irregular shape, the motion blur angle θ of its motion blurred image can be directly obtained using Radon transform. However, the shape of the license plate is very regular and symmetrical, and its size is also strictly limited. Because the vehicle has a stable driving direction and travels in a straight line at a constant speed in a short period of time, there may be multiple extreme values with the same projection value at different angles in the projection matrix R with 100 column vectors. The maximum values with the same projection value are collectively referred to as extreme values below. There may also be multiple extreme values in a column vector. If the angle θ corresponding to a column with an extreme value is randomly selected as the motion blur angle, it may have an adverse effect on the subsequent image restoration. Therefore, the motion blur angle needs to be further processed. The blurred motion direction B(i) of the i-th column with an extreme value in the projection matrix R is calculated as follows:
[0050]
[0051] Where B(i) is the blur motion direction of the i-th column with extreme value in the projection matrix R; θ i is the angle corresponding to the i-th column with extreme value, is the mean of the angles corresponding to all column vectors with extreme values, u iis the number of extreme values in the i-th column with extreme values.
[0052] Since the shape of the license plate is a standard rectangle, the more extreme values there are in the i-th column, the more likely the angle corresponding to the current column is to be the best motion blur angle. When the angle corresponding to the i-th column is closer to the angles corresponding to the other columns with extreme values, that is, the smaller the blurred motion direction B(i) of the i-th column is, the higher the probability that the angle corresponding to the i-th column is the motion blur angle of the license plate. The angle corresponding to the column with the smallest blurred motion direction is taken as the motion blur angle β of the license plate. The reason why the mean of the angles corresponding to the column with the extreme value is not taken is to avoid the situation where there is no extreme value in the column corresponding to the mean.
[0053] The motion blur angle and motion blur distance of the license plate area image determine the PSF point spread function of the image motion blur. Therefore, we only need to obtain the blur distance in the blur direction to estimate the PSF point spread function. Taking the blue license plate in the scene as an example, the font and background colors in the license plate image are very different. The font color is white with the highest grayscale value, and the edge features are obvious; however, after being affected by motion blur, the edge features of the font area are blurred and become a blurred edge area with uneven grayscale value distribution. Since the car is traveling in a straight line at a constant speed and the direction is stable, the motion blur length of the license plate is the same. Based on the obtained motion blur angle β, a motion direction straight line S that is consistent with the direction of the motion blur angle is randomly constructed in the grayscale license plate image A. β , assuming that the width of the moving direction straight line is 1 pixel, and the grayscale value of the pixel on the moving direction straight line is the average grayscale value of all pixels in the grayscale license plate image A. By using the method of sampling along the moving direction straight line to calculate the width of the blurred edge area in the straight line direction, the blurred distance of the image can be calculated. The schematic diagram of the blurred distance is shown in Figure 4 shown.
[0054] Take all the pixels in the grayscale license plate image A as input and obtain the i-th pixel in the moving direction straight line S β The projected pixel points on the moving direction line S β The pixel point with the closest Euclidean distance to the i-th pixel point is the projected pixel point, recorded as the projected pixel point of the i-th pixel point Projection pixels Create a 3*3 sliding window for the center and use the LBP algorithm to obtain the projected pixel points The LBP feature value of the pixel is located on the straight line, so it is recorded as S [L(i)] The LBP algorithm is a well-known technology and will not be described in detail in this embodiment. β And the projected pixels The LBP eigenvalue S [L(i)] , we can get the projected pixel point Blur index in the direction of motion Among them, S [L(i)] Projection pixel point on the straight line The LBP feature value can reflect the projected pixel point The difference between the grayscale values in its neighborhood range, considering that the colors of the font area and the background area in the license plate image are highly consistent, the LBP eigenvalues of the projected pixels in the font area and the background area will be very small, and only in the fuzzy edge area will the LBP eigenvalues of the projected pixels be large. Therefore, if S [L(i)] The larger the value, the greater the possibility that the projected pixel is in the blurred edge area.
[0055] Because the overall blur direction of the license plate is consistent, the motion blur direction of the pixels in the license plate is also consistent, and when the pixel is located in the blurred edge area of the font area and the background area, the blur degree of the pixel will be higher. Since there are strict requirements on the color of the characters and the background in the license plate, the font color is white, and the grayscale value of the pixels in the font area is 255. Taking the rth pixel in the grayscale license plate image as an example, with the rth pixel as the starting point, a rectangular coordinate system is constructed, in which the x-axis is aligned with the motion direction straight line S β Vertical, y-axis and motion direction straight line S β Parallel. In the rectangular coordinate system, in the positive and negative directions of the y-axis and the positive and negative directions of the x-axis, a total of four directions, search for pixels with a grayscale value of 255. Hereinafter, pixels with a grayscale value of 255 are uniformly referred to as font pixels. Set the Euclidean distance between the r-th pixel and the first font pixel found in the above four directions as y1 r ,y2 r 、x1 r , x2 r If the font pixel cannot be found in one of the four directions, the Euclidean distance in that direction is set to 0, and the font remoteness index D of the rth pixel is calculated. r , the expression is:
[0056]
[0057] Where D r is the font remoteness index of the rth pixel point, τ is a preset parameter adjustment coefficient greater than zero, and the setting of τ can be selected by the implementer. In this embodiment, τ is 0.0001; y1 r ,y2 r 、x1 r , x2 r Respectively represent the Euclidean distance between the rth pixel and the first font pixel found in the positive direction of the y-axis, the negative direction of the y-axis, the positive direction of the x-axis, and the negative direction of the x-axis.
[0058] If the rth pixel is in the background area, no font pixel can be found in the positive and negative directions of the y-axis and the positive and negative directions of the x-axis. r The value of will be larger; if the rth pixel is in the font area, there is a font pixel with a Euclidean distance of 1 to the rth pixel in the positive and negative directions of the y axis and the positive and negative directions of the x axis, respectively. r The value of will also be larger; if the rth pixel is in the blurred area or on the edge of the font, the sum of the Euclidean distances between the rth pixel and the font pixels in the above four directions must be smaller, D r The smaller the value of .
[0059] Project the t-th pixel and the r-th pixel onto the motion direction line S respectively. β On the top, let the projection pixel of the t-th pixel be The projection pixel of the rth pixel is According to the spatial distance between the t-th pixel and the r-th pixel in the blur motion direction and the font remoteness index, the spatial blur similarity coefficient K between the two pixels is calculated. (t,r) , the expression is:
[0060]
[0061] In the formula, K (t,r) is the spatial fuzzy similarity coefficient between the t-th pixel and the r-th pixel; e * is an exponential function with a natural constant as the base, γ is a preset parameter adjustment coefficient greater than zero, and the setting of γ can be selected by the implementer. In this embodiment, γ is 0.01; Distance() is a Euclidean distance function; is the projection pixel of the t-th pixel, is the projection pixel of the rth pixel, D t is the font remoteness index of the t-th pixel, D r is the font remoteness index of the r-th pixel.
[0062] The closer the distance between the spatial projection points of the t-th pixel and the r-th pixel, The smaller the value of |D is, the more likely it is that the font remoteness index is calculated by the Euclidean distance between the pixel and the first font pixel in the above four directions. Therefore, if the t-th pixel and the r-th pixel are not in the same fuzzy interval, the fuzzy difference between the t-th pixel and the r-th pixel will be greater. Therefore, if |D t -D rThe smaller the value of |, the greater the possibility that the t-th pixel and the r-th pixel are in the same fuzzy edge area. At this time, if the spatial fuzzy similarity coefficient K between the two pixels is (t,r) The larger it is, the more likely it is that the two pixels are in the same fuzzy interval and the higher the fuzzy similarity.
[0063] According to the blur index of the projected pixel of each pixel in the motion direction, the motion blur distance is calculated by sampling along the straight line in the motion direction. Taking the rth pixel as an example, the rth pixel is taken as the sampling center and the motion blur distance is calculated by sampling along the straight line S in the motion direction. β Sampling is performed to obtain the sampling pixel of the r-th pixel. The similarity between the m-th pixel and the r-th pixel in the sampling pixel of the r-th pixel is calculated to construct the fuzzy similarity coefficient P (r,m) , the expression is:
[0064]
[0065] Where P (r,m) is the fuzzy similarity coefficient between the r-th pixel and the m-th pixel in the sampling pixel of the r-th pixel, K (r,m) is the spatial fuzzy similarity coefficient between the r-th pixel and the m-th pixel in the sampling pixel of the r-th pixel, γ is a preset parameter adjustment coefficient greater than zero, and the setting of γ can be selected by the implementer. In this embodiment, γ is 0.01, M() is a fuzzy index operation, is the projection pixel of the rth pixel, It is the projection pixel point of the m-th pixel point among the sampling pixels of the r-th pixel point.
[0066] When the fuzzy similarity between the r-th pixel and the m-th pixel in the sampling pixel of the r-th pixel is higher, that is, the spatial fuzzy similarity coefficient between the above two pixels is larger, and the absolute value of the difference between the LBP eigenvalues of the projected pixel points of the above two pixels is smaller, that is, the absolute value of the difference between the fuzzy indexes of the projected pixel points of the above two pixels is smaller, then P (r,m) The larger the value of , the more likely it is that the two pixels are in the same fuzzy interval.
[0067] In order to obtain the width of the blurred edge area more accurately, it is necessary to calculate the number of pixels in the same blurred interval. For the convenience of calculation, the pixel fuzzy similarity coefficient P (r,m) The value of is normalized and the pixel fuzzy similarity coefficient P is set. (r,m)The normalized preset fuzzy similarity threshold is V, and the setting of V can be selected by the implementer. In this embodiment, V is 0.7. The fuzzy similarity coefficients between all pixels in the sampling pixel of the r-th pixel and the r-th pixel are traversed to obtain the motion blur distance U(r) of the pixel in the motion blur direction, which is expressed as:
[0068] U(r)=Number{Norm[P (r,m) ]>V},m∈[1,Q]
[0069] Where U(r) is the motion blur distance of the r-th pixel in the motion blur direction, Number{} represents the statistical function, Norm[] represents the normalization function, and P (r,m) is the fuzzy similarity coefficient between the r-th pixel and the m-th pixel, and Q is the number of sampling pixels of the r-th pixel.
[0070] The fuzzy similarity coefficients of all pixels in the sampled pixels of the r-th pixel and the r-th pixel are traversed, and the statistical function is expressed as the number of pixels whose normalized value of the fuzzy similarity coefficient is greater than the preset fuzzy similarity threshold V.
[0071] Since the car is moving in a straight line at a constant speed and in a stable direction, the motion blur distances of all pixels in the grayscale license plate image in the motion blur direction are equal. Therefore, the motion blur distance U(r) of the rth pixel in the motion blur direction can be used as the motion blur distance U of the license plate.
[0072] The license plate area image restoration module 103 constructs a PSF point spread function and performs license plate area image restoration.
[0073] The PSF point spread function is constructed based on the motion blur angle β and motion blur distance U of the license plate. The expression is:
[0074]
[0075] In the formula, h() is the PSF point spread function, U is the motion blur distance of the license plate, β is the motion blur angle of the license plate, x is the horizontal coordinate of the pixel in the grayscale license plate image, and y is the vertical coordinate of the pixel in the grayscale license plate image. The schematic diagram of the acquisition process of the PSF point spread function is as follows: Figure 5 shown.
[0076] The PSF point spread function is obtained, and the Wiener filter algorithm is used to restore the license plate area image. Image restoration using Wiener filtering is a well-known technology and will not be described in detail in this embodiment. So far, according to the above process of this embodiment, the restoration of urban road images can be realized, the quality of road images can be improved, and the purpose of intelligent monitoring of roads in smart cities can be achieved.
[0077] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0078] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0079] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A smart city road intelligent monitoring system, characterized in that: The system comprises: An image acquisition module collects road images and uses a neural network to segment the license plate area of the road image to obtain a grayscale license plate image; The license plate area image processing module uses Fourier transform to obtain the spectrum of the grayscale license plate image, converts the spectrum into a binary image, performs edge detection on the binary image to obtain a binary edge spectrum image, and uses Radon transform to obtain the projection matrix of the binary edge spectrum image; obtains the fuzzy motion direction of each column with extreme values through the extreme values in the projection matrix and the angles corresponding to each column with extreme values; obtains the motion blur angle of the license plate based on the fuzzy motion direction of the column with extreme values; randomly constructs a motion direction straight line consistent with the motion blur angle direction in the grayscale license plate image, and obtains the Euclidean distance between each pixel in the grayscale license plate image and the pixel on the motion direction straight line. Project pixel points; obtain the font remoteness index of each pixel point according to the Euclidean distance between each pixel point and the font pixel point; obtain the spatial fuzzy similarity coefficient between any two pixel points according to the font remoteness index of any two pixel points and the projected pixel point; take each pixel point as the sampling center and perform sampling along the straight line in the motion direction to obtain the sampled pixel point of each pixel point, and obtain the fuzzy similarity coefficient between each pixel point and the sampled pixel point according to the spatial fuzzy similarity coefficient between each pixel point and the sampled pixel point and the LBP feature value; obtain the motion fuzzy distance of the license plate according to the fuzzy similarity coefficient between each pixel point and the sampled pixel point; construct the PSF point spread function based on the motion fuzzy angle and motion fuzzy distance of the license plate; The license plate area image restoration module uses the Wiener filter algorithm based on the PSF point spread function to restore the license plate area image, achieving the purpose of intelligent monitoring of smart city roads; The obtaining of the font remoteness index of each pixel point according to the Euclidean distance between each pixel point and the font pixel point includes: For each pixel point, a rectangular coordinate system is constructed with the pixel point as the starting point, where the x-axis is perpendicular to the straight line of the motion direction, and the y-axis is parallel to the straight line of the motion direction. Pixel points with a grayscale value of 255 are searched in the positive and negative directions of the y-axis and the positive and negative directions of the x-axis, which are recorded as font pixels. The Euclidean distance between the pixel point and the first font pixel point found in the four directions is calculated. If the font pixel point cannot be found in one of the four directions, the Euclidean distance is 0. The expression of the font remoteness index of the r-th pixel point is: Where D r is the font remoteness index of the rth pixel, τ is the parameter adjustment coefficient preset to be greater than zero, y1 r ,y2 r 、x1 r , x2 r Respectively represent the Euclidean distance between the rth pixel and the first font pixel found in the positive direction of the y-axis, the negative direction of the y-axis, the positive direction of the x-axis, and the negative direction of the x-axis; The method of obtaining a spatial fuzzy similarity coefficient between any two pixels according to the font remoteness index of any two pixels and the projected pixel point includes: For any two pixel points, obtain the opposite number of the Euclidean distance between the projected pixel points of the two pixel points, use the opposite number as the exponent of an exponential function with a natural constant as the base, calculate the absolute value of the difference between the font remoteness indexes of the two pixel points, calculate the sum of a preset parameter adjustment coefficient greater than zero and the absolute value of the difference, and use the ratio of the calculation result of the exponential function to the sum as the spatial fuzzy similarity coefficient between the two pixel points; The method of obtaining the fuzzy similarity coefficient between each pixel point and the sampling pixel point according to the spatial fuzzy similarity coefficient between each pixel point and the sampling pixel point and the LBP feature value includes: For each pixel point, the projection pixel point of each sampling pixel point of the pixel point is obtained, a square window is constructed with each projection pixel point as the center, and the LBP eigenvalue of the pixel point at the center of each window is used as the fuzzy index of each projection pixel point in the motion direction; Calculate the absolute value of the difference between the projection pixel point of the pixel point and the projection pixel point of each sampling pixel point of the pixel point, calculate the sum of the preset parameter adjustment coefficient greater than zero and the absolute value of the difference, obtain the ratio of the spatial fuzzy similarity coefficient between the pixel point and each sampling pixel point of the pixel point and the sum, and use the ratio as the fuzzy similarity coefficient between the pixel point and each sampling pixel point of the pixel point; The method of obtaining the motion blur distance of the license plate according to the blur similarity coefficient between each pixel point and the sampling pixel point includes: For each pixel point, obtain the normalized value of the blur similarity coefficient between the pixel point and each sampling pixel point of the pixel point, count the number of the normalized values greater than the preset blur similarity threshold, use the number as the motion blur distance of the pixel point in the motion blur direction, and randomly select the motion blur distance of a pixel point in the motion blur direction as the motion blur distance of the license plate.
2. According to claim 1, a smart city road intelligent monitoring system is characterized in that: The method of obtaining a projection matrix of a binary edge spectrum image by using Radon transform includes: The binary edge spectrum image is used as the input of Radon transform, and the output of Radon transform is the projection matrix.
3. According to claim 1, a smart city road intelligent monitoring system is characterized in that: The step of obtaining the blur motion direction of each column having the extreme value through the extreme value in the projection matrix and the angle corresponding to each column having the extreme value comprises: Get the extreme values in the projection matrix, for each column with extreme values, calculate the mean of the angles corresponding to all columns with extreme values, calculate the absolute value of the difference between the angle corresponding to the column with extreme values and the mean, calculate the ratio of the absolute value of the difference of the column with extreme values to the number of extreme values in the column with extreme values, and use the ratio as the blurred motion direction of the column with extreme values.
4. The smart city road intelligent monitoring system according to claim 1 is characterized in that: The method of obtaining the motion blur angle of the license plate according to the blur motion direction of the column with the extreme value is specifically: taking the angle corresponding to the column with the smallest blur motion direction as the motion blur angle of the license plate.
5. The smart city road intelligent monitoring system according to claim 1 is characterized in that: The method of obtaining the projected pixel point of each pixel point in the grayscale license plate image according to the Euclidean distance between each pixel point in the grayscale license plate image and the pixel point on the straight line of the moving direction includes: The pixel point on the straight line of the moving direction with the closest Euclidean distance to each pixel point in the grayscale license plate image is used as the projection pixel point of each pixel point in the grayscale license plate image, where the grayscale value of the pixel point on the straight line of the moving direction is the average grayscale value of all pixels in the grayscale license plate image.
6. The smart city road intelligent monitoring system according to claim 1 is characterized in that: The PSF point spread function is constructed based on the motion blur angle and motion blur distance of the license plate, and the expression is: Where h() is the PSF point spread function, U is the motion blur distance of the license plate, β is the motion blur angle of the license plate, x is the horizontal coordinate of the pixel in the grayscale license plate image, and y is the vertical coordinate of the pixel in the grayscale license plate image.
