Visual automatic water distribution method and related device
By setting up a camera outside the water distributor, using computer vision technology to identify the water level line, and controlling the valve to open or close, the problems of poor applicability and high cost of existing water distributor methods are solved, automatic water distributor is realized, and water distributor efficiency is improved. Security.
Patent Information
- Application Number
- CN202411058687.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-11-19
AI Technical Summary
The existing water separation method requires improvements to the water separation equipment, resulting in poor applicability and high cost, and human factors and safety hazards.
The visual automatic water separation method is adopted, by setting up a camera outside the water distributor, using the Hough linear fitting algorithm and the object detection algorithm to identify the water level line, and controlling the valve to open or close, to achieve automatic separation of the water-soluble solvent and water.
It realizes automatic water dispensing, reduces manual intervention, improves water dispensing efficiency and quality, reduces costs, is suitable for various water dispensers, and has a higher control accuracy than manual.
Smart Images

Figure CN118976278A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of water dividers and relates to a visual automatic water divider method and a related device. Background Art
[0002] The water separation process is common in the chemical and pharmaceutical fields. Most of the processes are carried out in non-water-soluble solvents (such as benzene, toluene, chloroform, dichloroethane, etc.). These solvents are insoluble in water at room temperature, but can form azeotropes, which are generally less dense than water. In order to separate the two substances, water and solvents are generally heated to azeotropy, and the steam is condensed and liquefied. Since these solvents are insoluble in water at room temperature, the solvents and water are stratified in the water separator, and the water accumulates in the lower part of the water separator, and the solvent flows back to the reaction system. Ordinary water separators require people to actively control the liquid level to prevent the water brought out from returning to the reactor. This method is greatly affected by human factors and has safety hazards. With the advancement of science and technology, semi-automatic and automated water separators have become the direction of development, which can improve efficiency, reduce losses caused by human errors, and ensure the personal safety of experimental personnel.
[0003] Most of the existing water separation methods realize automatic water separation by improving the physical device of the water separator. They cannot be realized and applied on ordinary water separators, have poor applicability, greatly reduce the scope of application and implementation, and have high costs. A few of them realize automatic water separation by adding sensors for monitoring, which requires improvements to the water separation equipment. Sensors are generally expensive and have a certain service life. It is also necessary to collect sensor data of related solvents, which is time-consuming and labor-intensive.
[0004] In summary, it is urgent to develop a water distribution method and device that does not damage the original water distribution device and is suitable for various water distributors. Summary of the invention
[0005] The purpose of the present invention is to provide a visual automatic water distribution method and related devices to solve the technical problems that the existing technology needs to improve the water distribution equipment to achieve automatic water distribution, has poor applicability and high cost.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] In the first aspect, the present invention provides a visual automatic water separation device, comprising a condenser; the outlet of the condenser is connected to the inlet of a water separator; a water outlet and a valve are arranged at the bottom of the water separator, and the opening and closing of the water outlet is controlled by the valve; a maximum water level mark is arranged on the wall of one side of the water separator, and a camera is arranged to observe the water level in the water separator; the other side of the water separator is connected to a reflux pipe, and a solvent outlet is arranged at the end of the reflux pipe.
[0008] In a second aspect, the present invention provides a visual automatic water distribution method, based on the above-mentioned visual automatic water distribution device, comprising the following steps:
[0009] The distilled gas is liquefied into liquid by the condenser and enters the water separator, where it is stratified. The water level in the water separator is identified by a camera, and when the water level reaches the maximum water level mark, the valve is controlled to open to discharge water from the water outlet. The non-water-soluble solvent flows back from the reflux pipe under pressure to achieve automatic water separation.
[0010] In a third aspect, the present invention provides a visual automatic water distribution control method, based on the above-mentioned visual automatic water distribution device, comprising the following steps:
[0011] Collect the liquid surface image in the water separator by using a camera;
[0012] Fitting the water level line according to the liquid surface image by using the Hough straight line fitting algorithm to obtain the height of the first water level line;
[0013] The position of the water level line is detected according to the liquid surface image by using a target detection algorithm, and the height of the second water level line is calculated according to the position of the water level line;
[0014] The first water level height and the second water level height are integrated to obtain a final water level height, and the opening and closing of the valve are controlled according to the final water level height.
[0015] Furthermore, the step of fitting the water level line according to the liquid surface image by using the Hough straight line fitting algorithm to obtain the height of the first water level line specifically includes:
[0016] The liquid surface image is subjected to mask processing, and the mask is multiplied with the original liquid surface image to obtain a water divider area image;
[0017] The water divider region image is grayed out, and then Sobel edge filtering is performed to obtain an edge-enhanced water divider region image.
[0018] Binarize the image result of the water divider area after edge enhancement, then perform Hough line detection, and filter out the lines whose slope and length do not meet the requirements to obtain the fitted straight line;
[0019] The fitted straight lines are sorted by y-axis height, and the straight line with the largest line segment coordinate y value is taken as the water level line to obtain the height of the first water level line.
[0020] Furthermore, the step of detecting the position of the water level line according to the liquid surface image by using the target detection algorithm and calculating the height of the second water level line by using the water level line position specifically includes:
[0021] The liquid surface image is input into the pre-trained PT model for detection to obtain the rectangular area image where the water level line is located; the midpoint of the y-axis of the rectangular area is taken as the height of the second water level line.
[0022] Furthermore, the training method of the PT model comprises the following steps:
[0023] The video footage of the camera in the water separation experiment was collected, and the labelimg software was used to annotate the data in VOC format. The annotated data was divided into training and test sets. The YOLOv8 model was trained using the training set to obtain a pt model that can detect the water level line. After the test set test reached the expected indicators, the training of the pt model was completed.
[0024] Furthermore, the step of integrating the first water level height and the second water level height to obtain the final water level height specifically includes:
[0025] When the target detection algorithm has a detection result, but the Hough straight line fitting algorithm has no detection result, the second water level height obtained by the target detection algorithm is verified to be within the preset range, and the target detection result is used as the final water level height; when the final water level height is higher than the maximum water level mark, the valve is controlled to open, otherwise the valve remains closed;
[0026] When the target detection algorithm has no detection result, but the Hough line fitting algorithm has a detection result, the first water level height obtained by the Hough line fitting algorithm is verified to be within the preset range, and the Hough line detection result is used as the final water level height; when the final water level height is higher than the maximum water level mark, the valve is controlled to open, otherwise the valve remains closed;
[0027] When both the target detection algorithm and the Hough straight line fitting algorithm have detection results, if the difference between the two detection results is within the preset range, the average of the first water level height and the second water level height is taken as the final water level height; if the difference between the two detection results is outside the preset range, the larger value is taken as the final water level height; when the final water level height is higher than the maximum water level mark, the valve is controlled to open, otherwise the valve remains closed;
[0028] When neither the target detection algorithm nor the Hough line fitting algorithm has any detection results, the water level line is not detected at this time and the valve remains closed.
[0029] In a fourth aspect, the present invention provides a visual automatic water distribution control system, comprising:
[0030] An image acquisition module, used for acquiring a liquid surface image in the water separator through a camera;
[0031] A Hough line detection module is used to fit the water level line according to the liquid surface image by using the Hough line fitting algorithm to obtain the height of the first water level line;
[0032] The target detection module is used to detect the position of the water level line according to the liquid surface image by using a target detection algorithm, and calculate the height of the second water level line according to the position of the water level line;
[0033] The control module is used to integrate the first water level height and the second water level height to obtain the final water level height, and control the opening and closing of the valve according to the final water level height.
[0034] In a fifth aspect, the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0035] In a sixth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the steps of the above method when executed by a processor.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] The present invention discloses a visual automatic water separation method and related devices. By arranging a camera outside the water separator, the water level in the water separator is identified according to the liquid surface image collected by the camera, so as to control the valve below the water separator to open or close, thereby realizing the separation of non-water-soluble solvent and water. In addition, the present invention adopts the Hough line detection algorithm and the target detection algorithm to detect the water level line, and finally integrates the Hough line detection result and the target detection result to obtain the final water level line height, and the result is accurate and reliable. The present invention combines computer vision technology in the laboratory water separation scene to realize automatic water separation, and controls the valve drainage by detecting the water level line height. After actual scene testing, the control accuracy rate reaches more than 99%, which is higher than the manual control accuracy. In the water separation experiment scene, manual intervention is reduced, the efficiency and quality of water separation are guaranteed, the workload of the experimenters is reduced, and the personal safety of the experimenters is guaranteed. The automatic water separation method proposed by the present invention does not need to improve the water separator, but only needs to add camera observation, does not destroy the original water separation device, is applicable to various water separators, has lower cost than the existing technical method, has strong applicability, and has a wide range of application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0039] Figure 1 It is a structural schematic diagram of the visual automatic water separation device of the present invention;
[0040] Figure 2 It is a flow chart of the visual automatic water distribution control method of the present invention;
[0041] Figure 3 The schematic diagram of the visual automatic water distribution control system of the present invention;
[0042] Figure 4 This is a schematic diagram of image processing in the Hough line detection process according to an embodiment of the present invention. Figure 4 a is the original image, Figure 4 b is the result of mask processing, Figure 4 c is the region of interest image, Figure 4 d is the image after grayscale processing. Figure 4 e is the image after edge filtering, Figure 4 f is a binary image, Figure 4 g is the Hough line detection result image;
[0043] Figure 5 This is a schematic diagram of image processing in the target detection process according to an embodiment of the present invention. Figure 5 a is the labeled result graph, Figure 5 b is the target detection result image;
[0044] Figure 6 It is a schematic diagram of the computer device structure of the present invention.
[0045] Among them: 1-steam inlet; 2-water outlet; 3-condenser; 4-water inlet; 5-water distributor; 6-water level maximum mark; 7-reflux pipe; 8-camera; 9-valve; 10-solvent outlet; 11-water outlet. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0047] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0049] In the description of the embodiments of the present invention, it should be noted that if the terms "upper", "lower", "horizontal", "inner", etc. indicate an orientation or positional relationship based on the orientation or positional relationship shown in the drawings, or the orientation or positional relationship in which the product of the invention is usually placed when in use, it is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0050] In addition, if the term "horizontal" appears, it does not mean that the component must be absolutely horizontal, but can be slightly tilted. For example, "horizontal" only means that its direction is more horizontal than "vertical", which does not mean that the structure must be completely horizontal, but can be slightly tilted.
[0051] In the description of the embodiments of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal connection of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0052] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0053] See also Figure 1The embodiment of the present invention discloses a visual automatic water separation device, comprising a condenser 3; one end of the condenser 3 is a steam inlet 1, from which the distilled gas enters the condenser 3, and the other end is an outlet, which is connected to the inlet of a water separator 5; a water outlet 2 and a water inlet 4 are arranged on the wall of the condenser 3; the water outlet 2 is arranged close to the steam inlet 1; the water inlet 4 is arranged close to the water separator 5; a water outlet 11 and a valve 9 are arranged at the bottom of the water separator 5, and the water outlet 11 is controlled to open and close by the valve 9; a water level maximum mark 6 is arranged on one side wall of the water separator 5, and a camera 8 is arranged to observe the water level in the water separator 5; the other side of the water separator 5 is connected to a reflux pipe 7, and a solvent outlet 10 is arranged at the end of the reflux pipe 7, from which the non-water-soluble solvent flows back to the reaction system.
[0054] The embodiment of the present invention discloses a visual automatic water distribution method, based on the above-mentioned visual automatic water distribution device, comprising the following steps:
[0055] The distilled gas is liquefied into liquid by the condenser 3 and enters the water separator 5, where it is stratified. The water level in the water separator 5 is identified by a camera 8, and when the water level reaches the maximum water level mark 6, the control valve 9 is opened to discharge water from the water outlet 11. The water-insoluble solvent flows back from the reflux pipe 7 under pressure to achieve automatic water separation.
[0056] See also Figure 2 The embodiment of the present invention also discloses a visual automatic water distribution control method, comprising the following steps:
[0057] S1, collecting the liquid surface image in the water separator through the camera;
[0058] S2, fitting the height of the water level line according to the liquid surface image by using the Hough straight line fitting algorithm to obtain the height of the first water level line;
[0059] S201, performing mask processing on the liquid surface image, and multiplying the mask with the original liquid surface image to obtain a water divider area image;
[0060] S202, graying the water divider region image, and then performing Sobel edge filtering to obtain an edge-enhanced water divider region image;
[0061] S203, binarizing the image result of the water divider region after edge enhancement, and then performing Hough line detection, and filtering out the lines whose slopes and lengths do not meet the requirements, to obtain a fitted line;
[0062] S204, sorting the fitted straight lines by y-axis height, taking the straight line with the largest line segment coordinate y value as the water level line, and obtaining the first water level line height.
[0063] S3, detecting the position of the water level line according to the liquid surface image by using a target detection algorithm, and calculating the height of the second water level line according to the position of the water level line;
[0064] The liquid surface image is input into the pre-trained pt model for detection, and the rectangular area image where the water level line is located is obtained, and a detection frame similar to the minimum circumscribed rectangle of the water level line is obtained; the midpoint of the y-axis of the rectangular area is taken as the height of the second water level line.
[0065] The training method of the pt model includes the following steps:
[0066] The video footage of the camera in the water separation experiment was collected, and the labelimg software was used to annotate the data in VOC format. The annotated data was divided into training and test sets. The YOLOv8 model was trained using the training set to obtain a pt model that can detect the water level line. After the test set test reached the expected indicators, the training of the pt model was completed.
[0067] S4, integrates the Hough line detection results and the target detection results to obtain the final water level height, and controls the opening and closing of the valve according to the final water level height.
[0068] When the target detection algorithm has a detection result, but the Hough line detection algorithm has no detection result, the water level height obtained by the target detection algorithm is verified to be within the preset range, and the target detection result is used as the final water level height; when the final water level height is higher than the maximum water level mark, the valve is controlled to open, otherwise the valve remains closed;
[0069] When the target detection algorithm has no detection result, but the Hough line detection algorithm has a detection result, the water level height obtained by the Hough line detection algorithm is verified to be within the preset range, and the Hough line detection result is used as the final water level height; when the final water level height is higher than the maximum water level mark, the valve is controlled to open, otherwise the valve remains closed;
[0070] When both the target detection algorithm and the Hough line detection algorithm have detection results, if the difference between the two detection results is within the preset range, the average of the two results is taken as the final water level height; if the difference between the two detection results is outside the preset range, the larger value is taken as the final water level height; when the final water level height is higher than the maximum water level mark, the valve is controlled to open, otherwise the valve remains closed;
[0071] When neither the target detection algorithm nor the Hough line detection algorithm has any detection results, the water level line is not detected at this time and the valve remains closed.
[0072] See also Figure 3 The embodiment of the present invention discloses a visual automatic water distribution control system, comprising:
[0073] An image acquisition module, which acquires the liquid surface image in the water separator through a camera;
[0074] The Hough line detection module performs mask processing on the liquid surface image, and ANDs the mask with the original liquid surface image to obtain the water divider area image; grayscales the water divider area image, and then performs Sobel edge filtering to obtain the water divider area image after edge enhancement; binarizes the water divider area image result after edge enhancement, and then performs Hough line detection, and filters out the lines whose slopes and lengths do not meet the requirements to obtain the fitted lines; sorts the fitted lines by y-axis height, takes the line with the largest line segment coordinate y value as the water level line, and obtains the first water level line height.
[0075] The target detection module inputs the liquid surface image into the pre-trained pt model for detection, and obtains a detection frame similar to the minimum circumscribed rectangle of the water level line; the midpoint of the y-axis of the rectangular area is taken as the height of the second water level line.
[0076] The control module controls the valve 9 to open when the water level reaches the maximum water level mark 6, so that water is discharged from the water outlet 11; when the water level does not reach the maximum water level mark 6, the valve 9 remains closed.
[0077] Example:
[0078] The visual automatic water distribution control method of this embodiment includes the following steps.
[0079] 1. Data collection: Pull the video stream of the camera through the network as the data input of the intelligent water splitting algorithm. The program intercepts the video into frames and passes them to the algorithm for recognition;
[0080] 2. Hough line detection: The water level position is fitted by using the Hough line detection algorithm;
[0081] Hough line detection uses the duality of points and lines, that is, the lines in the image space correspond one-to-one to the points in the parameter space, and the lines in the parameter space correspond one-to-one to the points in the image space. Therefore, the Hough line detection algorithm converts the line detection problem in the image space into the point detection problem in the parameter space, and completes the line detection task by finding the peak in the parameter space. In the water separation process, water and non-water-soluble solvents are incompatible at room temperature, forming a stratified interface. The stratified interface is fitted through Hough line detection to realize the recognition of water level height.
[0082] The specific implementation details of Hough line detection in this step are as follows:
[0083] 1) Input the water separation image obtained by data collection as follows Figure 4 As shown in a.
[0084] 2) Mask the image and keep only the region of interest, i.e. the water divider region. The purpose of this is to remove irrelevant images such as the background and improve the accuracy of the straight line fitting. Figure 4 b.
[0085] 3) Add the mask to the original image to obtain the image of the region of interest, see Figure 4 c.
[0086] 4) Grayscale the result of 3). The purpose of this is to achieve better edge enhancement of grayscale images. Figure 4 d.
[0087] 5) Perform Sobel edge filtering on the result of 4). The purpose of this is to enhance the edge of the image and ensure the accuracy of the straight line fitting. Figure 4 e.
[0088] 6) Binarize the result of 5). The purpose of this is: Hough line fitting needs to be performed on a binary image, see Figure 4 f.
[0089] 7) Perform Hough line detection on 6) and filter out lines that do not meet the requirements in terms of slope, length, etc. The purpose of this is to exclude the lines that are fitted but not needed, see Figure 4 g.
[0090] 8) Sort the fitted straight lines by their y-axis heights, and take the straight line with the largest y-value of the line segment coordinate as the water level line, i.e., the lowest straight line.
[0091] 3. Target detection algorithm: The position of the water level line is detected by the target detection algorithm;
[0092] Target detection focuses on specific targets and requires obtaining the category and location information of the target. Compared with classification, it can understand the foreground and background of the image and separate the target of interest from the background. In the water separation scene, the layered interface of water and non-water-soluble solvents can be regarded as a target, and the target detection algorithm can be used to identify and track it.
[0093] Before the emergence of deep learning, traditional target detection algorithms were mainly based on manually designed features, such as Sobel edge detection features, Haar features, Hog features, etc. These features have weak generalization capabilities and poor performance in complex scenes. Target detection based on deep learning uses convolutional neural networks for feature extraction. This feature learning method can convert the original input information into more abstract and higher-dimensional features. This high-dimensional feature has strong feature expression capabilities and generalization, so it performs well in complex scenes and can meet most application needs in the industry. The YOLO framework stands out with its significant balance of speed and accuracy, and can quickly and accurately identify targets in images. Since its publication, the YOLO series has undergone many iterations, which is enough to prove the excellence of its framework. The present invention uses YOLOv8 as the waterline detection algorithm.
[0094] The specific implementation details of the target detection algorithm in this step are as follows:
[0095] 1) Create a data set, collect the camera video in the water separation experiment, and use labelimg software to annotate the data in VOC format. The annotated results are as follows: Figure 5 As shown in a. The labeled data is divided into training set, validation set and test set.
[0096] 2) Use the training set to train the YOLOv8 model. During the training process, the following optimizations are performed: images in the data set are converted into grayscale images to reduce the impact of color on the recognition results, and the network extracts features without extracting color features, making the network insensitive to color. Finally, a pt model that can detect water levels is obtained through training. After the test set test reaches the expected indicators, the model can be put into use.
[0097] 3) Use the model to test the data collected in the experiment and obtain the test results as follows Figure 5 As shown in b, the midpoint of the rectangle y-axis is taken as the water level height.
[0098] 4. Integrated prediction: By integrating the results of Hough line detection and target detection, the water level position can be identified;
[0099] Since the use of a single algorithm may lead to false detection or missed detection, two algorithms are used for integrated detection. Hough line detection does not require a data set for training, and the detection results are independent of the data sample and are not affected by the environment. However, multiple lines may be identified due to background or solution influences, resulting in detection errors. Target detection requires a data set for training, but has better feature extraction capabilities. This article uses grayscale to filter out the influence of color on the water level line, but there are also cases where the recognition accuracy of different solutions is different. Therefore, the two algorithms are combined and verified with each other to obtain more accurate results.
[0100] The specific implementation details of the integrated prediction algorithm in this step are as follows:
[0101] 1) If the target detection has a result but the Hough line detection has no result, and the height of the line is verified to be within a reasonable range, the result of the target detection is taken as the final result.
[0102] 2) If there is no result in target detection but there is a result in Hough line detection, and the height of the line is verified to be within a reasonable range, the result of Hough line detection is taken as the final result.
[0103] 3) There are results for both target detection and Hough line detection. If the difference between the two results is within a certain range, take the average of the two results; if the difference between the two values exceeds a certain range, take the larger value as the final result. The coordinates are larger as they go down. The larger the value, the lower the height. The reason is that even if some water flows back to the reaction system after a misjudgment, it can continue to be purified by distillation)
[0104] 4) There are no results for target detection and Hough line detection. At this time, the water level line is not detected and the prediction result is given: valve closed.
[0105] In one embodiment of the present invention, a computer device is provided. Figure 6 , the computer device includes a processor and a memory, the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit, or other general-purpose processors, digital signal processors, application-specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions in a computer storage medium to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used for the operation of the visual automatic water separation method.
[0106] The present invention also provides a storage medium, specifically a computer-readable storage medium, which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both the built-in storage medium in the computer device and the extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs. It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the visual automatic water separation method in the above embodiment.
[0107] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0108] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices, and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0109] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0110] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0111] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A visual automatic water separation device, characterized in that: The invention comprises a condenser (3); the outlet of the condenser (3) is connected to the inlet of a water separator (5); a water outlet (11) and a valve (9) are arranged at the bottom of the water separator (5), and the opening and closing of the water outlet (11) are controlled by the valve (9); a water level maximum mark (6) is arranged on a wall surface of one side of the water separator (5), and a camera (8) is arranged to observe the water level in the water separator (5); the other side of the water separator (5) is connected to a reflux pipe (7), and a solvent outlet (10) is arranged at the end of the reflux pipe (7).
2. A visual automatic water separation method, characterized in that: A visual automatic water separation device according to claim 1 comprises the following steps: The distilled gas is liquefied into liquid by the condenser (3) and enters the water separator (5), where it is stratified. The water level in the water separator (5) is identified by a camera (8). When the water level reaches the maximum water level mark (6), the control valve (9) is opened to discharge water from the water outlet (11). The non-water-soluble solvent is refluxed from the reflux pipe (7) by pressure, thereby achieving automatic water separation.
3. A visual automatic water distribution control method, characterized in that: A visual automatic water separation device according to claim 1 comprises the following steps: Collect the liquid surface image in the water separator by using a camera; Fitting the water level line according to the liquid surface image by using the Hough straight line fitting algorithm to obtain the height of the first water level line; The position of the water level line is detected according to the liquid surface image by using a target detection algorithm, and the height of the second water level line is calculated according to the position of the water level line; The first water level height and the second water level height are integrated to obtain a final water level height, and the opening and closing of the valve are controlled according to the final water level height.
4. A visual automatic water distribution control method according to claim 3, characterized in that: The step of fitting the water level line according to the liquid surface image by using the Hough straight line fitting algorithm to obtain the height of the first water level line specifically includes: The liquid surface image is subjected to mask processing, and the mask is multiplied with the original liquid surface image to obtain a water divider area image; The water divider region image is grayed out, and then Sobel edge filtering is performed to obtain an edge-enhanced water divider region image. Binarize the image result of the water divider area after edge enhancement, then perform Hough line detection, and filter out the lines whose slope and length do not meet the requirements to obtain the fitted straight line; The fitted straight lines are sorted by y-axis height, and the straight line with the largest line segment coordinate y value is taken as the water level line to obtain the height of the first water level line.
5. A visual automatic water distribution control method according to claim 3, characterized in that: The step of detecting the position of the water level line according to the liquid surface image by using the target detection algorithm and calculating the height of the second water level line by using the water level line position specifically includes: The liquid surface image is input into the pre-trained PT model for detection to obtain the rectangular area image where the water level line is located; the midpoint of the y-axis of the rectangular area is taken as the height of the second water level line.
6. A visual automatic water distribution control method according to claim 5, characterized in that: The training method of the PT model comprises the following steps: The video footage of the camera in the water separation experiment was collected, and the labelimg software was used to annotate the data in VOC format. The annotated data was divided into training and test sets. The YOLOv8 model was trained using the training set to obtain a pt model that can detect the water level line. After the test set test reached the expected indicators, the training of the pt model was completed.
7. A visual automatic water distribution control method according to claim 3, characterized in that: The step of integrating the first water level height and the second water level height to obtain the final water level height specifically includes: When the target detection algorithm has a detection result, but the Hough straight line fitting algorithm has no detection result, the second water level height obtained by the target detection algorithm is verified to be within the preset range, and the target detection result is used as the final water level height; when the final water level height is higher than the maximum water level mark, the valve is controlled to open, otherwise the valve remains closed; When the target detection algorithm has no detection result, but the Hough line fitting algorithm has a detection result, the first water level height obtained by the Hough line fitting algorithm is verified to be within the preset range, and the Hough line detection result is used as the final water level height; when the final water level height is higher than the maximum water level mark, the valve is controlled to open, otherwise the valve remains closed; When both the target detection algorithm and the Hough straight line fitting algorithm have detection results, if the difference between the two detection results is within the preset range, the average of the first water level height and the second water level height is taken as the final water level height; if the difference between the two detection results is outside the preset range, the larger value is taken as the final water level height; when the final water level height is higher than the maximum water level mark, the valve is controlled to open, otherwise the valve remains closed; When neither the target detection algorithm nor the Hough line fitting algorithm has any detection results, the water level line is not detected at this time and the valve remains closed.
8. A visual automatic water distribution control system, characterized in that: include: An image acquisition module, used for acquiring a liquid surface image in the water separator through a camera; A Hough line detection module is used to fit the water level line according to the liquid surface image by using the Hough line fitting algorithm to obtain the height of the first water level line; The target detection module is used to detect the position of the water level line according to the liquid surface image by using a target detection algorithm, and calculate the height of the second water level line according to the position of the water level line; The control module is used to integrate the first water level height and the second water level height to obtain the final water level height, and control the opening and closing of the valve according to the final water level height.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 3 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 3 to 7 are implemented.
Citation Information
Patent Citations
Intelligent extraction equipment
CN107670330A
Water level measurement method
CN108759973A
Continuous extraction control device and method based on machine vision liquid separation identification
CN112546671A
Water level identification method, device and system and storage medium
CN118135470A
