[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN117934417B - Method, device, equipment and medium for identifying apparent defects of road based on neural network - Google Patents

Method, device, equipment and medium for identifying apparent defects of road based on neural network Download PDF

Info

Publication number
CN117934417B
CN117934417B CN202410101114.9A CN202410101114A CN117934417B CN 117934417 B CN117934417 B CN 117934417B CN 202410101114 A CN202410101114 A CN 202410101114A CN 117934417 B CN117934417 B CN 117934417B
Authority
CN
China
Prior art keywords
image
gray
gray level
real
road
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410101114.9A
Other languages
Chinese (zh)
Other versions
CN117934417A (en
Inventor
刘波
姚玲
周卫东
王斌
闫敬辉
李佳文
任伟龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Shoufa Highway Maintenance And Construction Co ltd
Original Assignee
Beijing Shoufa Highway Maintenance And Construction Co ltd
Filing date
Publication date
Application filed by Beijing Shoufa Highway Maintenance And Construction Co ltd filed Critical Beijing Shoufa Highway Maintenance And Construction Co ltd
Priority to CN202410101114.9A priority Critical patent/CN117934417B/en
Publication of CN117934417A publication Critical patent/CN117934417A/en
Application granted granted Critical
Publication of CN117934417B publication Critical patent/CN117934417B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a road identification area design method based on a neural network for realizing road apparent defect identification, which comprises the following steps: acquiring a real-time image of a road; carrying out graying treatment on the real-time image to obtain a gray image; carrying out normalization processing on the gray level image to obtain a normalized image; carrying out noise reduction treatment on the normalized image to obtain a noise reduction image; carrying out gray enhancement on the noise reduction image by using a histogram equalization algorithm to obtain a real-time gray histogram; classifying and identifying the real-time gray level histogram by using a preset neural network, and judging whether the road has apparent defects or not; an enhanced image is generated using the real-time gray level histogram and segmented on the enhanced image to form a defective region. In addition, the invention also provides a device, equipment and medium for identifying the apparent defects of the road based on the neural network. The invention can efficiently and simply extract the useful information in the road image and accurately identify the apparent defects of the road by matching with the neural network.

Description

Method, device, equipment and medium for identifying apparent defects of road based on neural network
Technical Field
The invention relates to the technical field of road identification, in particular to a method, a device, equipment and a medium for identifying apparent defects of a road based on a neural network.
Background
The apparent defects of the road comprise road cracks, loose roads, road deformation, road flooding and the like, and various defects cause the performance of the road to be reduced, so that the driving safety is influenced, and based on the situation, related personnel adopt a neural network to identify the apparent defects of the road, acquire specific information of the apparent defects of the road, such as specific positions, specific defect ranges and the like, so as to remind the driving of avoiding the apparent defects of the road.
The existing method for identifying the apparent defects of the road by adopting the neural network firstly identifies the information of the road image and then matches the neural network for identification, because of the limitation of the method, a large amount of road information needs to be acquired during identification, so that the amount of information processed by the neural network is too huge, millions of information is less, more millions of information are more and more millions of information are processed, in daily life, the hardware configuration carried by the household automobile is low in calculation power, a large amount of information cannot be rapidly processed, and thus people on the automobile cannot be timely reminded of avoiding the defective road.
Disclosure of Invention
The invention provides a method for realizing road apparent defect identification based on a neural network, which mainly aims to solve the problems of how to efficiently and simply extract useful information in a road image and reasonably apply the calculation power of the neural network to accurately identify the road apparent defect.
In order to achieve the above object, the present invention provides a method for identifying apparent defects of a road based on a neural network, the method comprising:
acquiring a real-time image of a road;
carrying out graying treatment on the real-time image by using a weighted average method to obtain a gray image;
carrying out normalization processing on the gray level image by using a maximum and minimum method to obtain a normalized image;
Carrying out noise reduction treatment on the normalized image by utilizing median filtering to obtain a noise reduction image;
Gray scale enhancement is carried out on the noise reduction image by using a histogram equalization algorithm, so that an enhanced image is obtained;
classifying and identifying the enhanced image by using a preset neural network, and judging whether the road has apparent defects or not;
and dividing and forming a defect area on the enhanced image according to the apparent defects of the road.
Optionally, the performing a graying process on the real-time image by using a weighted average method to obtain a gray image includes:
three channel pixel values of each pixel point in the real-time image are extracted;
The gray pixel values for each pixel point are calculated one by one using the following weighted average algorithm:
Grayi=0.299*Ri+0.578*Gi+0.114*Bi
Wherein Grayi represents a gray pixel value of an ith extraction pixel point, ri represents a red channel pixel value of the ith extraction pixel point, gi represents a green channel pixel value of the ith extraction pixel point, bi represents a blue channel pixel value of the ith extraction pixel point, i represents the ith extraction pixel point, 0.299, 0.578 and 0.114 represent weighted values of pixel values of different channels, and the gray pixel value of the ith extraction pixel point in the real-time image is obtained through formula calculation;
and obtaining a gray image according to the calculated gray pixel values of each pixel point.
Optionally, the normalizing the gray scale image by using a maximum-minimum method to obtain a normalized image includes:
extracting gray pixel values of all pixel points in the gray image;
and calculating gray pixel values of all the pixel points one by using the following maximum and minimum methods to obtain standard values of all the pixel points:
Wherein i represents the number of times of extraction, normi represents the standard value of the ith extracted pixel point, xi represents the gray pixel value of the ith extracted pixel point, min (x) represents the minimum gray pixel value in each pixel point in the gray image, and max (x) represents the maximum gray pixel value in each pixel point in the gray image;
and obtaining a normalized image according to the standard value of each pixel point.
Optionally, the denoising processing is performed on the normalized image by using median filtering, so as to obtain a denoised image, including:
S41, creating a sliding window with odd pixel value size;
s42, placing the sliding window on the normalized image, and collecting standard values of all pixel points in the sliding window;
S43, sorting the standard values of all pixel points of the sliding window from small to large to obtain an intermediate value;
S44, giving the intermediate value to the pixel point in the center of the sliding window;
S45, continuously moving the sliding window, and repeating the steps S43 and S44 until the whole normalized image is covered, and converting the normalized image into a noise reduction image.
Optionally, the performing gray enhancement on the noise reduction image by using a histogram equalization algorithm to obtain a real-time gray histogram includes:
generating an original gray level histogram according to the noise reduction image;
The original gray level histogram is equalized by using the following histogram equalization algorithm to obtain a real-time gray level histogram:
Where MN is the total number of pixels of the noise reduction image, sk is the gray level of the real-time gray level histogram, rk is the gray level of the noise reduction image, nj is the number of pixels of the current gray level, p (ri) is the probability of each gray level, L is the total number of gray levels of the noise reduction image, and k is the gray level range [0, L-1].
Optionally, the classifying and identifying the real-time gray level histogram by using a preset neural network, and judging whether the road has an apparent defect includes:
extracting normal distribution, average value and bimodal characteristic value in the real-time gray level histogram by using a neural network;
Performing similarity comparison on the normal distribution, the average value and the bimodal characteristic value and the normal distribution, the average value and the bimodal characteristic value of a preset gray level histogram to obtain a comparison result;
if the similarity of the comparison result is higher than or equal to 95%, the road has no apparent defect;
if the similarity of the comparison result is lower than 95%, the road has apparent defects.
Optionally, the generating an enhanced image using the real-time gray level histogram and dividing the enhanced image to form a defect region includes:
Generating an enhanced image according to the real-time gray level histogram;
dividing the enhanced image into a number of tiles;
Respectively extracting normal distribution, average value and bimodal characteristic value of gray level histograms of a plurality of image blocks by using a neural network;
Respectively comparing the normal distribution, the average value and the bimodal characteristic value of the gray level histograms of a plurality of image blocks with the normal distribution, the average value and the bimodal characteristic value of the preset gray level histograms in a similarity manner to obtain a plurality of second comparison results;
marking the image blocks with the similarity lower than 95% of the second comparison results in the image blocks as '1';
On the enhanced image, all tiles marked "1" are segmented, forming a defective area.
In order to solve the above problems, the present invention also provides a device for identifying apparent defects of a road based on a neural network, the device comprising:
The acquisition module acquires a real-time image of a road;
The image conversion module is used for carrying out graying treatment on the real-time image by using a weighted average method to obtain a gray image, carrying out normalization treatment on the gray image by using a maximum and minimum method to obtain a normalized image, and carrying out noise reduction treatment on the normalized image by using median filtering to obtain a noise reduction image;
The image enhancement module is used for carrying out gray enhancement on the noise reduction image by using a histogram equalization algorithm to obtain a real-time gray histogram;
And the neural network module is used for classifying and identifying the real-time gray level histogram by using a preset neural network, judging whether the road has apparent defects, generating an enhanced image by using the real-time gray level histogram, and dividing the enhanced image into defect areas.
In order to solve the above-mentioned problems, the present invention also provides an electronic apparatus including:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform any one of the above-described neural network-based road apparent defect identification methods.
In order to solve the above-mentioned problems, the present invention also provides a computer-readable storage medium having stored therein at least one computer program that is executed by a processor in an electronic device to implement the above-mentioned method for identifying apparent defects of a road based on a neural network.
According to the embodiment of the invention, each characteristic value in the real-time image can be extracted and obtained according to the obtained real-time image, the real-time image is converted into the gray image by using a weighted average method, the information value in the real-time image is reduced, the process of reading information by a system is quickened, the gray image is converted into the normalized image by using a maximum and minimum method, the gray pixel value span of each pixel point in the gray image is reduced, the work load of recognition calculation is further reduced, the working speed is quickened, the normalized image is converted into the noise reduction image by using a median filtering method, particles and discoloration in the normalized image are reduced, useful information in the image is reserved, the image is made clear, the noise reduction image is converted into the real-time gray histogram by using a histogram equalization algorithm, the real-time gray histogram image is extracted by using a preset neural network, whether the apparent defect exists on a road can be rapidly identified, the reinforced image is generated according to the real-time gray histogram, and a defect area is segmented on the reinforced image. Therefore, the method, the device, the equipment and the medium for realizing the identification of the apparent defects of the road based on the neural network can efficiently extract the useful information in the road image, and the method is used for carrying out the identification of the apparent defects of the road in cooperation with the neural network, and a double identification mode is provided, so that whether the apparent defects exist on the road is identified for the first time, the apparent defect areas of the road are identified for the second time, the calculation force of the equipment is reasonably distributed and applied, and the service life of the equipment is prolonged.
Drawings
FIG. 1 is a schematic flow chart of a method for identifying apparent defects of a road based on a neural network according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a gray scale image obtained by performing a gray scale process on the real-time image by using a weighted average method according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of normalizing the gray scale image by using the maximum and minimum method according to an embodiment of the present invention to obtain a normalized image;
FIG. 4 is a schematic flow chart of denoising the normalized image by median filtering according to an embodiment of the present invention;
FIG. 5 is a functional block diagram of a device for identifying apparent defects of a road in a neural network according to an embodiment of the present invention;
Fig. 6 is a schematic structural diagram of an electronic device for implementing a method for identifying apparent defects of a road based on a neural network according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the application provides a method for realizing road apparent defect identification based on a neural network. The execution subject of the method for realizing the road apparent defect identification based on the neural network comprises, but is not limited to, at least one of a server, a terminal and the like which can be configured to execute the method provided by the embodiment of the application. In other words, the method for identifying apparent defects of a road based on the neural network may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service end includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 1, a flow chart of a method for identifying apparent defects of a road based on a neural network according to an embodiment of the invention is shown.
In this embodiment, the method for identifying apparent defects of a road based on a neural network includes:
S1, acquiring a road real-time image.
Specifically, the real-time image of the road scene can be obtained by combining the vehicle-mounted camera device with the satellite picture, the obtaining mode is not required, and the real-time image is changed according to actual conditions.
S2, carrying out graying treatment on the real-time image by using a weighted average method to obtain a gray image.
In the embodiment of the invention, the real-time image is a color image, the color of each pixel point of the color image is determined by R, G, B channel pixel values, and the value range of each channel pixel value is between 0 and 255, so that in the calculation process, the variation range of each pixel point has 256 x 256=16777216 possibilities, the information quantity is too large, the calculation speed is slow, the Gray processing is the process of converting one color image into a Gray image, and in the Gray image, the color of each pixel point is determined by Gray channel pixel values, thereby simplifying the information quantity in the real-time image and improving the calculation speed.
Referring to fig. 2, in an embodiment of the present invention, the method for graying the real-time image by using a weighted average method to obtain a gray image includes:
S21, three channel pixel values of each pixel point in the real-time image are extracted;
s22, calculating gray pixel values of all pixel points one by using the following weighted average algorithm:
Grayi=0.299*Ri+0.578*Gi+0.114*Bi
Wherein Grayi represents a gray pixel value of an ith extraction pixel point, ri represents a red channel pixel value of the ith extraction pixel point, gi represents a green channel pixel value of the ith extraction pixel point, bi represents a blue channel pixel value of the ith extraction pixel point, i represents the ith extraction pixel point, 0.299, 0.578 and 0.114 represent weighted values of pixel values of different channels, and the gray pixel value of the ith extraction pixel point in the real-time image is obtained through formula calculation;
s23, obtaining a gray image according to the calculated gray pixel values of the pixel points.
In the embodiment of the invention, each pixel point has three values (red, green and blue) for representing colors, which are called three channels, the gray value of each color channel is between 0 and 255, and the three channels are overlapped and displayed as color pixels.
Specifically, the three-channel pixel values of each pixel point in the real-time image are extracted, for example, three-channel pixel values of each pixel point in the real-time image are extracted by using a preset first matlab statement, specific values of three channels of each pixel point are obtained, the extraction sequence is in a mode of from left to right and from top to bottom, sequential marking is performed, for example, three-channel pixel values of a first row above the real-time image are sequentially extracted from left to right, three-channel pixel values of a second row above the real-time image are sequentially extracted after the first row is extracted, and so on until the whole real-time image is extracted, and in the extraction process, i represents the extraction times.
Specifically, the gray pixel values of each pixel point are calculated one by using the following weighted average algorithm, for example, a three-channel pixel value is calculated by using a weighted average algorithm in a preset first matlab statement, wherein the algorithm selection may also adopt algorithms such as a maximum value method, a component method, an average value method, etc., and the specific algorithm selection is determined according to the actual situation.
The weighted average method is an algorithm for converting three channels (red, green and blue) into a single channel (gray), and the three different weights of 0.299, 0.578 and 0.114 are the highest sensitivity of human eyes to green and the lowest sensitivity to blue, so that the three components R, G, B are weighted and averaged with different weights to obtain reasonable gray pixel values.
Further, according to the calculated gray pixel values of each pixel point, a gray image is obtained, for example, a preset first matlab statement is used for combining the gray pixel values, and according to the extraction sequence, the gray pixel values of each pixel point are filled into a blank image until the gray pixel values of all pixel points are filled, so that the gray image is obtained.
In this embodiment, the preset first matlab statement does not require specifically, and the same functions and effects of the first matlab statement can be achieved by adopting modes such as Java statement, and the like, and the first matlab statement is selected according to specific situations.
And S3, carrying out normalization processing on the gray level image by using a maximum and minimum value method to obtain a normalized image.
In the embodiment of the invention, as the gray pixel value span of each pixel point in the gray image obtained in the step S2 is very large, the recognition and calculation workload is too large, and the normalization processing is carried out, so that the gray pixel value span of each pixel point is reduced, the recognition and calculation workload is reduced, and the working speed is accelerated.
Referring to fig. 3, in an embodiment of the present invention, the normalizing the gray scale image by using the maximum and minimum method to obtain a normalized image includes:
S31, extracting gray pixel values of all pixel points in the gray image;
S32, calculating gray pixel values of the pixel points one by using the following maximum and minimum methods to obtain standard values of the pixel points:
Wherein i represents the number of times of extraction, normi represents the standard value of the ith extracted pixel point, xi represents the gray pixel value of the ith extracted pixel point, min (x) represents the minimum gray pixel value in each pixel point in the gray image, and max (x) represents the maximum gray pixel value in each pixel point in the gray image;
s33, obtaining a normalized image according to the standard value of each pixel point.
The extraction method of each pixel point in the gray level image refers to S2, i represents the number of times of extraction, gray pixel values of each pixel point are sequentially extracted by using a preset second matlab statement, the maximum term of the gray pixel values of each pixel point is marked as max (x), and the minimum term is marked as min (x) according to the extraction sequence.
In detail, the following maximum and minimum methods are used for calculating the gray pixel values of all the pixel points one by one to obtain the standard value of each pixel point, and the gray pixel values of all the pixel points are sequentially traversed and calculated by using a maximum and minimum algorithm in a preset second matlab statement, so that the standard value of each pixel point is obtained, and the normalization operation can be performed by adopting a Z-score method, and the specific method is selected according to the actual situation.
Further, according to the standard values of the pixel points, a normalized image is obtained, the standard values of the pixel points are combined by using a preset second matlab statement, and according to the extraction sequence, the standard values of the pixel points are filled into a second blank image until the standard values of all the pixel points are filled, so that the normalized image is obtained.
S4, carrying out noise reduction processing on the normalized image by utilizing median filtering to obtain a noise reduction image.
In the embodiment of the invention, in the process of converting the real-time image into the gray level image and then into the normalized image, due to the limitation of technology, the image quality is inevitably reduced and unclear, and after the noise reduction treatment, particles and color changes in the image can be reduced, useful information in the image is reserved, so that the image becomes clear and the process of processing the image information is improved.
Referring to fig. 4, in the embodiment of the present invention, the noise reduction processing is performed on the normalized image by using median filtering to obtain a noise-reduced image, including:
S41, creating a sliding window with odd pixel value size;
s42, placing the sliding window on the normalized image, and collecting standard values of all pixel points in the sliding window;
S43, sorting the standard values of all pixel points of the sliding window from small to large to obtain an intermediate value;
S44, giving the intermediate value to the pixel point in the center of the sliding window;
S45, continuously moving the sliding window, and repeating the steps S43 and S44 until the whole normalized image is covered, and converting the normalized image into a noise reduction image.
The median filtering method is to take a certain pixel point as a center, create a window around the center, arrange from small to large according to the standard value of all the pixel points in the window, take the intermediate value in the arrangement as the median, and replace the median with the standard value of a certain pixel point.
In detail, the normalized image is read using the third matlab statement.
In the embodiment of the present invention, a sliding window with a pixel value of (odd x odd) is created, for example, a 3*3 sliding window is created, and the size of the sliding window needs to be selected according to an odd x odd rule, and the specific situation can be changed according to the actual situation.
Further, the normalized image boundary needs to be expanded from the lower left corner of the normalized image before collection, 0 is filled in the expanded boundary, for example, the number of pixels of the normalized image is k×k, the number of pixels of the image after expansion is (k+2) ×k+2, and the standard values of the pixels in the sliding window are collected and marked according to the collection sequence.
And sequencing the standard values of all pixel points of the sliding window from small to large to obtain a sliding window with a middle value and 3*3 pixel values, collecting 9 standard values, and arranging the 9 standard values from small to large, wherein the middle value is the standard value of the 5 th arrangement.
In detail, the sliding window is continuously moved, and the steps S43 and S44 are repeated until the whole normalized image is covered, the normalized image is converted into a noise reduction image, and the standard value of each pixel point in the original normalized image is replaced by an intermediate value, that is, the whole normalized image is replaced by the noise reduction image.
S5, carrying out gray enhancement on the noise reduction image by using a histogram equalization algorithm to obtain a real-time gray histogram.
In the embodiment of the invention, the gray level range of a pixel point of an image is [0, L-1], the histogram is expressed as a discrete function h (rk) =nk, rk is the k-th gray level value, nk is the number of pixels with the gray level value rk, namely the gray level histogram of the image represents the gray level distribution of the image, if the gray level histogram of an image almost covers the whole gray level value range, the image has a larger gray level dynamic range and higher contrast under the condition that the gray level distribution is approximately uniformly distributed, namely the details of the image are more abundant, the histogram equalization is to obtain a transformation function according to the histogram information of the input image, and the input image is recalculated by using the transformation function to obtain the real-time gray level histogram.
In the embodiment of the present invention, the performing gray enhancement on the noise reduction image by using a histogram equalization algorithm to obtain an enhanced image includes:
generating an original gray level histogram according to the noise reduction image;
The original gray level histogram is equalized by using the following histogram equalization algorithm to obtain a real-time gray level histogram:
Where MN is the total number of pixels of the noise reduction image, sk is the gray level of the real-time gray level histogram, rk is the gray level of the noise reduction image, nj is the number of pixels of the current gray level, p (ri) is the probability of each gray level, L is the total number of gray levels of the noise reduction image, and k is the gray level range [0, L-1].
In the embodiment of the invention, the information of each pixel point in the noise reduction image is read by using a fourth matlab statement, and a gray level histogram is generated according to the gray level rk, the pixel number nk and the probability p (ri) in the information.
In detail, the histogram equalization is a mapping method, namely, an original gray level histogram in an image is converted into a real-time gray level histogram through formula calculation, and the algorithm reflects the mapping relation between the real-time gray level histogram and the original gray level histogram.
The specific execution language selection is changed according to the actual situation.
S6, classifying and identifying the real-time gray level histogram by using a preset neural network, and judging whether the road has apparent defects or not.
In the embodiment of the invention, each characteristic in the real-time gray level histogram is extracted rapidly by using the preset neural network, the extracted characteristic is compared with the characteristic of the preset gray level histogram, and whether the road has apparent defects is determined by judging the comparison result, so that the preset neural network has the advantages of high performance, high calculation speed and high timeliness.
In the embodiment of the present invention, the classifying and identifying the real-time gray level histogram by using a preset neural network, and judging whether the road has an apparent defect, includes:
extracting normal distribution, average value and bimodal characteristic value in the real-time gray level histogram by using a neural network;
Performing similarity comparison on the normal distribution, the average value and the bimodal characteristic value and the normal distribution, the average value and the bimodal characteristic value of a preset gray level histogram to obtain a comparison result;
if the similarity of the comparison result is higher than or equal to 95%, the road has no apparent defect;
if the similarity of the comparison result is lower than 95%, the road has apparent defects.
The preset neural network needs to train in advance by utilizing images of each time period and each place of the road.
The preset neural network can realize a target detection function and a semantic segmentation function.
The preset neural network uses a VGG16 model.
The preset gray level histogram is a gray level histogram of a road without apparent defects, and is preset in a neural network for comparison.
Further, similarity comparison is carried out on the normal distribution, the average value and the bimodal eigenvalue and the normal distribution, the average value and the bimodal eigenvalue of the preset gray level histogram to obtain a comparison result, average value distinction of two graphs is specifically compared, the normal distribution, the bimodal eigenvalue and the highest value of the two graph features are compared, and the specifically extracted eigenvalue and eigenvalue comparison mode is changed according to real-time requirements.
In detail, the apparent defects of the road can be classified into road cracks, road looseness and the like, and the characteristics displayed by the gray level histogram in each case are different from those displayed by the preset gray level histogram.
If the similarity of the comparison result is higher than or equal to 95%, the road has no apparent defect, and according to the training process and the result of the preset neural network, the road has no apparent defect when the similarity is higher than or equal to 95%, and when 95% is used as a judgment threshold value because the neural network performs feature extraction, part of data is lost, and 100% similarity cannot be achieved.
In detail, by comparing the real-time gray level histogram with the preset gray level histogram, the apparent defect of the road can be determined, for example, when the condition of foreign matter on the road can be found, compared with the preset gray level histogram, the bimodal characteristic value of the gray level histogram of the road with the foreign matter is higher, when the road has deformation, compared with the preset gray level histogram, the gray level histogram of the deformed road is not uniformly distributed, and the gray level histogram of other apparent defects also has the characteristic.
S7, generating an enhanced image by using the real-time gray level histogram, and dividing the enhanced image to form a defect area.
In the embodiment of the invention, if the road has no apparent defect, the S7 is not needed, so that the calculation force is saved, if the road has the apparent defect, the enhanced image is generated according to the real-time gray level histogram, the enhanced image is divided into a plurality of modules, whether each module has the apparent defect or not is judged, the modules with the apparent defect are uniformly divided, a defect area is formed, the inspection by personnel is convenient, and the situation of driving is avoided in time.
In an embodiment of the present invention, the generating an enhanced image using a real-time gray level histogram and dividing the enhanced image to form a defect area includes:
Generating an enhanced image according to the real-time gray level histogram;
dividing the enhanced image into a number of tiles;
Respectively extracting normal distribution, average value and bimodal characteristic value of gray level histograms of a plurality of image blocks by using a neural network;
Respectively comparing the normal distribution, the average value and the bimodal characteristic value of the gray level histograms of a plurality of image blocks with the normal distribution, the average value and the bimodal characteristic value of the preset gray level histograms in a similarity manner to obtain a plurality of second comparison results;
marking the image blocks with the similarity lower than 95% of the second comparison results in the image blocks as '1';
On the enhanced image, all tiles marked "1" are segmented, forming a defective area.
Wherein an enhanced image is generated in combination with the real-time gray level histogram by using imshow functions.
In detail, the enhanced image is divided into a plurality of blocks, and the specific block sizes and the specific block numbers are divided according to actual requirements.
Further, the neural network is used for respectively extracting the normal distribution, the average value and the bimodal characteristic value of the gray level histograms of the plurality of image blocks, the normal distribution, the average value and the bimodal characteristic value of the gray level histograms of the plurality of image blocks are respectively compared with the normal distribution, the average value and the bimodal characteristic value of the preset gray level histograms in a similarity manner, so that a plurality of second comparison results are obtained, the steps are similar to the step S6, the similar method can be adopted for operation, and the specific operation method does not need.
And comparing the characteristics of each image block on the enhanced image with normal distribution, average value and bimodal characteristic value of a preset gray level histogram one by one, and marking the image block as '1' if the similarity of the comparison result of one image block is lower than 95%.
Further, a type of block marked as '1' is segmented on the enhanced image, the segmented area is used as a defect area, the defect area can be marked on the real-time image according to the connection between the enhanced image and the real-time image, for example, the defect area can be marked on the real-time image in a red filling mode, so that a user is reminded, the defect area can be marked in other modes, the specific mode is not required, and the defect area is changed according to actual conditions.
Fig. 5 is a functional block diagram of a device for identifying apparent defects of a road based on a neural network according to an embodiment of the present invention.
The device for identifying the apparent defects of the road based on the neural network can be installed in electronic equipment. According to the realized functions, the device for realizing the road apparent defect recognition based on the neural network can comprise an acquisition module, a feature extraction module, an image conversion module and a neural network module. The module of the invention, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows:
The acquisition module acquires a real-time image of a road;
The image conversion module is used for carrying out graying treatment on the real-time image by using a weighted average method to obtain a gray image, carrying out normalization treatment on the gray image by using a maximum and minimum method to obtain a normalized image, and carrying out noise reduction treatment on the normalized image by using median filtering to obtain a noise reduction image;
The image enhancement module is used for carrying out gray enhancement on the noise reduction image by using a histogram equalization algorithm to obtain a real-time gray histogram;
And the neural network module is used for classifying and identifying the real-time gray level histogram by using a preset neural network, judging whether the road has apparent defects, generating an enhanced image by using the real-time gray level histogram, and dividing the enhanced image into defect areas.
Fig. 6 is a schematic structural diagram of an electronic device for implementing a road apparent defect recognition method based on a neural network according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program stored in the memory 11 and executable on the processor 10, such as a program for implementing a road apparent defect identification method based on a neural network.
The processor 10 may be formed by an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be formed by a plurality of integrated circuits packaged with the same function or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects respective components of the entire electronic device using various interfaces and lines, executes or executes programs or modules stored in the memory 11 (for example, executes programs or the like for implementing a road apparent defect recognition method based on a neural network), and invokes data stored in the memory 11 to perform various functions of the electronic device and process the data.
The memory 11 includes at least one type of readable storage medium including flash memory, a removable hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, such as a mobile hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only for storing application software installed in an electronic device and various types of data, such as codes of programs for implementing a road apparent defect recognition method based on a neural network, but also for temporarily storing data that has been output or is to be output.
The communication bus 12 may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc.
The communication interface 13 is used for communication between the electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), or alternatively a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface.
Only an electronic device having components is shown, and it will be understood by those skilled in the art that the structures shown in the figures do not limit the electronic device, and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power source (such as a battery) for supplying power to the respective components, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device may further include various sensors, bluetooth modules, wi-Fi modules, etc., which are not described herein.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The program stored in the memory 11 of the electronic device 1 for implementing the road apparent defect identifying method based on the neural network is a combination of a plurality of instructions, which when executed in the processor 10, can implement:
acquiring a real-time image of a road;
carrying out graying treatment on the real-time image by using a weighted average method to obtain a gray image;
carrying out normalization processing on the gray level image by using a maximum and minimum method to obtain a normalized image;
Carrying out noise reduction treatment on the normalized image by utilizing median filtering to obtain a noise reduction image;
carrying out gray enhancement on the noise reduction image by using a histogram equalization algorithm to obtain a real-time gray histogram;
classifying and identifying the real-time gray level histogram by using a preset neural network, and judging whether the road has apparent defects or not;
An enhanced image is generated using the real-time gray level histogram and segmented on the enhanced image to form a defective region.
In particular, the specific implementation method of the above instructions by the processor 10 may refer to the description of the relevant steps in the corresponding embodiment of the drawings, which is not repeated herein.
Further, the modules/units integrated in the electronic device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. The computer readable storage medium may be volatile or nonvolatile. For example, the computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
The present invention also provides a computer readable storage medium storing a computer program which, when executed by a processor of an electronic device, can implement:
acquiring a real-time image of a road;
carrying out graying treatment on the real-time image by using a weighted average method to obtain a gray image;
carrying out normalization processing on the gray level image by using a maximum and minimum method to obtain a normalized image;
Carrying out noise reduction treatment on the normalized image by utilizing median filtering to obtain a noise reduction image;
carrying out gray enhancement on the noise reduction image by using a histogram equalization algorithm to obtain a real-time gray histogram;
classifying and identifying the real-time gray level histogram by using a preset neural network, and judging whether the road has apparent defects or not;
An enhanced image is generated using the real-time gray level histogram and segmented on the enhanced image to form a defective region.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the foregoing description, and all changes which come within the meaning and range of equivalency of the scope of the invention are therefore intended to be embraced therein.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Wherein artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) is the theory, method, technique, and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend, and expand human intelligence, sense the environment, acquire knowledge, and use knowledge to obtain optimal results.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. Multiple units or means stated in the system may also be implemented by one unit or means, either by software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (7)

1. A method for realizing road apparent defect identification based on a neural network, which is characterized by comprising the following steps:
acquiring a real-time image of a road;
carrying out graying treatment on the real-time image by using a weighted average method to obtain a gray image;
carrying out normalization processing on the gray level image by using a maximum and minimum method to obtain a normalized image;
Carrying out noise reduction treatment on the normalized image by utilizing median filtering to obtain a noise reduction image;
carrying out gray enhancement on the noise reduction image by using a histogram equalization algorithm to obtain a real-time gray histogram;
classifying and identifying the real-time gray level histogram by using a preset neural network, and judging whether the road has apparent defects or not;
Generating an enhanced image by using the real-time gray level histogram, and dividing the enhanced image to form a defect area;
the method for carrying out gray enhancement on the noise reduction image by using a histogram equalization algorithm to obtain a real-time gray histogram comprises the following steps:
generating an original gray level histogram according to the noise reduction image;
The original gray level histogram is equalized by using the following histogram equalization algorithm to obtain a real-time gray level histogram:
Wherein the method comprises the steps of To reduce the total number of pixels of the image,For the gray level of the real-time gray level histogram, rk is the gray level of the noise reduction image,The number of pixel points p is the current gray levelFor the probability of each gray level,For the total number of gray levels of the noise reduced image,Is a gray scale range
The step of classifying and identifying the real-time gray level histogram by using a preset neural network to judge whether the road has apparent defects comprises the following steps:
extracting normal distribution, average value and bimodal characteristic value in the real-time gray level histogram by using a neural network;
Performing similarity comparison on the normal distribution, the average value and the bimodal characteristic value and the normal distribution, the average value and the bimodal characteristic value of a preset gray level histogram to obtain a comparison result;
If the similarity of the comparison result is higher than or equal to 95%, the road has no apparent defect;
If the similarity of the comparison result is lower than 95%, the road has apparent defects;
the generating an enhanced image by using the real-time gray level histogram and dividing the enhanced image to form a defect area comprises the following steps:
Generating an enhanced image according to the real-time gray level histogram;
dividing the enhanced image into a number of tiles;
Respectively extracting normal distribution, average value and bimodal characteristic value of gray level histograms of a plurality of image blocks by using a neural network;
Respectively comparing the normal distribution, the average value and the bimodal characteristic value of the gray level histograms of a plurality of image blocks with the normal distribution, the average value and the bimodal characteristic value of the preset gray level histograms in a similarity manner to obtain a plurality of second comparison results;
marking the image blocks with the similarity lower than 95% of the second comparison results in the image blocks as '1';
On the enhanced image, all tiles marked "1" are segmented, forming a defective area.
2. The method for identifying apparent defects of a road based on a neural network according to claim 1, wherein the performing the graying process on the real-time image by using a weighted average method to obtain a gray image comprises:
three channel pixel values of each pixel point in the real-time image are extracted;
The gray pixel values for each pixel point are calculated one by one using the following weighted average algorithm:
Represent the first Sub-extracting gray pixel values of the pixel points,Represents the firstSub-extracting red channel pixel values of the pixel points,Represent the firstSub-extracting green channel pixel values of the pixel points,Represent the firstSub-extracting a blue channel pixel value of the pixel point,Represent the firstThe pixel points are extracted once more,AndThe weighted value representing the pixel value of each different channel is calculated by a formula to obtain the first image in the real-time imageGray pixel values of the sub-extracted pixel points;
and obtaining a gray image according to the calculated gray pixel values of each pixel point.
3. The method for identifying apparent defects of a road based on a neural network according to claim 1, wherein the normalizing the gray image by using a maximum-minimum method to obtain a normalized image comprises:
extracting gray pixel values of all pixel points in the gray image;
and calculating gray pixel values of all the pixel points one by using the following maximum and minimum methods to obtain standard values of all the pixel points:
wherein, The number of times of extraction is indicated,Represent the firstExtracting the standard value of the pixel point for the second time,Represent the firstSub-extracting gray pixel values of the pixel points,Representing the minimum gray pixel value in each pixel point in the gray image,Representing a maximum gray pixel value in each pixel point in the gray image;
and obtaining a normalized image according to the standard value of each pixel point.
4. The method for identifying apparent defects of a road based on a neural network according to claim 1, wherein the denoising the normalized image by using median filtering to obtain a denoised image comprises:
s41, creating an odd number A sliding window of odd pixel value size;
s42, placing the sliding window on the normalized image, and collecting standard values of all pixel points in the sliding window;
S43, sorting the standard values of all pixel points of the sliding window from small to large to obtain an intermediate value;
S44, giving the intermediate value to the pixel point in the center of the sliding window;
S45, continuously moving the sliding window, and repeating the steps S43 and S44 until the whole normalized image is covered, and converting the normalized image into a noise reduction image.
5. An apparatus for identifying apparent defects of a road based on a neural network, the apparatus comprising:
The acquisition module acquires a real-time image of a road;
The image conversion module is used for carrying out graying treatment on the real-time image by using a weighted average method to obtain a gray image, carrying out normalization treatment on the gray image by using a maximum and minimum method to obtain a normalized image, and carrying out noise reduction treatment on the normalized image by using median filtering to obtain a noise reduction image;
The image enhancement module is used for carrying out gray enhancement on the noise reduction image by using a histogram equalization algorithm to obtain a real-time gray histogram;
the neural network module is used for classifying and identifying the real-time gray level histogram by using a preset neural network, judging whether the road has apparent defects or not, generating an enhanced image by using the real-time gray level histogram, and dividing the enhanced image into defect areas;
the method for carrying out gray enhancement on the noise reduction image by using a histogram equalization algorithm to obtain a real-time gray histogram comprises the following steps:
generating an original gray level histogram according to the noise reduction image;
The original gray level histogram is equalized by using the following histogram equalization algorithm to obtain a real-time gray level histogram:
Wherein the method comprises the steps of To reduce the total number of pixels of the image,For the gray level of the real-time gray level histogram, rk is the gray level of the noise reduction image,The number of pixel points p is the current gray levelFor the probability of each gray level,For the total number of gray levels of the noise reduced image,Is a gray scale range
The step of classifying and identifying the real-time gray level histogram by using a preset neural network to judge whether the road has apparent defects comprises the following steps:
extracting normal distribution, average value and bimodal characteristic value in the real-time gray level histogram by using a neural network;
Performing similarity comparison on the normal distribution, the average value and the bimodal characteristic value and the normal distribution, the average value and the bimodal characteristic value of a preset gray level histogram to obtain a comparison result;
If the similarity of the comparison result is higher than or equal to 95%, the road has no apparent defect;
If the similarity of the comparison result is lower than 95%, the road has apparent defects;
the generating an enhanced image by using the real-time gray level histogram and dividing the enhanced image to form a defect area comprises the following steps:
Generating an enhanced image according to the real-time gray level histogram;
dividing the enhanced image into a number of tiles;
Respectively extracting normal distribution, average value and bimodal characteristic value of gray level histograms of a plurality of image blocks by using a neural network;
Respectively comparing the normal distribution, the average value and the bimodal characteristic value of the gray level histograms of a plurality of image blocks with the normal distribution, the average value and the bimodal characteristic value of the preset gray level histograms in a similarity manner to obtain a plurality of second comparison results;
marking the image blocks with the similarity lower than 95% of the second comparison results in the image blocks as '1';
On the enhanced image, all tiles marked "1" are segmented, forming a defective area.
6. An electronic device, the electronic device comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the neural network-based road apparent defect identification method of any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method for identifying apparent defects of a road based on a neural network according to any one of claims 1 to 4.
CN202410101114.9A 2024-01-24 Method, device, equipment and medium for identifying apparent defects of road based on neural network Active CN117934417B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410101114.9A CN117934417B (en) 2024-01-24 Method, device, equipment and medium for identifying apparent defects of road based on neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410101114.9A CN117934417B (en) 2024-01-24 Method, device, equipment and medium for identifying apparent defects of road based on neural network

Publications (2)

Publication Number Publication Date
CN117934417A CN117934417A (en) 2024-04-26
CN117934417B true CN117934417B (en) 2024-11-15

Family

ID=

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111047624A (en) * 2019-12-27 2020-04-21 成都英飞睿技术有限公司 Image dim target detection method, device, equipment and storage medium
CN114332935A (en) * 2021-12-29 2022-04-12 长春理工大学 Pedestrian detection algorithm applied to AGV
CN116580006A (en) * 2023-05-12 2023-08-11 河海大学 Bottled product labeling quality detection method based on machine vision
CN116805302A (en) * 2023-04-28 2023-09-26 兰州交通大学 Cable surface defect detection device and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111047624A (en) * 2019-12-27 2020-04-21 成都英飞睿技术有限公司 Image dim target detection method, device, equipment and storage medium
CN114332935A (en) * 2021-12-29 2022-04-12 长春理工大学 Pedestrian detection algorithm applied to AGV
CN116805302A (en) * 2023-04-28 2023-09-26 兰州交通大学 Cable surface defect detection device and method
CN116580006A (en) * 2023-05-12 2023-08-11 河海大学 Bottled product labeling quality detection method based on machine vision

Similar Documents

Publication Publication Date Title
CN111652845B (en) Automatic labeling method and device for abnormal cells, electronic equipment and storage medium
CN112241699A (en) Object defect category identification method and device, computer equipment and storage medium
CN109948566B (en) Double-flow face anti-fraud detection method based on weight fusion and feature selection
CN110555465A (en) Weather image identification method based on CNN and multi-feature fusion
CN112507923B (en) Certificate copying detection method and device, electronic equipment and medium
CN111639704A (en) Target identification method, device and computer readable storage medium
CN108665417A (en) A kind of license plate image deblurring method, apparatus and system
CN113537037A (en) Pavement disease identification method, system, electronic device and storage medium
CN110782409A (en) Method for removing shadow of multi-motion object
CN114627435A (en) Intelligent light adjusting method, device, equipment and medium based on image recognition
CN113610934A (en) Image brightness adjusting method, device, equipment and storage medium
CN111383054A (en) Advertisement checking method and device
CN117934417B (en) Method, device, equipment and medium for identifying apparent defects of road based on neural network
CN117455762A (en) Method and system for improving resolution of recorded picture based on panoramic automobile data recorder
CN117934417A (en) Method, device, equipment and medium for identifying apparent defects of road based on neural network
CN117315369A (en) Fundus disease classification method and device based on neural network
CN117152182A (en) Ultralow-illumination network camera image processing method and device and electronic equipment
CN110633705A (en) Low-illumination imaging license plate recognition method and device
CN114463685B (en) Behavior recognition method, behavior recognition device, electronic equipment and storage medium
CN115205596A (en) Image classification method, device, equipment and storage medium
CN113792671B (en) Face synthetic image detection method and device, electronic equipment and medium
CN115760854A (en) Deep learning-based power equipment defect detection method and device and electronic equipment
CN112561893B (en) Picture matching method and device, electronic equipment and storage medium
CN116403200A (en) License plate real-time identification system based on hardware acceleration
CN116129100A (en) Truck part positioning and fault identifying method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant