Liquid level height detection method

Using machine vision technology combined with HSV color space and edge detection algorithm to identify liquid level, it solves the problems of low detection efficiency and high cost of traditional industrial assembly lines, achieves accurate detection and quality determination of product liquid level, improves production efficiency and Reduces employee work intensity.

CN118570281APending Publication Date: 2024-08-30ANHUI UNIV

Patent Information

Application Number
CN202410740067.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In traditional industrial assembly line inspection, the cost is high and the efficiency is low. The combination of liquid level identification and color identification is rarely used, and there is a lack of research and customized development, resulting in incomplete product inspection.

Method used

Machine vision technology is used to collect images through CCD industrial cameras, converted into HSV color space, combined with grayscale, morphology and image enhancement processing, and the Laplacian of Gaussian LoG and Harris corner detection algorithms are used to identify the liquid level height and determine whether the product is qualified.

Benefits of technology

It improves production efficiency, reduces employee work intensity, achieves accurate identification of liquid level height and product quality determination, and is suitable for testing a variety of filling products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570281A
    Figure CN118570281A
Patent Text Reader

Abstract

The invention discloses a liquid level height detection method. Firstly, a CCD industrial camera is used for carrying out image acquisition on a lubricating oil bottle passing through a detection position; converting the RGB color space model of the liquid in the lubricating oil bottle in the acquired image into an HSV color space model; graying, morphology and image enhancement processing is carried out on the acquired image; detecting the processed image by using an LoG edge detection algorithm to obtain contour features of the lubricating oil bottle and the liquid level in the bottle; a Harris corner detection algorithm is utilized to position key points according to the contour features, and the liquid level height of liquid in the lubricating oil bottle is obtained; judging whether the lubricating oil is a qualified product or not according to the liquid level height, and performing corresponding treatment on the qualified product and the unqualified product. According to the method, the liquid level height and the liquid injection amount of the product are recognized through machine vision instead of human eyes, and whether the product is qualified or not is judged accordingly, so that the production efficiency is improved, and the working intensity of staff is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of product inspection, and in particular to a liquid level detection method. Background Art

[0002] At present, product inspection is very necessary in product processing and production, but there are problems of high cost and low detection efficiency in traditional industrial assembly line detection. It is relatively rare to apply liquid level recognition to traditional industrial assembly line detection and combine it with color recognition, but this combination can provide more comprehensive product detection and quality control. Liquid level recognition and color recognition have certain complexity in technology and algorithms. At present, this comprehensive application lacks more research and customized development. Summary of the invention

[0003] The purpose of the present invention is to provide a liquid level detection method, which uses machine vision to replace human eyes to identify the liquid level and injection volume of the product, and uses this to determine whether the product is qualified, thereby improving production efficiency and reducing employee workload.

[0004] The objective of the present invention is achieved through the following technical solutions:

[0005] A method for detecting a liquid level, the method comprising:

[0006] Step 1: First, use a CCD industrial camera to collect images of the lubricating oil bottle passing through the detection position;

[0007] Step 2: convert the RGB color space model of the liquid in the lubricating oil bottle in the collected image into an HSV color space model, identify the color characteristics of the liquid in the lubricating oil bottle, and determine the type of lubricating oil product;

[0008] Step 3: grayscale, morphology and image enhancement processing are performed on the collected images;

[0009] Step 4: Use the Laplace Gaussian LoG edge detection algorithm to detect the image processed in step 3, and obtain the contour features of the lubricating oil bottle and the liquid level in the bottle;

[0010] Step 5: Use the Harris corner point detection algorithm to locate key points based on the contour features obtained in step 4, and obtain the liquid level height of the lubricating oil bottle;

[0011] Step 6: Determine whether the lubricating oil is qualified according to the liquid level height obtained in step 5, and handle qualified and unqualified products accordingly.

[0012] It can be seen from the technical solution provided by the present invention that the above method uses machine vision to replace the human eye to identify the product liquid level height and injection volume, and uses this to determine whether the product is qualified, thereby improving production efficiency and reducing employee workload. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0014] Figure 1 A schematic diagram of a flow chart of a liquid level detection method provided by an embodiment of the present invention;

[0015] Figure 2 Schematic diagram of the comparison of lubricating oil image test results at different liquid level heights. DETAILED DESCRIPTION

[0016] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, which does not constitute a limitation 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.

[0017] like Figure 1 FIG. 1 is a flow chart of a liquid level detection method provided by an embodiment of the present invention, wherein the method comprises:

[0018] Step 1: First, use a CCD industrial camera to collect images of the lubricating oil bottle passing through the detection position;

[0019] In this step, the lubricating oil bottle is a transparent bottle. After being assembled by the filling machine, the two products in the lubricating oil bottle are different in color, namely yellow and white.

[0020] Step 2: convert the RGB color space model of the liquid in the lubricating oil bottle in the collected image into an HSV color space model, identify the color characteristics of the liquid in the lubricating oil bottle, and determine the type of lubricating oil product;

[0021] In this step, the RGB color space model of the liquid in the lubricating oil bottle in the captured image is converted into the HSV color space model. In the HSV color space model, H represents hue, S represents saturation, and V represents brightness. The specific conversion formula is:

[0022] V=max / 255

[0023]

[0024]

[0025] Among them, u is the unknown quantity of the cone coordinate system of the HSV color space model; H is the converted hue value; 00ax = 00aX (R, G, B) represents the maximum pixel value in RGB; min = min (R, G, B) represents the minimum pixel value in RGB; R, G, B are the color pixel sizes in the three directions of red, green, and blue of the image;

[0026] Then, the color characteristics of the liquid in the lubricant bottle are identified according to the converted HSV color space model to determine the product type of the lubricant.

[0027] Step 3: grayscale, morphology and image enhancement processing are performed on the collected images;

[0028] In this step, the weighted average method is used to grayscale the collected image. The specific formula is:

[0029] f(x,y)=0.299R(x,y)+0.578G(x,y)+0.114B(x,y)

[0030] In the formula, R, G, B are the color pixel sizes in the red, green, and blue directions of the image; x and y refer to the coordinates of the pixel point on the image; R(x, y), G(x, y), and B(x, y) refer to the grayscale values ​​of the RGB components of the grayscale image at (x, y) respectively; f(x, y) refers to the weighted average of the grayscale values ​​of the grayscale image after grayscale with different weights;

[0031] In order to make the liquid level contour smoother and eliminate the spot noise points, the expansion and corrosion operations are combined to achieve morphological processing. The expression is:

[0032]

[0033] in, Indicates that image area A is eroded by mask B; B is the set mask used to perform an opening operation on image area A; represents the morphological opening operation;

[0034] Then the Retinex algorithm is used for image enhancement, and the expression is:

[0035]

[0036] Where K is the number of Gaussian center surround functions; S(x, y) is the original image; Fk(x, y) is the Gaussian center surround function; r(x, y) is the output enhanced image; * is the convolution symbol; w k Indicates the weighting coefficient of the kth scale when weighting, which needs to satisfy

[0037] Step 4: Use the Laplacian of Gaussian (Laplacian of Gaussian) edge detection algorithm to detect the image processed in step 3, and obtain the contour features of the lubricating oil bottle and the liquid level in the bottle;

[0038] In this step, we first use the change in gradient amplitude to determine the pixel points where the pixel values ​​in the vicinity of the image grayscale point have changed significantly. The specific formula is:

[0039]

[0040] in,

[0041] h(x,y) is the coordinate of the pixel point where the pixel value in the area near the grayscale point of the image has a significant change; g(x,y) and f(x,y) are two pixel points; is a second-order differential; Differential operators;

[0042] Then determine whether the determined pixel point is a zero crossing point of the second-order differential; if so, determine that the pixel point is an edge contour point, thereby obtaining the contour features of the lubricating oil bottle and the liquid level in the bottle, including the corner point of the liquid surface position and the lubricating oil bottle and the inflection point at the bottom of the lubricating oil bottle.

[0043] Step 5: Use the Harris corner point detection algorithm to locate key points based on the contour features obtained in step 4, and obtain the liquid level height of the lubricating oil bottle;

[0044] In this step, the Harris corner detection algorithm is used to locate the key points p1(x1,y1), p2(x2,y2), and p3(x3,y3) according to the obtained contour features; then the elimination method is used to select two points with a large span in the y direction and a small difference in the x direction, so point p3 is excluded and p1 and p2 are selected as two key points;

[0045] The calculation formula for the liquid level h in the lubricating oil bottle is:

[0046] h=0.08×(y1-y2)

[0047] Where p1(x1,y1), p2(x2,y2) are the coordinates of key points p1 and p2.

[0048] Step 6: Determine whether the lubricating oil is qualified according to the liquid level height obtained in step 5, and handle qualified and unqualified products accordingly.

[0049] In this step, if the liquid level is within the qualified range of the product injection amount, the lubricating oil is determined to be a qualified product; otherwise, the lubricating oil is determined to be a failed product;

[0050] Then, the qualified products are picked up by the Da Ming robotic arm and placed on the feeding track of the automatic labeling machine, and the unqualified products are picked up and placed in the processing area.

[0051] It is worth noting that the contents not described in detail in the embodiments of the present invention belong to the prior art known to professional and technical personnel in the field.

[0052] The above method embodiment can complete the product liquid level detection without external auxiliary measurement equipment. Figure 2 The figure shows the comparison of the test results of lubricating oil images with different liquid level heights. By testing 80 lubricating oil images with different liquid level heights, the comparison results of the measured height and the standard height are shown in Figure 2 As shown, the results show that the method described in the embodiment of the present invention can effectively complete the non-contact measurement of the liquid level and can quickly obtain accurate measurement results.

[0053] In summary, the method described in the embodiment of the present invention uses a method that combines mechanical vision with processing machines to make classification, processing, assembly, quality inspection and packaging intelligent, greatly improving production efficiency and reducing the workload of employees; at the same time, this method can not only be used for established lubricant products, but also can realize the production process of other filling products by changing the type of some equipment parts, the type of liquid and the parameters of the host computer, thereby transforming the existing production line at a relatively low cost to meet the production needs of other materials, and has unique advantages in both technology and market prospects.

[0054] In addition, a person skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be implemented by instructing related hardware through a program, and the corresponding program can be stored in a computer-readable storage medium. The above-mentioned storage medium can be a read-only memory, a disk or an optical disk, etc.

[0055] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed in the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims. The information disclosed in the background technology section of this article is only intended to deepen the understanding of the overall background technology of the present invention, and should not be regarded as an admission or in any form that the information constitutes prior art known to those skilled in the art.

Claims

1. A method for detecting liquid level, It is characterized in that The method comprises: Step 1: First, use a CCD industrial camera to collect images of the lubricating oil bottle passing through the detection position; Step 2: convert the RGB color space model of the liquid in the lubricating oil bottle in the collected image into an HSV color space model, identify the color characteristics of the liquid in the lubricating oil bottle, and determine the type of lubricating oil product; Step 3: grayscale, morphology and image enhancement processing are performed on the collected images; Step 4: Use the Laplace Gaussian LoG edge detection algorithm to detect the image processed in step 3, and obtain the contour features of the lubricating oil bottle and the liquid level in the bottle; Step 5: Use the Harris corner point detection algorithm to locate key points based on the contour features obtained in step 4, and obtain the liquid level height of the lubricating oil bottle; Step 6: Determine whether the lubricating oil is qualified according to the liquid level height obtained in step 5, and handle qualified and unqualified products accordingly.

2. The liquid level detection method according to claim 1, It is characterized in that In step 1, the lubricating oil bottle is a transparent bottle. After being assembled by a filling machine, the two products in the lubricating oil bottle are different in color, namely yellow and white.

3. The liquid level detection method according to claim 1, It is characterized in that In step 2, the RGB color space model of the liquid in the lubricating oil bottle in the captured image is converted into the HSV color space model. In the HSV color space model, H represents hue, S represents saturation, and V represents brightness. The specific conversion formula is: V=max / 255 Among them, u is the unknown quantity of the cone coordinate system of the HSV color space model; H is the converted hue value; max = max(R, G, B), which represents the maximum value of the pixel in RGB; min = min(R, G, B), which represents the minimum value of the pixel in RGB; R, G, B are the color pixel sizes in the three directions of red, green, and blue of the image; Then, the color characteristics of the liquid in the lubricant bottle are identified according to the converted HSV color space model to determine the product type of the lubricant.

4. The liquid level detection method according to claim 1, It is characterized in that In step 3, the collected image is grayed using the weighted average method. The specific formula is: f(x,y)=0.299R(x,y)+0.578G(x,y)+0.114B(x,y) In the formula, R, G, B are the color pixel sizes in the red, green, and blue directions of the image; x and y refer to the coordinates of the pixel point on the image; R(x, y), G(x, y), and B(x, y) refer to the grayscale values ​​of the RGB components of the grayscale image at (x, y) respectively; f(x, y) refers to the weighted average of the grayscale values ​​of the grayscale image after grayscale with different weights; In order to make the liquid level contour smoother and eliminate the light spot noise points, the two operations of expansion and corrosion are combined to realize morphological processing. The expression is: in, Indicates that the image area A is eroded by the mask B; B is the set mask used to perform an opening operation on the image area A; AοB represents a morphological opening operation; Then the Retinex algorithm is used for image enhancement, and the expression is: Where K is the number of Gaussian center surround functions; S(x,y) is the original image; F k (x, y) is the Gaussian center surround function; r(x, y) is the output enhanced image; * is the convolution symbol; w k Indicates the weighting coefficient of the kth scale when weighting, which needs to satisfy 5. The liquid level detection method according to claim 1, It is characterized in that The process of step 4 is specifically as follows: First, the change in gradient amplitude is used to determine the pixel points where the pixel values ​​in the vicinity of the image grayscale point have changed significantly. The specific formula is: h(x,y)=▽ 2 [g(x,y)×f(x,y)]=[▽ 2 g(x,y)×f(x,y)] in, h(x,y) is the coordinate of the pixel point where the pixel value in the area near the grayscale point of the image has a significant change; g(x,y) and f(x,y) are two pixel points; ▽ 2 [] is the second-order differential; ▽ is the differential operator; Then determine whether the determined pixel point is a zero crossing point of the second-order differential; If so, the pixel point is determined to be an edge contour point, thereby obtaining contour features of the lubricating oil bottle and the liquid level in the bottle, including the corner point of the liquid surface position and the lubricating oil bottle and the inflection point at the bottom of the lubricating oil bottle.

6. The liquid level detection method according to claim 1, It is characterized in that In step 5, the Harris corner detection algorithm is used to locate the key point p according to the obtained contour features. 1 (x 1 ,y 1 ), p 2 (x 2 ,y 2 ), p 3 (x 3 ,y 3 ); Then, by using the elimination method, we select two points with a large span in the y direction and a small difference in the x direction, thus eliminating point p 3 , select p 1 With p 2 There are two key points; The calculation formula for the liquid level h in the lubricating oil bottle is: h=0.08×(y 1 -y 2 ) Where p 1 (x 1 ,y 1 ), p 2 (x 2 ,y 2 ) is the key point p 1 With p 2 The coordinates of .

7. The liquid level detection method according to claim 1, It is characterized in that In step 6, if the liquid level is within the qualified range of the product injection amount, the lubricating oil is determined to be a qualified product; otherwise, the lubricating oil is determined to be a failed product; Then, the qualified products are picked up by the Da Ming robotic arm and placed on the feeding track of the automatic labeling machine, and the unqualified products are picked up and placed in the processing area.

Citation Information

Patent Citations

  • Self-adaptive robust high-precision detection method for liquid level in grayscale image

    CN111353984A

  • High-flux canning liquid injection equipment

    CN114455529A

  • Liquid flow detection method and device, computer readable medium and computing equipment

    CN115046597A

  • Refined oil manufacturing method

    KR1019990078988A

Cited By

  • Metering detection data identification method and system based on machine vision

    CN119037772A