Method for controlling camera to track water level fluctuation based on image recognition

CN114612504BActive Publication Date: 2024-08-27JIANGHE RUITONG (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011428349.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-07
Publication Date
2024-08-27
Estimated Expiration
2040-12-07

AI Technical Summary

Technical Problem

[0003]然而,基于人工的方法去控制摄像头跟踪水位的方法,由于人工无法24小时全程对水位点进行监控,导致水位变化后摄像头采集回来的数据无法观察到当前水位,且人工图像识别方式只能对对现有的图像进行识别,获取当前的水位数据,在水库等需要较大量程的监控点时,若水位涨落变化较大,导致水位脱离摄像头的拍摄范围后,则无法识别到当前水位

Benefits of technology

[0019] Compared with the existing technology, the beneficial effects achieved by the present invention are: the method of controlling the camera to track the rise and fall of the water level based on image recognition replaces the traditional manual image recognition method with the image recognition method of machine learning, thereby avoiding the risk of water level rise. The problem of excessive water level falling out of the camera shooting range reduces the labor cost of water level monitoring, monitors the current water level rise and fall in real time, adjusts the camera to automatically track the rise and fall of the water level in a timely manner, reduces the collection of invalid data, and improves the accuracy of the data. It is efficient, and uses the onvif protocol to control the camera to track the rise and fall of the water level. It also improves the range and accuracy of water level recognition using images, and expands the application scope of the image water level recognition method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114612504B
    Figure CN114612504B
Patent Text Reader

Abstract

The present invention discloses a method for controlling a camera to track water level fluctuations based on image recognition, comprising the following steps: step one, water gauge segmentation; step two, water level marking; step three, water area segmentation; step four, model training; step five, mask acquisition; step six, distance calculation; step seven, water level tracking. The invention replaces the traditional manual image recognition method with an image recognition method based on machine learning, thereby avoiding the problem that the water level is out of the camera shooting range due to excessive water level fluctuations, real-time monitoring of the current water level fluctuation, and timely adjusting the camera to automatically track the water level fluctuation, reducing the collection of invalid data, improving data efficiency, and reducing the laying cost of cameras and sensors. The onvif protocol is used to control the camera to track the water level fluctuations, which also improves the range and accuracy of using images to identify water levels, and expands the application scope of the image recognition water level method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of hydrological monitoring, and in particular to a method for controlling a camera to track water level fluctuations based on image recognition. Background Art

[0002] The existing camera tracking water level rise and fall method mainly adopts the method of manually observing the data collected by the camera. By manually observing the images or videos collected by the camera, it is determined whether the current water level is within the camera's shooting range, and then the camera's shooting position for the current water level is manually adjusted.

[0003] However, the method of manually controlling the camera to track the water level is unable to monitor the water point manually for 24 hours a day, so the data collected by the camera after the water level changes cannot observe the current water level. In addition, the manual image recognition method can only recognize the existing images to obtain the current water level data. At monitoring points such as reservoirs that require a larger range, if the water level fluctuates greatly and causes the water level to be out of the camera's shooting range, the current water level cannot be recognized.

[0004] Therefore, it is necessary to design a method based on image recognition to control the camera to track the rise and fall of water levels. Summary of the invention

[0005] The object of the present invention is to provide a method for controlling a camera to track water level fluctuations based on image recognition, so as to solve the problems raised in the above-mentioned background technology.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: a method for controlling a camera to track water level fluctuations based on image recognition, comprising the following steps: step 1, water gauge segmentation; step 2, water level marking; step 3, water area segmentation; step 4, model training; step 5, mask acquisition; step 6, distance calculation; step 7, water level tracking;

[0007] In the above step 1, the camera is controlled by the onvif protocol to capture multiple segmented images of the water gauge, and the full segment image of the water gauge is synthesized, and the segmented preset position of the camera corresponding to each segmented image is recorded at the same time;

[0008] In the above step 2, the water level of the full-segment image of the water gauge obtained in step 1 is marked, the highest water level value and the lowest water level value of each water gauge segment are marked, and the upper calibration point and the lower calibration point are calibrated on each water gauge segment, the pixel distance and the actual distance between the two calibration points are obtained, and the ratio of the pixel distance to the actual distance is calculated;

[0009] In the above step 3, based on the deep learning semantic segmentation method, the water area image is segmented to obtain the water area network structure;

[0010] In the above step 4, the water gauge full-segment image obtained in step 1 is used as a sample to perform model training on the water network structure, and a water segmentation model is obtained after the training;

[0011] In the above step 5, the water level image captured by the current camera is input into the water area segmentation model obtained in step 4 to obtain a mask image of the water area, and the mask image is used to accurately segment the water area in the image;

[0012] In the above step 6, according to the upper calibration point and the lower calibration point obtained in step 2, the connecting line of the two calibration points is obtained, and the intersection point of the connecting line of the two calibration points or its extension line and the mask image obtained in step 5 is calculated, and then according to the ratio of the pixel distance obtained in step 2 to the actual distance, the actual distance value between the upper calibration point and the intersection point is calculated;

[0013] In the above step 7, the corresponding preset position of the current water level is determined according to the actual distance value obtained in step 6, and the camera is adjusted to the corresponding preset position using the onvif protocol to track the rise and fall of the water level.

[0014] According to the above technical solution, in step 2, the position of the upper mark fixed point is the highest water level value of the water gauge segment, and the position of the lower mark fixed point is the lowest water level value of the water gauge segment.

[0015] According to the above technical solution, in step seven, if the actual distance value is zero, then according to the segmented preset position obtained in step one, it is determined that the corresponding preset position of the current water level is a segmented preset position upward from the current segmented preset position of the camera.

[0016] According to the above technical solution, in step seven, if the actual distance value is not zero, the current water level value is obtained by subtracting the actual distance value obtained in step six from the highest water level value obtained in step two.

[0017] According to the above technical solution, in step seven, if the current water level value is higher than the lowest water level value of the water gauge segment obtained in step two, the corresponding preset position of the current water level is determined to be the current segment preset position of the camera.

[0018] According to the above technical solution, in step one, if the current water level value is lower than the lowest water level value of the segment obtained in step two, it is determined that the corresponding preset position of the current water level is a segment preset position below the current segment preset position of the camera.

[0019] Compared with the prior art, the beneficial effects achieved by the present invention are: the method of controlling the camera to track the rise and fall of water levels based on image recognition replaces the traditional manual image recognition method with the image recognition method of machine learning, thereby avoiding the problem of the water level being out of the camera shooting range due to excessive water level fluctuations, reducing the manpower cost of water level monitoring, real-time monitoring of the current water level fluctuation, timely adjusting the camera to automatically track the rise and fall of water levels, reducing the collection of invalid data, and improving data efficiency. The onvif protocol is used to control the camera to track the rise and fall of water levels, which also improves the range and accuracy of using images to identify water levels, and expands the application scope of the image recognition water level method. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0021] Figure 1 is a flow chart of the method of the present invention;

[0022] Figure 2 It is a water level marking diagram of the present invention. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] See also Figure 1-2 The present invention provides a technical solution: a method for controlling a camera to track water level fluctuations based on image recognition, comprising the following steps: step one, water gauge segmentation; step two, water level marking; step three, water area segmentation; step four, model training; step five, mask acquisition; step six, distance calculation; step seven, water level tracking;

[0025] In the above step 1, the camera is controlled by the onvif protocol to capture multiple segmented images of the water gauge, and the full segment image of the water gauge is synthesized, and the segmented preset position of the camera corresponding to each segmented image is recorded at the same time;

[0026] In the above step 2, the water level of the full-segment image of the water ruler obtained in step 1 is marked, and the highest water level value and the lowest water level value of each water ruler segment are marked, and an upper calibration point and a lower calibration point are calibrated on each water ruler segment. The position of the upper calibration point is the highest water level value of the water ruler segment, and the position of the lower calibration point is the lowest water level value of the water ruler segment. The pixel distance and the actual distance between the two calibration points are obtained, and the ratio of the pixel distance to the actual distance is calculated at the same time;

[0027] In the above step 3, based on the deep learning semantic segmentation method, the water area image is segmented to obtain the water area network structure;

[0028] In the above step 4, the water gauge full-segment image obtained in step 1 is used as a sample to perform model training on the water network structure, and a water segmentation model is obtained after the training;

[0029] In the above step 5, the water level image captured by the current camera is input into the water area segmentation model obtained in step 4 to obtain a mask image of the water area, and the mask image is used to accurately segment the water area in the image;

[0030] In the above step 6, according to the upper calibration point and the lower calibration point obtained in step 2, the connecting line of the two calibration points is obtained, and the intersection point of the connecting line of the two calibration points or its extension line and the mask image obtained in step 5 is calculated, and then according to the ratio of the pixel distance obtained in step 2 to the actual distance, the actual distance value between the upper calibration point and the intersection point is calculated;

[0031] In the above step seven, according to the actual distance value obtained in step six, the corresponding preset position of the current water level is determined. If the actual distance value is zero, then according to the segmented preset position obtained in step one, it is determined that the corresponding preset position of the current water level is a segmented preset position upward of the current segmented preset position of the camera; if the actual distance value is not zero, the current water level value is obtained by subtracting the actual distance value obtained in step six from the highest water level value obtained in step two. If the current water level value is higher than the lowest water level value of the water gauge segment obtained in step two, then the corresponding preset position of the current water level is determined to be the current segmented preset position of the camera; if the current water level value is lower than the lowest water level value of the segment obtained in step two, then the corresponding preset position of the current water level is determined to be a segmented preset position downward of the current segmented preset position of the camera, and the camera is adjusted to the corresponding preset position using the onvif protocol to track the rise and fall of the water level.

[0032] Based on the above, the advantage of the present invention lies in that the present invention adopts an image recognition method based on machine learning, thereby avoiding the problem of water level fluctuations being too large, causing the water level to be out of the camera shooting range, monitoring the current water level fluctuations in real time, adjusting the camera to automatically track the water level fluctuations, reducing the collection of invalid data, and improving data efficiency. The camera is controlled to track the water level fluctuations, which also improves the range and accuracy of using images to identify water levels, and expands the application scope of the image recognition water level method.

[0033] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0034] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for controlling a camera to track water level fluctuations based on image recognition, comprising the following steps: Step 1: water gauge segmentation; Step 2: water level marking; Step 3: water area segmentation; Step 4: model training; Step 5: mask acquisition; Step 6: distance calculation; Step 7: water level tracking; It is characterized by: In the above step 1, the ONVIF protocol is used to control the camera to capture multiple segmented images of the water gauge, and synthesize the full-segment image of the water gauge, while recording the segmented preset position of the camera corresponding to each segmented image; In the above step 2, the water level of the full-segment water gauge image obtained in step 1 is marked, and the highest and lowest water level values ​​of each water gauge segment are marked. An upper calibration point and a lower calibration point are calibrated on each water gauge segment, and the pixel distance and actual distance between the two calibration points are obtained, and the ratio of the pixel distance to the actual distance is calculated. In the above step 3, the water area image is segmented based on the deep learning semantic segmentation method to obtain the water area network structure; In the above step 4, the full-segment water gauge image obtained in step 1 is used as a sample to perform model training on the water network structure, and a water segmentation model is obtained after the training; In the above step 5, the water level image captured by the current camera is input into the water area segmentation model obtained in step 4 to obtain a mask image of the water area, and the mask image is used to accurately segment the water area in the image; In step 6, the line connecting the upper and lower calibration points obtained in step 2 is obtained, and the intersection of the line connecting the two calibration points or its extension with the mask image obtained in step 5 is calculated. The actual distance between the upper and lower calibration points is then calculated based on the ratio of the pixel distance obtained in step 2 to the actual distance. In the above step 7, the corresponding preset position of the current water level is determined according to the actual distance value obtained in step 6, and the camera is adjusted to the corresponding preset position using the ONVIF protocol to track the rise and fall of the water level.

2. The method for controlling a camera to track water level fluctuations based on image recognition according to claim 1, characterized in that: In the step 2, the position of the upper mark fixed point is the highest water level value of the water gauge segment, and the position of the lower mark fixed point is the lowest water level value of the water gauge segment.

3. The method for controlling a camera to track water level fluctuations based on image recognition according to claim 1, characterized in that: In step seven, if the actual distance value is zero, then based on the segmented preset position obtained in step one, it is determined that the preset position corresponding to the current water level is a segmented preset position upward from the current segmented preset position of the camera.

4. The method for controlling a camera to track water level fluctuations based on image recognition according to claim 1, characterized in that: In step seven, if the actual distance value is not zero, the actual distance value obtained in step six is ​​subtracted from the highest water level value obtained in step two to obtain the current water level value.

5. The method for controlling a camera to track water level fluctuations based on image recognition according to claim 1, characterized in that: In step seven, if the current water level value is higher than the lowest water level value of the water gauge segment obtained in step two, the corresponding preset position of the current water level is determined to be the current segment preset position of the camera.

6. The method for controlling a camera to track water level fluctuations based on image recognition according to claim 1, characterized in that: In step 1, if the current water level is lower than the lowest water level of the segment obtained in step 2, it is determined that the corresponding preset position of the current water level is a segment preset position below the current segment preset position of the camera.