Water line visual identification method in low-illumination environment

Through the algorithm solution of calibrating the water level scale in advance and training the object detection model, the character recognition failure problem of water level line visual recognition in low-illumination environment is solved, and the accurate water level line height calculation is achieved under low-illumination.

CN119723553APending Publication Date: 2025-03-28INST OF ENERGY HEFEI COMPREHENSIVE NAT SCI CENT (ANHUI ENERGY LAB)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411825305.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In low-illumination environments, the existing water level line visual recognition method cannot accurately read the scale of the water level ruler due to the failure of the character recognition algorithm, resulting in the failure of the water level recognition.

Method used

An algorithm scheme for pre-calibrating water level scale and target detection is proposed. During the preparation stage, the camera position is fixed, the pixel height and scale parameters of the water level scale are calibrated in advance, the water level scale object detection algorithm model is trained on the water level line, and the water level scale is directly detected in the deployment stage, and the conversion formula is used to calculate the water level line height.

Benefits of technology

This solution can solve the problem of character recognition algorithm failure under low illumination, directly calculate the height of the water level line, and improve the accuracy and reliability of water level recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119723553A_ABST
    Figure CN119723553A_ABST
Patent Text Reader

Abstract

The invention provides a water level visual identification method in a low-illumination environment, which comprises the following steps: a preparation stage: step S1, setting an erection position, a lens direction and an angle outside a fixed camera, and setting an internal focal length, an aperture and white balance of the fixed camera; s2, on the shot reference image of the water gauge, the pixel height H of the water gauge and the lower end reading a and the upper end reading b of the water gauge are calibrated at the position where the water gauge is to be installed; s3, the water gauge is placed at different water surface positions, water gauge images are collected, and the target detection model is trained to detect the part, exposed out of the water surface, of the water gauge; and a deployment stage: step S4, installing the water gauge, detecting the part h exposed out of the water surface by using the target detection model, and calculating the height of the water line by using the following formula: # imgabs0 #. According to the technical scheme, water level identification under the condition of fuzzy reading can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical fields of image processing, artificial intelligence and computer vision, and in particular to a water level visual recognition method in a low-illumination environment. Background Art

[0002] Visual target detection is to locate the position of the target in the visual image and identify the category of the target. At present, the technical solution of the water level line visual recognition solution based on the water level gauge is roughly as follows: First, the characters near the water level line of the water level gauge are detected in the water level gauge image, and then the scale is obtained using the character recognition algorithm. Under sufficient lighting conditions, the algorithm can read the scale more accurately when the characters in the video are clear. However, under low illumination conditions, the video image is noisy, the scale reading is not clear, and the character detection and character recognition algorithms will fail. Summary of the invention

[0003] The technical problem to be solved by the present invention is to solve the problem of failure of character recognition algorithm under low illumination conditions. To this end, the present invention proposes an algorithm scheme for pre-calibrating the water level gauge and target detection, which can solve the problem of water level recognition under fuzzy readings. In the preparation stage, the camera position is fixed, and the pixel height and scale parameters of the water level gauge are calibrated in advance, and the water level gauge target detection algorithm model on the water level line is trained. In the deployment stage, the water level gauge is directly detected, and then the water level line is directly calculated using the conversion formula. This method can solve the problem of failure of character recognition algorithm under low illumination conditions.

[0004] A water level visual recognition method in a low-light environment, comprising:

[0005] Preparation stage:

[0006] Step S1, fixing the camera's external settings, installation position, lens direction and angle, and fixing the camera's internal focal length, aperture and white balance settings;

[0007] Step S2, on the reference image of the water level gauge taken, at the location where the water level gauge is to be installed, calibrate the pixel height H of the water level gauge, as well as the lower end reading a and the upper end reading b of the water level gauge;

[0008] Step S3, placing the water level gauge at different water surface positions, collecting water level gauge images, and training the target detection model to detect the part of the water level gauge exposed above the water surface;

[0009] Deployment phase:

[0010] Step S4: After the water level gauge is installed, the target detection model is used to detect the part h exposed above the water surface, and the water level height is calculated using the following formula:

[0011] .

[0012] Compared with the prior art, the present invention has the following beneficial effects:

[0013] The present invention proposes an algorithm solution for pre-calibrating the water level gauge and detecting targets, which can solve the problem of water level recognition in the case of fuzzy readings. In the preparation stage, the camera position is fixed, the pixel height and scale parameters of the water level gauge are calibrated in advance, and the water level gauge target detection algorithm model on the water level line is trained. In the deployment stage, the water level gauge is directly detected, and then the water level line is directly calculated using the conversion formula. This method can solve the problem of failure of the character recognition algorithm under low illumination conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 is a schematic diagram of water level gauge detection used in a water level line visual recognition method in a low-light environment according to an embodiment of the present invention;

[0015] Figure 2 It is a marked schematic diagram of the preparation stage;

[0016] Figure 3 It is a diagram of target detection model annotation. DETAILED DESCRIPTION

[0017] The following is a detailed description of an embodiment of the present invention. This embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation method and a specific operation process are given, but the protection scope of the present invention is not limited to the following embodiment.

[0018] According to an embodiment of the present invention, a method for visually recognizing a water level in a low-light environment is provided, the method comprising:

[0019] Preparation stage:

[0020] Step S1, fixing the camera's external settings of the mounting position, lens direction and angle, and fixing the camera's internal settings of the focal length, aperture and white balance.

[0021] In the installation location, select the installation point of the camera to ensure that it can always capture the water level gauge throughout the entire water level range and is not affected by external environmental factors (such as wind, water waves, etc.). The position of the camera needs to be stable and avoid vibration. In the lens direction and angle setting: Aim the lens vertically at the water level gauge and ensure that the shooting angle is directly opposite the center line of the water level gauge to reduce image distortion. At the same time, ensure that the lens direction is fixed to prevent calibration errors caused by angle changes. In the internal settings of the camera, select an appropriate focal length so that the water level gauge has a suitable proportion in the picture and the water level scale is clear. The focal length should be fixed to avoid invalidation of calibration parameters due to focal length changes. Set the aperture size to ensure moderate exposure, especially in low-light environments, the aperture should be appropriately opened to improve light capture capabilities. Avoid too small an aperture resulting in too dark an image. White balance Fix the white balance according to the ambient light source (such as daylight, shadow, or artificial light) to reduce color shift caused by changes in ambient light and ensure that the color of the water level gauge is consistent under different lighting conditions. The purpose of fixing the internal and external parameters of the camera in step S1 is to ensure that the video images captured in the preparation phase and the deployment phase are consistent.

[0022] Step S2, on the reference image of the water gauge taken, at the location where the water gauge is to be installed, calibrate the pixel height H of the water gauge, as well as the lower end reading a and the upper end reading b of the water gauge, such as Figure 1 shown.

[0023] like Figure 2 As shown, aim the camera at the water level gauge so that the entire height of the water level gauge is fully displayed in the image. Take a reference image of the water level gauge to ensure that the image is clear enough for subsequent processing. Use image processing software or algorithm tools to measure the pixel height of the water level gauge in the image, that is, first record the Y-direction pixel starting point of the water level gauge, recorded as y1, and then record the Y-direction pixel end point of the water level gauge, recorded as y2, H=y2-y1, H is a specific value taken at a fixed distance and fixed angle, and is the pixel height of the water level gauge. Slight changes in the camera position will affect the calibration results, so this position must remain unchanged during subsequent use. Read the lower end a and record the scale value at the bottom of the water level gauge. This value represents the water level value corresponding to the water level gauge at the bottom position. This value is usually marked at the lowest position of the water level gauge, such as "0 cm" or other specific values. Read the upper end and record the scale value at the top of the water level gauge, that is, the water level value corresponding to the water level gauge at the highest position. This value can be the maximum measuring range of the water level gauge, such as "100 cm", or can be set according to the actual situation of the water level gauge.

[0024] Ensure that the pixel height H of the water level gauge in the image is consistent with the actual readings a and b at the lower and upper ends, and that the pixel height H of the water level gauge measured after multiple shots of the image remains essentially unchanged under the fixed settings of the camera.

[0025] In step S2, the water level gauge needs to be at the same distance and vertical angle as the actual position, so as to ensure that: at the actual installation position, the height pixels of the water level gauge are consistent with those during calibration.

[0026] Step S3, placing the water level gauge at different water surface positions, collecting water level gauge images, and training the target detection model to detect the exposed horizontal part of the water level gauge;

[0027] Object detection annotation is a key step in training the model.

[0028] Object detection annotation refers to adding annotation information to objects in an image, including the location and category of the object, usually by marking the object in the image with a bounding box and a category label. This is one of the basic steps in training an object detection model in deep learning. The specific process usually includes the following aspects:

[0029] Bounding box annotation: The position of the target object is enclosed by a rectangular box. The bounding box is usually represented by four coordinates, namely the coordinates of the upper left corner (x1, y1) and the coordinates of the lower right corner (x2, y2), or described by the center coordinates (cx, cy) and width and height (w, h).

[0030] Category label: Each bounding box corresponds to a category label, indicating the type of object contained in the area. For example, in an image containing multiple objects, there may be different category annotations, such as "person", "car", "cat", etc.

[0031] Data format:

[0032] YOLO format: In the YOLO (You Only Look Once) model, annotations are usually in the form of text files, with each line containing the annotation information of an object:<class_id><x_center><y_center> <width> <height>, where the coordinates and width and height are relative to the scale of the image.

[0033] VOC format: In the Pascal VOC format, annotation information is stored in XML files, and the annotation of each object includes the coordinates of the bounding box and the category label.

[0034] COCO format: COCO (Common Objects in Context) format is a JSON-formatted annotation file that contains detailed image information, category labels, bounding boxes, segmentation masks, etc.

[0035] Labeling tools: To facilitate the labeling of target detection, some labeling tools are often used, such as LabelImg, LabelMe, etc. These tools provide an intuitive graphical interface that can easily draw bounding boxes and assign category labels.

[0036] Labeling accuracy: Accuracy in labeling is crucial for training models. Mislabeling or missing labels may lead to poor model performance. Therefore, it is necessary to carefully check and ensure the accuracy of the labels.

[0037] The quality of object detection annotation directly affects the training effect of the deep learning model. The diversity of annotation data, the accuracy of annotation boxes, and the diversity of categories will all affect the accuracy and generalization ability of the model.

[0038] By annotating images of the water gauge at different water levels, we provide high-quality training data for the model to ensure that the part of the water gauge that is exposed above the water surface is accurately detected during actual deployment. During data collection, we need to ensure that the images cover different water levels, lighting conditions (especially low illumination), time periods, and environmental factors (such as weather and water surface fluctuations) to improve the generalization ability of the target detection model. Figure 3 As shown in the figure, during the annotation process, a rectangular frame is used to accurately frame the part of the water level ruler that is exposed above the water surface, avoiding including too much background to improve the accuracy of the target detection model. Especially in low illumination, the clearest edge of the water level ruler should be framed. The annotation category can be uniformly set to "water level ruler" or similar labels. If there are multiple different types of water level rulers (such as different colors or shapes), different labels can be assigned to different types to facilitate the model to identify specific types. In addition, to improve the annotation efficiency and the accuracy of model detection, a "region of interest" (ROI) can be preset in the image to limit the annotation range to the area where the water level ruler is located to avoid detection interference.

[0039] Collect images of the water level gauge at different water surfaces, different depths and different time periods, and split them into training sets, validation sets and test sets, with a common ratio of 7:2:1. The detection accuracy of the model on the validation set should reach more than 95%. After the annotation is completed, stop the collection and switch to deployment. This ensures the stability of the annotation effect. Finally, save all label files according to the selected target detection framework to ensure that the annotation information of each image is complete and the format is standardized. The labeled data should be checked for consistency before training to ensure that the box selection size, label name, and position are accurate to avoid training deviations caused by inconsistent annotations.

[0040] The object detection model can be a YOLO (You Only Look Once) model, which is a common choice in object detection tasks due to its speed and accuracy. The YOLO model is a single-stage detector that divides an image into multiple grids and predicts the category and bounding box position of the object on each grid. This architecture enables YOLO to process images quickly and provide relatively accurate detection results in low-light and complex environments.

[0041] Preferably, you can compare multiple target detection models such as YOLOv5, YOLOv6, YOLOv7, etc., and select a target detection model with high accuracy for deployment and use.

[0042] Deployment phase:

[0043] Step S4: After the water level gauge is installed, the target detection model is used to detect the part h exposed above the water surface, and the water level height is calculated using the following formula:

[0044] .

[0045] Since the water gauge is partially submerged, the part exposed above the water becomes the key basis for calculating the position of the water level. In this step, the object detection model detects the top edge of the water gauge and determines the height coordinate (pixel value) of the edge in the image as h.

[0046] To ensure accuracy, the detection algorithm needs to accurately identify the boundaries of the exposed part of the water level gauge in the real environment. In practical applications, the detection area can be limited to the screen area where the water level gauge is located, which can reduce the interference of irrelevant content and improve the detection accuracy and speed. Once the h value, that is, the height of the top edge of the water level gauge, is obtained, the actual height of the water level line can be calculated using the following conversion formula:

[0047] ,

[0048] In the formula, represents the length of the exposed part, and (ba) / H is the scaling factor between the pixel height and the actual scale value. By multiplying the two and adding the reference value of the bottom scale a, the actual height y of the water level can be obtained. This calculation process realizes the conversion between pixel height and scale reading through linear mapping, so that the water level height can be accurately calculated based on the exposed part of the water level gauge even in complex environments such as different lighting and turbid water.

[0049] Preferably, in order to improve the detection accuracy and efficiency, multi-scale detection and region of interest (ROI) delineation strategies can be introduced in the target detection model. Multi-scale detection ensures that the water gauge can be accurately detected at various exposure lengths by identifying the water gauge at different resolutions. For example, image pyramid technology can be used or a multi-scale feature fusion module (such as FPN or PAN) can be added to the YOLO model to enhance the detection ability of the model at various scales. In addition, by adding detection heads of different scales to the model, more robust detection can be achieved when the exposure height of the water gauge changes. Delineating the ROI in advance can further narrow the detection range. For example, a region of interest (ROI) is preset near the installation location of the water gauge, so that only the area is focused on during the detection process to avoid false detection and improve reasoning efficiency. The system can also automatically adjust the ROI according to the detection results, and update it when the water gauge changes slightly, so as to maintain the ability to continuously track the position of the water level line.

[0050] In addition, to balance performance, multi-scale detection and ROI screening schemes can be combined with model optimization strategies, such as pruning, quantization, and step-by-step detection, to speed up multi-scale detection. Pruning and quantization can reduce the parameters of the target detection model and ensure real-time detection speed, while step-by-step detection first performs low-resolution large-scale detection, and then performs high-resolution detection in the ROI where the water level gauge is located, further balancing detection accuracy and speed. In terms of data processing, multi-scale data enhancement can be used to enable the target detection model to better learn the characteristics of water level gauges at different scales. At the same time, during the training phase, the ROI area samples of the water level gauge are focused on to improve the robustness and adaptability of the target detection model under low-light conditions. These optimization schemes can enhance the adaptability of the target detection model in various environments, especially to cope with changes in the position of the water level gauge in low-light scenes.

[0051] In summary, a water level measurement method based on key markers and deep learning is proposed. The existing vision-based water level detection scheme requires identifying the marking scale of the water level gauge and obtaining the water level by reading. In low-light conditions, this scheme cannot read the water level because the picture is too blurred, resulting in failure of water level measurement. The present invention proposes an algorithm scheme of pre-calibrating the water level gauge + target detection, which can solve the problem of water level recognition in the case of fuzzy readings.< / height> < / width>

Claims

1. A water level visual recognition method in a low-light environment, characterized in that: include: Preparation stage: Step S1, fixing the camera's external settings, installation position, lens direction and angle, and fixing the camera's internal focal length, aperture and white balance settings; Step S2, on the reference image of the water level gauge taken, at the location where the water level gauge is to be installed, calibrate the pixel height H of the water level gauge, as well as the lower end reading a and the upper end reading b of the water level gauge; Step S3, placing the water level gauge at different water surface positions, collecting water level gauge images, and training the target detection model to detect the part of the water level gauge exposed above the water surface; Deployment phase: Step S4: After the water level gauge is installed, the target detection model is used to detect the part h exposed above the water surface, and the water level height is calculated using the following formula: 。 2. The water level visual recognition method in a low-light environment according to claim 1, characterized in that: Step S2 includes: using image processing software or algorithm tools to measure the pixel height of the water level gauge in the reference image, including: first recording the Y direction pixel starting point of the water level gauge, recorded as y1, and then recording the Y direction pixel end point of the water level gauge, recorded as y2, H=y2-y1, H is a specific value taken at a fixed distance and fixed angle, and is the pixel height of the water level gauge; Read the lower end a, record the scale value at the bottom of the water gauge, and mark it at the lowest position of the water gauge; The upper reading b records the scale value at the top of the water level gauge, which is the maximum measuring range of the water level gauge.

3. The water level visual recognition method in a low-light environment according to claim 1, characterized in that: In step S2, the water level gauge needs to be at the same distance and vertical angle as the actual position.

4. The water level visual recognition method in a low-light environment according to claim 3, characterized in that: In the case of multiple calibrations, ensure that the pixel height H of the water level gauge measured multiple times is consistent.

5. The water level visual recognition method in a low-light environment according to claim 1, characterized in that: Step S3 includes: collecting images of the water level gauge at different water surfaces, different depths and different time periods, splitting them into training sets, verification sets and test sets, and when the verification set detection reaches 95%, stopping the collection and switching to deployment.

6. The water level visual recognition method in a low-light environment according to claim 1, characterized in that: Step S4 includes: A regional interest delineation strategy is introduced into the target detection model, including: presetting a region of interest around the water level gauge installation location, so that only the region of interest is focused during the detection process.