A water level measurement method and device based on image recognition
Through image recognition technology, the water level of underground tunnels is refined, segmented and edge feature analysis, and combined with offset algorithm correction, the problem of low accuracy caused by the susceptibility of sensors is solved, and a higher accuracy water level measurement is achieved.
Patent Information
- Application Number
- CN202411804592.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2044-12-10
AI Technical Summary
The existing water level measurement technology in underground tunnels has low measurement accuracy because the sensor is susceptible to water quality changes and aging.
The water level measurement method based on image recognition is adopted to achieve accurate positioning and correction of the water level line through image refinement processing, environmental feature extraction, image segmentation, edge feature analysis and offset algorithm correction.
It improves the accuracy of underground tunnel water level measurement, can monitor water level changes in real time, reduce noise interference, and ensure data reliability and accuracy.
Smart Images

Figure CN119273747B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and particularly to a water level measurement method and device based on image recognition. Background Art
[0002] With the continuous development of urban underground engineering, 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 the change of water level may affect the construction progress and safety in underground tunnels. Therefore, in order to be able to detect water accumulation or seepage problems in underground tunnels in a timely manner, it is necessary to monitor the change of water level in underground tunnels in real time to ensure the safety of the tunnel structure.
[0003] Most of the existing water level measurement technologies directly measure the water level underwater by using pressure sensors. In practical applications, pressure sensors are vulnerable to water quality changes (such as sediments, bubbles) and sensor aging. Sediments in water may adhere to the surface of the sensor, changing its response characteristics, resulting in a decrease in sensitivity and an increase in measurement error when measuring the water level, thus having a low accuracy when measuring the water level in underground tunnels. Summary of the Invention
[0004] The present invention provides a water level measurement method and device based on image recognition, and its main purpose is to solve the problem of low accuracy when measuring the water level in underground tunnels.
[0005] To achieve the above object, a water level measurement method based on image recognition provided by the present invention includes:
[0006] Collecting a water level image in an underground tunnel according to a preset sliding window, and performing image thinning processing on the water level image to obtain a water level thinned image;
[0007] Extracting environmental features corresponding to the underground tunnel, determining an image label of the water level image according to the environmental features, and performing image segmentation on the water level thinned image one by one according to the image label to obtain a water level segmented image;
[0008] Extracting edge features corresponding to the water level segmented image, determining the water level line position of the target water surface in the underground tunnel according to the edge features, and calculating the water level line pixel coordinates corresponding to the water level image according to the water level line position;
[0009] Converting the water level line pixel coordinates into actual water level coordinates, and calculating the actual water level value corresponding to each image label in the target water surface according to the actual water level coordinates;
[0010] Determine the water level positions corresponding to each image label in the target water surface according to the actual water level value, and correct the positions of the water level positions by using a preset offset algorithm to obtain the actual water level position of the target water surface, including: counting the water level positions corresponding to the same target water surface according to the image labels; calculating the offset value of the water level position by using the following offset algorithm 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: ;
[0011] where 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 offset control weight, is the offset influence speed;
[0012] Determine the target water level value of the target water surface according to the offset value and the highest water level value corresponding to the water level position, and determine the actual water level position of the target water surface according to the target water level value.
[0013] Optionally, the collecting the water level image in the underground tunnel according to a preset sliding window includes:
[0014] Identifying the water body area in the underground tunnel;
[0015] Configuring the initial acquisition position of a preset image acquisition device according to the water body area;
[0016] Determining the sliding step length of the sliding window according to the acquisition area of the image acquisition device;
[0017] Determining the target acquisition position corresponding to the image acquisition device through the sliding step length and the initial acquisition position;
[0018] Collecting the water level image in the underground tunnel in segments by using the target acquisition position.
[0019] Optionally, the performing image thinning processing on the water level image to obtain a water level thinned image includes:
[0020] Performing graying on the water level image to obtain a grayed water level image;
[0021] Extracting the water level detail image from the grayed water level image;
[0022] Performing a binarization operation on the water level detail image;
[0023] Generating multiple thinning conditions according to the pixel values of the binarized water level detail image, where the multiple thinning conditions are: ;
[0024] Among them, A is a set of multiple detail conditions, is each pixel value in the i-th neighborhood, is each pixel value in the is the modulo function, is the j-th neighborhood pixel correlation function in the first refinement condition, is the j-th neighborhood pixel correlation function in the second refinement condition;
[0025] Refine the binarized water level detail image according to the multiple refinement conditions to obtain a water level refined image.
[0026] Optionally, determining the image label of the water level image according to the environmental feature includes:
[0027] Extract the illumination feature, tunnel feature, and weather feature in the environmental feature;
[0028] Extract multiple image features in the water level image;
[0029] Perform feature mapping on the multiple image features with the illumination feature, the tunnel feature, and the weather feature respectively to obtain the mapping features corresponding to the water level image;
[0030] Determine the image label of the water level image according to the mapping features.
[0031] Optionally, segmenting the water level refined image one by one according to the image label to obtain a water level segmented image includes:
[0032] Determine the gray value of the water body area corresponding to the water level refined image according to the image label, where the gray value of the water body area is: ;
[0033] Among them, G is the gray value of the water body area, is the original gray value corresponding to the pixel point at the abscissa x and ordinate y, is the illumination weight coefficient, is the weather weight coefficient, is the gray value correction coefficient, is the illumination adjustment coefficient, is the weather adjustment coefficient, is the illumination feature value corresponding to the pixel point at the abscissa x and ordinate y, is the weather gray feature value corresponding to the pixel point at the abscissa x and ordinate y;
[0034] Identify the target image area in the refined water level image according to the gray value of the water area;
[0035] Separate the target image area from the refined water level image to obtain a water level segmentation image.
[0036] Optionally, the determining the water level line position of the target water surface in the underground tunnel according to the edge feature includes:
[0037] Determine the contour position corresponding to the water level image according to the edge feature;
[0038] Determine the horizontal curve and vertical curve of the water level image according to the contour position;
[0039] Determine the highest water level point of the target water surface in the underground tunnel through the curve intersection points of the horizontal curve and the vertical curve;
[0040] Determine the water level line position of the target water surface in the underground tunnel according to the highest water level point.
[0041] Optionally, the calculating the water level line pixel coordinates corresponding to the water level image according to the water level line position includes:
[0042] Extract the pixel data corresponding to the water level line position in the water level image;
[0043] Count the edge points and the highest water level point corresponding to the water level image according to the pixel data;
[0044] Calculate the abscissa and ordinate corresponding to the water level line position according to the edge points and the highest water level point, where the abscissa and ordinate are: ;
[0045] Where, X is the abscissa, Y is the ordinate, x is the abscissa of all edge points, y is the highest ordinate among the edge points, E is the edge point, and n is the total number of edge points;
[0046] Generate the water level pixel coordinates corresponding to the water level image according to the abscissa and the ordinate.
[0047] Optionally, the converting the water level line pixel coordinates to actual water level coordinates includes:
[0048] Obtain the object image corresponding to the target object in the underground tunnel, extract the coordinate system position corresponding to the water level image, and use the coordinate system position to determine the object pixel coordinates of the object image;
[0049] Extract the device parameters of the image acquisition device, normalize the object pixel coordinates according to the device parameters to obtain the object normalized coordinates, and normalize the water level line pixel coordinates according to the device parameters to obtain the water level line normalized coordinates;
[0050] Calculate the actual water level coordinates of the water level line according to the object normalized coordinates, the water level line normalized coordinates and the target height of the target object obtained in advance, where the actual water level coordinates are: ;
[0051] where U is the abscissa in the actual water level coordinates, V is the ordinate in the actual water level coordinates, H is the target height, is the abscissa in the water level line normalized coordinates, is the ordinate in the water level line normalized coordinates, is the abscissa in the object normalized coordinates, is the ordinate in the object normalized coordinates.
[0052] Optionally, 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:
[0053] Obtain the actual water level coordinates corresponding to each image label;
[0054] Extract the ordinate in the actual water level coordinates;
[0055] Determine the ordinate as the actual water level value corresponding to each image label in the target water surface.
[0056] To solve the above problems, the present invention also provides a water level measurement device based on image recognition, and the device includes:
[0057] An image thinning processing module, configured to collect a water level image in an underground tunnel according to a preset sliding window, and perform image thinning processing on the water level image to obtain a water level thinned image;
[0058] An image segmentation module, configured to extract the environmental features corresponding to the underground tunnel, determine the image labels of the water level image according to the environmental features, and perform image segmentation on the water level thinned image one by one according to the image labels to obtain a water level segmented image;
[0059] A water level line pixel coordinate calculation module, configured to extract the edge features corresponding to the water level segmented image, determine the position of the water level line of the target water surface in the underground tunnel according to the edge features, and calculate the water level line pixel coordinates corresponding to the water level image according to the water level line position;
[0060] An actual water level value calculation module, configured to convert the pixel coordinates of the water level line 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;
[0061] A water level position correction module, configured to determine the water level position corresponding to each image label in the target water surface according to the actual water level value, and perform position correction on the water level position by using a preset offset algorithm to obtain the actual water level position of the target water surface.
[0062] In the embodiment of the present invention, the water level change of the underground tunnel can be continuously monitored through a sliding window to capture dynamic water level information; the collected images are refined, and the refinement processing can improve the clarity and edge definition of the images, making the water level line more obvious; based on the environmental characteristics of the underground tunnel, it is helpful to better adapt to different scenarios and ensure the accuracy of image labels; through image segmentation of each refined water level 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 usability 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; converting pixel coordinates into actual water level coordinates and calculating the actual water level value can obtain water level information under different environmental conditions; using a preset offset algorithm to correct the water level position can 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 in measuring the water level of the underground tunnel. Description of the Drawings
[0063] Figure 1 It is a schematic flowchart of a water level measurement method based on image recognition provided by an embodiment of the present invention;
[0064] Figure 2 It is a schematic flowchart of generating an image label provided by an embodiment of the present invention;
[0065] Figure 3 It is a schematic flowchart of determining the position of the water level line provided by an embodiment of the present invention;
[0066] Figure 4 It is a functional module diagram of a water level measurement device based on image recognition provided by an embodiment of the present invention.
[0067] The realization, functional characteristics and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. Detailed Embodiments
[0068] 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.
[0069] An 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 electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided in 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 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 Network (CDN), and big data and artificial intelligence platforms.
[0070] Referring to Figure 1 As shown, it is a flowchart of the 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:
[0071] S1. Collect water level images in the underground tunnel according to a preset sliding window, and perform image thinning processing on the water level images to obtain water level thinned images.
[0072] 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 change in the tunnel, so as to analyze the potential water hazard risk in the underground tunnel, and in combination with image recognition, to extract the required water level information in the underground tunnel.
[0073] In an embodiment of the present invention, the collecting of the water level images in the underground tunnel according to the preset sliding window includes:
[0074] Identify the water body area in the underground tunnel;
[0075] Configure the initial acquisition position of the preset image acquisition device according to the water body area;
[0076] Determine the sliding step length of the sliding window according to the acquisition area of the image acquisition device;
[0077] Determine the target acquisition position corresponding to the image acquisition device through the sliding step length and the initial acquisition position;
[0078] Use the target acquisition position to segment and collect the water level images in the underground tunnel.
[0079] Specifically, the water body area in the underground tunnel is identified, that is, it is identified which places in the underground tunnel have water, the areas with water are determined as the water body areas, and image acquisition devices (such as cameras) are configured in the water body areas. Then, based on the detected water body areas, the initial acquisition positions of the image acquisition devices are randomly configured at the edges of the water body areas, and the sliding step length corresponding to the acquisition area is determined based on the pre-acquired area size of the water body areas. Thus, the next acquisition position corresponding to the initial acquisition position is determined according to the sliding step length until the entire water body area can be completely covered. For example, the step length can be set to 50% or less of the window width to increase the density of image acquisition, and the initial acquisition positions of the image acquisition devices can be allocated at 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 body area is covered. And when generating positions, it is checked whether there are duplicate or missing areas and appropriate adjustments are made. Then, move to each target acquisition position in turn, use the image acquisition device to capture the water level images, and set a unique identifier (such as timestamp, position coordinates) for each image, so as to obtain the water level images in the underground tunnel corresponding to each target acquisition position.
[0080] Specifically, when the initial acquisition position is point A, the target acquisition positions configured by the sliding step length are point B and point C. And points A, B, and C need to ensure that they can completely cover the depth of the entire water body area. Then, points A, B, and C capture the 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 there will be only one water level image. If the shooting height of the camera cannot completely capture the water level image, all the target acquisition positions corresponding to the initial acquisition position need to be configured according to the sliding step length to ensure that the depth of the entire water body area can be completely covered. Then, the images captured at all the target acquisition positions need to be stitched together to obtain the water level image of the water body area in the underground tunnel. And there may be more than one water body area in the underground tunnel. Then, in other water body areas, the water level images corresponding to the water body areas in the underground tunnel are also acquired by the method of sliding step length. Thus, intercepting and averaging consecutive frames of images can avoid abnormal interference and improve the measurement accuracy.
[0081] Furthermore, in order to measure the water level height more accurately, remove the redundant information in the images and retain the important water level information, it is also necessary to refine the acquired water level images in the underground tunnel to improve the image quality of the water level images.
[0082] In the embodiment of the present invention, the refined water level image refers to the image obtained after processing the water level image, that is, it is realized through image processing (such as grayscale conversion, edge detection, binarization, refinement, etc.), making the change of the water level more obvious and enhancing and highlighting the boundaries and features of the water level.
[0083] In the embodiment of the present invention, the step of performing image thinning processing on the water level image to obtain a thinned water level image includes:
[0084] Grayscale the water level image to obtain a grayscale water level image;
[0085] Extract the water level detail image from the grayscale water level image;
[0086] Perform binarization on the water level detail image;
[0087] Generate multiple thinning conditions according to the pixel values of the binarized water level detail image, where the multiple thinning conditions are: ;
[0088] where A is a set of multiple detail conditions, is the pixel value of each pixel in the i-th neighborhood, is the pixel value of each pixel in the -th neighborhood, is the modulo function, is the j-th neighborhood pixel correlation function in the first thinning condition, is the j-th neighborhood pixel correlation function in the second thinning condition;
[0089] Perform thinning processing on the binarized water level detail image according to the multiple thinning conditions to obtain a thinned water level image.
[0090] Specifically, convert the original water level image into a grayscale image. The grayscale conversion can be achieved through , where R, G, and B are the pixel values of the red, green, and blue channels in the image respectively. Then, use the median filtering algorithm to extract the details in the water level image, filter out the irrelevant details, highlight the detail features in the water level image, and perform binarization processing on the processed water level detail image to convert the image into a black and white image. The Otsu method or the adaptive threshold method can be used to determine a threshold to divide the pixels into foreground (water level) and background, and determine the conditions for thinning the water level image according to the pixel values and pixel neighborhoods in the binarized water level detail image.
[0091] Specifically, for any pixel in a binary image, the corresponding 8 neighborhoods can be expressed as , where represents a foreground pixel, represents a background pixel, 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 thinning process, pixel Deletion checks will be performed based on multiple refinement conditions. Irrelevant pixels will be deleted through the first refinement condition or the second refinement condition. In the first refinement condition, is and then is , is ; In the second refinement condition, is and then is , is By repeatedly applying various refinement conditions, pixels that meet the conditions are checked and deleted until the image no longer changes. The number of pixels gradually decreases with each iteration, thus achieving the refinement effect; Convergence condition When no more pixels meet the deletion condition, the algorithm stops, and the final result is the refined binary image, that is, the water level refined image.
[0092] Furthermore, in order to more accurately monitor the water level change in the tunnel, it is necessary to perform more precise water level analysis based on the environment in the tunnel, such as water level exceeding the standard or rising rapidly, so as to improve the issuance of early warnings and reduce the negative impacts of tunnel construction and operation.
[0093] S2. Extract the environmental features corresponding to the underground tunnel, determine the image label of the water level image according to the environmental features, and perform image segmentation on the water level refined image one by one according to the image label to obtain the water level segmentation image.
[0094] In the embodiment of the present invention, the environmental features refer to the lighting features, tunnel features, and weather features in the underground tunnel. The lighting features include the light source type (natural light or artificial light), light intensity (strong, medium, weak), and light direction; the tunnel features refer to the geometric shape of the tunnel (circular, rectangular, etc.), the structural materials of the tunnel (concrete, steel, etc.), the slope and height changes of the tunnel; the weather features refer to the current weather conditions (sunny, cloudy, rainy, etc.), temperature and humidity levels, wind speed, and wind direction.
[0095] Specifically, tools such as laser rangefinders and levels can be used to measure the size and height of the tunnel, and monitor the structure, shape, and materials of the tunnel; the temperature and humidity changes in the tunnel can be continuously monitored through a wet thermometer, and the light intensity in the tunnel can be measured through an illuminometer to analyze the influence of natural light and artificial light sources.
[0096] Furthermore, based on the environmental features, determine the labels of each captured water level image in the underground tunnel. Different water level conditions can be quickly identified and classified according to the clear image labels. By effectively labeling the water level images, the value of data utilization can be enhanced at multiple levels.
[0097] In the embodiments of the present invention, the image label refers to a descriptive or classificatory identifier assigned to an image, used to indicate the image content, features, or the category to which it belongs.
[0098] In the embodiments of the present invention, with reference to Figure 2 as shown, determining the image label of the water level image according to the environmental features includes:
[0099] S21. Extract the illumination feature, tunnel feature, and weather feature in the environmental features;
[0100] S22. Extract multiple image features in the water level image;
[0101] S23. Perform feature mapping on the multiple image features respectively with the illumination feature, the tunnel feature, and the weather feature to obtain the mapped features corresponding to the water level image;
[0102] S24. Determine the image label of the water level image according to the mapped features.
[0103] Specifically, the illumination feature refers to measuring the illumination intensity in the image, the tunnel feature refers to the height and slope of the tunnel, the weather feature refers to the current weather condition (such as rainfall or snowfall), and extract multiple image features in the water level image, that is, analyze the illumination intensity, tunnel feature, and weather feature in the water level image, identify the tunnel slope and height, and the presence or absence of raindrops or snowflakes in the water level image, so as to map the multiple image features with the environmental features, such as comparing the same illumination intensity, tunnel feature, and weather feature, thereby obtaining the mapped features corresponding to the water level image, and determining the image label corresponding to the water level image according to the mapped features.
[0104] Specifically, if the illumination feature in the environmental features includes , the tunnel feature includes , , , the weather feature includes , , , and if the multiple image features corresponding to the extracted water level image are , , , then , , are the mapped features, and the image label corresponding to its water level image is .
[0105] 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 refined water level image, and accurate segmentation of the water level image can achieve tracking of water level changes.
[0106] In the embodiments of the present invention, the water level segmentation image refers to an image obtained by extracting the water level area from the original water body image. In the water level segmentation image, the water level area can be clearly identified, while other background or non-water area parts are removed or suppressed.
[0107] In the embodiments of the present invention, the step of performing image segmentation on the refined water level image one by one according to the image tags to obtain the water level segmentation image includes:
[0108] Determining the gray value of the water body area corresponding to the refined water level image according to the image tags, where the gray value of the water body area is: ;
[0109] where G is the gray value of the water body area, is the original gray value corresponding to the pixel point at the abscissa x and the ordinate y, is the illumination weight coefficient, is the weather weight coefficient, is the gray value correction coefficient, is the illumination adjustment coefficient, is the weather adjustment coefficient, is the illumination feature value corresponding to the pixel point at the abscissa x and the ordinate y, is the weather gray feature value corresponding to the pixel point at the abscissa x and the ordinate y;
[0110] Identifying the target image area in the refined water level image according to the gray value of the water body area;
[0111] Separating the target image area from the refined water level image to obtain the water level segmentation image.
[0112] Specifically, the illumination feature value can be estimated by analyzing the local illumination conditions of each pixel in the image. By calculating the average brightness of the neighborhood around the pixel, the illumination value corresponding to the illumination feature value is then converted into a gray value, that is ; and for the weather feature value it can be analyzed using the color distribution of the image, for example, using The luminance channel in the color space gives corresponding characteristic values according to weather conditions (such as sunny, cloudy, rainy, etc.). When the weather conditions change, the luminance (V channel) of the image usually varies. For example: Sunny: Usually has a higher luminance, larger V value; Cloudy: Lower luminance, the V value may decrease, and the color may be grayish; Rainy: Further reduced luminance, and the reflection on the object surface also affects the V value. Corresponding weather characteristic values are given according to the classification results. , different numerical values can be assigned to different weather conditions, such as sunny , cloudy , rainy , and and are used to balance the influence degrees of illumination and weather. The gray value correction coefficient is used to fine-tune the final gray value to meet the requirements of different scenarios. It is usually in the range of 0 to 1. For example, it can start from 0.5 and be adjusted step by step according to the illumination 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 influence later. It is usually in the range of -20 to 20 and is fine-tuned according to the gray value adjustment requirements. The initial value can be set to 0, and then optimized according to the image result. , and can be adjusted customarily.
[0113] Specifically, according to the calculated gray value G of the water body area, threshold segmentation or other image processing techniques (such as edge detection, region growing, etc.) are used to identify the target area in the refined water level image, that is, the gray value G is divided into water body and non-water body areas. Once the gray value of the target area is within the gray range, this target area is classified as the water body area, otherwise it is the non-water body area, where T is the division threshold of the water body area, and the division threshold can be set according to the known gray value of the 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 the water level information from the refined image.
[0114] Furthermore, the edge feature can clearly define the boundary between the water body and the surrounding area, improve the recognition accuracy of the target area, and reduce misrecognition. Therefore, to highlight the important structural and shape features in the image, it is necessary to extract the edge features corresponding to the water level image.
[0115] S3. Extract the edge features corresponding to the water level segmentation image, determine the water level line position of the target water surface in the underground tunnel according to the edge features, and calculate the pixel coordinates of the water level line corresponding to the water level image.
[0116] In the embodiment of the present invention, the edge feature refers to the important information used to represent the boundary of an object in an image, which refers to the area where the brightness or color changes greatly in the image, reflecting the shape, contour and structure of the object. Among them, the edge features of the water level segmentation image can be extracted through an edge detection algorithm, and the edge detection algorithm includes but is not limited to the Canny edge detection, Sobel algorithm, and Laplace operator. After edge detection, the shape of the water body is extracted by using contour extraction technology, and the findContours function of OpenCV can be used to extract the contours in the image and represent them in the form of a point set.
[0117] Furthermore, through edge detection, the boundary between the water surface and the surrounding environment can be accurately identified, ensuring the accurate measurement of the water level line position. Then, based on the edge features, the water level information in the underground tunnel can be extracted, so that the water level change can be timely feedback.
[0118] In the embodiment of the present invention, the water level line position refers to the height or horizontal plane where the water surface is located in the underground tunnel, representing the boundary of the water body and 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 state of the water body.
[0119] In the embodiment of the present invention, refer to Figure 3 As shown, the determining the water level line position of the target water surface in the underground tunnel according to the edge features includes:
[0120] S31. Determine the contour position corresponding to the water level image according to the edge features;
[0121] S32. Determine the horizontal curve and vertical curve of the water level image according to the contour position;
[0122] S33. Determine the highest water level point of the target water surface in the underground tunnel through the curve intersection points of the horizontal curve and the vertical curve;
[0123] S34. Determine the water level line position of the target water surface in the underground tunnel according to the highest water level point.
[0124] Specifically, the contour position of the water level is identified based on edge features. 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 that row is counted. According to the statistical result, the horizontal projection curve, i.e., 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 that column is counted. According to the statistical result, the vertical projection curve, i.e., the distribution of the water level line in the vertical direction, is drawn. Based on the statistical data of the horizontal and vertical projections, continuous horizontal and vertical curves are generated using interpolation or smoothing algorithms (such as B-spline or polynomial fitting). Then the horizontal and vertical curves will more accurately represent the position and shape of the water level line.
[0125] Specifically, the horizontal and vertical curves are drawn in a coordinate system, and then intersections are searched for between the horizontal curve and the vertical curve. There will be four intersections for the curve intersections. Then the highest water level point among the curve intersections is selected, i.e., the highest water level point of the target water surface in the underground tunnel. The curve formed by the two highest water level points is determined as the water level line position of the target water surface in the underground tunnel.
[0126] Furthermore, based on the water level line position, the pixel coordinates of the water level line can be determined, 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 carried out, such as statistically analyzing the water level change trend at different time points, analyzing the impact of the water level on the surrounding environment, etc., so as to achieve real-time water level monitoring and feedback.
[0127] In the 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 abscissa (X): representing the horizontal position of the water level line in the image, and the ordinate (Y): representing the vertical position of the water level line in the image. In a digital image, the coordinates are usually in pixels and are counted starting from the upper left corner of the image. The abscissa increases to the right, and the ordinate increases downward.
[0128] In the embodiment of the present invention, calculating the water level line pixel coordinates corresponding to the water level image according to the water level line position includes:
[0129] Extracting the pixel data corresponding to the water level line position in the water level image;
[0130] Statistically analyzing the edge points and the highest water level point corresponding to the water level image according to the pixel data;
[0131] Calculating the abscissa and ordinate corresponding to the water level line position according to the edge points and the highest water level point, where the abscissa and ordinate are: ;
[0132] Wherein, X is the abscissa, Y is the ordinate, x is the abscissa of all edge points, y is the highest ordinate among the edge points, E is an edge point, and n is the total number of edge points;
[0133] Generate the water level pixel coordinates corresponding to the water level image according to the abscissa and the ordinate.
[0134] Specifically, extract the pixel data of the image corresponding to the position of the water level line in the water level image. The gray value of each pixel reflects the characteristics of the image. Then, the water level line image corresponding to the water level line position is an image, representing the gray value at the position in the water level line image. Using an edge detection algorithm (such as Canny) to extract the contour, a binary image can be obtained. Then, represents that this position is an edge, represents that this position is not an edge. The highest water level point refers to the point on the water level line position.
[0135] Specifically, calculate the abscissa of the water level line by calculating the average value of the abscissas (x coordinates) of all edge points in the water level line image. is all points that satisfy , or count the maximum value of the abscissas (x coordinates) of the edge points in the water level line image as the abscissa of the water level line position. The ordinate can be calculated by finding the highest point of the contour. Thus, according to the calculated X and Y, generate the water level pixel coordinates corresponding to the water level image .
[0136] 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 the reliability of the monitoring results.
[0137] 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.
[0138] In the embodiment of the present invention, the actual water level coordinates refer to the true position of the water level line relative to the underground tunnel in a specific coordinate system, represented in the form of abscissa and ordinate, reflecting the position of the water level in the physical space, so as to determine the actual water level position in the underground tunnel.
[0139] In the embodiment of the present invention, the conversion of the water level line pixel coordinates into actual water level coordinates includes:
[0140] Obtain the object image corresponding to the target object in the underground tunnel, extract the coordinate position corresponding to the water level image, and use the coordinate position to determine the object pixel coordinates of the object image;
[0141] Extract the device parameters of the image acquisition device, normalize the object pixel coordinates according to the device parameters to obtain the object normalized coordinates, and normalize the water level line pixel coordinates according to the device parameters to obtain the water level line normalized coordinates;
[0142] Calculate the actual water level coordinates of the water level line according to the object normalized coordinates, the water level line normalized coordinates and the target height of the target object obtained in advance, where the actual water level coordinates are: ;
[0143] where U is the abscissa in the actual water level coordinates, V is the ordinate in the actual water level coordinates, H is the target height, is the abscissa in the water level line normalized coordinates, is the ordinate in the water level line normalized coordinates, is the abscissa in the object normalized coordinates, is the ordinate in the object normalized coordinates.
[0144] Specifically, in the underground tunnel, use an image acquisition device (camera) to take images of known objects (such as rulers, pipes, support columns, etc.), ensure their visibility and stability in the tunnel, and set the object image corresponding to the target object collected in the same coordinate system as the water level image. For example, the coordinate position of the water level image is a coordinate system set with the camera as the origin, and determine the pixel coordinates corresponding to the object image in the same coordinate system, that is, use the coordinate position of the water level line to determine the pixel coordinates of the target object in the same coordinate system , and then based on the device parameters of the image acquisition device, such as the focal length and the principal point coordinates , and then normalize the object pixel coordinates and the water level pixel coordinates respectively according to the device parameters to obtain the object normalized coordinates and the water level line normalized coordinates.
[0145] Specifically, through the device parameters, convert the object pixel coordinates and the water level line pixel coordinates into normalized coordinates. The normalization operation usually converts the pixel coordinates into unit values so that they reflect the relative positions. That is, for the normalization operation of the water level line pixel coordinates , and for the normalization operation of the object pixel coordinates , and then use the height of the known target object and the distance between the camera and the known target object to calculate the scale factor k between the pixel coordinates and the actual coordinates, then where is the height between the object and the camera, and then the actual coordinates of the water level line are calculated according to the scale factor. Then , and the scale factor can be dynamically adjusted. 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, so as to continuously obtain accurate water level information to calculate the actual water level coordinates of the pixel coordinates of the water level line.
[0146] Furthermore, by converting the pixel coordinates into actual coordinates, the water level change can be more accurately reflected, and the error caused by image distortion can be reduced. Thus, according to the actual coordinates, the actual water level value of the target water surface in the underground tunnel can be determined.
[0147] In the embodiments of the present invention, the actual water level value refers to the true height or depth of the water body in the underground tunnel, representing the vertical distance between the water surface and the ground.
[0148] In the embodiments of the present invention, calculating the actual water level value corresponding to each image tag in the target water surface according to the actual water level coordinates includes:
[0149] Obtaining the actual water level coordinates corresponding to each image tag;
[0150] Extracting the ordinate in the actual water level coordinates;
[0151] Determining the ordinate as the actual water level value corresponding to each image tag in the target water surface.
[0152] Specifically, in the underground tunnel, the image acquisition device can be set near different water body areas, or different water level images can be acquired at different time points in the same water body area. Then each acquired water level image has a unique image tag. Based on the actual water level coordinates corresponding to the water body image corresponding to the image tag, and performing coordinate processing on the extracted actual water level coordinates, the ordinate part in the actual water level coordinates is extracted. The ordinate represents the height of the water level. Thus, the extracted ordinate is determined as the actual water level value corresponding to each image tag in the target water surface. Among them, the ordinate in the actual water level coordinates can be obtained from the pre-stored storage area through computer statements with data scraping functions (such as Java statements, Python statements, etc.). The storage area includes but is not limited to databases and blockchains.
[0153] Furthermore, through the actual water level value, the accurate analysis of the water surface state can be improved, ensuring that the analysis is based on real measurement data, and combining the actual water level value with the image tag, the water body state can be clearly displayed through visualization means (such as charts or maps).
[0154] S5. Determine the water level positions corresponding to each image tag in the target water surface based on the actual water level value, and correct the positions of the water level positions using a preset offset algorithm to obtain the actual water level position of the target water surface.
[0155] In the embodiments of the present invention, the water level position refers to the position of the water surface in the underground tunnel relative to the ground. According to the actual water level value, the depth of the target water surface can be determined, and thus the water level positions of the actual water body positions corresponding to each image tag can be determined, that is, the water body depth positions corresponding to each water body area in the underground tunnel.
[0156] Furthermore, during the actual measurement process, the 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 standard to make the data more comparable and consistent, and it may be affected by various factors, such as the accuracy of the equipment, environmental conditions (such as temperature, air pressure), etc. It is necessary to effectively correct these errors to improve the measurement accuracy.
[0157] In the embodiments of the present invention, the actual water level position refers to the true height of the water surface relative to the ground in the underground tunnel under specific time and conditions.
[0158] In the embodiments of the present invention, the step of using a preset offset algorithm to correct the position of the water level position to obtain the actual water level position of the target water surface includes:
[0159] Statistical the water level positions corresponding to the same target water surface according to the image tags;
[0160] Calculate the offset value of the water level position using the following offset algorithm 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: ;
[0161] where 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 offset control weight, is the offset influence speed;
[0162] Determine the target water level value of the target water surface according to the offset value and the highest water level value corresponding to the water level position, and determine the actual water level position of the target water surface according to the target water level value.
[0163] Specifically, through image tag recognition, the water level positions corresponding to the same target water surface at different times or different acquisition positions are counted. For example, the water body images collected at the target water surface A at different time points (with an interval of 10 seconds each time) are , and the image tags corresponding to each water body image are , then the water level positions corresponding to the water body images are counted respectively, and the highest water level value among the water level values corresponding to the water body images is counted respectively. Then, the offset algorithm is used to correct and fuse the water level values of the same target water surface to obtain a more accurate water level value.
[0164] Specifically, the historical water level value corresponding to the target water surface in the historical measurement records is obtained, and the difference between the highest water level value corresponding to the currently measured water level position and the mean value of the historical water level values is calculated to reflect the deviation between the currently 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. And based on the standard deviation of the introduced historical water level values, the volatility of the measured values is considered, and the form of the exponential function ensures that as the measured values increase, the change of the offset value is smoother, while avoiding overcorrection. Moreover, the offset adjustment coefficient f can adjust the sensitivity of the offset amount and can be appropriately adjusted according to specific situations. 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 influence of the standard deviation on the offset value, and an initial value is selected between 0.5 and 2.0, usually it can be set to 1. This means that the influence of the standard deviation on the offset value is direct but not overly strong; the parameter controls the response speed of the offset value changing with the measured value. A smaller value (such as 0.1 to 1) is selected, and the response speed can be observed through experiments. A smaller value will make the response smoother, while a larger value can make it more sensitive, then select .
[0165] Furthermore, by adding the calculated offset value P and the highest water level value corresponding to the water level position, the standard water level value of the target water surface in the underground tunnel can be obtained. 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.
[0166] In the embodiments of the present invention, the water level change of the underground tunnel can be continuously monitored through a sliding window to capture dynamic water level information; the collected images are refined, and the refinement process can improve the clarity and edge definition of the images, making the water level line more obvious; based on the environmental characteristics of the underground tunnel, it helps to better adapt to different scenarios and ensure the accuracy of image labels; by performing image segmentation on each refined water level 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 usability of the data can be improved; edge feature extraction can accurately locate the position of the water level line and ensure that the calculated water level coordinates are more reliable; by converting the pixel coordinates into actual water level coordinates and calculating the actual water level value, water level information under different environmental conditions can be obtained; a preset offset algorithm is used to correct the water level position 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 in measuring the water level of underground tunnels.
[0167] As Figure 4 shown, it is a functional module diagram of a water level measurement device based on image recognition provided by an embodiment of the present invention.
[0168] The water level measurement device 100 based on image recognition according to the present invention can be installed in an electronic device. According to the functions achieved, 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 modules in the present invention can also be referred to as units, which refer to a series of computer program segments that can be executed by a processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
[0169] In this embodiment, the functions of each module / unit are as follows:
[0170] The image refinement processing module 101 is used to collect water level images in the underground tunnel according to a preset sliding window and perform image refinement processing on the water level images to obtain refined water level images;
[0171] The image segmentation module 102 is used to extract the environmental characteristics corresponding to the underground tunnel, determine the image labels of the water level images according to the environmental characteristics, and perform image segmentation on the refined water level images one by one according to the image labels to obtain water level segmentation images;
[0172] The water level line pixel coordinate calculation module 103 is used to extract the edge features corresponding to the water level segmentation images, determine the position of the water level line of the target water surface in the underground tunnel according to the edge features, and calculate the water level line pixel coordinates corresponding to the water level images according to the water level line position;
[0173] The actual water level value calculation module 104 is configured to convert the pixel coordinates of the water level line 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;
[0174] The water level position correction module 105 is configured to determine the water level position corresponding to each image label in the target water surface according to the actual water level value, and perform position correction on the water level position by using a preset offset algorithm to obtain the actual water level position of the target water surface.
[0175] Specifically, each module in the water level measurement device 100 based on image recognition in the embodiments of the present invention adopts the same technical means as those in the above Figures 1 to 3 described water level measurement method based on image recognition, and can produce the same technical effects, which will not be elaborated here.
[0176] In several embodiments provided by the present invention, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0177] 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 may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0178] In addition, each functional module in each embodiment of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware, or in the form of a combination of hardware and software functional modules.
[0179] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and can be implemented in other specific forms without departing from the spirit or basic characteristics of the present invention.
[0180] Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of the present invention is not limited only by the above description. Therefore, it is intended to include all changes within the meaning and scope of equivalent elements falling within the protection scope in the present invention.
[0181] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology, and application device that uses a digital computer or a machine controlled by a digital computer to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results.
[0182] In addition, it is obvious that the word "including" does not exclude other units or steps, and the singular does not exclude the plural. A plurality of units or devices stated in the apparatus claims can also be implemented by one unit or device through software or hardware. The terms such as first and second are used to denote names and do not denote any particular order.
[0183] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A water level measurement method based on image recognition, characterized in that, The method includes: Collect the water level image in the underground tunnel according to a preset sliding window, grayscale the water level image to obtain a grayscale water level image; extract the water level detail image from the grayscale water level image; perform a binarization operation on the water level detail image; generate multiple thinning conditions according to the pixel values of the binarized water level detail image, where the multiple thinning conditions are: ; Among them, A is a set of multiple detail conditions, is each pixel value in the i-th neighborhood, is for the each pixel value in the j-th neighborhood, is the modulo function, is the i-th neighborhood pixel association function in the first refinement condition, and is the j-th neighborhood pixel association function in the second refinement condition; Performing thinning processing on the binary water level detail image according to the multiple thinning conditions to obtain a water level thinned image; Extract the environmental features corresponding to the underground tunnel, determine the image label of the water level image according to the environmental features, and determine the gray value of the water body area corresponding to the refined water level image, where the gray value of the water body area is: ; Wherein, G is the gray value of the water body area, is the original gray value corresponding to the pixel at the abscissa x and the ordinate y, is the illumination weight coefficient, is the weather weight coefficient, is the gray value correction coefficient, is the illumination adjustment coefficient, is the weather adjustment coefficient, is the illumination feature value corresponding to the pixel at the abscissa x and the ordinate y, is the weather gray feature value corresponding to the pixel at the abscissa x and the ordinate y; Identifying a target image area in the water level thinned image according to the gray value of the water body area, separating the target image area from the water level thinned image to obtain a water level segmentation image; Extracting the edge features corresponding to the water level segmentation image, determining the water level line position of the target water surface in the underground tunnel according to the edge features, and calculating the water level line pixel coordinates corresponding to the water level image according to the water level line position; Converting the water level line pixel coordinates into actual water level coordinates, and calculating the actual water level value corresponding to each image label in the target water surface according to the actual water level coordinates; Determine the water level positions corresponding to each image label in the target water surface according to the actual water level value, and correct the positions of the water level positions by using a preset offset algorithm to obtain the actual water level position of the target water surface, including: counting the water level positions corresponding to the same target water surface according to the image labels; calculating the offset value of the water level position by using the following offset algorithm 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: ; where 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 offset control weight, is the offset influence speed; Determining the target water level value of the target water surface according to the offset value and the highest water level value corresponding to the water level position, and determining the actual water level position of the target water surface according to the target water level value.
2. The water level measurement method based on image recognition according to claim 1, wherein, The collecting the water level image in the underground tunnel according to the preset sliding window includes: Identifying the water body area in the underground tunnel; Configuring the initial collection position of the preset image collection device according to the water body area; Determining the sliding step length of the sliding window according to the collection area of the image collection device; Determining the target collection position corresponding to the image collection device through the sliding step length and the initial collection position; Segmentally collecting the water level image in the underground tunnel by using the target collection position.
3. The water level measurement method based on image recognition according to claim 1, characterized in that, The determining the image label of the water level image according to the environmental features includes: Extracting the illumination feature, tunnel feature and weather feature in the environmental features; Extracting multiple image features in the water level image; Performing feature mapping on the multiple image features with the illumination feature, the tunnel feature and the weather feature respectively to obtain the mapping features corresponding to the water level image; Determining the image label of the water level image according to the mapping features.
4. The water level measurement method based on image recognition according to claim 3, characterized in that The determining the water level line position of the target water surface in the underground tunnel according to the edge features includes: Determining the contour position corresponding to the water level image according to the edge features; Determining the horizontal curve and vertical curve of the water level image according to the contour position; Determining the highest water level point of the target water surface in the underground tunnel through the curve intersection points of the horizontal curve and the vertical curve; Determining the water level line position of the target water surface in the underground tunnel according to the highest water level point.
5. The water level measurement method based on image recognition according to claim 1, wherein, The calculating the water level line pixel coordinates corresponding to the water level image according to the water level line position includes: Extracting the pixel data corresponding to the water level line position in the water level image; Counting the edge points and the highest water level point corresponding to the water level image according to the pixel data; Calculate the abscissa and ordinate corresponding to the water level line position according to the edge point and the highest water level point, where the abscissa and ordinate are as follows: ; Wherein, X is the abscissa, Y is the ordinate, x is the abscissa of all edge points, y is the highest ordinate among the edge points, E is the edge point, and n is the total number of edge points; Generating the water level pixel coordinates corresponding to the water level image according to the abscissa and the ordinate.
6. The method for measuring water level based on image recognition according to claim 3, wherein The converting the water level line pixel coordinates into actual water level coordinates includes: Obtaining the object image corresponding to the target object in the underground tunnel, extracting the coordinate system position corresponding to the water level image, and determining the object pixel coordinates of the object image by using the coordinate system position; Extract the device parameters of the image acquisition device, normalize the object pixel coordinates according to the device parameters to obtain object normalized coordinates, and normalize the water level line pixel coordinates according to the device parameters to obtain water level line normalized coordinates; Calculate the actual water level coordinates of the water level line according to the normalized coordinates of the object, the normalized coordinates of the water level line, and the target height of the target object obtained in advance, where the actual water level coordinates are: ; Wherein, U is the abscissa in the actual water level coordinates, V is the ordinate in the actual water level coordinates, and H is the target height. is the abscissa in the normalized coordinates of the water level line. is the ordinate in the normalized coordinates of the water level line. is the abscissa in the normalized coordinates of the object. is the ordinate in the normalized coordinates of the object.
7. 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: Obtain the actual water level coordinates corresponding to each image label; Extract the ordinate in the actual water level coordinates; Determine the ordinate as the actual water level value corresponding to each image label in the target water surface.
8. A water level measuring device based on image recognition, characterized in that, For executing the water level measurement method based on image recognition according to any one of claims 1-7, the device includes: An image thinning processing module, configured to collect water level images in an underground tunnel according to a preset sliding window, grayscale the water level images to obtain grayscale water level images; extract water level detail images from the grayscale water level images; perform a binarization operation on the water level detail images; generate multiple thinning conditions according to the pixel values of the binarized water level detail images, where the multiple thinning conditions are: ; Among them, A is a set of multiple detail conditions, is the pixel value of each pixel in the i-th neighborhood, is the pixel value of each pixel in the -th neighborhood, is the modulo function, is the j-th neighborhood pixel correlation function in the first refinement condition, is the j-th neighborhood pixel correlation function in the second refinement condition; Perform a thinning process on the binary water level detail image according to the multiple thinning conditions to obtain a water level thinned image; An image segmentation module, configured to extract environmental features corresponding to an underground tunnel, determine an image label of the water level image according to the environmental features, and determine a gray value of a water body region corresponding to the refined water level image according to the image label, where the gray value of the water body region is: ; Among them, G is the gray value of the water body area, is the original gray value corresponding to the pixel at the abscissa x and the ordinate y, is the illumination weight coefficient, is the weather weight coefficient, is the gray value correction coefficient, is the illumination adjustment coefficient, is the weather adjustment coefficient, is the illumination feature value corresponding to the pixel at the abscissa x and the ordinate y, is the weather gray feature value corresponding to the pixel at the abscissa x and the ordinate y; Identify the target image area in the water level thinned image according to the gray value of the water body area, and separate the target image area from the water level thinned image to obtain a water level segmentation image; A water level line pixel coordinate calculation module, configured to extract the edge features corresponding to the water level segmentation image, determine the position of the water level line of the target water surface in the underground tunnel according to the edge features, and calculate the water level line pixel coordinates corresponding to the water level image according to the water level line position; An actual water level value calculation module, configured 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 perform position correction on the water level position by using a preset offset algorithm to obtain the actual water level position of the target water surface, including: counting the water level positions corresponding to the same target water surface according to the image tags; calculating the offset value of the water level position by using the following offset algorithm 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: ; where 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 offset control weight, is the offset influence speed; Determine the target water level value of the target water surface according to the offset value and the highest water level value corresponding to the water level position, and determine the actual water level position of the target water surface according to the target water level value.
Citation Information
Patent Citations
High-precision ruler scale identification method and system based on machine vision
CN119049030A