A magnetic reed liquid level meter identification method

By improving the target detection algorithm and HSV color space segmentation method, the recognition error caused by angle deflection and illumination changes of magnetic float level gauges in oil and gas stations has been solved, achieving high-precision level gauge recognition and enhancing the applicability and detection efficiency of the system.

CN115861991BActive Publication Date: 2026-06-02XIAN ANCN INTELLIGENT INSTR +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIAN ANCN INTELLIGENT INSTR
Filing Date
2022-11-29
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In existing technologies for image recognition of magnetic float level gauges in oil and gas stations, there are large recognition errors caused by angle deflection, changes in lighting, and aging of liquid column color, and the recognition system does not have good versatility.

Method used

An improved target detection algorithm and HSV color space segmentation method are used, combined with logistic regression and log loss function, to perform image correction and color segmentation, and extract the position and liquid column height of the magnetic float level gauge.

Benefits of technology

It effectively solves the recognition error under different angles and lighting conditions, improves the applicability and accuracy of recognition, and enhances the versatility and detection efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115861991B_ABST
    Figure CN115861991B_ABST
Patent Text Reader

Abstract

The application discloses a kind of magnetic flap liquid level meter identification methods, it is related to image recognition technical field, comprising the following steps: obtaining the original image containing magnetic flap liquid level meter;Improved target detection algorithm is constructed, and the original image is corrected based on improved target detection algorithm to obtain the corrected image, and the position coordinate information of magnetic flap liquid level meter is obtained;Extract ROI image only containing magnetic flap liquid level meter area in corrected image;ROI image is converted into HSV color space image, and the HSV space threshold value for segmenting ROI image is obtained according to magnetic flap liquid column area;According to the binary image containing liquid column, the minimum circumscribed rectangle of white area in binary image is extracted, the position information relative to ROI image coordinate system is obtained according to minimum circumscribed rectangle, and the actual liquid column height of magnetic flap liquid level meter is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition technology, and in particular to a method for recognizing magnetic float level gauges. Background Technology

[0002] Magnetic level gauges are indicating instruments used to measure the liquid level height of various containers. They are widely used in the oil and gas industry, and real-time, accurate monitoring of the liquid level is crucial for safe production. Traditionally, manual readings are used, but oil and gas stations contain flammable, explosive, toxic, and harmful gases, and require high-frequency recording of liquid level values, posing safety hazards to manual readings.

[0003] The method of liquid level gauge value recognition based on computer vision technology has been widely developed in the field of industrial meter recognition. It achieves automated liquid level identification by analyzing and processing images containing liquid level gauge data, ultimately converting the data into the actual liquid level value. Inspection robots or explosion-proof pan-tilt units equipped with visible light cameras are currently the main image acquisition devices for magnetic float liquid level gauges. However, issues such as variable shooting angles or unpredictable instrument installation positions lead to a certain degree of tilt or distortion in the acquired static images of the magnetic float liquid level gauge. Furthermore, due to the inherent characteristics of magnetic float liquid level gauges—namely, their large aspect ratio and relatively small proportion of key image information such as the liquid column—as well as the influence of natural lighting and the aging of the magnetic float causing color degradation in the liquid column, recognition errors increase, reducing the value of industrial applications.

[0004] Therefore, when identifying the level gauge readings, existing technologies require inspection robots or pan-tilt devices to be directly facing the equipment before acquiring images to reduce recognition errors caused by the angle of the magnetic level gauge. Existing segmentation technologies require the liquid column to be a specific color in magnetic level gauge segmentation applications. However, in actual industrial settings, magnetic level gauges may have the same surface color due to aging or different liquid column colors, such as yellow liquid column level gauges. This diversity of liquid column colors limits the versatility of the identification system. Summary of the Invention

[0005] This invention provides a magnetic float level gauge identification method that can solve the problems existing in the prior art.

[0006] This invention provides a method for identifying magnetic level gauges, comprising the following steps:

[0007] Acquire the original image containing the magnetic float level gauge;

[0008] An improved target detection algorithm is constructed, and the original image is corrected based on the improved target detection algorithm to obtain a corrected image, and information of the magnetic float level gauge is obtained.

[0009] Extract the ROI image from the corrected image that contains only the area of ​​the magnetic float level gauge;

[0010] The ROI image is converted into an HSV color space image, and the HSV space threshold for segmenting the ROI image is obtained based on the magnetic flip liquid column region.

[0011] The ROI image is segmented based on the HSV spatial threshold to obtain a binary image containing liquid columns.

[0012] Extract the minimum bounding rectangle of the white area in the binary image, obtain the position information relative to the ROI image coordinate system based on the minimum bounding rectangle, and obtain the actual liquid column height of the magnetic float level gauge.

[0013] Preferably, the improved target detection algorithm specifically includes the following improvements:

[0014] A logistic regression algorithm is added to the YOLO object detection algorithm to predict multiple sets of coordinate points;

[0015] The CSP layer of the YOLO object detection algorithm is improved by replacing the correction unit with three standard convolutional layers and multiple Bottleneck layers, and replacing the standard convolutional activation function with the Silu function.

[0016] Preferably, the loss function in the improved target detection algorithm is a logarithmic loss function, the formula of which is as follows:

[0017]

[0018] In the formula, the positive number w restricts the range of the nonlinear part to the interval [-w, w], e is used to constrain the curvature of the nonlinear region, and C = ww × ln(1 + w / e) is a constant used for the continuous piecewise linear and nonlinear parts.

[0019] Preferably, the improved target detection algorithm obtains the position coordinate information (x, y, w, h) of the magnetic level gauge by acquiring the circumscribed rectangle of the magnetic level gauge, where x and y represent the coordinates of the upper left fixed point of the magnetic level gauge outline, and w and h represent the width and height of the detected magnetic level gauge outline.

[0020] Preferably, before obtaining the HSV spatial threshold for segmenting the ROI image based on the magnetic flip liquid column region, the color of the ROI image is segmented into three component channels: hue, saturation, and brightness. Then, the color corresponding to each pixel in the image is flattened into a list and normalized.

[0021] Preferably, the selected HSV space thresholds are low_r = (hl, sl, vl) and high_r = (h2, s2, v2).

[0022] Preferably, the binary image includes a white area and a black area, where the white area represents the segmented liquid column region and the black area represents the background.

[0023] Preferably, extracting the minimum bounding rectangle of the white area in the binary image requires performing an expansion operation on the binary image to compensate for the disconnected areas in the binary image.

[0024] Compared with the prior art, the beneficial effects of the present invention are:

[0025] 1. During the process of the inspection robot acquiring images of the liquid level gauge, there will inevitably be angular deviation, causing reading errors. This invention provides image correction for the liquid level gauge, which can solve the problem of tilting of the liquid level gauge at different angles and positions when captured, and has strong applicability.

[0026] 2. This invention can solve the problem of diverse colors in the liquid column area under different lighting conditions and at different sites, and has strong versatility.

[0027] 3. Combining deep learning algorithms with traditional image processing algorithms can improve detection efficiency while ensuring detection accuracy. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 A flowchart of a magnetic float level gauge identification method according to the present invention;

[0030] Figure 2 This is a schematic diagram of the improved target detection algorithm of the present invention;

[0031] Figure 3 This is a schematic diagram of the image correction process of the magnetic float level gauge of the present invention. Detailed Implementation

[0032] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0033] Reference Figure 1This invention provides a method for identifying a magnetic level gauge, comprising the following steps:

[0034] Step 1: Obtain the original image containing the magnetic float level gauge;

[0035] Step 2: Construct an improved target detection algorithm. Based on the improved target detection algorithm, correct the original image to obtain a corrected image, and obtain the position coordinate information of the magnetic float level gauge. For example... Figure 3 As shown, Figure 3 (a) is the image of the magnetic float level gauge in the original image. Figure 3 (b) is the corrected image of the magnetic level gauge. The tilt of the magnetic level gauge in the original image, caused by the shooting angle and the installation position, is corrected so that the four sides of the ROI region of the magnetic level gauge in the corrected image are parallel to the boundary of the corrected image. The improved target detection algorithm obtains the circumscribed rectangle of the magnetic level gauge, i.e., the position coordinate information (x, y, w, h) relative to the coordinate system of the corrected image (origin at the top left corner, positive x-axis to the right, and positive y-axis downwards). Specifically, x and y represent the coordinates of the top left fixed point of the magnetic level gauge outline, w and h are the width and height values ​​(in pixels) of the detected magnetic level gauge outline, and h is the level gauge range.

[0036] Reference Figure 2 Improved target detection model: Based on the mainstream single-stage target detection algorithm YOLO, logistic regression for predicting four sets of coordinate points is added, enabling the network to predict four sets of key point coordinates while predicting the region proposals (candidate regions) of the magnetic float level gauge. These key points are used for the correction of the magnetic float ROI region.

[0037] Improvements to the main network structure: The input image is downsampled to the nearest neighbor in the Focus module to obtain a double-downsampled feature map without information loss. The CONV module (Conv2d+BN+Silu) processes the input features through convolutional layers, normalization layers, and activation layers to obtain the output layer. The SPPF layer avoids distortion caused by cropping and scaling of image regions, while improving the speed of generating candidate boxes. The CSP layer is improved, with the correction unit using 3 standard convolutional layers and multiple Bottleneck layers, and the standard convolutional activation function is changed to Silu.

[0038] Reorganize the output model; output = bounding box + confidence score + landmark + category.

[0039] In the later stages of neural network training, the regression of the four key points of the magnetic float level gauge profile is performed to regress points with small errors more accurately. A logarithmic loss function is used to amplify local losses, thereby improving the accuracy of key point detection. Loss function formula:

[0040]

[0041] In this context, the positive number w restricts the range of the nonlinear part to the interval [-w, w], e is used to constrain the curvature of the nonlinear region, and C = ww × ln(1 + w / e) is a constant used for the continuous piecewise linear and nonlinear parts.

[0042] Step 3: Extract the ROI image from the corrected image that contains only the area of ​​the magnetic float level gauge;

[0043] Step 4: Convert the ROI image to an HSV color space image, divide the image colors into three component channels: hue, saturation, and lightness, and then flatten the colors corresponding to each pixel in the image into a list and normalize them.

[0044] The HSV space threshold of the segmented image can be obtained from the display of the image in the HSV color space based on the region of the liquid column of the magnetic flip. The threshold space selected here is low_r = (hl, sl, vl) and high_r = (h2, s2, v2), which is the HSV space threshold range of the liquid column color.

[0045] Step 5: Segment the ROI image according to the HSV spatial threshold to obtain a binary image containing the liquid columns. White areas in the binary image represent the segmented liquid column regions, and black areas represent the background. Since the edges of the liquid column outlines or the middle parts of the liquid columns are discontinuous, an image dilation operation is used to compensate for the discontinuous areas.

[0046] Step 6: Extract the minimum bounding rectangle of the white area in the binary image. Based on the minimum bounding rectangle, obtain the position information relative to the ROI image coordinate system, and obtain the actual liquid column height (x2, y2, w2, h2) of the magnetic float level gauge. h2 is the actual liquid column height, and the liquid column recognition value = h2 / h.

[0047] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.

[0048] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for identifying liquid level using a magnetic float level gauge, characterized in that, The process includes the following steps: acquiring an original image containing a magnetic level gauge; constructing an improved target detection algorithm, correcting the original image based on the improved target detection algorithm to obtain a corrected image, and obtaining the position coordinate information of the magnetic level gauge; extracting a Region of Interest (ROI) image containing only the magnetic level gauge region from the corrected image; converting the ROI image to an HSV color space image, and obtaining an HSV space threshold for segmenting the ROI image based on the magnetic level gauge liquid column region; segmenting the ROI image based on the HSV space threshold to obtain a binary image containing the liquid column; extracting the minimum bounding rectangle of the white region in the binary image, obtaining the position information relative to the ROI image coordinate system based on the minimum bounding rectangle, and obtaining the actual liquid column height of the magnetic level gauge. The improved target detection algorithm specifically includes the following improvements: adding a logistic regression algorithm to the YOLO target detection algorithm to predict multiple sets of coordinate points; improving the CSP layer of the YOLO target detection algorithm, wherein the correction unit is replaced with 3 standard convolutional layers and multiple Bottleneck layers, and the standard convolutional activation function is replaced with Silu. Function; The loss function in the improved target detection algorithm is the logarithmic loss function, and the formula for the logarithmic loss function is as follows: In the formula, the positive number w restricts the range of the nonlinear part to the interval [-w, w], e represents the curvature used to constrain the nonlinear region, and C = w - wln(1 + w / e) is a constant used for the continuous piecewise linear and nonlinear parts.

2. The magnetic float level gauge identification method as described in claim 1, characterized in that, The improved target detection algorithm obtains the position coordinate information (x, y, w, h) of the magnetic level gauge by acquiring the circumscribed rectangle of the magnetic level gauge. x and y represent the coordinates of the upper left fixed point of the magnetic level gauge outline, and w and h represent the width and height of the detected magnetic level gauge outline.

3. The magnetic float level gauge identification method as described in claim 1, characterized in that, Before obtaining the HSV spatial threshold for segmenting the ROI image based on the magnetic flip liquid column region, the color of the ROI image is segmented into three component channels: hue, saturation, and brightness. Then, the color corresponding to each pixel in the image is flattened into a list and normalized.

4. The magnetic float level gauge identification method as described in claim 1, characterized in that, The selected HSV space thresholds are low_r = (h1, s1, v1) and high_r = (h2, s2, v2).

5. The magnetic float level gauge identification method as described in claim 1, characterized in that, The binary image includes a white area and a black area, where the white area represents the segmented liquid column region and the black area represents the background.

6. The magnetic float level gauge identification method as described in claim 1, characterized in that, Extracting the minimum bounding rectangle of the white region in a binary image requires dilating the binary image to compensate for disconnected regions.