A deep learning-based oil window liquid level height identification method and system
By recognizing oil window and liquid level mask images using a deep learning-based image segmentation model and calculating the liquid level height, the problem of performance degradation of traditional sensors in extreme environments is solved, achieving high-precision and robust liquid level detection.
Patent Information
- Application Number
- CN202411265553.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-09-10
AI Technical Summary
Traditional liquid level sensors suffer from performance degradation or failure in high temperature, high pressure, dust, and humid environments, making them difficult to apply effectively in narrow or specially shaped spaces.
An oil window level recognition method based on deep learning is adopted. The oil window and liquid level mask images are obtained through the image segmentation model, and the liquid level height is calculated using the positional relationship between the circle and the straight line, avoiding the use of the sensor in extreme environments.
It achieves high-precision and robust liquid level height recognition in complex environments, avoids sensor failure under high temperature and high pressure, and adapts to the detection needs of narrow or special-shaped spaces.
Smart Images

Figure CN119338889B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image recognition, in particular to an oil window liquid level height recognition method and system based on deep learning. BACKGROUND
[0002] The liquid level height recognition algorithm plays an indispensable role in modern industrial production and the storage and transportation of fine chemical raw materials, and its importance is increasingly prominent. This key technology not only directly relates to the automation level and efficiency improvement of the production process, but also deeply affects the safety and accuracy of raw material management. Traditionally, liquid level detection mainly relies on various sensors, although these sensors can work effectively under normal conditions, but when facing the extreme environment of high temperature and high pressure, the pervasive dust, and the humid and variable storage conditions commonly seen in industrial production, they often appear to be inadequate, and are prone to performance degradation or even failure. In addition, the arrangement of sensors is often limited by narrow or special-shaped spaces, further limiting their application range and effect.
[0003] Therefore, it is particularly urgent to develop a liquid level height recognition algorithm that has high precision, strong robustness, and can maintain excellent stability performance in complex and variable environments. SUMMARY
[0004] In view of the above defects, the purpose of the present application is to provide an oil window liquid level height recognition method and system based on deep learning to solve the problem that sensors cannot normally obtain the liquid level temperature of the equipment in high temperature and high pressure environments.
[0005] To achieve this purpose, the present application adopts the following technical solution: an oil window liquid level height recognition method based on deep learning, comprising the following steps:
[0006] Obtain the detection image of the oil window of the equipment to be detected;
[0007] Input the detection image into an image segmentation model to obtain an oil window mask image and a liquid level mask image through the image segmentation model;
[0008] Respectively process the oil window mask image and the liquid level mask image to obtain a circle and a straight line;
[0009] Calculate the liquid level height of the equipment to be detected through the positional relationship between the straight line and the circle.
[0010] Preferably, before calling the image segmentation model, the image segmentation model needs to be trained, and the training process is as follows:
[0011] Obtain training pictures under different scenes and different lighting conditions, wherein the training pictures include pictures containing oil windows and pictures containing liquid levels;
[0012] Use the third-party labeling software Labelme to label each circular oil sight glass and liquid level polygonal area in the training image, and annotate the image with type information to obtain the training set images;
[0013] Use the established training set images to train the yolov8s-seg image segmentation network to obtain the trained image segmentation models for oil window mask segmentation and liquid level mask segmentation.
[0014] Preferably, the image processing includes circle processing and line processing;
[0015] The circle processing includes the following steps:
[0016] Performing image morphological opening operation on the oil window mask image to obtain a first image;
[0017] Obtaining a minimum circumscribed circle based on edge point pixels in the first image;
[0018] Taking the minimum circumscribed circle as the circle;
[0019] The straight line processing comprises the following steps:
[0020] Obtain the minimum rotation bounding box in the liquid level mask image as the first bounding box;
[0021] Obtain the side with the smallest angle between the first bounding box and the image in the horizontal direction as the first side;
[0022] Taking the center point of the first side as the base point, reduce the first bounding box to 1 / 2 of its original size to obtain a first processed bounding box;
[0023] Using a first processing bounding box to intercept the content of the liquid level mask image to obtain a first processing mask image;
[0024] Obtaining the minimum rotation bounding box in the first processed mask image as the second bounding box;
[0025] Get the two sides of the second bounding box with the smallest angle between them and the vertical direction of the image, and use them as the second side and the third side respectively;
[0026] The midpoints of the second side and the third side are obtained respectively, and the midpoints of the second side and the third side are connected to obtain the straight line.
[0027] Preferably, the specific steps of calculating the liquid level height of the device to be detected based on the positional relationship between the straight line and the circle are as follows:
[0028] Obtaining the center of the circle;
[0029] judging whether the straight line passes through the center of the circle, if it passes through the center of the circle, taking the radius R of the circle as the current liquid level height;
[0030] If it does not pass through the center of the circle, the vertical distance D from the straight line to the center of the circle is obtained, and it is judged whether the straight line is above the center of the circle, if it is, the radius R of the circle plus the vertical distance D is taken as the current liquid level height, if not, the radius R of the circle minus the vertical distance D is taken as the current liquid level height.
[0031] An oil window liquid level height recognition system based on deep learning, using the oil window liquid level height recognition method based on deep learning, comprising an acquisition module, a segmentation module, a processing module and a calculation module;
[0032] The acquisition module is used to acquire the detection image of the oil window of the to-be-detected device;
[0033] The segmentation module is used to input the detection image into an image segmentation model, and obtain an oil window mask image and a liquid level mask image through the image segmentation model;
[0034] The processing module is used to perform image processing on the oil window mask image and the liquid level mask image respectively, and obtain a circle and a straight line;
[0035] The calculation module is used to calculate the liquid level height of the to-be-detected device through the positional relationship between the straight line and the circle.
[0036] Preferably, it further comprises a modeling module;
[0037] The modeling module is used to acquire training pictures under different scenes and different lighting conditions, wherein the training pictures include pictures containing oil windows and pictures containing liquid levels;
[0038] The polygon area of each circular oil sight glass and liquid level in the training picture is labeled by a third-party labeling software Labelme, and the information of the type name of the picture is labeled, to obtain a training set image;
[0039] The established training set image is used to train a yolov8s-seg image segmentation network, to obtain a trained image segmentation model for oil window mask segmentation and liquid level mask segmentation.
[0040] Preferably, the processing module comprises a first processing submodule and a second processing submodule;
[0041] The first processing submodule is used to perform an opening operation on the oil window mask image in image morphology, to obtain a first image;
[0042] The minimum circumscribed circle is obtained according to the edge point pixels in the first image;
[0043] take the minimum circumscribed circle as the circle;
[0044] The second processing submodule is configured to obtain a minimum rotating bounding box in the liquid level mask image as a first bounding box;
[0045] The first edge is obtained as an edge with a smallest angle with a horizontal direction of the image;
[0046] The first bounding box is reduced to 1 / 2 of the original size with the center point of the first edge as a base point to obtain a first processing bounding box;
[0047] The first processing mask image is obtained by using the first processing bounding box to intercept the content of the liquid level mask image;
[0048] The second bounding box is obtained as a minimum rotating bounding box in the first processing mask image;
[0049] The second edge and the third edge are obtained as two edges with smallest angles with a vertical direction of the image in the second bounding box;
[0050] The midpoints of the second edge and the third edge are obtained respectively, and the straight line is obtained by connecting the midpoints of the second edge and the third edge.
[0051] Preferably, the computing module performs the following steps:
[0052] The center of the circle is obtained;
[0053] It is determined whether the straight line passes through the center of the circle, and if so, the radius R of the circle is taken as the current liquid level height;
[0054] If not, the vertical distance D from the straight line to the center of the circle is obtained, and it is determined whether the straight line is above the center of the circle, and if so, the radius R of the circle plus the vertical distance D is taken as the current liquid level height, and if not, the radius R of the circle minus the vertical distance D is taken as the current liquid level height.
[0055] One of the above technical solutions has the following advantages or beneficial effects: In the present application, an image recognition algorithm is used, and a camera, a camera, or the like is used to capture an oil window to obtain a detection image. In the present application, a complex liquid level detection problem is converted into a deep learning image segmentation problem. The position relationship between the segmented mask image and the straight line corresponding to the circle of the circular oil sight glass is obtained to obtain the height of the current oil level. Without using a sensing device for detection, the problem that the sensor cannot work normally in a high temperature and high pressure environment is avoided. BRIEF DESCRIPTION OF DRAWINGS
[0056] Figure 1 is a flowchart of an embodiment of the present application.
[0057] Figure 2 is a schematic diagram of a training picture in an embodiment of the present application.
[0058] Figure 3 is a schematic diagram of an oil window mask picture in an embodiment of the present application.
[0059] Figure 4 is a schematic diagram of a first bounding box in an embodiment of the present application.
[0060] Figure 5 is a schematic diagram of a first processing bounding box in an embodiment of the present application.
[0061] Figure 6 is a schematic diagram of a first processing mask picture structure in an embodiment of the present application.
[0062] Figure 7 is a schematic diagram of a structure of an embodiment of the system of the present application. DETAILED DESCRIPTION
[0063] Embodiments of the present application are described in detail below with reference to the attached drawing figures, wherein the same or like reference numerals and characters denote the same or like elements throughout the attached drawing figures. The embodiments described below are merely exemplary for the purpose of explanation only and are not to be understood as limiting the present application.
[0064] In the description of embodiments of the present application, the terms "first", "second", and the like are used only to describe the purpose and are not to be construed as indicating or implying relative importance or implying the number of the indicated technical features. Thus, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of embodiments of the present application, the meaning of "a plurality of" is two or more, unless otherwise specifically limited.
[0065] In addition, the terms "first", "second", and the like are used only for the purpose of description and are not to be construed as indicating or implying relative importance or implying the number of the indicated technical features. Thus, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the present application, unless otherwise stated, the meaning of "a plurality of" is two or more. The specific meaning of the above terms in the present application can be understood in specific cases by those of ordinary skill in the art.
[0066] As shown in FIG. 1, a deep learning-based oil window liquid level recognition method includes the following steps: Figures 1-7
[0067] obtaining a detection image of an oil window of a device to be detected;
[0068] input the detection image into the image segmentation model, and obtain an oil window mask image and a liquid level mask image through the image segmentation model;
[0069] perform image processing on the oil window mask image and the liquid level mask image respectively, and obtain a circle and a straight line;
[0070] the liquid level height of the device to be detected is calculated through the positional relationship between the straight line and the circle.
[0071] In the present application, an image recognition algorithm is used, and the oil window is photographed by a camera, a camera and other devices to obtain a detection image. In the present application, the complex problem of liquid level detection is converted into a deep learning image segmentation problem. The segmented mask image is used to obtain the circle oil sight glass corresponding to the circle and the straight line corresponding to the liquid level, and then the height of the current oil level is obtained through the geometric positional relationship between the circle and the straight line. Without using sensing devices for detection, the problem that the sensor cannot work normally in a high temperature and high pressure environment is avoided.
[0072] On the other hand, using the technical solution of the present application, the obtained detection image can be sent to a detection personnel, and the detection personnel can judge and remotely review through the detection image and the calculated liquid level height. The oil window liquid level detection is further guaranteed.
[0073] Preferably, before calling the image segmentation model, the image segmentation model needs to be trained, and the training process is as follows:
[0074] obtain training pictures under different scenes and different light conditions, wherein the training pictures include pictures containing oil windows and pictures containing liquid levels;
[0075] label the polygonal area of each circular oil sight glass and liquid level in the training picture through a third-party labeling software Labelme, and label the type name information of the picture to obtain a training set image;
[0076] train the yolov8s-seg image segmentation network with the established training set image to obtain a trained image segmentation model for oil window mask segmentation and liquid level mask segmentation.
[0077] As shown in Figure 2 the present application collects training pictures under different scenes and different light conditions, and the model can learn the oil window and liquid level features in various complex environments. This diversity ensures the wide adaptability and robustness of the model in actual application.
[0078] Meanwhile, the yolov8s-seg image segmentation network is trained, which combines the rapidity and high efficiency of the YOLO series in the target detection field and the accuracy of the image segmentation technology. This makes the model maintain the real-time processing speed while realizing the high-precision oil window and liquid level mask segmentation.
[0079] It is worth integrating that in order to improve the liquid level mask segmentation accuracy, when obtaining the training picture, different transparent containers can be used to load the liquid, and then the corresponding training picture is obtained by image shooting, so that the image segmentation model can effectively analyze the light influence under different transparent containers, thereby better recognizing the liquid level mask.
[0080] Preferably, the image processing includes circular processing and straight line processing.
[0081] The circular processing includes the following steps:
[0082] The oil window mask image is subjected to an image morphological opening operation to obtain a first image;
[0083] The minimum circumscribed circle is obtained according to the edge point pixels in the first image;
[0084] The minimum circumscribed circle is taken as the circle;
[0085] In the present application, the burrs in the oil window mask image are removed through the image morphological opening operation, so that the region boundary is smoother, thereby reducing the influence of the burrs in the subsequent minimum circumscribed circle calculation. Figure 3 As shown in the first image, there are recesses, protrusions and the like in the mask image, although part of the burrs are removed through the opening operation, but it is difficult to confirm the center of the image in the image.
[0086] The edge in the first image can be obtained by fitting, and then 3 points are randomly selected on the edge points to obtain the circumscribed circle, and then different points are repeatedly replaced to continue obtaining the circumscribed circle. After obtaining a plurality of circumscribed circles, the circumscribed circle with the smallest area is obtained, and the smallest circumscribed circle is taken as the circle. The finally obtained minimum circumscribed circle can intuitively represent the circular boundary of the oil window, which is convenient for subsequent analysis and processing.
[0087] The straight line processing includes the following steps:
[0088] The minimum rotating bounding box in the liquid level mask image is obtained as a first bounding box;
[0089] The edge with the smallest angle with the horizontal direction of the first bounding box is obtained as a first edge;
[0090] Taking a center point of the first side as a base point, the first bounding box is reduced to 1 / 2 of the original, to obtain a first processing bounding box;
[0091] The content of the liquid level mask image is intercepted using the first processing bounding box, to obtain a first processing mask image;
[0092] A minimum rotation bounding box in the first processing mask image is obtained as a second bounding box;
[0093] Two sides of the second bounding box with the smallest angle with the vertical direction of the image are obtained as a second side and a third side;
[0094] The midpoints of the second side and the third side are obtained respectively, and the midpoints of the second side and the third side are connected to obtain the straight line.
[0095] As shown in Figure 4 the first bounding box, since the liquid level mask image may be affected by the light refraction of the transparent container during identification, the identified liquid level mask image is not a horizontal straight line, and therefore the liquid level mask image needs to be fitted to make the liquid level mask image close to the real straight line of the liquid level.
[0096] Therefore, in the present application, first, the side of the first bounding box with the smallest angle with the horizontal direction of the image is obtained as a first side, since the first side is a horizontal line, the first bounding box is reduced by the horizontal line to obtain a first processing bounding box, as shown in Figure 5 After the liquid level mask image is intercepted by the first processing bounding box, a first processing mask image is obtained, as shown in Figure 6 At this time, since the horizontal scaling interception is performed, the influence of the liquid level mask on the left and right sides is reduced, so that the first processing mask image approaches a straight line segment;
[0097] After the first processing mask image is obtained, the minimum rotation bounding box thereof is obtained, and the minimum rotation bounding box (second bounding box) is searched again in the reduced bounding box, which can quickly locate the specific shape of the liquid level and avoid time-consuming searching in the entire image. Then, the second side and the third side are selected in the vertical direction, and the midpoints of the second side and the third side are connected to obtain a straight line, which can better reflect the direction or trend of the liquid level. Even when the shape of the first processing mask image is not close to a straight line segment, the straight line obtained by the midpoints of the second side and the third side can remain stable, so that the straight line can effectively and correctly feedback the position of the device liquid level.
[0098] It is worth mentioning that the present application enhances the robustness of the algorithm by finding the minimum rotation bounding box to adapt to liquid level images of different angles. The operations of obtaining the minimum rotation bounding box, image cropping, etc. can be realized through the tools in the existing image processing library (such as OpenCV).
[0099] Preferably, the specific steps of calculating the liquid level height of the device to be detected through the positional relationship between the straight line and the circle are as follows:
[0100] Obtaining the center of the circle;
[0101] Judging whether the straight line passes through the center of the circle, if it does, taking the radius R of the circle as the current liquid level height;
[0102] If it does not pass through the center of the circle, obtaining the vertical distance D from the straight line to the center of the circle, judging whether the straight line is above the center of the circle, if it is, taking the radius R of the circle plus the vertical distance D as the current liquid level height, if it is not, taking the radius R of the circle minus the vertical distance D as the current liquid level height.
[0103] When the circle and the straight line are obtained, the height of the oil level can be accurately calculated by calculating the geometric relationship between the straight line (representing the oil level line) and the circle (representing the container section). The present application obtains the liquid level height through a geometric method, which is more intuitive and has higher precision than other empirical calculation or image information calculation methods. The calculation amount of this method is relatively small, and the liquid level height can be quickly obtained.
[0104] An oil window liquid level height recognition system based on deep learning uses the oil window liquid level height recognition method based on deep learning, which includes an acquisition module, a segmentation module, a processing module, and a calculation module.
[0105] The acquisition module is used to acquire the detection image of the oil window of the device to be detected.
[0106] The segmentation module is used to input the detection image into an image segmentation model to obtain an oil window mask image and a liquid level mask image through the image segmentation model.
[0107] The processing module is used to perform image processing on the oil window mask image and the liquid level mask image respectively to obtain a circle and a straight line.
[0108] The calculation module is used to calculate the liquid level height of the device to be detected through the positional relationship between the straight line and the circle.
[0109] Preferably, it further includes a modeling module.
[0110] The modeling module is configured to obtain training pictures under different scenes and different lighting conditions, wherein the training pictures include pictures containing oil windows and pictures containing liquid levels.
[0111] The training pictures are labeled by a third-party labeling software Labelme to obtain a training set of images, wherein each circular oil sight glass and a polygonal area of a liquid level in the training pictures are labeled, and information of a type name of the pictures is labeled.
[0112] The yolov8s-seg image segmentation network is trained by using the established training set of images to obtain an image segmentation model for oil window mask segmentation and liquid level mask segmentation.
[0113] Preferably, the processing module includes a first processing submodule and a second processing submodule.
[0114] The first processing submodule is configured to perform an opening operation on an oil window mask image in image morphology to obtain a first image.
[0115] A minimum circumscribed circle is obtained from the first image according to edge point pixels.
[0116] The minimum circumscribed circle is taken as the circular shape.
[0117] The second processing submodule is configured to obtain a minimum rotating bounding box in a liquid level mask image as a first bounding box.
[0118] An edge with a smallest horizontal direction angle with the first bounding box is obtained as a first edge.
[0119] A center point of the first edge is taken as a base point, and the first bounding box is reduced to 1 / 2 of the original size to obtain a first processing bounding box.
[0120] The first processing bounding box is used to cut the content of the liquid level mask image to obtain a first processing mask image.
[0121] A minimum rotating bounding box in the first processing mask image is obtained as a second bounding box.
[0122] Two edges with a smallest vertical direction angle with the second bounding box are obtained as a second edge and a third edge.
[0123] A midpoint of the second edge and a midpoint of the third edge are obtained, and the second edge and the third edge are connected to obtain a straight line.
[0124] Preferably, the calculation module performs the following steps:
[0125] A center of the circular shape is obtained.
[0126] It is determined whether the straight line passes through the center of the circular shape, and if so, a radius R of the circular shape is taken as a current liquid level height.
[0127] If not through the center of the circle, the vertical distance D from the straight line to the center of the circle is obtained, it is judged whether the straight line is above the center of the circle, if yes, the radius R of the circle plus the vertical distance D is taken as the current liquid level height, if not, the radius R of the circle minus the vertical distance D is taken as the current liquid level height.
[0128] In the description of the present specification, the description referring to the terms "one embodiment", "some embodiments", "exemplary embodiment", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the exemplary description of the above terms does not necessarily mean the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0129] Although the embodiments of the present application have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and variations can be made thereto without departing from the principles and spirit of the present application, and the scope of the present application is defined by the claims and their equivalents.
Claims
1. A deep learning-based oil window liquid level height recognition method, characterized in that, The method comprises the following steps: obtaining a detection image of an oil window of a device to be detected; inputting the detection image into an image segmentation model to obtain an oil window mask image and a liquid level mask image through the image segmentation model; performing image processing on the oil window mask image and the liquid level mask image respectively to obtain a circle and a straight line; calculating a liquid level height of the device to be detected through a positional relationship between the straight line and the circle; the image processing comprises circle processing and straight line processing; the circle processing comprises the following steps: performing an opening operation on the oil window mask image according to image morphology to obtain a first image; obtaining a minimum circumscribed circle according to edge point pixels in the first image; taking the minimum circumscribed circle as the circle; the straight line processing comprises the following steps: obtaining a minimum rotating bounding box in the liquid level mask image as a first bounding box; obtaining a side with a minimum angle with a horizontal direction of an image as a first side; taking a center point of the first side as a base point, reducing the first bounding box to 1 / 2 of the original size to obtain a first processing bounding box; using the first processing bounding box to intercept contents of the liquid level mask image to obtain a first processing mask image; obtaining a minimum rotating bounding box in the first processing mask image as a second bounding box; obtaining two sides with a minimum angle with a vertical direction of the image as a second side and a third side respectively; obtaining midpoints of the second side and the third side respectively, and connecting the midpoints to obtain the straight line.
2. The oil window level height recognition method based on deep learning according to claim 1, characterized in that, Before the image segmentation model is called, the image segmentation model needs to be trained, and the training process is as follows: obtaining training pictures under different scenes and different light conditions, wherein the training pictures comprise pictures containing oil windows and pictures containing liquid levels; labeling a polygon area of each circular oil sight glass and liquid level in the training pictures by using a third-party labeling software Labelme, and labeling information of a type name of the pictures to obtain training set images; training a yolov8s-seg image segmentation network by using the established training set images to obtain a trained image segmentation model for oil window mask segmentation and liquid level mask segmentation.
3. The oil window level height recognition method based on deep learning according to claim 1, characterized in that, The specific steps of calculating the liquid level height of the device to be detected through the positional relationship between the straight line and the circle are as follows: obtaining a center of the circle; judging whether the straight line passes through the center, if yes, taking a radius R of the circle as a current liquid level height; if no, obtaining a vertical distance D from the straight line to the center, judging whether the straight line is above the center, if yes, taking the radius R of the circle plus the vertical distance D as the current liquid level height, if no, taking the radius R of the circle minus the vertical distance D as the current liquid level height.
4. A deep learning-based oil window liquid level height recognition system, characterized by, The method comprises the following steps: obtaining a detection image of an oil window of a device to be detected; inputting the detection image into an image segmentation model to obtain an oil window mask image and a liquid level mask image through the image segmentation model; performing image processing on the oil window mask image and the liquid level mask image respectively to obtain a circle and a straight line; calculating a liquid level height of the device to be detected through a positional relationship between the straight line and the circle; the image processing comprises circle processing and straight line processing; the circle processing comprises the following steps: performing an opening operation on the oil window mask image according to image morphology to obtain a first image; obtaining a minimum circumscribed circle according to edge point pixels in the first image; taking the minimum circumscribed circle as the circle; the straight line processing comprises the following steps: obtaining a minimum rotating bounding box in the liquid level mask image as a first bounding box; obtaining a side with a minimum angle with a horizontal direction of an image as a first side; taking a center point of the first side as a base point, reducing the first bounding box to 1 / 2 of the original size to obtain a first processing bounding box; using the first processing bounding box to intercept contents of the liquid level mask image to obtain a first processing mask image; obtaining a minimum rotating bounding box in the first processing mask image as a second bounding box; obtaining two sides with a minimum angle with a vertical direction of the image as a second side and a third side respectively; obtaining midpoints of the second side and the third side respectively, and connecting the midpoints to obtain the straight line. The processing module is used for image processing on the oil window mask image and the liquid level mask image respectively, to obtain a circle and a straight line; The calculation module is used for calculating the liquid level height of the to-be-detected equipment through the positional relationship between the straight line and the circle.
5. The oil window level height recognition system based on deep learning according to claim 4, characterized in that, Further comprising a modeling module; The modeling module is used for obtaining training pictures under different scenes and different light conditions, wherein the training pictures include pictures containing oil windows and pictures containing liquid levels; The polygon areas of each circular oil sight glass and liquid level in the training pictures are labeled by a third-party labeling software Labelme, and the information of the type name of the pictures is labeled, to obtain training set images; The established training set images are used to train a yolov8s-seg image segmentation network, to obtain an image segmentation model trained for oil window mask segmentation and liquid level mask segmentation.
6. The oil window level height recognition system based on deep learning according to claim 4, characterized in that, The processing module comprises a first processing submodule and a second processing submodule; The first processing submodule is used for performing an opening operation on the oil window mask image in image morphology, to obtain a first image; The minimum circumscribed circle is obtained according to the edge point pixels in the first image; The minimum circumscribed circle is taken as the circle; The second processing submodule is used for obtaining the minimum rotating bounding box in the liquid level mask image as a first bounding box; The side with the smallest angle with the horizontal direction of the image in the first bounding box is obtained as a first side; The first bounding box is reduced to 1 / 2 of the original size with the center point of the first side as the base point, to obtain a first processing bounding box; The content of the liquid level mask image is intercepted using the first processing bounding box, to obtain a first processing mask image; The minimum rotating bounding box in the first processing mask image is obtained as a second bounding box; The two sides with the smallest angle with the vertical direction of the image in the second bounding box are obtained as a second side and a third side respectively; The midpoints of the second side and the third side are obtained respectively, and the midpoints of the second side and the third side are connected, to obtain the straight line.
7. The oil window level height recognition system based on deep learning according to claim 4, characterized in that, The calculation module performs the following steps: The center of the circle is obtained; It is judged whether the straight line passes through the center of the circle, if yes, the radius R of the circle is taken as the current liquid level height; If not, the vertical distance D from the straight line to the center of the circle is obtained, it is judged whether the straight line is above the center of the circle, if yes, the radius R of the circle plus the vertical distance D is taken as the current liquid level height, if not, the radius R of the circle minus the vertical distance D is taken as the current liquid level height.
Citation Information
Patent Citations
Pointer type oil level indicator reading identification method based on deep learning
CN111368906A
Oil level detection method and system
CN111640151A