A machine vision-based tunnel abnormal form identification method and system
By using machine vision frame difference method and morphological filtering, the problem of monitoring sudden abnormal morphology in tunnels was solved, realizing safety early warning and construction safety assurance in tunnels.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2026-03-20
AI Technical Summary
Traditional tunnel monitoring methods cannot identify sudden abnormalities in tunnels in a timely and accurate manner, resulting in low monitoring efficiency and failing to guarantee tunnel safety and the safety of construction personnel.
A machine vision-based frame difference method is used to analyze tunnel image differences. By adaptively and dynamically adjusting the time interval and morphological filtering, abnormal shapes in the tunnel are identified.
It enables accurate monitoring and early warning of abnormal conditions within tunnels, reducing the probability of tunnel disasters and improving the safety of tunnel construction.
Smart Images

Figure CN116994172B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure belongs to the technical field of machine vision, and particularly relates to a tunnel abnormal form identification method and system based on machine vision. BACKGROUND
[0002] The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute prior art.
[0003] The abnormal form in the tunnel has strong concealment, strong burst, strong destructiveness and the like hazards, and if not monitored in time, it can cause irreparable loss.
[0004] The traditional monitoring of the sudden event in the tunnel is generally through human intervention, and when the sudden stone collapse or the water flow becomes large, measures cannot be taken in time to reduce the loss; in the actual tunnel scene, various light interferences exist in the tunnel, or strong changes of light caused by human beings, which easily lead to monitoring failure; the water flow change or the sudden collapse in the tunnel are both instantaneous, and the traditional human monitoring cannot accurately identify the abnormal state of the tunnel in time.
[0005] With the rapid development of artificial intelligence, machine vision, as an interdisciplinary technology containing image processing, pattern recognition and the like, has gradually replaced manual work. The traditional tunnel monitoring method cannot guarantee the safety inside the tunnel, cannot accurately identify the form change in the tunnel in a short time, cannot identify the sudden situation in the tunnel, has low monitoring efficiency, and also cannot guarantee the safety of the personnel in the tunnel and the construction site in the tunnel to the greatest extent. SUMMARY
[0006] To solve the above problems, the present disclosure provides a tunnel abnormal form identification method and system based on machine vision, which analyzes and identifies the difference of the tunnel image based on the frame difference method, accurately and quickly finds the abnormal form inside the tunnel, and reduces the probability of accidents inside the tunnel.
[0007] According to some embodiments, the first aspect of the present disclosure provides a tunnel abnormal form identification method based on machine vision, which adopts the following technical scheme:
[0008] A tunnel abnormal form identification method based on machine vision, comprising:
[0009] acquiring a tunnel scene video to be identified;
[0010] capturing a previous frame image and a current frame image of the acquired video based on a preset time interval;
[0011] processing the captured previous frame image and current frame image by a frame difference method to obtain a frame difference image;
[0012] According to the obtained frame difference image and the preset frame difference threshold image, the running characteristics of the tunnel scene video are analyzed, and the abnormal form in the tunnel is identified.
[0013] As a further technical limitation, the preset time interval is the time interval between the captured consecutive frames, and the preset time interval is adaptively dynamically adjusted.
[0014] Further, the adaptive dynamic adjustment of the preset time interval adopts target speed prediction or motion detection threshold adjustment.
[0015] As a further technical limitation, in the process of obtaining the frame difference image by processing the captured last frame image and the current frame image by the frame difference method, each pixel point in the captured last frame image and the current frame image is subtracted to obtain the difference image between different frame images, i.e. the frame difference image.
[0016] As a further technical limitation, the frame difference threshold is a parameter of binarization or thresholding, which is used to convert the pixel value in the frame difference image into 0 or 1 in binary, so as to judge whether the pixel value of the frame difference image belongs to a moving target.
[0017] As a further technical limitation, the obtained frame difference image is subjected to morphological filtering processing to identify the detection target. Specifically, an erosion operation is first performed to filter out details smaller than the frame difference threshold image from the image, and then an expansion operation is performed to expand the image edge until the distance between the frame difference images is less than the frame difference threshold.
[0018] As a further technical limitation, the identified abnormal form in the tunnel includes sudden water and sudden mud in the tunnel.
[0019] According to some embodiments, the second aspect of the present disclosure provides a tunnel abnormal form identification system based on machine vision, which adopts the following technical solution:
[0020] A tunnel abnormal form identification system based on machine vision, comprising:
[0021] An acquisition module configured to acquire a tunnel scene video to be identified;
[0022] A capture module configured to capture a last frame image and a current frame image of the acquired video based on a preset time interval;
[0023] A processing module configured to obtain a frame difference image by processing the captured last frame image and the current frame image by the frame difference method;
[0024] An identification module configured to analyze the running characteristics of the tunnel scene video according to the obtained frame difference image and the preset frame difference threshold image, and identify the abnormal form in the tunnel.
[0025] According to some embodiments, a third aspect of the present disclosure provides a computer readable storage medium, adopting the technical scheme as follows:
[0026] A computer readable storage medium, having a program stored thereon, which, when executed by a processor, implements the steps in the machine vision based tunnel abnormal morphology identification method according to the first aspect of the present disclosure.
[0027] According to some embodiments, a fourth aspect of the present disclosure provides an electronic device, adopting the technical scheme as follows:
[0028] An electronic device, comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor implements the steps in the machine vision based tunnel abnormal morphology identification method according to the first aspect of the present disclosure when executing the program.
[0029] Compared with the prior art, the present disclosure has the beneficial effects that:
[0030] The present disclosure accurately monitors the abnormal burst morphology in the tunnel, issues a warning when a hazard occurs, reduces the occurrence of irreversible tunnel disasters caused by abnormal morphology in the tunnel, maximizes the safety of tunnel construction, and has a high engineering application prospect. BRIEF DESCRIPTION OF DRAWINGS
[0031] The accompanying drawings, which form a part of the present disclosure, are used to provide further understanding of the present disclosure, and the schematic embodiments of the present disclosure and their descriptions are used to explain the present disclosure, and do not constitute improper limitations on the present disclosure.
[0032] Figure 1 is a flowchart of the machine vision based tunnel abnormal morphology identification method in the first embodiment of the present disclosure;
[0033] Figure 2 is a structural block diagram of the machine vision based tunnel abnormal morphology identification system in the second embodiment of the present disclosure. DETAILED DESCRIPTION
[0034] The present disclosure will be further described below in conjunction with the accompanying drawings and embodiments.
[0035] It should be pointed out that the following detailed description is exemplary and is intended to provide further description of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as generally understood by those skilled in the art to which the present disclosure belongs.
[0036] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this disclosure. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0037] Where there is no conflict, the embodiments and features described herein can be combined with each other.
[0038] Example 1
[0039] Embodiment 1 of this disclosure introduces a method for identifying abnormal shapes in tunnels based on machine vision.
[0040] like Figure 1 The method for identifying abnormal shapes within a tunnel based on machine vision, as shown, includes:
[0041] Acquire video of the tunnel scene to be identified;
[0042] Based on a preset time interval, capture the previous frame and the current frame of the acquired video.
[0043] The frame difference image is obtained by processing the captured previous frame image and the current frame image using the frame difference method.
[0044] Based on the obtained frame difference image and the preset frame difference threshold image, the running characteristics of the tunnel scene video are analyzed, and abnormal shapes in the tunnel are identified.
[0045] As one or more implementation methods, during the process of acquiring scene video, the width, height, size of the tunnel image, as well as the images of the previous frame and the current frame are read, and the color image is converted to grayscale and then saved accordingly.
[0046] It's important to note that everyday environments typically produce color images. Each pixel in a color image is represented by three bytes, with each byte corresponding to the brightness of the RGB components. Grayscale conversion involves transforming the three RGB channels into a single channel (R=G=B). Single-channel data processing is much simpler and computationally less complex, making it suitable for object detection. The grayscale process unifies the RGB values of each pixel to a single value. In the converted grayscale image, each pixel uses one byte to represent its grayscale value, which ranges from 0 to 255. A higher value indicates a brighter, whiter pixel, while a lower value indicates a darker pixel.
[0047] For example: the weight of human eye to perceive red, green and blue is not the same, JPEG image compression format adopts YUV space, YUV space is linear conversion of RGB space, conversion relationship: Gray(i,j)=0.11B(i,j)+0.59G(i,j)+0.3R(i,j).
[0048] Target detection is carried out on the grayed picture, when an abnormal object moves in the monitoring scene, a relatively obvious difference will appear between frames. In the embodiment, frame difference method is adopted, specifically:
[0049] Rayimg is the current frame, pregrayimg is the last frame, img is the result after frame difference, enhance_times is the weight:
[0050] Img=|grayimg-pregrayimg|*enhance_times.
[0051] The result obtained by subtracting the last frame image (generally stored in external memory or SDRAM) from the current frame image is taken as an absolute value, which is actually difference operation on corresponding pixel points, finally, whether the result is greater than the threshold is analyzed to analyze the motion characteristics of the video or image sequence, and determine the occurrence of abnormal morphology. However, the result of difference operation may be too small to reach the required value of early warning, so the obtained difference value is multiplied by the weight, and the amplified value is still within the effective range of 0-255. Then, open operation (OPEN(X)=D(E(X))) morphological filtering processing is carried out, wherein the open operation includes erosion operation and dilation operation.
[0052] In the embodiment, subtraction processing between images generally refers to the operation of subtracting each pixel point of two images, so as to obtain a new difference image; the specific process is as follows: two images are read in, assuming that their sizes are the same, and they are gray images or color images. For each pixel point, calculate the difference between their pixel values in two images. If it is a color image, the difference between the pixel values of each channel can be calculated.
[0053] The difference between pixel values is taken as the pixel value of the pixel point in the new image. If the difference between pixel values is negative, it is set to 0 or taken as an absolute value, so that all pixel values in the difference image can be limited to the non-negative range.
[0054] In this embodiment, the threshold of the frame difference method refers to a binarization or thresholding parameter used to convert pixel values in the difference image to binary 0 or 1 in order to determine whether the pixel belongs to the moving target; points with pixel values greater than the threshold represent detected moving targets. If the frame difference result is 0, the target is stationary. If the result is 1, it is a moving target to be detected.
[0055] The erosion operation is specifically: the "and" operation of the structure element and the binary image covered by it. Shift the structure element B to get Ba, if Ba is contained in X, we record this a point, and the set of all a points that satisfy the above conditions is called the result of X being eroded by B:
[0056]
[0057] The dilation operation is specifically: the "or" operation of the structure element and the binary image covered by it. Shift the structure element B to get Ba, if Ba hits X, we record this a point, and the set of all a points that satisfy the above conditions is called the result of X being dilated by B:
[0058]
[0059] Due to various interference factors in real-world video sequences, these factors mainly include: changes in light and shade, inherent noise of the imaging sensor itself, changes in the motion target itself or displacement, clutter in the background, etc. Changes in light and shade can cause changes in image brightness and contrast, which will directly affect the performance of the frame difference method. When the light becomes dim, the overall brightness of the image decreases, and the difference between the target and the background may also decrease, making it difficult for the frame difference method to accurately extract the target. When the light becomes bright, the overall brightness of the image increases, which may cause some subtle differences to be amplified, resulting in an increase in false positives.
[0060] The imaging sensor will introduce certain inherent noise during image acquisition. These noises may be mixed with the motion of the target or the difference in the background, making it difficult for the frame difference method to accurately extract the target. If the target changes in shape or displacement during motion or change, the frame difference method may have the following effects:
[0061] 1. Shape change: When the target changes in shape, such as changes in size, shape, or posture, the frame difference method may produce blurred or inaccurate results. This is because the frame difference method is based only on pixel-level differences to extract moving targets, ignoring the internal structure and shape information of the target.
[0062] 2. Displacement changes: If the target undergoes displacement, i.e., changes in position, the frame difference method can result in false negatives or false positives. When the target displacement is large, the frame difference method can fail to correctly capture the changes in the target, resulting in the movement of the target being ignored or incorrectly identified as a new target.
[0063] Clutter, texture, or other complex structures in the background can interfere with image processing and shape recognition. For the frame difference method, these clutters can be incorrectly identified as movement of the target, resulting in false positives. In actual scenarios, there are various disturbances such as light in the tunnel, or strong changes in light caused by human factors, and the background of the images collected in reality cannot remain unchanged. At this time, if reinitialization is not performed, the incorrect monitoring results will accumulate over time, causing a vicious cycle and leading to monitoring failure. Therefore, a background update model needs to be established to ensure that the background image changes with changes in light and ensures the accuracy of recognition.
[0064] The result after the difference is processed by morphological filtering (i.e., open operation processing). Finally, the seed-filling method is used to fill the color of the detected target, and the processed image is exported. According to the result of the detected target in the image, it is judged whether the warning requirement is met, and if so, the alarm device is started.
[0065] Since the change in water flow in the tunnel cannot be predicted, the time interval between two frames in the frame difference method also needs to be adaptively adjusted. When the water flow changes quickly, a smaller time interval needs to be selected. If the selection is not appropriate, when there is no overlap between the water flow in the front and back two frames, it will be recognized as two separate targets. For slow-changing water flow, a larger time difference is selected. If the selection is not appropriate, when the target is almost completely overlapped in the front and back two frames, the moving target cannot be monitored. The present embodiment can accurately identify the change in water flow and make real-time warnings.
[0066] To prevent the water flow in the tunnel from changing greatly, but still unable to identify the changed moving target due to external or human factors, the result after the frame difference is multiplied by an adaptive weight, which can be automatically adjusted according to the change in the identified target. Even if the water flow does not change significantly, by "enlarging" the changed pixel points, the effect of video monitoring can also be achieved.
[0067] The present embodiment accurately monitors the abnormal sudden shape in the tunnel, issues a warning when a hazard occurs, reduces the occurrence of irreversible tunnel disasters caused by abnormal shapes in the tunnel, maximizes the safety of construction in the tunnel, and has a high engineering application prospect.
[0068] Embodiment Two
[0069] Embodiment 2 of this disclosure introduces a machine vision-based system for identifying abnormal shapes in tunnels.
[0070] like Figure 2 The machine vision-based tunnel anomaly recognition system shown includes:
[0071] The acquisition module is configured to acquire video of the tunnel scene to be identified;
[0072] The capture module is configured to capture the previous frame and the current frame of the acquired video based on a preset time interval.
[0073] The processing module is configured to process the captured previous frame image and the current frame image using the frame difference method to obtain a frame difference image;
[0074] The identification module is configured to analyze the running characteristics of the tunnel scene video based on the obtained frame difference image and the preset frame difference threshold image, and identify abnormal shapes in the tunnel.
[0075] The detailed steps are the same as those of the machine vision-based tunnel anomaly recognition method provided in Example 1, and will not be repeated here.
[0076] Example 3
[0077] Embodiment 3 of this disclosure provides a computer-readable storage medium.
[0078] A computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps of the machine vision-based tunnel anomaly morphology recognition method as described in Embodiment 1 of this disclosure.
[0079] The detailed steps are the same as those of the machine vision-based tunnel anomaly recognition method provided in Example 1, and will not be repeated here.
[0080] Example 4
[0081] Embodiment 4 of this disclosure provides an electronic device.
[0082] An electronic device includes a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps in the machine vision-based tunnel anomaly recognition method as described in Embodiment 1 of this disclosure.
[0083] The detailed steps are the same as those of the machine vision-based tunnel anomaly recognition method provided in Example 1, and will not be repeated here.
[0084] The above merely describes preferred embodiments of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent replacements, improvements, and the like made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
[0085] Although the specific embodiments of the present disclosure are described above with reference to the drawings, the description is not intended to limit the protection scope of the present disclosure, and those skilled in the art should understand that various modifications or changes made on the basis of the technical solutions of the present disclosure without creative labor are still within the protection scope of the present disclosure.
Claims
1. A method for identifying abnormal shapes within tunnels based on machine vision, characterized in that, include: Acquire video of the tunnel scene to be identified; Based on a preset time interval, capture the previous frame and the current frame of the acquired video. The preset time interval is the time interval between consecutive captured frames, and the preset time interval is adaptively and dynamically adjusted; the adaptive and dynamic adjustment of the preset time interval is adjusted by target velocity prediction or motion detection threshold. The frame difference image is obtained by processing the captured previous frame image and the current frame image using the frame difference method. Based on the obtained frame difference image and the preset frame difference threshold image, the operation characteristics of the tunnel scene video are analyzed to identify abnormal morphologies within the tunnel; the identified abnormal morphologies within the tunnel include sudden water inrush and mud inrush within the tunnel. In the frame difference method, the time interval between two frames also needs to be adaptively adjusted. When the water flow changes rapidly, a smaller time interval needs to be selected. If the selection is not appropriate, when there is no overlap between the two frames of the water flow, they will be identified as two separate targets. For water flow that changes slowly, a larger time difference is selected.
2. The method for identifying abnormal shapes in tunnels based on machine vision as described in claim 1, characterized in that, In the process of obtaining the frame difference image by processing the captured previous frame image and the current frame image using the frame difference method, each pixel in the captured previous frame image and the current frame image is subtracted to obtain the difference image between different frame images, i.e., the frame difference image.
3. The method for identifying abnormal shapes in tunnels based on machine vision as described in claim 1, characterized in that, The frame difference threshold is a binarization or thresholding parameter used to convert pixel values in the frame difference image into 0 or 1 in binary so as to determine whether the pixel values in the frame difference image belong to a moving target.
4. The method for identifying abnormal shapes in tunnels based on machine vision as described in claim 1, characterized in that, Morphological filtering is performed on the obtained frame difference images to identify the detection target. Specifically, erosion is first performed to filter out image details smaller than the frame difference threshold from the image, and then dilation is performed to expand the image edges until the distance between the frame difference images is less than the frame difference threshold.
5. A machine vision-based system for identifying abnormal shapes within tunnels, characterized in that, include: The acquisition module is configured to acquire video of the tunnel scene to be identified; The capture module is configured to capture the previous frame and the current frame of the acquired video based on a preset time interval; the preset time interval is the time interval between consecutive captured frames, and the preset time interval is adaptively and dynamically adjusted; the adaptive and dynamic adjustment of the preset time interval is adjusted by target velocity prediction or motion detection threshold. The processing module is configured to process the captured previous frame image and the current frame image using the frame difference method to obtain a frame difference image; The identification module is configured to analyze the running characteristics of the tunnel scene video based on the obtained frame difference image and the preset frame difference threshold image, and identify abnormal morphologies in the tunnel; the identified abnormal morphologies in the tunnel include sudden water inrush and mud inrush in the tunnel. In the frame difference method, the time interval between two frames also needs to be adaptively adjusted. When the water flow changes rapidly, a smaller time interval needs to be selected. If the selection is not appropriate, when there is no overlap between the two frames of the water flow, they will be identified as two separate targets. For water flow that changes slowly, a larger time difference is selected.
6. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the machine vision-based method for identifying abnormal morphologies in tunnels as described in any one of claims 1-4.
7. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the machine vision-based tunnel anomaly recognition method as described in any one of claims 1-4.
Citation Information
Patent Citations
Video monitoring method based on local computing
CN105046682A
Fully-automatic mechanical equipment installation leak detection method and device
CN109146860A