Milliliter capacity bottle water setting method and system, electronic equipment and storage medium
By directly detecting the meniscus, combining water injection below the liquid surface with dripping from above, and employing different detection methods and injection speeds at different liquid surface heights, the calibration accuracy problem caused by the influence of external reference objects in existing technologies has been solved, achieving efficient and robust calibration of milliliter-level volumetric flasks.
Patent Information
- Application Number
- CN202511177020.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2026-04-28
- Estimated Expiration
- 2045-08-21
AI Technical Summary
In the current technology for calibrating volumetric flasks at the milliliter level, external reference objects affect the accuracy of liquid level identification, and the water injection operation can easily lead to inflated calibration data, especially in narrow-necked volumetric flasks, where calibration accuracy and efficiency need to be improved.
By directly detecting the meniscus, combined with water injection below and dripping above the liquid surface, and employing different detection methods and injection speeds for different liquid level heights, interference from external reference objects is avoided. Image processing techniques such as maximum line grayscale, maximum particle size, line grayscale gradient, and edge detection are used to precisely control the position of the liquid surface relative to the scale line.
It improves the calibration accuracy and efficiency of milliliter-level volumetric flasks, enabling direct detection of curved surfaces at different liquid levels using appropriate detection methods and water injection speeds, reducing interference from external reference objects, and achieving efficient and robust liquid level calibration.
Smart Images

Figure CN121026279B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of volumetric flask calibration technology, specifically relating to a method, system, electronic device, and storage medium for adjusting a milliliter-level volumetric flask by filling it with water. Background Technology
[0002] A volumetric flask is a measuring instrument used to accurately measure a specific volume of solution. During calibration, the correct water filling procedure is to keep your line of sight aligned with the graduation mark on the volumetric flask. As you add water, the liquid level rises to the graduation mark. When you observe that the indentation on the liquid level is tangent to the encirclement line on the graduation mark, stop filling and the process is complete.
[0003] In existing technologies, industrial cameras are used to continuously capture images of the water-filling process in volumetric flasks. Machine vision is then used to detect the liquid level in the images and determine its distance from the graduation marks. When the distance between the bottom of the liquid level and the graduation mark is sufficiently small, the machine vision determines that the water filling is complete and outputs a signal to stop the water filling operation, thus completing the calibration.
[0004] However, the above calibration process requires the use of external reference imaging patterns to assist in identifying the liquid surface. For the narrow neck of a milliliter (ml) volumetric flask, the external reference will occupy some of the bottleneck pixels, reducing the effective pixels required for liquid surface identification and increasing the difficulty of identification. Secondly, the imaging change characteristics produced by the reference at the liquid surface are often inconsistent with the concave points of the curved surface. If the imaging change characteristics of the reference are used to mark the liquid surface, this will lead to an overestimation of the calibration data. Moreover, during calibration, water is added above the liquid surface through the water filling tube. For the narrow neck of a milliliter volumetric flask, water droplets splashed from the water can easily adhere to the inner wall of the neck, causing the calibration data to be overestimated.
[0005] Therefore, the calibration accuracy of existing calibration methods still needs to be improved. Summary of the Invention
[0006] The purpose of this invention is to provide a method, system, electronic device, and storage medium for adjusting the water filling of milliliter-level volumetric flasks, so as to improve the calibration accuracy of milliliter-level volumetric flasks.
[0007] The first aspect of this invention discloses a method for adjusting the water filling of a milliliter-level volumetric flask, comprising:
[0008] Based on the first image obtained from photographing the volumetric flask, the location of the neck diameter change is determined;
[0009] The area from the bottom of the bottle to the neck diameter change position is defined as the first region, the area from the neck diameter change position to the preset first neck position is defined as the second region, the area from the first neck position to the preset second neck position is defined as the third region, and the area from the second neck position to the scale line is defined as the fourth region. The neck diameter change position, the first neck position, the second neck position, and the scale line position are sequentially increased.
[0010] The volumetric flask was continuously photographed as the liquid level rose, resulting in a second image.
[0011] The first detection method is used to detect the liquid surface based on the second image. When the liquid surface is in the first region, water is quickly injected below the liquid surface. When the liquid surface is in the second region or the third region, water is slowly injected below the liquid surface. The first detection method is used to detect the liquid surface with coarse accuracy and high efficiency.
[0012] When the liquid level is in the fourth region, dripping is performed above the liquid level. The second detection method is used to detect the liquid level based on the second image. When the liquid level reaches the scale line, dripping is stopped. The second detection method is used to detect the liquid level with fine precision and robustness.
[0013] In some implementations, the first detection method is the maximum row grayscale detection method, and the second detection method includes: first using the maximum particle detection method to detect the liquid surface, and then using the row grayscale gradient detection method to correct the liquid surface; or, first using the maximum particle detection method to detect the liquid surface, and then using the edge detection method to detect the liquid surface if the detection fails.
[0014] In some implementations, when the liquid surface is located in the second region, the maximum row grayscale detection method is first used to detect the liquid surface. When no liquid surface is detected, the maximum particle detection method is used to detect the liquid surface. When the liquid surface is located in the third region, the maximum row grayscale detection method, the maximum particle detection method, the row grayscale gradient detection method, and the edge detection method are used alternately to detect the liquid surface until it is detected.
[0015] In some embodiments, the maximum row grayscale detection method includes: obtaining the grayscale of several rows in the bottleneck region of the second image according to a specified step size; when the maximum grayscale exceeds a grayscale threshold, marking the row corresponding to the maximum grayscale as the liquid surface; the maximum particle detection method includes: performing binarized threshold segmentation and particle morphology processing on the bottleneck region in the second image to obtain several particles; among all particles, the particle with the largest combined particle area and boundary rectangle width is taken as the maximum particle, and the bottom of the boundary rectangle of the maximum particle is marked as the liquid surface; the row grayscale gradient detection method includes: analyzing the gradient change of grayscale of all rows in the bottleneck region of the second image, and marking the first row exceeding the gradient threshold from bottom to top as the liquid surface; the edge detection method includes: detecting the edge vertically in the bottleneck region of the second image, removing singular points among the edge points, performing curve fitting on the obtained effective edge points, and marking the points on the fitted curve located on the upper line of the bottleneck region as the liquid surface.
[0016] In some implementations, after obtaining the second image, the first image is subtracted from the second image to obtain a filtered image, and the filtered image is set as the second image.
[0017] In some implementations, when the volumetric flask is a brown flask, after obtaining the second image, a power function method with an exponent less than 1 is used to enhance the low grayscale pixels of the second image.
[0018] In some implementations, when the liquid level reaches the first bottleneck position, the water injection pipe is moved upward to the bottleneck diameter change position, the liquid level position after moving the water injection pipe is calculated, and the bottom of the bottleneck area is updated as the liquid level position and the top of the bottleneck area is updated as a preset position above the volumetric flask scale line.
[0019] A second aspect of this invention discloses a milliliter-level volumetric flask water filling and setting system, comprising:
[0020] The region setting module is used to obtain the bottleneck diameter change position based on the first image obtained by shooting the volumetric flask; the bottom of the flask to the bottleneck diameter change position is set as the first region, the bottleneck diameter change position to the preset first bottleneck position is set as the second region, the first bottleneck position to the preset second bottleneck position is set as the third region, and the second bottleneck position to the scale line position is set as the fourth region, and the bottleneck diameter change position, the first bottleneck position, the second bottleneck position, and the scale line position are sequentially increased.
[0021] An image capturing module is used to continuously capture images of the volumetric flask as the liquid level rises, thereby obtaining a second image;
[0022] The water injection control module is used to detect the liquid level based on the second image using a first detection method. When the liquid level is in the first region, water is injected rapidly below the liquid level; when the liquid level is in the second region or the third region, water is injected slowly below the liquid level. The first detection method is used for coarse-precision and high-efficiency detection of the liquid level. When the liquid level is in the fourth region, water is dripped above the liquid level. The second detection method is used to detect the liquid level based on the second image using a second detection method. When the liquid level reaches the scale line, the dripping stops. The second detection method is used for fine-precision and robust detection of the liquid level.
[0023] A third aspect of the present invention discloses an electronic device, including a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the milliliter-level volumetric flask filling and setting method disclosed in the first aspect.
[0024] The fourth aspect of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the milliliter-level volumetric flask filling and adjustment method disclosed in the first aspect.
[0025] The beneficial effects of this invention are that by combining water injection below the liquid surface and dripping above the liquid surface, and employing different liquid surface detection methods and different water injection speeds for different liquid surface heights, it can directly detect curved liquid surfaces without relying on external reference objects to identify the liquid surface, and mark the liquid surface with concave points. This effectively improves detection accuracy and efficiency. Attached Figure Description
[0026] The accompanying drawings illustrate specific examples of the technical solutions described in this invention and, together with the detailed embodiments, form part of the specification, serving to explain the technical solutions, principles, and effects of this invention.
[0027] Unless otherwise specified or defined, the same reference numerals in different figures represent the same or similar technical features, and different reference numerals may be used to represent the same or similar technical features.
[0028] Figure 1 This is a flowchart of the method for adjusting the water filling of a milliliter-level volumetric flask according to an embodiment of the present invention;
[0029] Figure 2 This is a schematic diagram of the structure of the milliliter-level volumetric flask water filling and setting system according to an embodiment of the present invention;
[0030] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0031] Unless otherwise specified or defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. When combined with the technical solutions of the invention in a real-world scenario, all technical and scientific terms used herein may also have meanings corresponding to the purpose of achieving the technical solutions of the invention. The terms "first," "second," etc., used herein are merely for distinguishing names and do not represent a specific number or order. The term "and / or," as used herein, includes any and all combinations of one or more of the associated listed items.
[0032] It should be noted that when a component is considered "fixed" to another component, it can be directly fixed to the other component or there can be an intervening component; when a component is considered "connected" to another component, it can be directly connected to the other component or there can be an intervening component; when a component is considered "mounted" on another component, it can be directly mounted on the other component or there can be an intervening component; when a component is considered "placed" on another component, it can be directly placed on the other component or there can be an intervening component.
[0033] Unless otherwise specified or defined, the terms "described" or "the" as used herein refer to the technical features or technical content mentioned or described prior to the relevant section, which may be the same as or similar to the technical features or technical content mentioned herein. Furthermore, the terms "comprising" and "having," and any variations thereof, as used herein, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.
[0034] To facilitate understanding of the present invention, specific embodiments of the present invention will be described in more detail below with reference to the accompanying drawings.
[0035] To improve the calibration accuracy of ml-level volumetric flasks, this invention identifies the liquid level directly by detecting the meniscus without relying on external references, marking the liquid level with concave points. Specifically, through image recognition, the liquid level is detected in real time during the automatic water filling process of the ml-level volumetric flask. The water filling speed is controlled according to the liquid level position. When approaching the graduation mark, the liquid level is adjusted to a position tangent to the graduation mark by dripping. Furthermore, based on the liquid level height, a coarse-precision, high-efficiency liquid level detection method is used at low liquid levels, while a fine-precision, robust liquid level detection method with liquid level correction is used at high liquid levels close to the graduation mark. By combining subsurface water filling and dripping, and employing different liquid level detection methods for different liquid levels, calibration accuracy and efficiency are improved.
[0036] This embodiment provides a method for adjusting the water filling of a milliliter-level volumetric flask, implemented through computer programming. The execution subject of this method can be an electronic device such as a computer, laptop, or tablet, or a control chip embedded in an electronic device; this invention does not limit this to any particular device.
[0037] like Figure 1 As shown, the specific steps of the milliliter-level volumetric flask water filling and setting method in this embodiment include:
[0038] Step S100: Obtain the position of the neck diameter change based on the first image obtained from photographing the volumetric flask;
[0039] A volumetric flask is a glass instrument used in laboratories to accurately prepare solutions of a specific volume. Its structure can be divided into three parts: the body, the neck, and the transition point. The neck is the long, narrow section at the top of the flask, connecting the body to the mouth. The transition point is the junction between the body and the neck, where their diameters change abruptly.
[0040] After photographing the volumetric flask and obtaining the first image, the bottleneck region and the bottleneck diameter change position are identified in the first image. Specifically: the first edge is detected from left to right and from right to left using an edge detection algorithm. The Hough transform is used on the edge points detected on the left and right sides to detect the straight lines on both sides. The bottleneck region is created using the effective edge points used to construct the straight lines. The bottom of the bottleneck region corresponds to the bottleneck diameter change position.
[0041] Step S200: The area from the bottom of the bottle to the neck diameter change position is set as the first region, the area from the neck diameter change position to the preset first neck position is set as the second region, the area from the first neck position to the preset second neck position is set as the third region, and the area from the second neck position to the scale line position is set as the fourth region. The neck diameter change position, the first neck position, the second neck position, and the scale line position are raised sequentially.
[0042] When water is first added, the filling nozzle is located inside the bottle, near the bottom. When the liquid level rises above the neck diameter change point, because the neck diameter of a ml-level volumetric flask is much smaller than the body, moving the filling nozzle above the liquid level when it is close to the graduation mark will cause the liquid level to shift significantly up and down within the neck. To avoid this and to precisely control the process of the liquid level approaching the graduation mark, a first bottleneck position is pre-set above the neck diameter change point. When the liquid level reaches the first bottleneck position, the filling nozzle is moved from inside the bottle to the neck diameter change point.
[0043] The second bottleneck position is located above the first bottleneck position and closer to the graduation line. When the liquid level reaches the second bottleneck position, the water inlet is moved above the graduation line to start dripping.
[0044] By setting a first bottleneck position and a second bottleneck position, the water injection process can be controlled more precisely, improving calibration efficiency and accuracy. The specific positions of the first and second bottleneck positions are not limited and can be adapted to the diameter of the water injection pipe and the bottleneck. Preferably, the first bottleneck position is set based on the following: when the water injection pipe opening moves from inside the bottle to the bottleneck diameter change position, the liquid level drops from the first bottleneck position back to above the bottleneck diameter change position; the second bottleneck position is set based on the following: when the water injection pipe opening moves from below the liquid level to above the graduation line, the liquid level drops from the second bottleneck position back to above the first bottleneck position.
[0045] Step S300: Continuously photograph the volumetric flask during the liquid level rise to obtain a second image;
[0046] After obtaining the second image, this embodiment further preprocesses it to improve the accuracy of liquid level detection. Specifically, the first image (i.e., the volumetric flask image without water) is subtracted from the second image to obtain a filtered image, which is then set as the second image. This ensures that only the current liquid level is retained in the second image, eliminating interference from other parts of the image (such as the background, impurities attached to the volumetric flask, and dirt), effectively enhancing the liquid level characteristics and improving detection efficiency and success rate.
[0047] Volumetric flasks come in colorless and brown varieties. Current technology does not differentiate between the colors of the flasks being tested, but the grayscale features of the liquid surface in brown flasks are relatively weak, increasing the likelihood of detection failure. Therefore, for brown flasks, after obtaining the second image, a power function method with an exponent less than 1 is used to enhance the low-grayscale pixels, effectively enhancing the grayscale features of the liquid surface. This method is applicable to both colorless and brown flasks. The power function method is a conventional technique in image processing that uses a power function to non-linearly transform the pixel grayscale values of an image to enhance low- or high-grayscale features; it is not elaborated further here.
[0048] Step S400: The liquid level is detected using the first detection method based on the second image. When the liquid level is in the first region, water is quickly injected below the liquid level. When the liquid level is in the second or third region, water is slowly injected below the liquid level. When the liquid level is in the fourth region, water is dripped above the liquid level. The liquid level is detected using the second detection method based on the second image. When the liquid level reaches the scale line, the dripping is stopped.
[0049] The water filling and setting process consists of two parts: continuous water filling when the water inlet is below the liquid surface, and drip setting when the inlet is above the liquid surface. When the liquid surface is in the first, second, and third zones, water is poured below the surface to effectively avoid splashing and air bubble entrainment. When the liquid surface rises to the fourth zone, drip setting is used. In the drip setting, after each drop of water is added, the distance between the concave part of the liquid surface and the graduation mark is automatically detected. When the distance is sufficiently small, indicating that the liquid surface has reached the graduation mark, the setting ends and dripping stops.
[0050] Furthermore, the water injection calibration process is set with different water injection speeds: continuous rapid water injection is used when the liquid level is in the first zone, while continuous slow water injection is used when the liquid level is in the second and third zones. This balances calibration efficiency and accuracy.
[0051] To efficiently and accurately detect the liquid level, different liquid level detection methods are used depending on the liquid level height. When the liquid level is in the first, second, or third zone (i.e., low liquid level), a first detection method with coarse precision and high efficiency is used to improve detection efficiency. When the liquid level is in the fourth zone (i.e., high liquid level), a second detection method with fine precision and robustness is used to improve detection accuracy.
[0052] The water injection and adjustment process in this embodiment combines subsurface water injection and titration, with different injection speeds and liquid level detection methods depending on the liquid level. This allows for precise control of the water injection and adjustment process and effective liquid level detection without the need for external reference objects.
[0053] In some implementations, the first detection method is the maximum row grayscale detection method, and the second detection method includes: first using the maximum particle detection method to detect the liquid surface and obtain an initial result, and then using the row grayscale gradient detection method to correct the result; or, first using the maximum particle detection method to detect the liquid surface, and then using the edge detection method to detect the liquid surface if the detection fails. The maximum row grayscale detection method, the maximum particle detection method, the row grayscale gradient detection method, and the edge detection method are all applicable to meniscus-shaped liquid surfaces; the row grayscale gradient detection method and the edge detection method are also applicable to non-meniscus-shaped liquid surfaces, thus effectively detecting liquid surfaces of different shapes.
[0054] To further improve the reliability of liquid surface detection, in this embodiment, when the liquid surface is located in the second region, the maximum row grayscale detection method is used to detect the liquid surface first. When no liquid surface is detected, the maximum particle detection method is used to detect the liquid surface. When the liquid surface is located in the third region, the maximum row grayscale detection method, the maximum particle detection method, the row grayscale gradient detection method, and the edge detection method are used alternately until the liquid surface is detected.
[0055] The specific process of liquid level detection in this embodiment is as follows: After water is started, a second image of the volumetric flask is continuously captured. First, the maximum line grayscale detection method is used to detect the liquid level in the second image. When the liquid level reaches the bottleneck position (i.e., the height of the liquid level in the image is greater than or equal to the height of the bottleneck position), it means that the liquid level has moved from the first region to the second region. Then, the maximum line grayscale detection method is used again to detect the liquid level in the second image. If no liquid level is detected, the maximum particle detection method is used. When the liquid level reaches the first bottleneck position (i.e., the height of the liquid level in the image is greater than or equal to the height of the first bottleneck position), it means that the liquid level has moved from the second region to the third region. Then, the maximum line grayscale detection method, the maximum particle detection method, the line grayscale gradient detection method, and the edge detection method are used alternately for detection. If the previous method fails to detect the liquid level, the next method is selected to continue detecting the liquid level until the liquid level is detected. When the liquid level reaches the second bottleneck position, it means the liquid has entered the fourth region from the third region. The maximum particle detection method is then used to detect the liquid level. Based on the detection results, a region of interest slightly larger than the maximum particle boundary rectangle is constructed. Next, the horizontal grayscale gradient detection method is used to detect the liquid level within the region of interest, and the result is output. If the liquid level is not detected, the edge detection method is used. Alternatively, the maximum particle detection method can be used first, and if that fails, the edge detection method can be used. When the liquid level reaches the graduation mark, the dripping stops, completing the water injection calibration process.
[0056] The above maximum row grayscale detection method includes: obtaining the grayscale of several rows in the bottleneck area of the second image according to a specified step size, calculating the maximum grayscale among these grayscales, and marking the row corresponding to the maximum grayscale as the liquid surface when the maximum grayscale exceeds the grayscale threshold;
[0057] The aforementioned maximum particle detection method includes: performing binarized threshold segmentation and particle morphology processing on the bottleneck region in the second image to obtain several particles; sorting all particles according to their area from smallest to largest; sorting all particles according to their boundary rectangle width from smallest to largest; and identifying the particle with the largest combined ranking as the maximum particle. The bottom of the maximum particle's boundary rectangle is marked as the liquid surface. Particle morphology processing is an image processing technique for shape analysis, such as particle filling and adjacent particle connectivity, used to identify particles in the image. The combined ranking refers to the sum of the particle area ranking and the particle boundary rectangle width ranking. Obviously, the combined ranking can also be obtained by weighting the particle area ranking and the particle boundary rectangle width ranking.
[0058] The aforementioned row grayscale gradient detection method includes: analyzing the gradient changes of grayscale values in all rows of the bottleneck region in the second image, and marking the first row exceeding the gradient threshold from bottom to top as the liquid surface; where "from bottom to top" refers to the direction from the bottom to the top of the second image. The gradient threshold is the algebraic sum of the gradient mean and the gradient standard deviation.
[0059] The aforementioned edge detection method includes: using an edge detection algorithm to detect edges longitudinally in the bottleneck region of the second image, obtaining several edge points, removing singular points from the edge points, performing curve fitting on the obtained valid edge points to obtain a horizontal fitting curve, and marking the points on the fitted curve located on the upper line of the bottleneck region as liquid surfaces. The curve fitting includes first-order linear fitting and second-order polynomial fitting, and the one with the smaller fitting residual is taken as the fitting result.
[0060] To improve the reliability of liquid level detection, this embodiment moves the injection pipe upwards to the bottleneck diameter change position when the liquid level reaches the first bottleneck position. The distance the liquid level drops after moving the injection pipe is calculated based on its diameter, resulting in a new liquid level position. This new liquid level position then limits the bottleneck area to a more effective region of interest. Specifically, the bottom of the bottleneck area is updated to the new liquid level position, and the top of the bottleneck area is a preset position above the volumetric flask graduation line.
[0061] In summary, this embodiment identifies the liquid surface without relying on external reference objects, directly detects the curved liquid surface, and marks the liquid surface with concave points; furthermore, it combines water injection below the liquid surface with dripping above the liquid surface, employing different liquid surface detection methods for different liquid surface heights, which can effectively detect the liquid surface and improve detection accuracy and efficiency.
[0062] The complete water filling and setting process in this embodiment is as follows: After the program starts running, input the information of the volumetric flask to be tested (including capacity, color, etc.) and the detection parameters (including edge detection operators, morphological processing structural units, etc.).
[0063] Then, the bottleneck region in the volumetric flask image is detected. The detection process involves detecting the first edge from left to right and from right to left, respectively. For the edge points detected on the left and right sides, a Hough transform is applied to detect straight lines on both sides. The bottleneck region is created using the valid edge points that construct these straight lines. The bottom of the bottleneck region corresponds to the point where the bottleneck diameter changes, and the top of the bottleneck region is located at the bottle mouth. A diameter-changing region is constructed at the point where the bottleneck diameter changes.
[0064] Insert the water inlet tube into the neck of the bottle. As the tube is inserted deeper, monitor the grayscale changes in the diameter change area in real time. When the grayscale change exceeds a threshold, the tube is considered to have reached the diameter change point at the bottle neck. Based on the capacity of the volumetric flask being tested, select a reasonable insertion distance Hm and continue inserting the water inlet tube, ideally close to the bottom of the flask.
[0065] Start by rapidly filling the flask with water, while simultaneously using the maximum line grayscale detection method to detect the bottleneck region in the volumetric flask image. When the liquid level is detected, switch to slow filling and continue using the maximum line grayscale detection method to detect the bottleneck region. If the liquid level is not detected, continue trying using the maximum particle detection method. Record the liquid level position when it is detected. Stop filling the flask when the liquid level reaches the designated first bottleneck position Y2. Move the filling pipe upwards by Hm, returning the pipe opening to the bottleneck diameter change point. Based on the pipe diameter, the distance the liquid level will drop by hp can be predicted, and the liquid level position is updated to Y2 + hp (vertical axis downwards). Using the latest liquid level position as the base and a position above the scale line as the top, update the bottleneck region.
[0066] Continue slowly adding water while simultaneously detecting the bottleneck area. Select and use one of four methods in the following order: maximum row grayscale detection, maximum particle detection, row grayscale gradient detection, and edge detection. If the previous method fails to detect the liquid surface, switch to the next method. Record the liquid surface position when detected. Stop adding water when the liquid surface reaches the second bottleneck position Y1, close to the graduation mark. Construct the area above the graduation mark, using the graduation mark as the base and a certain distance above it as the top. Move the water pipe upwards while simultaneously detecting grayscale changes in the area above the graduation mark. When the grayscale change exceeds a threshold, it is determined that the pipe opening has reached the area above the graduation mark, and movement stops.
[0067] Initiate dripping while simultaneously detecting the bottleneck area. First, use the maximum particle detection method. Then, construct a region of interest (ROI) slightly larger than the maximum particle boundary rectangle based on the detection results. Next, use the row grayscale gradient detection method to detect the liquid surface and output the result. If no liquid surface is detected, use the edge detection method. Record the liquid surface position when detected. Stop dripping when the liquid surface reaches the scale mark Y0, completing the calibration and exiting the injection tube.
[0068] like Figure 2 As shown, based on the above-described method for adjusting the water filling of a milliliter-level volumetric flask, this embodiment of the invention discloses a system for adjusting the water filling of a milliliter-level volumetric flask, comprising:
[0069] The region setting module 600 is used to obtain the neck diameter change position based on the first image obtained by photographing the volumetric flask; the bottle bottom to the neck diameter change position is set as the first region, the neck diameter change position to the preset first neck position is set as the second region, the first neck position to the preset second neck position is set as the third region, and the second neck position to the scale line position is set as the fourth region, and the neck diameter change position, the first neck position, the second neck position, and the scale line position are sequentially increased.
[0070] Image capturing module 610 is used to continuously capture images of the volumetric flask during the liquid level rise to obtain a second image;
[0071] The water injection control module 620 is used to detect the liquid level based on the second image using a coarse-precision, high-efficiency detection method. When the liquid level is in the first region, water is injected rapidly below the liquid level. When the liquid level is in the second region or the third region, water is injected slowly below the liquid level. When the liquid level is in the fourth region, water is dripped above the liquid level. The module also uses a fine-precision, robust detection method to detect the liquid level based on the second image. When the liquid level reaches the scale line, the dripping stops.
[0072] like Figure 3 As shown, an embodiment of the present invention discloses an electronic device, including a memory 401 storing executable program code and a processor 402 coupled to the memory 401;
[0073] The processor 402 calls the executable program code stored in the memory 401 to execute the milliliter-level volumetric flask water filling and setting method described in the above embodiments.
[0074] This invention also discloses a computer-readable storage medium storing a computer program that causes a computer to execute the milliliter-level volumetric flask filling and setting method described in the above embodiments.
[0075] The purpose of the above embodiments is to reproduce and derive the technical solution of the present invention by way of example, and to fully describe the technical solution, purpose and effect of the present invention. The purpose is to enable the public to have a more thorough and comprehensive understanding of the disclosure of the present invention, and not to limit the scope of protection of the present invention.
[0076] The above embodiments are not an exhaustive list based on the present invention, and there may be many other embodiments not listed. Any substitutions and improvements made without departing from the concept of the present invention are within the protection scope of the present invention.
Claims
1. A method for adjusting the water filling of a milliliter-sized volumetric flask, characterized in that, include: Based on the first image obtained from photographing the volumetric flask, the location of the neck diameter change is determined; The area from the bottom of the bottle to the neck diameter change position is defined as the first region, the area from the neck diameter change position to the preset first neck position is defined as the second region, the area from the first neck position to the preset second neck position is defined as the third region, and the area from the second neck position to the scale line position is defined as the fourth region. The neck diameter change position, the first neck position, the second neck position, and the scale line position are sequentially increased. The volumetric flask was continuously photographed as the liquid level rose, resulting in a second image. The first detection method is used to detect the liquid surface based on the second image. When the liquid surface is in the first region, water is quickly injected below the liquid surface. When the liquid surface is in the second region or the third region, water is slowly injected below the liquid surface. The first detection method is used to detect the liquid surface with coarse accuracy and high efficiency. When the liquid level is in the fourth region, dripping is performed above the liquid level. The second detection method is used to detect the liquid level based on the second image. When the liquid level reaches the scale line, the dripping is stopped. The second detection method is used to detect the liquid level with fine precision and robustness. The first detection method is the maximum row grayscale detection method, and the second detection method includes: first using the maximum particle detection method to detect the liquid surface, and then using the row grayscale gradient detection method to correct the liquid surface, or, first using the maximum particle detection method to detect the liquid surface, and then using the edge detection method to detect the liquid surface when the detection fails.
2. The method for adjusting the water filling of a milliliter-level volumetric flask as described in claim 1, characterized in that, When the liquid surface is located in the second region, the maximum row grayscale detection method is used to detect the liquid surface first. When the liquid surface is not detected, the maximum particle detection method is used to detect the liquid surface. When the liquid surface is located in the third region, the maximum row grayscale detection method, the maximum particle detection method, the row grayscale gradient detection method, and the edge detection method are used alternately to detect the liquid surface until it is detected.
3. The method for adjusting the water filling of a milliliter-level volumetric flask as described in claim 1 or 2, characterized in that, The maximum row grayscale detection method includes: obtaining the grayscale of several rows in the bottleneck area of the second image according to a specified step size; when the maximum grayscale exceeds the grayscale threshold, the row corresponding to the maximum grayscale is marked as the liquid surface; the maximum particle detection method includes: performing binarized threshold segmentation and particle morphology processing on the bottleneck area in the second image to obtain several particles; among all particles, the particle with the largest combined particle area and boundary rectangle width is taken as the maximum particle, and the bottom of the boundary rectangle of the maximum particle is marked as the liquid surface; the row grayscale gradient detection method includes: analyzing the gradient change of grayscale of all rows in the bottleneck area of the second image, and marking the first row exceeding the gradient threshold from bottom to top as the liquid surface; the edge detection method includes: detecting the edge vertically in the bottleneck area of the second image, removing singular points among the edge points, performing curve fitting on the obtained effective edge points, and marking the points on the fitted curve located on the upper line of the bottleneck area as the liquid surface.
4. The method for adjusting the water filling of a milliliter-level volumetric flask as described in claim 3, characterized in that, After obtaining the second image, the first image is subtracted from the second image to obtain the filtered image, and the filtered image is set as the second image.
5. The method for adjusting the water filling of a milliliter-level volumetric flask as described in claim 3, characterized in that, When the volumetric flask is a brown flask, after obtaining the second image, a power function method with an exponent less than 1 is used to enhance the low grayscale pixels of the second image.
6. The method for adjusting the water filling of a milliliter-level volumetric flask as described in claim 3, characterized in that, When the liquid level reaches the first bottleneck position, the water injection pipe is moved up to the bottleneck diameter change position. The liquid level position after moving the water injection pipe is calculated, and the bottom of the bottleneck area is updated as the liquid level position, and the top of the bottleneck area is the preset position above the volumetric flask scale line.
7. A milliliter-level volumetric flask water filling and setting system, characterized in that, include: The region setting module is used to obtain the neck diameter change position based on the first image obtained from photographing the volumetric flask; The area from the bottom of the bottle to the neck diameter change position is defined as the first region, the area from the neck diameter change position to the preset first neck position is defined as the second region, the area from the first neck position to the preset second neck position is defined as the third region, and the area from the second neck position to the scale line position is defined as the fourth region. The neck diameter change position, the first neck position, the second neck position, and the scale line position are sequentially increased. An image capturing module is used to continuously capture images of the volumetric flask as the liquid level rises, thereby obtaining a second image; The water injection control module is used to detect the liquid level based on the second image using a first detection method. When the liquid level is in the first region, water is rapidly injected below the liquid level; when the liquid level is in the second region or the third region, water is slowly injected below the liquid level. The first detection method is used for coarse-precision and high-efficiency detection of the liquid level. When the liquid level is in the fourth region, water is dripped above the liquid level. The second detection method is used to detect the liquid level based on the second image using a second detection method. When the liquid level reaches the scale line, the dripping stops. The second detection method is used for fine-precision and robust detection of the liquid level. The first detection method is the maximum row grayscale detection method, and the second detection method includes: first using the maximum particle detection method to detect the liquid surface, and then using the row grayscale gradient detection method to correct the liquid surface, or, first using the maximum particle detection method to detect the liquid surface, and then using the edge detection method to detect the liquid surface when the detection fails.
8. An electronic device, characterized in that, It includes a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the milliliter-level volumetric flask filling and adjustment method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program causes a computer to perform the water filling and adjustment method for a milliliter-level volumetric flask as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method, device and equipment for automatically adjusting liquid level of measuring type glass measuring vessel
CN114877974A
