Liquid level meter reading algorithm and device based on computer vision
Through computer vision technology, the object detection and image segmentation model is used to realize real-time and accurate reading of the level gauge type meter, solving the problem of poor detection accuracy in complex environments, improving detection efficiency and anti-interference ability, and meeting the Real-time and efficient demand for industrial production.
Patent Information
- Application Number
- CN202410955422.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-11-12
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing liquid level detection technology has poor detection accuracy in complex environments and requires manual inspection, resulting in low detection accuracy, poor real-time performance and high operation and maintenance costs, which cannot meet the requirements of industrial production for real-time, efficient and accurate inspection.
Using the level meter reading algorithm based on computer vision, the meter detection model and the level segmentation model are trained through object detection, image segmentation and pattern recognition technology to realize real-time and accurate reading of the level meter type meter. Adapt to complex industrial environments.
It improves the accuracy and efficiency of automatic reading of liquid level meter meter, reduces manpower investment, enhances the anti-interference ability and rapid iteration ability of detection, and meets the requirements of intelligent inspection.
Smart Images

Figure CN118941768A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of digital image processing and provides a liquid level meter type meter reading algorithm and device based on computer vision. Background Art
[0002] Substation level meter detection technology is an important technology in the power system. Its background stems from the power system's demand for safe, stable and efficient operation. In the substation, the oil-immersed transformer is a key power equipment, and its normal operation is crucial to the reliability of the power system. In order to ensure the safe operation of the transformer, it is necessary to monitor the transformer liquid level in real time to prevent abnormal liquid level from causing equipment failure or accidents.
[0003] The traditional substation level meter detection method mainly relies on manual inspection, which obtains liquid level information by observing the liquid level indicator or liquid level meter of the transformer. However, manual inspection has certain limitations, such as low detection accuracy, poor real-time performance, and high workload. In order to improve the accuracy and real-time performance of liquid level detection and reduce operation and maintenance costs, researchers and technicians have begun to explore the use of modern sensor technology, communication technology, and computer technology to realize the automation of substation liquid level detection.
[0004] In recent years, with the rapid development of computer vision technology, its application in the field of substation liquid level detection has also attracted increasing attention. Computer vision technology simulates the human visual system to enable computers to recognize and understand image information, thereby realizing automatic detection and analysis of substation liquid levels.
[0005] However, existing liquid level detection technology still faces many challenges. For example, interference factors such as light, shadow, and reflection in complex environments can affect the accuracy of detection; the diversity and complexity of the products themselves also require the liquid level detection algorithm to be continuously optimized and adjusted. In addition, as the pace of industrial production continues to accelerate, the requirements for detection technology are also getting higher and higher, and real-time, efficient, and accurate detection is required.
[0006] In order to solve the above problems, the present invention proposes a liquid level meter reading algorithm based on computer vision. The method uses an image segmentation network to process the liquid level meter image, segment the mask of the liquid level area or the cursor area, and post-process the mask to obtain the liquid level reading. It can better meet the detection needs in complex industrial environments. Summary of the invention
[0007] The present invention aims to improve the accuracy and efficiency of automatic reading of liquid level meter type meters in substation scenarios. The algorithm realizes real-time and accurate reading of liquid level meter type meters through target detection, image segmentation and pattern recognition technologies, and has good stability and scalability.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] The present invention provides a liquid level meter type meter reading algorithm based on computer vision, comprising the following steps:
[0010] Step 1: Train the meter detection model and liquid level segmentation model;
[0011] Step 2: Collect visible light images of meters to be read in the substation;
[0012] Step 3: Use the meter detection model to detect the ROI area of the meter in the image, crop the ROI image, and obtain the ROI image containing only the meter;
[0013] Step 4: Use the liquid level segmentation model to segment the feature map set, and obtain the feature map with the largest confidence as the mask of the current liquid level meter, and obtain the corresponding ID;
[0014] Step 5: Select the corresponding post-processing algorithm according to the ID to post-process the extracted mask and calculate the liquid level reading.
[0015] In the above technical solution, step 1 includes the following steps:
[0016] Step 1.1, collecting an image including a level meter and a background;
[0017] Step 1.2, use the labelme annotation tool to annotate the parallel circumscribed rectangle of the level gauge area to obtain the level gauge detection data set;
[0018] Step 1.3, crop the labeled data set to obtain a ROI image containing only the liquid level gauge;
[0019] Step 1.4, use the labelme tool to annotate the polygon of the target area in the ROI image to obtain the liquid level segmentation dataset;
[0020] Step 1.5: Input the liquid level meter detection data set and the liquid level segmentation data set into the target detection model and the segmentation model for training respectively, to obtain the liquid level meter detection model and the liquid level segmentation model.
[0021] In the above technical solution, the characteristic graphs are divided into four types according to different meter recognition methods:
[0022] Vernier type: Identify the center position of the vernier area as the liquid level reading;
[0023] Liquid level type: Identify the center of the upper edge of the convex hull of the liquid level area as the liquid level reading;
[0024] Float type: Identify the center of the lower edge of the convex hull of the float area as the liquid level reading;
[0025] Circular oil level: Identify the center of the longest side at the upper end of the level area as the level reading.
[0026] In the above technical solution, step 5 includes the following steps:
[0027] Step 5.1, perform threshold segmentation on the mask obtained in step 4 to obtain a binary image of the target area;
[0028] Step 5.2, perform a closing operation on the binary image to merge discontinuous areas;
[0029] Step 5.3, perform contour search on the binary image to obtain the preliminary selected contour;
[0030] Step 5.4: Calculate the average confidence of each area in the preliminary selected contour and select the one with the largest confidence.
[0031] The contour is taken as the target area contour, and the average confidence calculation formula is as follows:
[0032]
[0033] Where Region represents the contour area, pix represents the pixels within the contour, Score represents the confidence of the pix pixel position, Area represents the contour area, and conf represents the average confidence;
[0034] Step 5.5, select the convex hull detection algorithm according to the corresponding ID to perform reading detection;
[0035] Step 5.6: Use the convex hull detection algorithm to calculate the contour convex hull, traverse all nodes in the convex hull, remove points whose angle change is less than the threshold, and merge the two sides. The main effect of this step is to merge adjacent shorter straight edges.
[0036] Step 5.6.1. Calculate the convex hull of the contour using the convex hull detection algorithm: For the preliminary contour obtained in step 5.3, apply the convex hull detection algorithm to calculate the convex hull of the contour. The convex hull is a minimum convex polygon that can contain all the points in the contour.
[0037] Step 5.6.2, traverse all nodes in the convex hull: for the calculated convex hull, traverse each node in it;
[0038] Step 5.6.3, remove points whose angle change is less than the threshold: For each node in the convex hull, calculate the angle between its two adjacent sides. If the change of the angle is less than the set threshold, the point is considered to be on a straight edge and removed from the convex hull;
[0039] Step 5.6.4, merge two sides: After removing the point, the two sides originally separated by the point will be merged into a new side;
[0040] Step 5.7: Select the top or bottom long edge with an inclination angle less than a threshold as the liquid level line according to the inclination angle, position and length of the edge. The main purpose of this step is to filter out long edges that are too inclined, retain relatively horizontal long edges as liquid level lines, and improve the accuracy of liquid level line recognition.
[0041] Step 5.8, calculate the Y value of the midpoint of the liquid level line as the liquid level position;
[0042] Step 5.9: Convert the pixel value of the liquid level into a percentage reading. The calculation formula is as follows:
[0043]
[0044] Where y is the y coordinate of the pixel where the liquid level is located, h is the height of the ROI image, and value is the reading value.
[0045] The present invention provides a liquid level meter type meter reading device based on computer vision, comprising the following modules:
[0046] Training module, used to train meter detection model and liquid level segmentation model;
[0047] An image acquisition module, used to acquire visible light images of meters to be read in the substation;
[0048] The ROI region detection and cropping module is used to detect the ROI region of the meter in the image using the meter detection model, and crop the ROI image to obtain the ROI image containing only the meter;
[0049] The feature map segmentation and selection module is used to segment the feature map set using the liquid level segmentation model, and obtain the feature map with the largest confidence as the mask of the current liquid level meter, and obtain the corresponding ID;
[0050] The post-processing module is used to select a corresponding post-processing algorithm according to the ID to post-process the extracted mask and calculate the liquid level reading.
[0051] In the above device, the training module includes:
[0052] A data acquisition submodule, for acquiring an image including a level meter and a background;
[0053] The labeling submodule is used to label the parallel circumscribed rectangle of the level gauge area using the labelme labeling tool to obtain the level gauge detection data set;
[0054] The data cropping submodule is used to crop the labeled data set to obtain a ROI image containing only the liquid level gauge;
[0055] The ROI image annotation submodule is used to annotate the polygons of the target area in the ROI image using the labelme tool to obtain the liquid level segmentation dataset;
[0056] The model training submodule is used to input the liquid level meter detection data set and the liquid level segmentation data set into the target detection model and the segmentation model for training respectively, so as to obtain the liquid level meter detection model and the liquid level segmentation model.
[0057] In the above device, the characteristic graphs are divided into four types according to different meter recognition methods:
[0058] Vernier type: Identify the center position of the vernier area as the liquid level reading;
[0059] Liquid level type: Identify the center of the upper edge of the convex hull of the liquid level area as the liquid level reading;
[0060] Float type: Identify the center of the lower edge of the convex hull of the float area as the liquid level reading;
[0061] Circular oil level: Identify the center of the longest side at the upper end of the level area as the level reading.
[0062] In the above device, the post-processing module includes:
[0063] A threshold segmentation submodule is used to perform threshold segmentation on the acquired mask to obtain a binary image of the target area;
[0064] The closing operation submodule is used to perform a closing operation on the binary image and merge discontinuous areas;
[0065] The contour search submodule is used to search for contours of binary images and obtain preliminary contours;
[0066] The confidence calculation submodule is used to calculate the average confidence of each area in the preliminary selected contour, and select the contour with the largest confidence as the target area contour. The average confidence calculation formula is as follows:
[0067]
[0068] Where Region represents the contour area, pix represents the pixels within the contour, Score represents the confidence of the pix pixel position, Area represents the contour area, and conf represents the average confidence;
[0069] The convex hull detection submodule is used to select the convex hull detection algorithm for reading detection according to the corresponding ID;
[0070] The liquid level line recognition submodule is used to calculate the contour convex hull using the convex hull detection algorithm, traverse all nodes in the convex hull, remove points whose angle change is less than the threshold, and merge the two sides. The main effect of this step is to merge adjacent shorter straight edges;
[0071] Use the convex hull detection algorithm to calculate the convex hull of the contour: For the preliminary contour obtained in step 5.3, apply the convex hull detection algorithm to calculate the convex hull of the contour. The convex hull is a minimum convex polygon that can contain all the points in the contour;
[0072] Traverse all nodes in the convex hull: for the calculated convex hull, traverse each node in it;
[0073] Remove points whose angle change is less than the threshold: For each node in the convex hull, calculate the angle between its two adjacent sides. If the change of the angle is less than the set threshold, the point is considered to be on a straight edge and removed from the convex hull.
[0074] Merge two sides: After removing the point, the two sides originally separated by the point will be merged into a new side;
[0075] Traverse all nodes in the convex hull, and select the top or bottom long edge with an inclination angle less than the threshold as the liquid level line according to the inclination angle, position and length of the edge. The main purpose of this step is to filter out long edges that are too inclined, retain relatively horizontal long edges as liquid level lines, and improve the accuracy of liquid level line recognition.
[0076] The liquid level position calculation submodule is used to calculate the Y value of the midpoint of the liquid level line as the liquid level position;
[0077] The reading conversion submodule is used to convert the pixel value of the liquid level into a percentage reading. The calculation formula is as follows:
[0078]
[0079] Where y is the y coordinate of the pixel where the liquid level is located, h is the height of the ROI image, and value is the reading value.
[0080] Because the present invention adopts the above technical means, it has the following beneficial effects:
[0081] Improved inspection efficiency: By adopting computer vision algorithms, automatic inspection of substation liquid level meters is realized, which greatly reduces the investment of manpower and material resources and improves inspection efficiency.
[0082] Strong generalization performance: The algorithm design has good generalization ability and can identify a variety of meters with different appearances but the same recognition rules. It is not limited to liquid level meters of specific equipment, which enhances the scope of application.
[0083] Fast iteration capability: When deploying to a new site, by collecting images of the corresponding site and pre-labeling them using existing models, and then manually verifying them, the detection model and segmentation model can be quickly retrained to achieve fast iteration and online operation.
[0084] Anti-interference: For level gauges with severe tilt, the contour filtering algorithm can accurately read the readings, improving the detection accuracy and anti-interference ability in complex environments.
[0085] Real-time and accurate readings: Combining target detection, image segmentation and pattern recognition technology, real-time and accurate readings of level meters are achieved, meeting the requirements of intelligent inspection.
[0086] Optimized post-processing algorithms: Through specific post-processing algorithms, such as closing operation, contour search and convex hull detection, the accuracy of liquid level line recognition and the robustness of the algorithm are further improved.
[0087] In summary, the present invention not only improves the accuracy and efficiency of the readings of liquid level meters in substations, but also provides effective technical support for intelligent inspection of substations through its rapid iteration and strong generalization capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] Figure 1 It is a flow chart of the program;
[0089] Figure 2 This is a schematic diagram of contour post-processing;
[0090] Figure 3 Schematic diagram of contour filtering. DETAILED DESCRIPTION
[0091] The following is a detailed description of the embodiments of the present invention. Although the present invention will be described and illustrated in conjunction with some specific embodiments, it should be noted that the present invention is not limited to these embodiments. On the contrary, modifications or equivalent substitutions made to the present invention should all be included in the scope of the claims of the present invention.
[0092] In addition, in order to better illustrate the present invention, numerous specific details are given in the following specific embodiments. It will be understood by those skilled in the art that the present invention can also be implemented without these specific details.
[0093] Example 1
[0094] The present invention provides a liquid level meter type meter reading algorithm based on computer vision, comprising the following steps:
[0095] Step 1: Train the meter detection model and the liquid level segmentation model. Through the training model, the model can identify and accurately segment the ROI area of the liquid level meter, providing accurate image input for subsequent liquid level readings;
[0096] Step 2: Collect visible light images of the meters to be read in the substation. The images of the meters are used as input for subsequent processing to provide visual information for the model.
[0097] Step 3: Use the meter detection model to detect the ROI area of the meter in the image, crop the ROI image, obtain the ROI image containing only the meter, accurately detect the ROI area of the liquid level meter from the image, and crop the image containing only the liquid level meter to provide an accurate target area for subsequent processing;
[0098] Step 4: Use the liquid level segmentation model to segment the feature map set, and obtain the feature map with the highest confidence as the mask of the current liquid level meter, and obtain the corresponding ID. Use the liquid level segmentation model to extract the feature map set from the ROI image, and select the feature map with the highest confidence as the mask to provide an accurate mask for subsequent liquid level line recognition;
[0099] Step 5: Select the corresponding post-processing algorithm according to the ID to post-process the extracted mask and calculate the liquid level reading.
[0100] In the above technical solution, step 1 includes the following steps:
[0101] Step 1.1, collect images containing liquid level meter and background to provide data for subsequent model training;
[0102] Step 1.2: Use the labelme annotation tool to annotate the parallel circumscribed rectangle of the level gauge area to obtain the level gauge detection data set. Use the annotation tool to annotate the boundary of the level gauge area to provide accurate annotation data for model training.
[0103] Step 1.3, crop the labeled data set to obtain a ROI image containing only the liquid level gauge;
[0104] Step 1.4, use the labelme tool to annotate the polygon of the target area in the ROI image to obtain the liquid level segmentation dataset;
[0105] Step 1.5: Input the liquid level meter detection data set and the liquid level segmentation data set into the target detection model and the segmentation model for training respectively, to obtain the liquid level meter detection model and the liquid level segmentation model.
[0106] In the above technical solution, the characteristic graphs are divided into four types according to different meter recognition methods:
[0107] Vernier type: Identify the center position of the vernier area as the liquid level reading;
[0108] Liquid level type: Identify the center of the upper edge of the convex hull of the liquid level area as the liquid level reading;
[0109] Float type: Identify the center of the lower edge of the convex hull of the float area as the liquid level reading;
[0110] Circular oil level: Identify the center of the longest side at the upper end of the level area as the level reading.
[0111] In the above technical solution, step 5 includes the following steps:
[0112] Step 5.1, perform threshold segmentation on the mask obtained in step 4 to obtain a binary image of the target area;
[0113] Step 5.2, perform a closing operation on the binary image to merge discontinuous areas;
[0114] Step 5.3, perform contour search on the binary image to obtain the preliminary selected contour;
[0115] Step 5.4: Calculate the average confidence of each area in the preliminary selected contour and select the one with the largest confidence.
[0116] The contour is taken as the target area contour, and the average confidence calculation formula is as follows:
[0117]
[0118] Where Region represents the contour area, pix represents the pixels within the contour, Score represents the confidence of the pix pixel position, Area represents the contour area, and conf represents the average confidence;
[0119] Step 5.5, select the convex hull detection algorithm according to the corresponding ID to perform reading detection;
[0120] Step 5.6: Use the convex hull detection algorithm to calculate the contour convex hull, traverse all nodes in the convex hull, remove points whose angle change is less than the threshold, and merge the two sides. The main effect of this step is to merge adjacent shorter straight edges.
[0121] Step 5.6.1. Calculate the convex hull of the contour using the convex hull detection algorithm: For the preliminary contour obtained in step 5.3, apply the convex hull detection algorithm to calculate the convex hull of the contour. The convex hull is a minimum convex polygon that can contain all the points in the contour.
[0122] Step 5.6.2, traverse all nodes in the convex hull: for the calculated convex hull, traverse each node in it;
[0123] Step 5.6.3, remove points whose angle change is less than the threshold: For each node in the convex hull, calculate the angle between its two adjacent sides. If the change of the angle is less than the set threshold, the point is considered to be on a straight edge and removed from the convex hull;
[0124] Step 5.6.4, merge two sides: After removing the point, the two sides originally separated by the point will be merged into a new side;
[0125] Step 5.7: Select the top or bottom long edge with an inclination angle less than a threshold as the liquid level line according to the inclination angle, position and length of the edge. The main purpose of this step is to filter out long edges that are too inclined, retain relatively horizontal long edges as liquid level lines, and improve the accuracy of liquid level line recognition.
[0126] Step 5.8, calculate the Y value of the midpoint of the liquid level line as the liquid level position;
[0127] Step 5.9: Convert the pixel value of the liquid level into a percentage reading. The calculation formula is as follows:
[0128]
[0129] Where y is the y coordinate of the pixel where the liquid level is located, h is the height of the ROI image, and value is the reading value.
[0130] Example 2
[0131] The present invention provides a liquid level meter type meter reading device based on computer vision, comprising the following modules:
[0132] Training module, used to train meter detection model and liquid level segmentation model;
[0133] An image acquisition module, used to acquire visible light images of meters to be read in the substation;
[0134] The ROI region detection and cropping module is used to detect the ROI region of the meter in the image using the meter detection model, and crop the ROI image to obtain the ROI image containing only the meter;
[0135] The feature map segmentation and selection module is used to segment the feature map set using the liquid level segmentation model, and obtain the feature map with the largest confidence as the mask of the current liquid level meter, and obtain the corresponding ID;
[0136] The post-processing module is used to select a corresponding post-processing algorithm according to the ID to post-process the extracted mask and calculate the liquid level reading.
[0137] In the above device, the training module includes:
[0138] A data acquisition submodule, for acquiring an image including a level meter and a background;
[0139] The labeling submodule is used to label the parallel circumscribed rectangle of the level gauge area using the labelme labeling tool to obtain the level gauge detection data set;
[0140] The data cropping submodule is used to crop the labeled data set to obtain a ROI image containing only the liquid level gauge;
[0141] The ROI image annotation submodule is used to annotate the polygons of the target area in the ROI image using the labelme tool to obtain the liquid level segmentation dataset;
[0142] The model training submodule is used to input the liquid level meter detection data set and the liquid level segmentation data set into the target detection model and the segmentation model for training respectively, so as to obtain the liquid level meter detection model and the liquid level segmentation model.
[0143] In the above device, the characteristic graphs are divided into four types according to different meter recognition methods:
[0144] Vernier type: Identify the center position of the vernier area as the liquid level reading;
[0145] Liquid level type: Identify the center of the upper edge of the convex hull of the liquid level area as the liquid level reading;
[0146] Float type: Identify the center of the lower edge of the convex hull of the float area as the liquid level reading;
[0147] Circular oil level: Identify the center of the longest side at the upper end of the level area as the level reading.
[0148] In the above device, the post-processing module includes:
[0149] A threshold segmentation submodule is used to perform threshold segmentation on the acquired mask to obtain a binary image of the target area;
[0150] The closing operation submodule is used to perform a closing operation on the binary image and merge discontinuous areas;
[0151] The contour search submodule is used to search for contours of binary images and obtain preliminary contours;
[0152] The confidence calculation submodule is used to calculate the average confidence of each area in the preliminary selected contour, and select the contour with the largest confidence as the target area contour. The average confidence calculation formula is as follows:
[0153]
[0154] Where Region represents the contour area, pix represents the pixels within the contour, Score represents the confidence of the pix pixel position, Area represents the contour area, and conf represents the average confidence;
[0155] The convex hull detection submodule is used to select the convex hull detection algorithm for reading detection according to the corresponding ID;
[0156] The liquid level line recognition submodule is used to calculate the contour convex hull using the convex hull detection algorithm, traverse all nodes in the convex hull, remove points whose angle change is less than the threshold, and merge the two sides. The main effect of this step is to merge adjacent shorter straight edges;
[0157] Use the convex hull detection algorithm to calculate the convex hull of the contour: For the preliminary contour obtained in step 5.3, apply the convex hull detection algorithm to calculate the convex hull of the contour. The convex hull is a minimum convex polygon that can contain all the points in the contour;
[0158] Traverse all nodes in the convex hull: for the calculated convex hull, traverse each node in it;
[0159] Remove points whose angle change is less than the threshold: For each node in the convex hull, calculate the angle between its two adjacent sides. If the change of the angle is less than the set threshold, the point is considered to be on a straight edge and removed from the convex hull.
[0160] Merge two sides: After removing the point, the two sides originally separated by the point will be merged into a new side;
[0161] Traverse all nodes in the convex hull, and select the top or bottom long edge with an inclination angle less than the threshold as the liquid level line according to the inclination angle, position and length of the edge. The main purpose of this step is to filter out long edges that are too inclined, retain relatively horizontal long edges as liquid level lines, and improve the accuracy of liquid level line recognition.
[0162] The liquid level position calculation submodule is used to calculate the Y value of the midpoint of the liquid level line as the liquid level position;
[0163] The reading conversion submodule is used to convert the pixel value of the liquid level into a percentage reading. The calculation formula is as follows:
[0164]
[0165] Where y is the y coordinate of the pixel where the liquid level is located, h is the height of the ROI image, and value is the reading value.
[0166] The above technical solution, based on the post-processing method of contour convex hull detection and contour filtering, can more accurately identify the position of the liquid level line and has the following characteristics:
[0167] Strong generalization ability: It can recognize multiple meters with different appearances but the same recognition rules.
[0168] Fast iteration: When deploying to a new site, you only need to collect images of the corresponding site, pre-label them using the existing model, manually verify the pre-labeled data, retrain the detection model and segmentation model, and then put them online.
[0169] Anti-interference: For level gauges with severe inclination, accurate readings can be obtained after using the contour filtering algorithm.
Claims
1. A liquid level meter reading algorithm based on computer vision, characterized in that: The following steps are involved: Step 1: Train the meter detection model and liquid level segmentation model; Step 2: Collect visible light images of meters to be read in the substation; Step 3: Use the meter detection model to detect the ROI area of the meter in the image, crop the ROI image, and obtain the ROI image containing only the meter; Step 4: Use the liquid level segmentation model to segment the feature map set, and obtain the feature map with the largest confidence as the mask of the current liquid level meter, and obtain the corresponding ID; Step 5: Select the corresponding post-processing algorithm according to the ID to post-process the extracted mask and calculate the liquid level reading.
2. A liquid level meter type meter reading algorithm based on computer vision according to claim 1, characterized in that: Step 1 includes the following steps: Step 1.1, collecting an image including a level meter and a background; Step 1.2, use the labelme annotation tool to annotate the parallel circumscribed rectangle of the level gauge area to obtain the level gauge detection data set; Step 1.3, crop the labeled data set to obtain a ROI image containing only the liquid level gauge; Step 1.4, use the labelme tool to annotate the polygon of the target area in the ROI image to obtain the liquid level segmentation dataset; Step 1.5: Input the liquid level meter detection data set and the liquid level segmentation data set into the target detection model and the segmentation model for training respectively, to obtain the liquid level meter detection model and the liquid level segmentation model.
3. The liquid level meter type meter reading algorithm based on computer vision according to claim 1 is characterized in that: The characteristic diagrams are divided into four types according to different meter identification methods: Vernier type: Identify the center position of the vernier area as the liquid level reading; Liquid level type: Identify the center of the upper edge of the convex hull of the liquid level area as the liquid level reading; Float type: Identify the center of the lower edge of the convex hull of the float area as the liquid level reading; Circular oil level: Identify the center of the longest side at the upper end of the level area as the level reading.
4. The liquid level meter type meter reading algorithm based on computer vision according to claim 1, characterized in that: Step 5 includes the following steps: Step 5.1, perform threshold segmentation on the mask obtained in step 4 to obtain a binary image of the target area; Step 5.2, perform a closing operation on the binary image to merge discontinuous areas; Step 5.3, perform contour search on the binary image to obtain the preliminary selected contour; Step 5.4: Calculate the average confidence of each area in the preliminary selected contours, and select the contour with the largest confidence as the target area contour. The average confidence calculation formula is as follows: Where Region represents the contour area, pix represents the pixels within the contour, Score represents the confidence of the pix pixel position, Area represents the contour area, and conf represents the average confidence; Step 5.5, select the convex hull detection algorithm according to the corresponding ID to perform reading detection; Step 5.6, use the convex hull detection algorithm to calculate the contour convex hull, traverse all nodes in the convex hull, remove points whose angle change is less than the threshold, and merge the two sides; Step 5.6.
1. Calculate the convex hull of the contour using the convex hull detection algorithm: For the preliminary contour obtained in step 5.3, apply the convex hull detection algorithm to calculate the convex hull of the contour. The convex hull is a minimum convex polygon that can contain all the points in the contour. Step 5.6.2, traverse all nodes in the convex hull: for the calculated convex hull, traverse each node in it; Step 5.6.3, remove points whose angle change is less than the threshold: For each node in the convex hull, calculate the angle between its two adjacent sides. If the change of the angle is less than the set threshold, the point is considered to be on a straight edge and removed from the convex hull; Step 5.6.4, merge two sides: After removing the point, the two sides originally separated by the point will be merged into a new side; Step 5.7, according to the inclination angle, position and length of the edge, select the uppermost or lowermost long edge with an inclination angle less than a threshold as the liquid level line; Step 5.8, calculate the Y value of the midpoint of the liquid level line as the liquid level position; Step 5.9: Convert the pixel value of the liquid level into a percentage reading. The calculation formula is as follows: Where y is the y coordinate of the pixel where the liquid level is located, h is the height of the ROI image, and value is the reading value.
5. A liquid level meter type meter reading device based on computer vision, characterized in that: Includes the following modules: Training module, used to train meter detection model and liquid level segmentation model; An image acquisition module, used to acquire visible light images of meters to be read in the substation; The ROI region detection and cropping module is used to detect the ROI region of the meter in the image using the meter detection model, and crop the ROI image to obtain the ROI image containing only the meter; The feature map segmentation and selection module is used to segment the feature map set using the liquid level segmentation model, and obtain the feature map with the largest confidence as the mask of the current liquid level meter, and obtain the corresponding ID; The post-processing module is used to select a corresponding post-processing algorithm according to the ID to post-process the extracted mask and calculate the liquid level reading.
6. A liquid level meter type meter reading device based on computer vision according to claim 5, characterized in that: The training modules include: A data acquisition submodule, for acquiring an image including a level meter and a background; The labeling submodule is used to label the parallel circumscribed rectangle of the level gauge area using the labelme labeling tool to obtain the level gauge detection data set; The data cropping submodule is used to crop the labeled data set to obtain a ROI image containing only the liquid level gauge; The ROI image annotation submodule is used to annotate the polygons of the target area in the ROI image using the labelme tool to obtain the liquid level segmentation dataset; The model training submodule is used to input the liquid level meter detection data set and the liquid level segmentation data set into the target detection model and the segmentation model for training respectively, so as to obtain the liquid level meter detection model and the liquid level segmentation model.
7. A liquid level meter type meter reading device based on computer vision according to claim 5, characterized in that: The characteristic diagrams are divided into four types according to different meter identification methods: Vernier type: Identify the center position of the vernier area as the liquid level reading; Liquid level type: Identify the center of the upper edge of the convex hull of the liquid level area as the liquid level reading; Float type: Identify the center of the lower edge of the convex hull of the float area as the liquid level reading; Circular oil level: Identify the center of the longest side at the upper end of the level area as the level reading.
8. The liquid level meter type meter reading algorithm based on computer vision according to claim 5, characterized in that: Post-processing modules include: The threshold segmentation submodule is used to perform threshold segmentation on the acquired mask to obtain a binary image of the target area; The closing operation submodule is used to perform a closing operation on the binary image and merge discontinuous areas; The contour search submodule is used to search for contours of binary images and obtain preliminary contours; The confidence calculation submodule is used to calculate the average confidence of each area in the preliminary selected contour, and select the contour with the largest confidence as the target area contour. The average confidence calculation formula is as follows: Where Region represents the contour area, pix represents the pixels within the contour, Score represents the confidence of the pix pixel position, Area represents the contour area, and conf represents the average confidence; The convex hull detection submodule is used to select the convex hull detection algorithm for reading detection according to the corresponding ID; The liquid level line recognition submodule is used to calculate the contour convex hull using the convex hull detection algorithm, traverse all nodes in the convex hull, remove points with angle changes less than the threshold, and merge the two sides; Use the convex hull detection algorithm to calculate the contour convex hull: For the preliminary contour obtained in step 5.3, apply the convex hull detection algorithm to calculate the convex hull of the contour. The convex hull is a minimum convex polygon that can contain all the points in the contour; Traverse all nodes in the convex hull: for the calculated convex hull, traverse each node in it; Remove points whose angle change is less than the threshold: For each node in the convex hull, calculate the angle between its two adjacent sides. If the change of the angle is less than the set threshold, the point is considered to be on a straight edge and removed from the convex hull. Merge two sides: After removing the point, the two sides originally separated by the point will be merged into a new side; Traverse all nodes in the convex hull, and select the top or bottom longest edge with an inclination angle less than a threshold as the liquid level line according to the inclination angle, position and length of the edge; The liquid level position calculation submodule is used to calculate the Y value of the midpoint of the liquid level line as the liquid level position; The reading conversion submodule is used to convert the pixel value of the liquid level into a percentage reading. The calculation formula is as follows: Where y is the y coordinate of the pixel where the liquid level is located, h is the height of the ROI image, and value is the reading value.
Citation Information
Patent Citations
Substation meter automatic positioning and unified segmentation method based on deep learning
CN113837178A
Substation abnormity inspection method and device, storage medium and computer equipment
CN116309364A
Camera watermark generation and WIoU verification scoring algorithm based on intelligent inspection of transformer substation
CN117391918A
Instrument recognition method based on improved u2 network
US20240005639A1
Cited By
Liquid level data acquisition method and interface and computer readable storage medium
CN114549399A
