Accumulated water identification method, device, equipment and medium

By training the waterlogging detection model and segmentation model, combined with rectangular detection boxes and pixel-level contour annotation, the problems of low recognition efficiency and accuracy in underground corridor waterlogging monitoring were solved, and efficient and accurate waterlogging identification was achieved.

CN120656122APending Publication Date: 2025-09-16CISDI INFORMATION TECH CO LTD

Patent Information

Application Number
CN202510793190.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

In the existing technology, underground corridor water accumulation monitoring relies on manual inspections and traditional sensors, resulting in low recognition efficiency and low accuracy, making it difficult to achieve real-time monitoring and accurate identification of water accumulation patterns.

Method used

The waterlogging detection model and waterlogging segmentation model are adopted. The training sample image set is annotated with rectangular detection boxes and pixel-level contours. The waterlogging area is determined by combining the first recognition results and the second recognition results. The degree of waterlogging is judged using the expansion coefficient and the preset waterlogging threshold.

Benefits of technology

The accuracy and efficiency of identifying water accumulation in underground corridors have been improved, and water accumulation areas can be identified in a timely and accurate manner, thereby reducing false alarm rates and ensuring the normal operation and safety of underground corridors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120656122A_ABST
    Figure CN120656122A_ABST
Patent Text Reader

Abstract

The invention provides an accumulated water identification method, device and equipment and a medium, and the method comprises the steps: obtaining a first sample image set and a second sample image set, marking the accumulated water region of each sample image in the first sample image set through a rectangular detection frame, the water accumulation area of each sample image in the second sample image set is marked by adopting a pixel-level contour; training a ponding detection model based on the first sample image set, and training a ponding segmentation model based on the second sample image set; obtaining a to-be-detected image, and inputting the to-be-detected image into the trained ponding detection model and the trained ponding segmentation model to obtain a first recognition result and a second recognition result; and if both the first identification result and the second identification result indicate that the ponding exists in the target area of the to-be-detected image, determining that the ponding exists in the target area. The method can be applied to underground vestibule ponding recognition, so that the underground vestibule ponding recognition efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and in particular relates to a method, device, equipment and medium for identifying accumulated water. Background Art

[0002] Water accumulation is a common and serious hidden danger in the management and maintenance of underground corridors. When water accumulates in underground corridors, it can damage equipment, disrupt traffic, and even pose the risk of safety incidents. Therefore, timely and accurate identification and treatment of water accumulation is crucial to ensuring the normal operation of underground corridors and the safety of personnel.

[0003] In related technologies, monitoring water accumulation in underground corridors primarily relies on manual inspections and traditional sensors. However, due to the complex environment and vast area of ​​underground corridors, manual inspections are labor-intensive and time-consuming, and real-time monitoring is difficult to achieve. Furthermore, traditional sensors often suffer from low detection accuracy and high false alarm rates when faced with the changing patterns of accumulated water and external interference factors. This reliance on manual labor and simple sensors results in low efficiency and accuracy in identifying accumulated water in underground corridors. Summary of the Invention

[0004] In view of the above-mentioned shortcomings of the prior art, the purpose of this application is to provide a water accumulation identification method, device, equipment and medium to solve the above-mentioned problems.

[0005] The water accumulation identification method provided in this application includes:

[0006] Obtain a first sample image set and a second sample image set, wherein the water accumulation area of ​​each sample image in the first sample image set is marked with a rectangular detection frame, and the water accumulation area of ​​each sample image in the second sample image set is marked with a pixel-level contour;

[0007] training a water accumulation detection model based on the first sample image set, and training a water accumulation segmentation model based on the second sample image set;

[0008] Acquire an image to be detected, and input the image to be detected into the trained water accumulation detection model and the trained water accumulation segmentation model respectively to obtain a first recognition result and a second recognition result;

[0009] If both the first recognition result and the second recognition result indicate that water accumulates in the target area of ​​the image to be detected, it is determined that water accumulates in the target area.

[0010] Optionally, the first recognition result is the image to be detected containing at least one rectangular detection frame. After obtaining the first recognition result, the method further includes:

[0011] Each rectangular detection frame in the image to be detected is expanded based on a preset expansion coefficient to obtain the expanded first recognition result.

[0012] Optionally, the second recognition result is the image to be detected including at least one pixel-level contour, or the second recognition result includes a segmented image of at least one water accumulation area to be confirmed, and the at least one pixel-level contour corresponds one-to-one to the at least one water accumulation area to be confirmed;

[0013] If both the first recognition result and the second recognition result indicate that water is present in the target area of ​​the image to be detected, determining that water is present in the target area includes:

[0014] If, in the expanded first recognition result, an area corresponding to any rectangular detection frame includes a target area in the at least one water accumulation area to be confirmed, it is determined that water accumulation exists in the target area.

[0015] Optionally, after determining that water accumulates in the target area, the method further includes:

[0016] determining a water accumulation area of ​​the target area based on the number of pixels within the target area in the second recognition result;

[0017] If the image to be detected includes the target area, determining the degree of water accumulation based on the water accumulation area of ​​the target area and a preset water accumulation threshold;

[0018] If the image to be detected includes multiple target areas, determining the maximum water accumulation area from the water accumulation areas of the multiple target areas;

[0019] The degree of water accumulation is determined based on the maximum water accumulation area and the preset water accumulation threshold.

[0020] Optionally, each sample image is captured by a camera at a plurality of camera postures, each camera posture is provided with a corresponding preset water accumulation threshold, and determining the degree of water accumulation based on the water accumulation area of ​​the target area and the preset water accumulation threshold includes:

[0021] If the image to be detected is taken by a first camera at a first camera posture, determining the degree of water accumulation based on the water accumulation area of ​​the target area and a preset water accumulation threshold corresponding to the first camera posture;

[0022] The determining of the degree of waterlogging based on the maximum waterlogging area and the preset waterlogging threshold comprises:

[0023] If the image to be detected is taken by the first camera in the first camera posture, the degree of water accumulation is determined based on the maximum water accumulation area and a preset water accumulation threshold corresponding to the first camera posture.

[0024] Optionally, each sample image is captured by a camera in multiple camera positions, the camera in at least some of the camera positions can simultaneously capture the bottom and side of the corresponding area, and at least some of the camera positions are preset with corresponding height line information. After determining that water accumulates in the target area, the method further includes:

[0025] If the image to be detected is captured by a first camera in a first camera posture, and the first camera posture is preset with corresponding first height line information, then based on the edge information of the target area and the information of the first height line, determining whether the edge of the target area exceeds the first height line;

[0026] If the edge of the target area exceeds the first height line, an alarm process is executed.

[0027] Optionally, determining whether the edge of the target area exceeds the first height line includes:

[0028] If the image to be detected is taken by a first camera in a first camera posture, and the first camera posture is preset with corresponding first height line information, and the target area does not meet the preset small water accumulation area condition, then based on the edge information of the target area and the information of the first height line, it is determined whether the edge of the target area exceeds the first height line.

[0029] The water accumulation identification device provided in this application includes:

[0030] A first acquisition module is configured to acquire a first sample image set and a second sample image set, wherein the water accumulation area of ​​each sample image in the first sample image set is annotated with a rectangular detection frame, and the water accumulation area of ​​each sample image in the second sample image set is annotated with a pixel-level contour;

[0031] a model training module, configured to train a water accumulation detection model based on the first sample image set, and to train a water accumulation segmentation model based on the second sample image set;

[0032] A second acquisition module is configured to acquire an image to be detected, and input the image to be detected into the trained water accumulation detection model and the trained water accumulation segmentation model, respectively, to obtain a first recognition result and a second recognition result;

[0033] The first determination module is configured to determine that water exists in the target area of ​​the image to be detected if both the first recognition result and the second recognition result indicate that water exists in the target area of ​​the image to be detected.

[0034] The electronic device provided in this application includes:

[0035] one or more processors;

[0036] A storage device is used to store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the water accumulation identification method.

[0037] The computer-readable storage medium provided in the present application stores a computer program thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the water accumulation identification method.

[0038] Beneficial effects of the present technical solution: In the present technical solution, a water accumulation detection model and a water accumulation segmentation model are trained separately; by inputting the image to be detected into the trained water accumulation detection model and the water accumulation segmentation model respectively, a first recognition result and a second recognition result can be obtained; by combining the first recognition result and the second recognition result, when the first recognition result and the second recognition result both indicate that there is water accumulation in the target area of ​​the image to be detected, it is determined that there is water accumulation in the target area, which is beneficial to improving the accuracy of water accumulation identification. Therefore, when the present application is applied to water accumulation identification in underground corridors, the efficiency and accuracy of water accumulation identification in underground corridors can be improved.

[0039] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings are incorporated into and constitute a part of the specification, illustrating embodiments consistent with the present application and, together with the specification, serving to explain the principles of the present application. It is obvious that the drawings described below are merely some embodiments of the present application, and a person of ordinary skill in the art can derive other drawings based on these drawings without inventive effort. In the drawings:

[0041] Figure 1 This is one of the flow charts of a method for identifying accumulated water, as shown in an exemplary embodiment of the present application;

[0042] Figure 2 is an output result of a water accumulation detection model shown in an exemplary embodiment of the present application;

[0043] Figure 3 This is a second flow chart of a method for identifying accumulated water, shown in an exemplary embodiment of the present application;

[0044] Figure 4 is an image sample of an underground corridor shown in an exemplary embodiment of the present application;

[0045] Figure 5 is a block diagram of a water accumulation identification device shown in an exemplary embodiment of the present application;

[0046] Figure 6 A schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0047] The following will describe the embodiments of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand the other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for the purpose of illustrating the present application and are not intended to limit the scope of protection of the present application.

[0048] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application. Therefore, the illustrations only show components related to the present application and are not drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component can be changed at will, and the component layout type may also be more complicated.

[0049] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.

[0050] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of a method for identifying water accumulation, as shown in an exemplary embodiment of the present application. Figure 1 As shown, in an exemplary embodiment, the water accumulation identification method includes steps S110 to S140, and each step is described in detail below.

[0051] Step S110 , obtaining a first sample image set and a second sample image set, wherein the water accumulation area of ​​each sample image in the first sample image set is marked with a rectangular detection frame, and the water accumulation area of ​​each sample image in the second sample image set is marked with a pixel-level contour.

[0052] Both the first sample image set and the second sample image set include a plurality of sample images, and the plurality of sample images may be images of an underground corridor.

[0053] The above rectangular detection box annotation refers to using a rectangular box to surround the water accumulation area. The marked boundary is a rectangle, which is usually defined by four coordinate points.

[0054] The above-mentioned pixel-level contour annotation refers to the precise pixel-level marking of the boundary of the target area. The annotated boundary is accurate to each pixel and is usually a closed curve.

[0055] The rectangular detection box annotation and the pixel-level contour annotation can be completed manually. After the annotation is completed to obtain the first sample image set and the second sample image set, the first sample image set and the second sample image set can be stored in a computer memory.

[0056] Step S120: training a water accumulation detection model based on the first sample image set, and training a water accumulation segmentation model based on the second sample image set.

[0057] The aforementioned water accumulation detection models include but are not limited to the YOLO series models and the Transformer model. To consider the difference between the predicted box and the true box in more dimensions, the complete intersection over union (CIoU) can be used as the loss function for the water accumulation detection model. CIoU is an improved intersection over union (IoU) loss function and can be expressed as:

[0058]

[0059] Among them, B gt represents the area of ​​the real box (the rectangular detection box marked in the sample image), B represents the area of ​​the predicted box (the rectangular detection box output by the water accumulation detection model), and IoU (B, B gt ) represents the intersection-over-union loss, ρ 2 (B,B gt ) represents the inner product of the two, v is the normalized difference between the aspect ratio of the predicted box and the true box, and its value is between 0 and 1. α is a balancing factor that balances the loss caused by the aspect ratio and the loss caused by the IoU part.

[0060] The above-mentioned water segmentation models include but are not limited to segformer-b0 and YOLO series models.

[0061] The Transformer model and models like SegFormer-B0 utilize a self-attention mechanism. If the water accumulation segmentation model or water accumulation detection model in this application utilizes a self-attention mechanism, a scaling factor R can be added to the self-attention mechanism to reduce the computational complexity of each self-attention module. This is described in detail below.

[0062] The principle of self-attention mechanism can be expressed as:

[0063]

[0064] This formula is used to determine the relationship between the query (Query, Q), key (Key, K) and value (Value, V), and is normalized by the Softmax function to obtain the attention weight, which is used for weighted summation value (Value).

[0065] The computational complexity of self-attention is O(N 2 ), N is the number of all image patches. On this basis, the scaling factor R is added. The specific operation is:

[0066]

[0067] Q, K, and V in the self-attention mechanism are all N*C feature maps, where N is the number of all patches and C is the dimension of each patch. The N*C feature map is converted into The feature map is then transformed through a fully connected layer (Linear) to transform the feature dimension from Mapping back to C, that is, Convert to The complexity can be reduced from O(N 2 ) is reduced to

[0068] Step S130 , obtaining an image to be detected, and inputting the image to be detected into the trained water accumulation detection model and the trained water accumulation segmentation model respectively to obtain a first recognition result and a second recognition result.

[0069] The image to be detected may be an image of an underground corridor area to be detected.

[0070] The first recognition result obtained by the trained water accumulation detection model can indicate the approximate location of the water accumulation area in the image to be detected (see Figure 2), which cannot accurately identify the exact location of the waterlogged area. The second recognition result obtained by using the trained waterlogged segmentation model can indicate the exact location of the waterlogged area in the image to be detected, but there may be misidentification.

[0071] Based on the above, if water accumulation is identified based solely on the first recognition result and the second recognition result, the accuracy is low. Therefore, in step S140 of this application, if both the first recognition result and the second recognition result indicate that there is water accumulation in the target area of ​​the image to be detected, it is determined that there is water accumulation in the target area.

[0072] By adopting the method of the embodiment of the present application, a water accumulation detection model and a water accumulation segmentation model are trained respectively; by inputting the image to be detected into the trained water accumulation detection model and the water accumulation segmentation model respectively, a first recognition result and a second recognition result can be obtained; by combining the first recognition result and the second recognition result, when the first recognition result and the second recognition result both indicate that there is water accumulation in the target area of ​​the image to be detected, it is determined that there is water accumulation in the target area, which is conducive to improving the accuracy of water accumulation identification. Therefore, when the present application is applied to water accumulation identification in underground corridors, the efficiency and accuracy of water accumulation identification in underground corridors can be improved.

[0073] Optionally, the first recognition result is the image to be detected containing at least one rectangular detection frame. After obtaining the first recognition result, the method further includes:

[0074] Each rectangular detection frame in the image to be detected is expanded based on a preset expansion coefficient to obtain the expanded first recognition result.

[0075] The embodiment of the present application expands each rectangular detection frame so that each rectangular detection frame can cover as much of the entire water accumulation area in the image to be detected as possible.

[0076] For ease of understanding, the following is a detailed explanation of the expansion of the rectangular detection box. The expansion expression is:

[0077] w′=w*p

[0078] h′=h*p

[0079] Where w and h represent the height and height of the original rectangular detection box, respectively; w′ and h′ represent the width and height of the expanded rectangular detection box, respectively; and p represents the expansion coefficient.

[0080] The position of the expanded rectangular detection frame can be described using the coordinates of the upper left corner and the lower right corner:

[0081]

[0082]

[0083] Among them, x0 and y0 represent the center point of the detection result, x top and y top Indicates the coordinate of the upper left corner of the expanded rectangular detection box, x bottom and y bottom Indicates the coordinates of the lower right corner of the expanded rectangular detection box.

[0084] Optionally, the second recognition result is the image to be detected including at least one pixel-level contour, or the second recognition result includes a segmented image of at least one water accumulation area to be confirmed, and the at least one pixel-level contour corresponds one-to-one to the at least one water accumulation area to be confirmed;

[0085] If both the first recognition result and the second recognition result indicate that water is present in the target area of ​​the image to be detected, determining that water is present in the target area includes:

[0086] If, in the expanded first recognition result, an area corresponding to any rectangular detection frame includes a target area in the at least one water accumulation area to be confirmed, it is determined that water accumulation exists in the target area.

[0087] In this implementation, the second recognition result is screened using the expanded first recognition result, which can be expressed as:

[0088]

[0089] Among them, R seg The image representing at least one water accumulation area to be confirmed (or at least one pixel-level contour image) is an irregular image. det Represents the image within the rectangular detection frame in the expanded first recognition result, R save Indicates the result after screening, R save Can be done through R det and R seg The coordinates of are determined.

[0090] In turn, they represent the coordinates of the upper left corner and lower right corner of the rectangular detection box. They represent the upper left corner coordinates and lower right corner coordinates of the rectangular detection box in the final screening result.

[0091] R save R within seg The corresponding area is the target area of ​​the embodiment of the present application.

[0092] The embodiment of the present application determines the target area where water accumulation exists through the above steps, which is conducive to further improving the accuracy of water accumulation identification and positioning.

[0093] Optionally, after determining that water accumulates in the target area, the method further includes:

[0094] determining a water accumulation area of ​​the target area based on the number of pixels within the target area in the second recognition result;

[0095] If the image to be detected includes the target area, determining the degree of water accumulation based on the water accumulation area of ​​the target area and a preset water accumulation threshold;

[0096] If the image to be detected includes multiple target areas, determining the maximum water accumulation area from the water accumulation areas of the multiple target areas;

[0097] The degree of water accumulation is determined based on the maximum water accumulation area and the preset water accumulation threshold.

[0098] In this embodiment, the number of pixels within the target region at the original input image size can represent the water accumulation area of ​​the target region. The original input image size can be understood as the original resolution and size of the image, rather than any image size after scaling, cropping, or other transformations.

[0099] The degree of waterlogging can be determined based on the waterlogging area of ​​the target area and a preset waterlogging threshold value, wherein the preset waterlogging threshold value can be one or more, such as a light waterlogging threshold value, a moderate waterlogging threshold value, and a heavy waterlogging threshold value.

[0100] When the image to be detected includes multiple target areas with accumulated water, the accumulated water area can be calculated for all target areas in the image to be detected (areas with too small accumulated water area can also be eliminated); then the accumulated water areas are sorted to obtain the maximum accumulated water area S max .

[0101] For ease of understanding, the following Figure 3 , with preset waterlogging thresholds including mild waterlogging threshold τ a and severe water accumulation threshold τ b As an example, how to determine the degree of water accumulation is described.

[0102] See also Figure 3 , if S max Less than the mild waterlogging threshold τ a , then the area corresponding to the image to be detected is determined to be normal; if S max Greater than or equal to the mild waterlogging threshold τ a And less than the severe waterlogging threshold τ b , then it is determined that the area corresponding to the image to be detected is slightly flooded; if S max Greater than the severe waterlogging threshold τ b, then it is determined that the area corresponding to the image to be detected is severely flooded. The exemplary expression is as follows:

[0103]

[0104] Where f is the waterlogging degree decision function.

[0105] Optionally, each sample image is captured by a camera at a plurality of camera postures, each camera posture is provided with a corresponding preset water accumulation threshold, and determining the degree of water accumulation based on the water accumulation area of ​​the target area and the preset water accumulation threshold includes:

[0106] If the image to be detected is taken by a first camera at a first camera posture, determining the degree of water accumulation based on the water accumulation area of ​​the target area and a preset water accumulation threshold corresponding to the first camera posture;

[0107] The determining of the degree of waterlogging based on the maximum waterlogging area and the preset waterlogging threshold comprises:

[0108] If the image to be detected is taken by the first camera in the first camera posture, the degree of water accumulation is determined based on the maximum water accumulation area and a preset water accumulation threshold corresponding to the first camera posture.

[0109] The camera pose includes the camera's position and orientation. Different preset water accumulation thresholds can be set for different camera poses. For example, as the distance between the camera pose and the water accumulation area changes, the size of the water accumulation area in the image also changes. The closer the distance, the more pixels the water accumulation area occupies in the image; the farther the distance, the fewer pixels. Therefore, the preset water accumulation threshold for camera poses with closer distances can be set higher than the preset water accumulation threshold for camera poses with farther distances.

[0110] The embodiment of the present application helps to improve accuracy by setting a preset water accumulation threshold corresponding to each camera posture, and then determining the degree of water accumulation based on the corresponding preset water accumulation threshold.

[0111] Among them, the preset water accumulation threshold corresponding to each camera pose can be manually pre-calibrated. In actual applications, if the camera pose and camera parameters (such as resolution) may change, a mapping table of camera pose-camera parameters-preset water accumulation threshold can also be calibrated. The preset water accumulation threshold corresponding to the camera pose-camera parameters can be obtained by looking up the table, and then the degree of water accumulation can be judged.

[0112] Optionally, each sample image is captured by a camera at a plurality of camera positions, the camera at at least some of the camera positions can simultaneously capture the bottom and side of the corresponding area, and at least some of the camera positions are preset with information of corresponding height lines. After determining that water accumulates in the target area, the method further includes:

[0113] If the image to be detected is captured by a first camera in a first camera posture, and the first camera posture is preset with corresponding first height line information, then based on the edge information of the target area and the information of the first height line, determining whether the edge of the target area exceeds the first height line;

[0114] If the edge of the target area exceeds the first height line, an alarm process is executed.

[0115] In this embodiment, the camera in at least some camera positions can simultaneously capture both the bottom and sides of the corresponding area, i.e., the camera's capture window is not horizontal. Because it can simultaneously capture both the bottom and sides of the corresponding area, the captured image can include height information. Based on this, at least some of the aforementioned camera positions can be annotated with information about the corresponding height lines.

[0116] During the height line information annotation process, annotation can be performed based on the sample image taken. For example, see Figure 4 , Figure 4 The original sample image has not been annotated with a rectangular detection frame or pixel-level contour. The original sample image contains the bottom and side information of the corresponding area. The height of the staircase is used as a reference to determine the height line information of the Nth floor of the staircase in the image. The height line information can then be compared with the captured image. Figure 4 The required camera pose correspondence is used for subsequent water height warning.

[0117] The following is an exemplary description of how to determine whether the edge of the target area exceeds the first height line based on the edge information of the target area and the information of the first height line.

[0118] First, as an example, the target areas with too small water accumulation areas can be eliminated (i.e., the target areas that meet the condition of too small water accumulation areas can be eliminated), and only the target areas that do not meet the condition of too small water accumulation areas can be judged as high alarms. Among them, the target areas with too small water accumulation areas can be eliminated by using an area threshold, for example, the water accumulation area can be less than the above-mentioned light water accumulation threshold τ a The target area is eliminated, or the area smaller than τ is eliminated. c (τ c Less than τ a ) target area culling.

[0119] Assume that the coordinate system corresponding to the image is based on the image center as the origin, with the right direction being the positive X-axis and the downward direction being the positive Y-axis. The height line may be located in the positive or negative direction of the coordinate axis. The edge of the target area exceeds the height line, including:

[0120] h≥τ h / l≤τ l

[0121] Among them, when the height line is in the positive direction of the coordinate axis: the information of the height line can be expressed as x = τ h , τ h >0 (located in the positive direction of the x-axis and parallel to the y-axis), h represents the maximum x-axis coordinate in the edge information of all target areas (in the case of needing to eliminate target areas with too small water accumulation areas, all target areas here are all target areas that have not been eliminated); the height line information may also be expressed as y = τ h , τ h >0 (located in the positive direction of the y-axis, parallel to the x-axis), h represents the maximum y-axis coordinate in the edge information of all target areas that are not eliminated.

[0122] When the height line is located in the negative direction of the coordinate axis: the information of the height line can be expressed as x = τ l , τ l ≤0 (located in the negative direction of the x-axis, parallel to the y-axis), l represents the minimum x-axis coordinate of the edge information of all target areas; the height line information may also be expressed as y=τ l , τ l ≤0 (located in the negative direction of the y-axis, parallel to the x-axis), l represents the minimum y-axis coordinate in the edge information of all target areas.

[0123] Satisfy h ≥ τ h or l≤τ l , the edge of the target area exceeds the height line.

[0124] Execute the alarm process, which may include the alarm indicator response, which can be expressed as:

[0125]

[0126] Among them, alarm is the alarm indicator, h≥τ h or l≤τ l If it is true, the alarm responds; otherwise, it is False and the alarm does not respond.

[0127] Optionally, determining whether the edge of the target area exceeds the first height line includes:

[0128] If the image to be detected is taken by a first camera in a first camera posture, and the first camera posture is preset with corresponding first height line information, and the target area does not meet the preset small water accumulation area condition, then based on the edge information of the target area and the information of the first height line, it is determined whether the edge of the target area exceeds the first height line.

[0129] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0130] Figure 5 FIG. 1 is a block diagram of a water accumulation identification device shown in an exemplary embodiment of the present application. Figure 5 As shown, the exemplary water accumulation identification device includes:

[0131] A first acquisition module 510 is configured to acquire a first sample image set and a second sample image set, wherein the water accumulation region of each sample image in the first sample image set is annotated with a rectangular detection frame, and the water accumulation region of each sample image in the second sample image set is annotated with a pixel-level contour;

[0132] a model training module 520, configured to train a water accumulation detection model based on the first sample image set, and to train a water accumulation segmentation model based on the second sample image set;

[0133] A second acquisition module 530 is configured to acquire an image to be detected and input the image to be detected into the trained water accumulation detection model and the trained water accumulation segmentation model, respectively, to obtain a first recognition result and a second recognition result;

[0134] The first determination module 540 is configured to determine whether water exists in the target area of ​​the image to be detected if both the first recognition result and the second recognition result indicate that water exists in the target area of ​​the image to be detected.

[0135] Optionally, the device further comprises:

[0136] An expansion module is used to expand each rectangular detection frame in the image to be detected based on a preset expansion coefficient to obtain the expanded first recognition result.

[0137] Optionally, the second recognition result is the image to be detected including at least one pixel-level contour, or the second recognition result includes a segmented image of at least one water accumulation area to be confirmed, and the at least one pixel-level contour corresponds one-to-one to the at least one water accumulation area to be confirmed;

[0138] The first determining module 540 is specifically configured to:

[0139] If, in the expanded first recognition result, an area corresponding to any rectangular detection frame includes a target area in the at least one water accumulation area to be confirmed, it is determined that water accumulation exists in the target area.

[0140] Optionally, the device further comprises:

[0141] a second determining module, configured to determine a water accumulation area of ​​the target area based on the number of pixels within the target area in the second recognition result;

[0142] a third determining module, configured to determine the degree of water accumulation based on the water accumulation area of ​​the target area and a preset water accumulation threshold if the target area is included in the image to be detected;

[0143] a fourth determining module, configured to determine a maximum water accumulation area from the water accumulation areas of the plurality of target areas if the image to be detected includes a plurality of the target areas;

[0144] The fifth determining module is configured to determine the degree of water accumulation based on the maximum water accumulation area and the preset water accumulation threshold.

[0145] Optionally, each sample image is captured by a camera at a plurality of camera postures, each camera posture is provided with a corresponding preset water accumulation threshold, and the third determination module is specifically configured to:

[0146] If the image to be detected is taken by a first camera at a first camera posture, determining the degree of water accumulation based on the water accumulation area of ​​the target area and a preset water accumulation threshold corresponding to the first camera posture;

[0147] The fifth determining module is specifically configured to:

[0148] If the image to be detected is taken by the first camera in the first camera posture, the degree of water accumulation is determined based on the maximum water accumulation area and a preset water accumulation threshold corresponding to the first camera posture.

[0149] Optionally, each sample image is captured by a camera in a plurality of camera positions, the camera in at least some of the camera positions can simultaneously capture the bottom and side of the corresponding area, and at least some of the camera positions are preset with corresponding height line information, and the device further includes:

[0150] a sixth determining module, configured to determine, if the image to be detected is captured by a first camera in a first camera posture, and the first camera posture is preset with corresponding first height line information, whether the edge of the target area exceeds the first height line based on the edge information of the target area and the information of the first height line;

[0151] An alarm module is configured to execute an alarm process if the edge of the target area exceeds the first height line.

[0152] Optionally, the sixth determining module is specifically configured to:

[0153] If the image to be detected is taken by a first camera in a first camera posture, and the first camera posture is preset with corresponding first height line information, and the target area does not meet the preset small water accumulation area condition, then based on the edge information of the target area and the information of the first height line, it is determined whether the edge of the target area exceeds the first height line.

[0154] It should be noted that the water accumulation identification device provided in the above embodiment and the water accumulation identification method provided in the above embodiment are based on the same concept, and the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here. In actual applications, the water accumulation identification device provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.

[0155] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the water accumulation identification method provided in the above-mentioned embodiments.

[0156] Figure 6 The following is a schematic diagram showing the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application. Figure 6 The computer system 600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0157] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 into the random access memory (RAM) 603, such as executing the method described in the above embodiment. Various programs and data required for system operation are also stored in the RAM 603. The CPU 601, ROM 602 and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0158] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, and the like; an output section 607 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. Removable media 611, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 610 as needed, so that computer programs read therefrom can be installed into the storage section 608 as needed.

[0159] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from a removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the various functions defined in the system of the present application are executed.

[0160] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable computer program. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0161] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0162] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. In some cases, the names of these units do not constitute limitations on the units themselves.

[0163] Another aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a computer processor, causes the computer to perform the aforementioned method for identifying accumulated water. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist independently and not be incorporated into the electronic device.

[0164] Another aspect of the present application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the water accumulation identification method provided in each of the above embodiments.

[0165] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, any equivalent modifications or alterations accomplished by a person of ordinary skill in the art without departing from the spirit and technical concepts disclosed in this application shall be covered by the claims of this application.

Claims

1. A method for identifying accumulated water, characterized in that: include: Obtain a first sample image set and a second sample image set, wherein the water accumulation area of ​​each sample image in the first sample image set is marked with a rectangular detection frame, and the water accumulation area of ​​each sample image in the second sample image set is marked with a pixel-level contour; training a water accumulation detection model based on the first sample image set, and training a water accumulation segmentation model based on the second sample image set; Acquire an image to be detected, and input the image to be detected into the trained water accumulation detection model and the trained water accumulation segmentation model respectively to obtain a first recognition result and a second recognition result; If both the first recognition result and the second recognition result indicate that water accumulates in the target area of ​​the image to be detected, it is determined that water accumulates in the target area.

2. The method for identifying accumulated water according to claim 1, wherein: The first recognition result is the image to be detected containing at least one rectangular detection frame. After obtaining the first recognition result, the method further includes: Each rectangular detection frame in the image to be detected is expanded based on a preset expansion coefficient to obtain the expanded first recognition result.

3. The method for identifying accumulated water according to claim 2, wherein: The second recognition result is the image to be detected including at least one pixel-level contour, or the second recognition result includes a segmented image of at least one water accumulation area to be confirmed, and the at least one pixel-level contour corresponds one-to-one to the at least one water accumulation area to be confirmed; If both the first recognition result and the second recognition result indicate that water is present in the target area of ​​the image to be detected, determining that water is present in the target area includes: If, in the expanded first recognition result, an area corresponding to any rectangular detection frame includes a target area in the at least one water accumulation area to be confirmed, it is determined that water accumulation exists in the target area.

4. The method for identifying accumulated water according to claim 3, wherein: After determining that water is present in the target area, the method further includes: determining a water accumulation area of ​​the target area based on the number of pixels within the target area in the second recognition result; If the image to be detected includes the target area, determining the degree of water accumulation based on the water accumulation area of ​​the target area and a preset water accumulation threshold; If the image to be detected includes multiple target areas, determining the maximum water accumulation area from the water accumulation areas of the multiple target areas; The degree of water accumulation is determined based on the maximum water accumulation area and the preset water accumulation threshold.

5. The method for identifying accumulated water according to claim 4, wherein: Each sample image is captured by a camera at a plurality of camera positions, each camera position is provided with a corresponding preset water accumulation threshold, and determining the degree of water accumulation based on the water accumulation area of ​​the target area and the preset water accumulation threshold includes: If the image to be detected is taken by a first camera at a first camera posture, determining the degree of water accumulation based on the water accumulation area of ​​the target area and a preset water accumulation threshold corresponding to the first camera posture; The determining of the degree of waterlogging based on the maximum waterlogging area and the preset waterlogging threshold comprises: If the image to be detected is taken by the first camera in the first camera posture, the degree of water accumulation is determined based on the maximum water accumulation area and a preset water accumulation threshold corresponding to the first camera posture.

6. The method for identifying accumulated water according to any one of claims 1 to 5, characterized in that: Each sample image is captured by a camera at a plurality of camera positions, the camera at at least some of the camera positions can simultaneously capture the bottom and side of the corresponding area, and at least some of the camera positions are preset with information of corresponding height lines. After determining that water accumulates in the target area, the method further includes: If the image to be detected is captured by a first camera in a first camera posture, and the first camera posture is preset with corresponding first height line information, then based on the edge information of the target area and the information of the first height line, determining whether the edge of the target area exceeds the first height line; If the edge of the target area exceeds the first height line, an alarm process is executed.

7. The method for identifying accumulated water according to claim 6, wherein: The determining whether the edge of the target area exceeds the first height line includes: If the image to be detected is taken by a first camera in a first camera posture, and the first camera posture is preset with corresponding first height line information, and the target area does not meet the preset small water accumulation area condition, then based on the edge information of the target area and the information of the first height line, it is determined whether the edge of the target area exceeds the first height line.

8. A water accumulation identification device, characterized in that: include: A first acquisition module is configured to acquire a first sample image set and a second sample image set, wherein the water accumulation area of ​​each sample image in the first sample image set is annotated with a rectangular detection frame, and the water accumulation area of ​​each sample image in the second sample image set is annotated with a pixel-level contour; a model training module, configured to train a water accumulation detection model based on the first sample image set, and to train a water accumulation segmentation model based on the second sample image set; A second acquisition module is configured to acquire an image to be detected, and input the image to be detected into the trained water accumulation detection model and the trained water accumulation segmentation model, respectively, to obtain a first recognition result and a second recognition result; The first determination module is configured to determine that water exists in the target area of ​​the image to be detected if both the first recognition result and the second recognition result indicate that water exists in the target area of ​​the image to be detected.

9. A device, characterized in that include: one or more processors and memory, A computer program is stored in the memory, and when the one or more processors execute the computer program, the device executes the water accumulation identification method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that A computer program is stored thereon, which, when executed by one or more processors, enables the device to perform the water accumulation identification method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Tooth area detection method, device and equipment and storage medium

    CN114004970A

  • Road ponding area detection method and device and electronic equipment

    CN115239794A

  • Artificial intelligence-based accumulated water identification method, apparatus and device, and storage medium

    CN115908816A

  • Accumulated water detection method and device, electronic equipment, storage medium and program product

    CN118736413A

Cited By

  • Accumulated water identification method and device and electronic equipment

    CN121459065A