Water level measuring method and device based on image recognition

By refining and segmenting the water level in underground tunnels using image recognition technology, and combining environmental features and offset algorithms, the problem of low accuracy caused by sensor aging was solved, achieving high precision and reliability in water level measurement.

CN119273747AActive Publication Date: 2025-01-07FUJIAN URBAN CONSTR INTELLIGENT CONTROL TECH CO LTD +1
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411804592.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-01-07
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

Existing water level measurement technologies have low accuracy in underground tunnels because sensors are susceptible to changes in water quality and aging.

Method used

An image recognition-based water level measurement method is adopted, which improves the accuracy of water level measurement by image thinning, environmental feature extraction, image segmentation and edge feature analysis, combined with an offset algorithm to correct the water level position.

Benefits of technology

It improves the accuracy of underground tunnel water level measurement, enables continuous monitoring of water level changes, reduces noise interference, and ensures accurate positioning of the water level line and the accuracy of the actual water level value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119273747A_ABST
    Figure CN119273747A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image recognition, and discloses a water level measurement method and device based on image recognition, and the method comprises the steps: collecting a water level image in an underground tunnel, and carrying out the image refining processing of the water level image; environment features corresponding to the underground tunnel are extracted, and image segmentation is carried out on the water level refined images one by one according to image labels; extracting edge features corresponding to the water level segmentation image, determining a water level line position of a target water surface in the underground tunnel according to the edge features, and calculating water level line pixel coordinates corresponding to the water level image according to the water level line position; converting the pixel coordinates of the water level line into actual water level coordinates, and calculating an actual water level value corresponding to each image label in the target water surface according to the actual water level coordinates; and determining a water level position corresponding to each image label in the target water surface according to the actual water level value, and performing position correction on the water level positions to obtain an actual water level position of the target water surface. The accuracy of underground tunnel water level measurement can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition, and in particular to a water level measurement method and device based on image recognition. Background Art

[0002] With the continuous development of urban underground projects, the construction and maintenance of underground tunnels have become particularly important. Under extreme weather conditions such as heavy rain, underground tunnels may face the risk of rising water levels, and changes in water levels may affect the construction progress and safety in underground tunnels. Therefore, in order to be able to promptly detect water accumulation or seepage problems in underground tunnels, it is necessary to monitor the water level changes in underground tunnels in real time to ensure the safety of the tunnel structure.

[0003] Most existing water level measurement technologies use pressure sensors to directly measure water levels underwater. In practical applications, pressure sensors are susceptible to changes in water quality (such as sediments and bubbles) and sensor aging. Sediments in the water may adhere to the sensor surface, changing its response characteristics, resulting in decreased sensitivity and increased measurement errors when measuring water levels, resulting in lower accuracy when measuring water levels in underground tunnels. Summary of the invention

[0004] The present invention provides a water level measurement method and device based on image recognition, the main purpose of which is to solve the problem of low accuracy when measuring the water level in an underground tunnel.

[0005] To achieve the above object, the present invention provides a water level measurement method based on image recognition, comprising: A water level image in the underground tunnel is collected according to a preset sliding window, and image refinement processing is performed on the water level image to obtain a water level refinement image; Extracting environmental features corresponding to the underground tunnel, determining image labels of the water level image according to the environmental features, and performing image segmentation on the water level refined images one by one according to the image labels to obtain a water level segmentation image; Extracting edge features corresponding to the water level segmentation image, determining the water level position of the target water surface in the underground tunnel according to the edge features, and calculating the water level pixel coordinates corresponding to the water level image according to the water level position; Convert the water level line pixel coordinates into actual water level coordinates, and calculate the actual water level value corresponding to each image label in the target water surface according to the actual water level coordinates; The water level position corresponding to each image tag in the target water surface is determined according to the actual water level value, and the water level position is corrected by using a preset offset algorithm to obtain the actual water level position of the target water surface, including: counting the water level position corresponding to the same target water surface according to the image tag; and calculating the offset value of the water level position according to the historical water level value corresponding to the same target water surface obtained in advance and the highest water level value corresponding to the water level position by using the following offset algorithm: ; Wherein, P is the offset value, f is the offset adjustment coefficient, is the highest water level value, is the average value of the historical water level values, is the standard deviation of the historical water level values, e is the exponent, is the bias control weight, The speed is affected by the offset; A target water level value of the target water surface is determined according to the offset value and the highest water level value corresponding to the water level position, and an actual water level position of the target water surface is determined according to the target water level value.

[0006] Optionally, collecting a water level image in the underground tunnel according to a preset sliding window includes: Identify water areas in underground tunnels; An initial acquisition position of an image acquisition device preset according to the water body area configuration; Determining the sliding step length of the sliding window according to the acquisition area of ​​the image acquisition device; Determine the target acquisition position corresponding to the image acquisition device according to the sliding step length and the initial acquisition position; The target acquisition position is used to acquire water level images in the underground tunnel in sections.

[0007] Optionally, performing image thinning processing on the water level image to obtain a water level thinned image includes: Gray-scaling the water level image to obtain a gray-scale water level image; Extracting a water level detail image from the grayscale water level image; Performing a binarization operation on the water level detail image; Generate multiple refinement conditions according to the pixel values ​​of the binarized water level detail image, wherein the multiple refinement conditions are: ; Among them, A is a set of multiple detail conditions, is the value of each pixel in the i-th neighborhood, For the Each pixel value in the neighborhood is is the remainder function, is the jth neighborhood pixel correlation function in the first refinement condition, is the jth neighborhood pixel correlation function in the second refinement condition; The binarized water level detail image is refined according to the multiple refinement conditions to obtain a water level refinement image.

[0008] Optionally, determining the image label of the water level image according to the environmental feature includes: Extracting illumination features, tunnel features and weather features from the environmental features; extracting multiple image features from the water level image; Performing feature mapping on the multiple image features, respectively, with the illumination features, the tunnel features, and the weather features to obtain mapping features corresponding to the water level image; An image label of the water level image is determined according to the mapping feature.

[0009] Optionally, performing image segmentation on the water level refined images one by one according to the image labels to obtain the water level segmented images includes: Determine the grayscale value of the water area corresponding to the water level refinement image according to the image label, wherein the grayscale value of the water area is: ; Wherein, G is the gray value of the water area, is the original grayscale value corresponding to the pixel at the horizontal coordinate x and the vertical coordinate y, is the illumination weight coefficient, is the weather weight coefficient, is the gray value correction coefficient, is the light regulation coefficient, is the weather adjustment factor, is the illumination characteristic value corresponding to the pixel point at the horizontal coordinate x and the vertical coordinate y, is the weather grayscale feature value corresponding to the pixel point at the horizontal coordinate x and the vertical coordinate y; Identify the target image area in the water level refinement image according to the grayscale value of the water body area; The target image area is separated to obtain the water level refinement image, so as to obtain a water level segmentation image.

[0010] Optionally, determining the water level position of a target water surface in the underground tunnel according to the edge feature includes: Determine a contour position corresponding to the water level image according to the edge feature; Determine the horizontal curve and the vertical curve of the water level image according to the contour position; Determine the highest water level point of the target water surface in the underground tunnel through the intersection of the horizontal curve and the vertical curve; The water level position of the target water surface in the underground tunnel is determined according to the highest water level position.

[0011] Optionally, calculating the water level line pixel coordinates corresponding to the water level image according to the water level line position includes: Extracting pixel data corresponding to the water level position in the water level image; Counting edge points and the highest water point corresponding to the water level image according to the pixel data; The horizontal coordinate and the vertical coordinate corresponding to the water level position are calculated according to the edge point and the highest water point, wherein the horizontal coordinate and the vertical coordinate are: ; Wherein, X is the horizontal coordinate, Y is the vertical coordinate, x is the horizontal coordinate of all edge points, y is the highest vertical coordinate among the edge points, E is the edge point, and n is the total number of edge points; The water level pixel coordinates corresponding to the water level image are generated according to the horizontal coordinate and the vertical coordinate.

[0012] Optionally, converting the water level line pixel coordinates into actual water level coordinates includes: Acquire an object image corresponding to a target object in an underground tunnel, extract a coordinate system position corresponding to the water level image, and determine object pixel coordinates of the object image using the coordinate system position; Extracting device parameters of an image acquisition device, normalizing the pixel coordinates of the object according to the device parameters to obtain normalized coordinates of the object, and normalizing the pixel coordinates of the water level line according to the device parameters to obtain normalized coordinates of the water level line; The actual water level coordinates of the water level line are calculated according to the normalized coordinates of the object, the normalized coordinates of the water level line and the target height of the target object acquired in advance, wherein the actual water level coordinates are: ; Wherein, U is the abscissa in the actual water level coordinate, V is the ordinate in the actual water level coordinate, and H is the target height. is the horizontal coordinate of the water level normalized coordinate, is the ordinate of the water level in the normalized coordinates, is the horizontal coordinate of the object in normalized coordinates, is the ordinate of the object in normalized coordinates.

[0013] Optionally, calculating the actual water level value corresponding to each image label in the target water surface according to the actual water level coordinates includes: Get the actual water level coordinates corresponding to each image label; Extracting the ordinate in the actual water level coordinate; The ordinate is determined as the actual water level value corresponding to each image label in the target water surface.

[0014] In order to solve the above problems, the present invention also provides a water level measurement device based on image recognition, the device comprising: An image refinement processing module is used to collect a water level image in the underground tunnel according to a preset sliding window, and perform image refinement processing on the water level image to obtain a water level refinement image; An image segmentation module is used to extract environmental features corresponding to the underground tunnel, determine image labels of the water level image according to the environmental features, and perform image segmentation on the water level refinement images one by one according to the image labels to obtain a water level segmentation image; A water level pixel coordinate calculation module is used to extract edge features corresponding to the water level segmentation image, determine the water level position of the target water surface in the underground tunnel according to the edge features, and calculate the water level pixel coordinates corresponding to the water level image according to the water level position; An actual water level value calculation module, used to convert the water level line pixel coordinates into actual water level coordinates, and calculate the actual water level value corresponding to each image label in the target water surface according to the actual water level coordinates; The water level position correction module is used to determine the water level position corresponding to each image tag in the target water surface according to the actual water level value, and use a preset offset algorithm to correct the water level position to obtain the actual water level position of the target water surface.

[0015] The embodiment of the present invention can continuously monitor the water level changes of the underground tunnel through the sliding window and capture dynamic water level information; the collected image is refined, and the refinement process can improve the clarity and edge definition of the image, making the water level line more obvious; the environmental characteristics based on the underground tunnel help to better adapt to different scenes and ensure the accuracy of the image label; by performing image segmentation on each water level refinement image, the water level area can be accurately identified, the background and the water surface can be separated, noise interference can be reduced, and the availability of data can be improved; edge feature extraction can accurately locate the position of the water level line to ensure that the calculated water level coordinates are more reliable; pixel coordinates are converted into actual water level coordinates, and the actual water level value is calculated to obtain water level information under different environmental conditions; the water level position is corrected using a preset offset algorithm to improve the accuracy of the actual water level position. Therefore, the water level measurement method and device based on image recognition proposed by the present invention can solve the problem of low accuracy when measuring the water level in underground tunnels. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A schematic diagram of a flow chart of a water level measurement method based on image recognition provided by an embodiment of the present invention; Figure 2A schematic diagram of a process for generating image tags according to an embodiment of the present invention; Figure 3 A schematic diagram of a process for determining a water level position provided by an embodiment of the present invention; Figure 4 A functional module diagram of a water level measurement device based on image recognition provided in one embodiment of the present invention.

[0017] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0018] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0019] The embodiment of the present application provides a water level measurement method based on image recognition. The execution subject of the water level measurement method based on image recognition includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the water level measurement method based on image recognition can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as 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 big data and artificial intelligence platforms.

[0020] Reference Figure 1 FIG. 1 is a flow chart of a water level measurement method based on image recognition provided by an embodiment of the present invention. In this embodiment, the water level measurement method based on image recognition includes: S1. Collecting a water level image in an underground tunnel according to a preset sliding window, and performing image refinement processing on the water level image to obtain a water level refinement image.

[0021] In an embodiment of the present invention, the water level image in the underground tunnel refers to an image showing the water level height taken in the underground tunnel, which can be used to monitor and analyze the water level changes in the tunnel to analyze the potential flood risks in the underground tunnel, and combined with image recognition to extract the required water level information in the underground tunnel.

[0022] In the embodiment of the present invention, the step of collecting a water level image in an underground tunnel according to a preset sliding window includes: Identify water areas in underground tunnels; An initial acquisition position of an image acquisition device preset according to the water body area configuration; Determining the sliding step length of the sliding window according to the acquisition area of ​​the image acquisition device; Determine the target acquisition position corresponding to the image acquisition device according to the sliding step length and the initial acquisition position; The target acquisition position is used to acquire water level images in the underground tunnel in sections.

[0023] In detail, the water area in the underground tunnel is identified, that is, which places in the underground tunnel have water are identified, the areas with water are determined as water areas, and an image acquisition device (such as a camera) is configured in the water area. Based on the detected water area, the initial acquisition position of the image acquisition device is randomly configured at the edge of the water area, and the sliding step length corresponding to the acquisition area is determined based on the area size of the water area obtained in advance, so as to determine the next acquisition position corresponding to the initial acquisition position according to the sliding step length until the water area can be completely covered. For example, the step length can be set to 50% or less of the window width to improve the density of image acquisition, and the initial acquisition position of the image acquisition device can be allocated to multiple positions in the underground tunnel. Starting from the initial acquisition position, a series of target acquisition positions are generated according to the sliding step length until the entire water area is covered, and when generating the positions, it is checked whether there are repeated or missed areas, and appropriate adjustments are made, and each target acquisition position is moved to each target acquisition position in turn, and a water level image is captured by using an image acquisition device, and a unique identifier (such as a timestamp, position coordinates) is set for each image, so as to obtain a water level image in the underground tunnel corresponding to each target acquisition position.

[0024] Specifically, when the initial acquisition position is point A, the target acquisition positions configured by the sliding step are points B and C, and points A, B, and C need to ensure that they can completely cover the depth of the entire water body area. Points A, B, and C take water level images from top to bottom. If the shooting height of the camera can completely capture the water level image, only one acquisition position needs to be configured, and only one water level image is required; if the shooting height of the camera cannot completely capture the water level image, all target acquisition positions corresponding to the initial acquisition position need to be configured according to the sliding step to ensure that the depth of the entire water body area can be completely covered. The images taken by all target acquisition positions need to be spliced ​​to obtain the water level image of the water body area in the underground tunnel. There may be more than one water body area in the underground tunnel. In other water body areas, the water level images corresponding to the water body area in the underground tunnel are also collected by sliding steps, so that several consecutive frames of images are captured and averaged to avoid abnormal interference and improve measurement accuracy.

[0025] Furthermore, in order to measure the water level more accurately, remove redundant information in the image, and retain important water level information, it is also necessary to refine the collected water level image in the underground tunnel to improve the image quality of the water level image.

[0026] In an embodiment of the present invention, the water level refined image refers to an image after the water level image is processed, that is, it is achieved through image processing (such as grayscale, edge detection, binarization, refinement, etc.), so that the change of water level is more obvious, and the boundaries and features of the water level are enhanced and highlighted.

[0027] In the embodiment of the present invention, performing image thinning processing on the water level image to obtain a water level thinned image includes: Gray-scaling the water level image to obtain a gray-scale water level image; Extracting a water level detail image from the grayscale water level image; Performing a binarization operation on the water level detail image; Generate multiple refinement conditions according to the pixel values ​​of the binarized water level detail image, wherein the multiple refinement conditions are: ; Among them, A is a set of multiple detail conditions, is the value of each pixel in the i-th neighborhood, For the Each pixel value in the neighborhood is is the remainder function, is the jth neighborhood pixel correlation function in the first refinement condition, is the jth neighborhood pixel correlation function in the second refinement condition; The binarized water level detail image is refined according to the multiple refinement conditions to obtain a water level refinement image.

[0028] In detail, the original water level image is converted into a grayscale image, and the grayscale conversion can be done by , where R, G, and B are the pixel values ​​of the red, green, and blue channels in the image, respectively. The median filtering algorithm is used to extract the details in the water level image, filter out irrelevant details, highlight the detail features in the water level image, and binarize the processed water level detail image to convert the image into a black and white image. A threshold can be determined by the Otsu method or the adaptive threshold method to divide the pixels into foreground (water level) and background, and the conditions for refining the water level image are determined based on the pixel values ​​and pixel neighborhoods in the binarized water level detail image.

[0029] Specifically, for any pixel in a binary image The corresponding 8 neighborhoods can be expressed as ,in represents the foreground pixel, represents background pixels, and represents the number of non-zero pixels in the 8-neighborhood of pixel P, , is the number of connected foreground pixels (i.e., boundary points) in the 8-neighborhood of pixel P. During the refinement process, the pixel The deletion check will be performed based on multiple refinement conditions. If irrelevant pixels are deleted by the first refinement condition or the second refinement condition, the first refinement condition for and ,but for , for ; The second refinement condition for and ,but for , for By repeatedly applying multiple refinement conditions, checking and deleting pixels that meet the conditions until the image no longer changes, each iteration will gradually reduce the number of pixels to achieve a refinement effect; when there are no more pixels that meet the deletion conditions, the algorithm stops, and the final result is a refined binary image, that is, a water level refinement image.

[0030] Furthermore, in order to more accurately monitor the water level changes in the tunnel, it is necessary to conduct more precise water level analysis based on the environment in the tunnel, such as when the water level exceeds the standard or rises rapidly, so as to improve the issuance of early warnings and reduce the negative impact of tunnel construction and operation.

[0031] S2. Extract environmental features corresponding to the underground tunnel, determine image labels of the water level image according to the environmental features, and perform image segmentation on the water level refinement images one by one according to the image labels to obtain a water level segmentation image.

[0032] In the embodiment of the present invention, the environmental characteristics refer to the lighting characteristics, tunnel characteristics and weather characteristics in the underground tunnel, and the lighting characteristics include the type of light source (natural light or artificial light), light intensity (strong, medium, weak), and light direction; the tunnel characteristics refer to the geometric shape of the tunnel (circular, rectangular, etc.), the structural material of the tunnel (concrete, steel, etc.), the slope and height change of the tunnel; the weather characteristics refer to the current weather conditions (sunny, cloudy, rainy, etc.), temperature and humidity levels, wind speed and wind direction.

[0033] In detail, the size and height of the tunnel can be measured by tools such as laser rangefinders and levels, and the structure, shape and material of the tunnel can be monitored; the temperature and humidity changes in the tunnel can be continuously monitored by a hygrothermometer; the light intensity in the tunnel can be measured by a illuminance meter to analyze the impact of natural light and artificial light sources.

[0034] Furthermore, by determining the label of each water level image taken in the underground tunnel based on environmental characteristics, different water level conditions can be quickly identified and classified according to clear image labels. By effectively labeling water level images, the value of data usage can be improved at multiple levels.

[0035] In the embodiment of the present invention, the image label refers to a descriptive or categorical identifier given to an image, which is used to indicate the image content, features or category.

[0036] In the embodiment of the present invention, referring to Figure 2 As shown, determining the image label of the water level image according to the environmental characteristics includes: S21, extracting illumination features, tunnel features and weather features from the environmental features; S22, extracting multiple image features from the water level image; S23, performing feature mapping on the multiple image features, the illumination features, the tunnel features, and the weather features, respectively, to obtain mapping features corresponding to the water level image; S24. Determine an image label of the water level image according to the mapping feature.

[0037] In detail, the illumination feature refers to the illumination intensity in the measured image, the tunnel feature refers to the height and slope of the tunnel, the weather feature refers to the current weather conditions (such as rain or snowfall), and multiple image features in the water level image are extracted, that is, the illumination intensity, tunnel features and weather features in the water level image are analyzed, the tunnel slope and height, the presence or absence of raindrops or snowflakes in the water level image are identified, and the multiple image features are mapped with the environmental features, such as comparing the same illumination intensity, tunnel features and weather features to obtain the mapping features corresponding to the water level image, and determining the image label corresponding to the water level image according to the mapping features.

[0038] Specifically, the illumination features in the environmental features include , tunnel features include , , , weather characteristics include , , , such as the multiple image features corresponding to the extracted water level image are , , ,but , , is the mapping feature, and the image label corresponding to the water level image is .

[0039] Furthermore, in order to improve the accuracy of water level measurement and clearly display the water level changes, it is necessary to perform image segmentation on the water level refinement image, and accurate segmentation of the water level image can achieve tracking of water level changes.

[0040] In the embodiment of the present invention, the water level segmentation image refers to an image of a water level area extracted from an original water body image. In the water level segmentation image, the water level area can be clearly identified, while other background or non-water areas are removed or suppressed.

[0041] In the embodiment of the present invention, the step of performing image segmentation on the water level thinned image one by one according to the image labels to obtain the water level segmented image includes: Determine the grayscale value of the water area corresponding to the water level refinement image according to the image label, wherein the grayscale value of the water area is: ; Wherein, G is the gray value of the water area, is the original grayscale value corresponding to the pixel at the horizontal coordinate x and the vertical coordinate y, is the illumination weight coefficient, is the weather weight coefficient, is the gray value correction coefficient, is the light regulation coefficient, is the weather adjustment factor, is the illumination characteristic value corresponding to the pixel point at the horizontal coordinate x and the vertical coordinate y, is the weather grayscale feature value corresponding to the pixel point at the horizontal coordinate x and the vertical coordinate y; Identify the target image area in the water level refinement image according to the grayscale value of the water body area; The target image area is separated to obtain the water level refinement image, so as to obtain a water level segmentation image.

[0042] In detail, the illumination feature value It can be estimated by analyzing the local lighting conditions of each pixel in the image, and then converting the lighting value corresponding to the lighting feature value into a grayscale value by calculating the average brightness of the neighborhood around the pixel, that is, ; and for weather characteristic values The color distribution analysis of the image can be used, for example, using The brightness channel in the color space gives corresponding characteristic values ​​according to the weather conditions (sunny, cloudy, rainy, etc.). When the weather conditions change, the brightness of the image (V channel) will usually be different. For example: sunny day: the brightness is usually higher, the V value is larger; cloudy day: the brightness is lower, the V value may be reduced, and the color may be gray; rainy day: the brightness is further reduced, and the reflection of the object surface will also change the V value. The corresponding weather characteristic value is given according to the classification result. , you can assign different values ​​to different weather conditions, such as sunny days ,cloudy day ,rain ,and and Used to balance the influence of light and weather, gray value correction coefficient Used to fine-tune the final grayscale value to meet the needs of different scenes. Usually in the range of 0 to 1, for example, you can start with 0.5 and gradually adjust it according to the lighting conditions; It can also be set in the range of 0 to 1. The initial value can be considered as 0.3 or 0.4, and then adjusted according to the weather. Usually in the range of -20 to 20, fine-tune according to the grayscale adjustment requirements, the initial value can be set to 0, and then optimize according to the image results. , and Can be customized.

[0043] Specifically, according to the calculated grayscale value G of the water area, threshold segmentation or other image processing techniques (such as edge detection, region growing, etc.) are used to identify the target area in the water level refinement image, that is, the grayscale value G is divided into water area and non-water area. If the grayscale value is within the range of , the target area is divided into a water area, otherwise it is a non-water area, where T is the division threshold of the water area, and the division threshold can be set according to the grayscale value of the known water body. Once the target image area is identified, it is separated from the background by contour extraction to form a water level segmentation image. The water level segmentation image highlights the water level area and can effectively extract water level information from the refined image.

[0044] Furthermore, edge features can clearly define the boundary between the water body and the surrounding area, improve the recognition accuracy of the target area, and reduce misidentification. Therefore, in order to highlight the important structures and shape features in the image, it is necessary to extract the edge features corresponding to the water level image.

[0045] S3. Extract edge features corresponding to the water level segmentation image, determine the water level position of the target water surface in the underground tunnel according to the edge features, and calculate the water level pixel coordinates corresponding to the water level image according to the water level position.

[0046] In an embodiment of the present invention, the edge feature refers to important information used to represent the boundary of an object in an image, and refers to an area in the image with a large change in brightness or color, reflecting the shape, contour and structure of the object. The edge features of the water level segmentation image can be extracted by an edge detection algorithm. The edge detection algorithm includes but is not limited to Canny edge detection, Sobel algorithm, and Laplace operator. After edge detection, the shape of the water body is extracted using contour extraction technology. The findContours function of OpenCV can be used to extract the contours in the image and represent them as a point set.

[0047] Furthermore, through edge detection, the boundary between the water surface and the surrounding environment can be accurately identified to ensure accurate measurement of the water level position. Based on the edge features, the water level information in the underground tunnel can be extracted, so that the water level changes can be fed back in a timely manner.

[0048] In an embodiment of the present invention, the water level line position refers to the height or horizontal plane of the water surface in the underground tunnel, indicating the boundary of the water body, and is used to describe the current water level of the water body in the underground tunnel. The water level line position is determined by analyzing the edge features of the water surface and the surrounding environment, reflecting the real-time status of the water body.

[0049] In the embodiment of the present invention, referring to Figure 3 As shown, the step of determining the water level position of the target water surface in the underground tunnel according to the edge feature includes: S31, determining a contour position corresponding to the water level image according to the edge feature; S32, determining a horizontal curve and a vertical curve of the water level image according to the contour position; S33, determining the highest water point of the target water surface in the underground tunnel through the intersection of the horizontal curve and the vertical curve; S34. Determine the water level position of the target water surface in the underground tunnel according to the highest water level position.

[0050] In detail, the contour position of the water level is identified according to the edge features, and the contour will represent the shape and position of the water surface. By analyzing the contour data, the horizontal projection of the water level line is extracted and converted into a horizontal curve. Similarly, the vertical projection of the water level contour is extracted to form a vertical curve, that is, each row in the water level segmentation image is traversed, and the number of pixels (representing the water surface part) in the row is counted. According to the statistical results, the horizontal projection curve, that is, the distribution of the water level line in the horizontal direction, is drawn, and each column in the water level segmentation image is traversed, and the number of pixels (representing the water surface part) in the column is counted. According to the statistical results, the vertical projection curve, that is, the distribution of the water level line in the vertical direction is drawn. According to the statistical data of the horizontal and vertical projections, interpolation or smoothing algorithms (such as B-spline or polynomial fitting) are used to generate continuous horizontal curves and vertical curves, and the horizontal curves and vertical curves will more accurately represent the position and shape of the water level line.

[0051] Specifically, the horizontal curve and the vertical curve are drawn in the coordinate system to find the intersection between the horizontal curve and the vertical curve. The curve intersection will have four intersection points. The highest water point among the curve intersections is selected, that is, the highest water point of the target water surface in the underground tunnel. The curve formed by the two highest water points is determined as the water level line position of the target water surface in the underground tunnel.

[0052] Furthermore, the pixel coordinates of the water level line can be determined according to the position of the water level line, so that the specific position of the water level in the image can be accurately determined. After obtaining the pixel coordinates of the water level line, further data analysis can be performed, such as counting the water level change trends at different time points, analyzing the impact of the water level on the surrounding environment, etc., thereby realizing real-time water level monitoring and feedback.

[0053] In an embodiment of the present invention, the water level line pixel coordinates refer to the coordinates of the pixel points representing the water level line position in the image, including the horizontal coordinate (X): representing the horizontal position of the water level line in the image, and the vertical coordinate (Y): representing the vertical position of the water level line in the image. In a digital image, the coordinates are usually in pixels, counting from the upper left corner of the image, with the horizontal coordinate increasing to the right and the vertical coordinate increasing downward.

[0054] In the embodiment of the present invention, the step of calculating the pixel coordinates of the water level line corresponding to the water level image according to the position of the water level line includes: Extracting pixel data corresponding to the water level position in the water level image; Counting edge points and the highest water point corresponding to the water level image according to the pixel data; The horizontal coordinate and the vertical coordinate corresponding to the water level position are calculated according to the edge point and the highest water point, wherein the horizontal coordinate and the vertical coordinate are: ; Wherein, X is the horizontal coordinate, Y is the vertical coordinate, x is the horizontal coordinate of all edge points, y is the highest vertical coordinate among the edge points, E is the edge point, and n is the total number of edge points; The water level pixel coordinates corresponding to the water level image are generated according to the horizontal coordinate and the vertical coordinate.

[0055] Specifically, the pixel data of the image corresponding to the water level position in the water level image is extracted, wherein the gray value of each pixel reflects the characteristics of the image, and the water level image corresponding to the water level position is a images, Indicates the position in the water level image The gray value of the image can be obtained by extracting the contour using an edge detection algorithm (such as Canny). ,but Indicates that the position is an edge. It indicates that the position is not the edge, and the highest water point refers to the point on the water level line.

[0056] Specifically, the abscissa of the water level line is calculated by calculating the average of the abscissas (x coordinates) of all edge points in the water level line image. is satisfied All points, or the maximum value of the horizontal coordinate (x coordinate) of the edge points in the water level line image is used as the horizontal coordinate of the water level position, and the vertical coordinate can be calculated by finding the highest point of the contour, so as to generate the water level pixel coordinate corresponding to the water level image according to the calculated X and Y .

[0057] Furthermore, the pixel coordinates are only relative positions in the image, while the actual water level coordinates can provide more accurate water level information. Therefore, it is necessary to convert the water level line pixel coordinates into actual water level coordinates to ensure that the monitoring results are reliable.

[0058] S4. Convert the water level line pixel coordinates into actual water level coordinates, and calculate the actual water level value corresponding to each image label in the target water surface according to the actual water level coordinates.

[0059] In an embodiment of the present invention, the actual water level coordinates refer to the actual position of the water level line relative to the underground tunnel in a specific coordinate system, expressed in the form of horizontal and vertical coordinates, reflecting the position of the water level in physical space, thereby determining the actual water level position in the underground tunnel.

[0060] In the embodiment of the present invention, the step of converting the water level line pixel coordinates into actual water level coordinates includes: Acquire an object image corresponding to a target object in an underground tunnel, extract a coordinate system position corresponding to the water level image, and determine object pixel coordinates of the object image using the coordinate system position; Extracting device parameters of an image acquisition device, normalizing the pixel coordinates of the object according to the device parameters to obtain normalized coordinates of the object, and normalizing the pixel coordinates of the water level line according to the device parameters to obtain normalized coordinates of the water level line; The actual water level coordinates of the water level line are calculated according to the normalized coordinates of the object, the normalized coordinates of the water level line and the target height of the target object acquired in advance, wherein the actual water level coordinates are: ; Wherein, U is the abscissa in the actual water level coordinate, V is the ordinate in the actual water level coordinate, and H is the target height. is the horizontal coordinate of the water level normalized coordinate, is the ordinate of the water level in the normalized coordinates, is the horizontal coordinate of the object in normalized coordinates, is the ordinate of the object in normalized coordinates.

[0061] In detail, in the underground tunnel, an image acquisition device (camera) is used to capture images of known objects (such as rulers, pipes, support columns, etc.) to ensure their visibility and stability in the tunnel, and the object image corresponding to the acquired target object is set in the same coordinate system as the water level image, such as the coordinate system position of the water level image is a coordinate system set with the camera as the origin, and the pixel coordinates corresponding to the object image are determined in the same coordinate system, that is, the pixel coordinates of the target object in the same coordinate system are determined by using the coordinate system position of the water level line. , based on the device parameters of the image acquisition device, such as focal length and the principal point coordinates ,Then according to the equipment parameters, the object pixel coordinates and the water level pixel coordinates are normalized to obtain the object normalized coordinates and the water level normalized coordinates.

[0062] Specifically, the object pixel coordinates and the water level pixel coordinates are converted into normalized coordinates through device parameters. The normalization operation is usually to convert the pixel coordinates into unit values ​​so that they reflect relative positions. That is, the normalization operation for the water level pixel coordinates is: , the normalization operation for the object pixel coordinates is , and then use the known height of the target object and the distance between the camera and the known target object to calculate the proportional factor k between the pixel coordinates and the actual coordinates, then ,in is the height between the object and the camera, and then the actual coordinates of the water level are calculated according to the scale factor. , and the scale factor can be adjusted dynamically. For example, in a tunnel, if the environment changes (such as water level fluctuations), new images can be captured in real time and k can be updated to continuously obtain accurate water level information to realize the calculation of the actual water level coordinates of the water level line pixel coordinates.

[0063] Furthermore, by converting pixel coordinates into actual coordinates, water level changes can be reflected more accurately, and errors caused by image distortion can be reduced, so that the actual water level value of the target water surface in the underground tunnel can be determined according to the actual coordinates.

[0064] In the embodiment of the present invention, the actual water level value refers to the real height or depth of the water body in the underground tunnel, indicating the vertical distance between the water surface and the ground.

[0065] In the embodiment of the present invention, the actual water level value corresponding to each image label in the target water surface is calculated according to the actual water level coordinates, including: Get the actual water level coordinates corresponding to each image label; Extracting the ordinate in the actual water level coordinate; The ordinate is determined as the actual water level value corresponding to each image label in the target water surface.

[0066] In detail, in an underground tunnel, an image acquisition device can be set near different water body areas, or different water level images can be acquired in the same water body area based on different time points. Then, each acquired water level image has a unique image label, and based on the actual water level coordinates corresponding to the water body image corresponding to the image label, the extracted actual water level coordinates are processed to extract the ordinate part of the actual water level coordinates, and the ordinate represents the height of the water level, so that the extracted ordinate is determined as the actual water level value corresponding to each image label in the target water surface, wherein the ordinate in the actual water level coordinate can be obtained from a pre-stored storage area through a computer statement with a data capture function (such as a Java statement, a Python statement, etc.), and the storage area includes but is not limited to a database and a blockchain.

[0067] Furthermore, the actual water level values ​​can improve the accuracy of the analysis of the water surface status, ensure that the analysis is based on real measurement data, and combine the actual water level values ​​with image labels to clearly display the water status through visualization means (such as charts or maps).

[0068] S5. Determine the water level position corresponding to each image tag in the target water surface according to the actual water level value, and use a preset offset algorithm to correct the water level position to obtain the actual water level position of the target water surface.

[0069] In an embodiment of the present invention, the water level position refers to the position of the water surface in the underground tunnel relative to the ground. The depth of the target water surface can be determined based on the actual water level value, thereby determining the water level position of the actual water body position corresponding to each image label, that is, the water body depth position corresponding to each water body area in the underground tunnel.

[0070] Furthermore, in the actual measurement process, water level data at different locations or at different times may be inconsistent due to different reference points. Therefore, it is necessary to unify the water level data standards to make the data more comparable and consistent. The data may be affected by various factors, such as the accuracy of the equipment, environmental conditions (such as temperature, air pressure), etc. These errors need to be effectively corrected to improve the accuracy of the measurement.

[0071] In the embodiment of the present invention, the actual water level position refers to the actual height of the water surface relative to the ground in the underground tunnel under specific time and conditions.

[0072] In the embodiment of the present invention, the method of using a preset offset algorithm to correct the water level position to obtain the actual water level position of the target water surface includes: Counting the water level position corresponding to the same target water surface according to the image label; The offset value of the water level position is calculated using the following offset algorithm based on the pre-acquired historical water level values ​​corresponding to the same target water surface and the highest water level value corresponding to the water level position: ; Wherein, P is the offset value, f is the offset adjustment coefficient, is the highest water level value, is the average value of the historical water level values, is the standard deviation of the historical water level values, e is the exponent, is the bias control weight, The speed is affected by the offset; A target water level value of the target water surface is determined according to the offset value and the highest water level value corresponding to the water level position, and an actual water level position of the target water surface is determined according to the target water level value.

[0073] In detail, through image label recognition, the water level position corresponding to the same target water surface at different times or different acquisition positions is counted. For example, the water body images collected at different time points (each time interval is 10 seconds) at the target water surface A are: , then the image label corresponding to each water body image is , then the statistical water body image The corresponding water level positions and statistical water body images The highest water level value among the water level values ​​in the corresponding water level positions is obtained, and the water level value of the same target water surface is corrected and fused using the offset algorithm to obtain a more accurate water level value.

[0074] Specifically, the historical water level value corresponding to the target water surface in the historical measurement record is obtained, and the difference between the highest water level value corresponding to the current measured water level position and the mean of the historical water level values ​​is calculated to reflect the deviation between the current measured highest water level value and the historical average value. If the current value is higher than the average value, the offset is positive; otherwise, it is negative. Based on the standard deviation of the introduced historical water level values, the volatility of the measured values ​​is taken into account, and the form of the exponential function ensures that as the measured values ​​increase, the change of the offset value is smoother, while avoiding over-correction. The offset adjustment coefficient f can adjust the sensitivity of the offset, which can be appropriately adjusted according to the specific situation. For example, it can be set to 0.5 to reduce the correction amplitude, or set to 1.5 to enhance the correction effect, and the parameter Controls the weight of the standard deviation on the offset value, select an initial value between 0.5 and 2.0, and it can usually be set to 1. This means that the standard deviation has a direct impact on the offset value, but not too strong; parameter Controls how quickly the offset value responds to changes in the measured value. Choose a small value (such as 0.1 to 1) to observe the response speed through experimentation. Smaller values ​​will make the response smoother, while larger values ​​will make it more sensitive. .

[0075] Furthermore, by adding the calculated offset value P and the highest water level value corresponding to the water level position, the marked water level value of the target water surface in the underground tunnel can be obtained, and then the obtained target water level value is used as the actual water level position of the target water surface for corresponding monitoring and management.

[0076] The embodiment of the present invention can continuously monitor the water level changes of the underground tunnel through the sliding window and capture dynamic water level information; the collected image is refined, and the refinement process can improve the clarity and edge definition of the image, making the water level line more obvious; the environmental characteristics based on the underground tunnel help to better adapt to different scenes and ensure the accuracy of the image label; by performing image segmentation on each water level refinement image, the water level area can be accurately identified, the background and the water surface can be separated, noise interference can be reduced, and the availability of data can be improved; edge feature extraction can accurately locate the position of the water level line to ensure that the calculated water level coordinates are more reliable; pixel coordinates are converted into actual water level coordinates, and the actual water level value is calculated to obtain water level information under different environmental conditions; the water level position is corrected using a preset offset algorithm to improve the accuracy of the actual water level position. Therefore, the water level measurement method and device based on image recognition proposed by the present invention can solve the problem of low accuracy when measuring the water level in underground tunnels.

[0077] like Figure 4 , is a functional module diagram of a water level measurement device based on image recognition provided by an embodiment of the present invention.

[0078] The water level measurement device 100 based on image recognition of the present invention can be installed in an electronic device. According to the functions to be implemented, the water level measurement device 100 based on image recognition can include an image refinement processing module 101, an image segmentation module 102, a water level line pixel coordinate calculation module 103, an actual water level value calculation module 104 and a water level position correction module 105. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0079] In this embodiment, the functions of each module / unit are as follows: The image refinement processing module 101 is used to collect a water level image in the underground tunnel according to a preset sliding window, and perform image refinement processing on the water level image to obtain a water level refinement image; The image segmentation module 102 is used to extract environmental features corresponding to the underground tunnel, determine image labels of the water level image according to the environmental features, and perform image segmentation on the water level refined images one by one according to the image labels to obtain a water level segmentation image; The water level pixel coordinate calculation module 103 is used to extract edge features corresponding to the water level segmentation image, determine the water level position of the target water surface in the underground tunnel according to the edge features, and calculate the water level pixel coordinates corresponding to the water level image according to the water level position; The actual water level value calculation module 104 is used to convert the water level line pixel coordinates into actual water level coordinates, and calculate the actual water level value corresponding to each image label in the target water surface according to the actual water level coordinates; The water level position correction module 105 is used to determine the water level position corresponding to each image tag in the target water surface according to the actual water level value, and to correct the water level position using a preset offset algorithm to obtain the actual water level position of the target water surface.

[0080] In detail, each module described in the water level measurement device 100 based on image recognition in the embodiment of the present invention is used in the same manner as described above. Figures 1 to 3 The water level measurement method based on image recognition described in the invention has the same technical means and can produce the same technical effects, so it will not be repeated here.

[0081] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0082] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on 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.

[0083] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0084] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0085] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is not limited only according to the above description, and it is intended that all changes within the meaning and scope of equivalent elements within the scope of protection are included in the present invention.

[0086] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application device that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0087] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in a device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A water level measurement method based on image recognition, characterized in that: The method comprises: A water level image in the underground tunnel is collected according to a preset sliding window, and image refinement processing is performed on the water level image to obtain a water level refinement image; Extracting environmental features corresponding to the underground tunnel, determining image labels of the water level image according to the environmental features, and performing image segmentation on the water level refined images one by one according to the image labels to obtain a water level segmentation image; Extracting edge features corresponding to the water level segmentation image, determining the water level position of the target water surface in the underground tunnel according to the edge features, and calculating the water level pixel coordinates corresponding to the water level image according to the water level position; Convert the water level line pixel coordinates into actual water level coordinates, and calculate the actual water level value corresponding to each image label in the target water surface according to the actual water level coordinates; The water level position corresponding to each image tag in the target water surface is determined according to the actual water level value, and the water level position is corrected by using a preset offset algorithm to obtain the actual water level position of the target water surface, including: counting the water level position corresponding to the same target water surface according to the image tag; and calculating the offset value of the water level position according to the historical water level value corresponding to the same target water surface obtained in advance and the highest water level value corresponding to the water level position by using the following offset algorithm: ; Wherein, P is the offset value, f is the offset adjustment coefficient, is the highest water level value, is the average value of the historical water level values, is the standard deviation of the historical water level values, e is the exponent, is the bias control weight, The speed is affected by the offset; A target water level value of the target water surface is determined according to the offset value and the highest water level value corresponding to the water level position, and an actual water level position of the target water surface is determined according to the target water level value.

2. The water level measurement method based on image recognition according to claim 1, characterized in that: The collecting of the water level image in the underground tunnel according to the preset sliding window comprises: Identify water areas in underground tunnels; An initial acquisition position of an image acquisition device preset according to the water body area configuration; Determining the sliding step length of the sliding window according to the acquisition area of ​​the image acquisition device; Determine the target acquisition position corresponding to the image acquisition device according to the sliding step length and the initial acquisition position; The target acquisition position is used to acquire water level images in the underground tunnel in sections.

3. The water level measurement method based on image recognition according to claim 1, characterized in that: The performing image thinning processing on the water level image to obtain a water level thinning image includes: Gray-scaling the water level image to obtain a gray-scale water level image; Extracting a water level detail image from the grayscale water level image; Performing a binarization operation on the water level detail image; Generate multiple refinement conditions according to the pixel values ​​of the binarized water level detail image, wherein the multiple refinement conditions are: ; Among them, A is a set of multiple detail conditions, is the value of each pixel in the i-th neighborhood, For the Each pixel value in the neighborhood is is the remainder function, is the jth neighborhood pixel correlation function in the first refinement condition, is the jth neighborhood pixel correlation function in the second refinement condition; The binarized water level detail image is refined according to the multiple refinement conditions to obtain a water level refinement image.

4. The water level measurement method based on image recognition according to claim 1, characterized in that: The step of determining the image label of the water level image according to the environmental feature comprises: Extracting illumination features, tunnel features and weather features from the environmental features; extracting multiple image features from the water level image; Performing feature mapping on the multiple image features, respectively, with the illumination features, the tunnel features, and the weather features to obtain mapping features corresponding to the water level image; An image label of the water level image is determined according to the mapping feature.

5. The water level measurement method based on image recognition according to claim 1, characterized in that: The step of performing image segmentation on the water level refinement images one by one according to the image labels to obtain the water level segmentation images comprises: Determine the grayscale value of the water area corresponding to the water level refinement image according to the image label, wherein the grayscale value of the water area is: ; Wherein, G is the gray value of the water area, is the original grayscale value corresponding to the pixel at the horizontal coordinate x and the vertical coordinate y, is the illumination weight coefficient, is the weather weight coefficient, is the gray value correction coefficient, is the light regulation coefficient, is the weather adjustment factor, is the illumination characteristic value corresponding to the pixel point at the horizontal coordinate x and the vertical coordinate y, is the weather grayscale feature value corresponding to the pixel point at the horizontal coordinate x and the vertical coordinate y; Identify the target image area in the water level refinement image according to the grayscale value of the water body area; The target image area is separated to obtain the water level refinement image, so as to obtain a water level segmentation image.

6. The water level measurement method based on image recognition according to claim 4, characterized in that: The step of determining the water level position of a target water surface in an underground tunnel according to the edge feature comprises: Determine a contour position corresponding to the water level image according to the edge feature; Determine the horizontal curve and the vertical curve of the water level image according to the contour position; Determine the highest water level point of the target water surface in the underground tunnel through the intersection of the horizontal curve and the vertical curve; The water level position of the target water surface in the underground tunnel is determined according to the highest water level position.

7. The water level measurement method based on image recognition according to claim 1, characterized in that: The step of calculating the pixel coordinates of the water level line corresponding to the water level image according to the water level line position includes: Extracting pixel data corresponding to the water level position in the water level image; Counting edge points and the highest water point corresponding to the water level image according to the pixel data; The horizontal coordinate and the vertical coordinate corresponding to the water level position are calculated according to the edge point and the highest water point, wherein the horizontal coordinate and the vertical coordinate are: ; Wherein, X is the horizontal coordinate, Y is the vertical coordinate, x is the horizontal coordinate of all edge points, y is the highest vertical coordinate among the edge points, E is the edge point, and n is the total number of edge points; The water level pixel coordinates corresponding to the water level image are generated according to the horizontal coordinate and the vertical coordinate.

8. The water level measurement method based on image recognition according to claim 4, characterized in that: The step of converting the water level line pixel coordinates into actual water level coordinates comprises: Acquire an object image corresponding to a target object in an underground tunnel, extract a coordinate system position corresponding to the water level image, and determine object pixel coordinates of the object image using the coordinate system position; Extracting device parameters of an image acquisition device, normalizing the pixel coordinates of the object according to the device parameters to obtain normalized coordinates of the object, and normalizing the pixel coordinates of the water level line according to the device parameters to obtain normalized coordinates of the water level line; The actual water level coordinates of the water level line are calculated according to the normalized coordinates of the object, the normalized coordinates of the water level line and the target height of the target object acquired in advance, wherein the actual water level coordinates are: ; Wherein, U is the abscissa in the actual water level coordinate, V is the ordinate in the actual water level coordinate, and H is the target height. is the horizontal coordinate of the water level normalized coordinate, is the ordinate of the water level in the normalized coordinates, is the horizontal coordinate of the object in normalized coordinates, is the ordinate of the object in normalized coordinates.

9. The water level measurement method based on image recognition according to claim 1, characterized in that: The calculating the actual water level value corresponding to each image label in the target water surface according to the actual water level coordinates includes: Get the actual water level coordinates corresponding to each image label; Extracting the ordinate in the actual water level coordinate; The ordinate is determined as the actual water level value corresponding to each image label in the target water surface.

10. A water level measuring device based on image recognition, characterized in that: The device is used to perform the water level measurement method based on image recognition as described in any one of claims 1 to 9, comprising: An image refinement processing module is used to collect a water level image in the underground tunnel according to a preset sliding window, and perform image refinement processing on the water level image to obtain a water level refinement image; An image segmentation module is used to extract environmental features corresponding to the underground tunnel, determine image labels of the water level image according to the environmental features, and perform image segmentation on the water level refinement images one by one according to the image labels to obtain a water level segmentation image; A water level pixel coordinate calculation module is used to extract edge features corresponding to the water level segmentation image, determine the water level position of the target water surface in the underground tunnel according to the edge features, and calculate the water level pixel coordinates corresponding to the water level image according to the water level position; An actual water level value calculation module, used to convert the water level line pixel coordinates into actual water level coordinates, and calculate the actual water level value corresponding to each image label in the target water surface according to the actual water level coordinates; The water level position correction module is used to determine the water level position corresponding to each image tag in the target water surface according to the actual water level value, and use a preset offset algorithm to correct the water level position to obtain the actual water level position of the target water surface, including: counting the water level position corresponding to the same target water surface according to the image tag; using the following offset algorithm to calculate the offset value of the water level position according to the pre-acquired historical water level value corresponding to the same target water surface and the highest water level value corresponding to the water level position: ; Wherein, P is the offset value, f is the offset adjustment coefficient, is the highest water level value, is the average value of the historical water level values, is the standard deviation of the historical water level values, e is the exponent, is the bias control weight, The speed is affected by the offset; A target water level value of the target water surface is determined according to the offset value and the highest water level value corresponding to the water level position, and an actual water level position of the target water surface is determined according to the target water level value.

Citation Information

Patent Citations

  • Water gauge identification method and system based on water area segmentation

    CN115049684A

  • Internet-of-things online monitoring and controlling intelligent water pump system

    CN118605626A

  • High-precision ruler scale identification method and system based on machine vision

    CN119049030A

  • Method for measuring velocity of flow

    JP1994148212A

  • Image analysis system

    JP2024133874A