A method and device for measuring alcohol content online
Real-time detection of alcohol content through the image acquisition device and contour search algorithm solves the problem in the existing technology that alcohol content measurement relies on manual labor and the equipment is easily damaged, realizes automated online measurement during the wine picking process, and improves efficiency and accuracy.
Patent Information
- Application Number
- CN202410815633.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-06-24
AI Technical Summary
In the existing technology, alcohol content measurement relies on manual operation, which consumes a lot of manpower, and the photoelectric conversion measurement equipment is expensive and susceptible to damage by grease, resulting in shortened service life.
The image acquisition device and the preset contour search algorithm are used to detect alcohol content in real time. By obtaining the contour information and liquid level height of the alcohol meter, combined with the mapping relationship between the pixel coordinate system and the world coordinate system, the alcohol content is calculated and automated online measurement is achieved.
Real-time automatic detection of alcohol content during the wine picking process is achieved, reducing manual intervention, improving measurement efficiency and accuracy, and avoiding the problem of shortened equipment life.
Smart Images

Figure CN118376618B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence and automation technology, and in particular to an alcohol content online measurement method and device. Background Art
[0002] The wine picking technology, which separates distillates of different readings by the physical and chemical properties of the wine during the distillation process, is an important part of the modern liquor production process. In the traditional production process, most of the wine is picked by quantity and quality: that is, the head and tail of the wine are removed, and the wine is picked and tasted at the same time. Due to the different alcohol content and temperature, the surface tension of the original wine at different stages is different, which arouses bubbles of different forms. Therefore, it is supplemented by "picking wine by looking at the flowers", and the two are combined to accurately grade the alcohol content. This method requires a lot of manpower and is extremely dependent on manual experience, and it is impossible to unify the standards. With the development of big data and artificial intelligence, intelligent applications are becoming more and more popular. Applying these technologies in wine picking makes wine picking intelligent, and continuously improves the efficiency and accuracy of wine picking, which is also an important direction for improving wine picking technology.
[0003] In order to measure the alcohol content of liquor in real time during the wine picking process to assist in the segmentation of liquor and measure the mass flow rate generated by liquor, an online alcohol content measurement method is proposed. The mass flow rate is converted into liquid level measurement, and the current alcohol content is measured by the alcohol meter in the device. Summary of the invention
[0004] 1. Technical issues to be resolved
[0005] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides an online alcohol content measurement method and device, which solves the technical problems that the existing manual offline alcohol content measurement is labor-intensive, the photoelectric conversion alcohol content measurement is expensive, and the service life is shortened due to the grease destruction device.
[0006] (II) Technical solution
[0007] In order to achieve the above object, the main technical solutions adopted by the present invention include:
[0008] In a first aspect, an embodiment of the present invention provides an online alcohol content measurement method, which is applied to real-time detection of the alcohol content of a solution during wine picking, and the method comprises:
[0009] S11, acquiring a first original image through a preset image acquisition device, wherein the first original image includes a transparent alcohol container and an alcohol meter disposed inside the alcohol container;
[0010] S12, acquiring contour information of the counterweight of the alcohol meter in the first original image according to a preset contour search algorithm, and acquiring a pixel position of the center of the counterweight in a vertical direction in a pixel coordinate system according to the contour information;
[0011] S13, obtaining the pixel length of the alcohol meter in the pixel coordinate system according to the pre-calibrated mapping relationship between the pixel coordinate system and the world coordinate system and the pre-set actual length of the alcohol meter in the world coordinate system;
[0012] S14, obtaining the pixel liquid level height of the solution in the pixel coordinate system according to a preset solution pixel height detection method;
[0013] S15. Obtain the alcohol content of the current solution according to the pixel liquid level height of the solution in the pixel coordinate system, the pixel length of the alcohol meter in the pixel coordinate system, the pixel position of the center of the counterweight in the vertical direction in the pixel coordinate system and a pre-established mapping table.
[0014] Optionally, before S11, the step further includes:
[0015] S01. Acquire a second original image through an image acquisition device, and calibrate parameters of the image acquisition device based on the second original image, so that the alcohol container in the second original image is always vertical, and establish a mapping relationship between a pixel coordinate system and a world coordinate system.
[0016] Optionally, before S11, the step further includes:
[0017] S02. Based on the relative position of any scale of the alcohol meter pre-set in the world coordinate system on the alcohol meter, a mapping table is established in which each relative position of the scale on the alcohol meter has a one-to-one correspondence between an alcohol content and the position.
[0018] Optionally, the S12 includes:
[0019] S12-1, performing binarization processing on the first original image to generate a first process image of the alcohol meter counterweight;
[0020] S12-2, performing morphological filtering on the first process image, and obtaining contour information of the alcohol meter counterweight in the first process image after morphological filtering according to a preset contour search algorithm;
[0021] S12-3, obtaining a minimum circumscribed rectangle of the alcohol meter counterweight according to the contour information of the alcohol meter counterweight in the first process image;
[0022] S12-4. According to the pixel position of the minimum circumscribed rectangle of the counterweight in the pixel coordinate system, obtain the pixel position of the center of the minimum circumscribed rectangle in the vertical direction of the pixel coordinate system, that is, the pixel position of the center of the counterweight in the vertical direction of the pixel coordinate system.
[0023] Optionally, the S14 includes:
[0024] Performing Gaussian filtering and edge detection on the first original image to obtain a second process image;
[0025] The solution in the second process image has a complete upper edge and a complete lower edge;
[0026] According to the upper edge and the lower edge of the solution in the second process image, the pixel liquid level height of the solution in the pixel coordinate system is obtained.
[0027] Optionally,
[0028] The S14 includes:
[0029] According to the actual distance of the alcohol container in the preset world coordinate system, the actual distance from the distance measuring device to the alcohol container in the vertical direction, and the actual distance from the distance measuring device to the liquid surface of the solution in the vertical direction measured by the distance measuring device, the actual liquid level height of the solution in the world coordinate system is obtained by formula 1;
[0030] Obtaining the pixel liquid level height of the solution in the pixel coordinate system according to the actual liquid level height of the solution in the world coordinate system and the pre-calibrated mapping relationship between the pixel coordinate system and the world coordinate system;
[0031] The formula 1 is:
[0032] ;
[0033] Among them, h w is the actual liquid level of the solution in the world coordinate system, H w is the actual height of the alcohol container in the world coordinate system, X w is the actual distance from the distance measuring device to the alcohol container in the vertical direction in the world coordinate system, d w It is the actual distance from the distance measuring device to the liquid surface of the solution measured by the distance measuring device in the world coordinate system.
[0034] Optionally, the S15 includes:
[0035] S15-1, obtaining the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the pixel coordinate system according to the pixel liquid level height of the solution in the pixel coordinate system, the pixel length of the alcohol meter in the pixel coordinate system, and the pixel position of the center of the counterweight in the vertical direction in the pixel coordinate system;
[0036] S15-2, obtaining the relative position of the liquid level of the solution in the world coordinate system in the vertical direction of the alcohol meter according to the pre-calibrated mapping relationship between the pixel coordinate system and the world coordinate system and the relative position of the liquid level of the solution in the pixel coordinate system in the vertical direction of the alcohol meter;
[0037] S15-3, traversing the mapping table, and determining whether there is a scale in the mapping table that is the same as the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system;
[0038] If it exists, the alcohol content corresponding to the same scale as the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system is used as the alcohol content of the current solution;
[0039] The mapping table is:
[0040] ;
[0041] Among them, Y s is the relative position of any alcohol meter scale in the vertical direction of the alcohol meter, V s is the alcohol content corresponding to the scale, Y smin , Y s1 , …, Y smax V is the relative position of the alcohol meter scale in the vertical direction after the scales are arranged from small to large. smin , V s1 , …, V smax Y smin , Y s1 , …, Y smax The corresponding alcohol content.
[0042] Optionally, the S15-3 further includes:
[0043] If it does not exist, traverse the mapping table to obtain the relative positions of the two scales closest to the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system, and obtain the alcohol content of the current solution according to the preset formula 2;
[0044] The formula 2 is:
[0045] ;
[0046] Among them, V c is the alcohol content of the current solution, Y c is the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system, Y i and Y j V is the relative position of the two scales in the mapping table that are closest to the relative position of the liquid level of the solution in the world coordinate system in the vertical direction of the alcohol meter. i and V j Y i and Y j The corresponding alcohol content.
[0047] Optionally, the S15-1 includes:
[0048] According to the preset formula 3, the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the pixel coordinate system is obtained;
[0049] The formula three is:
[0050] ;
[0051] Among them, Y w is the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the pixel coordinate system, h w is the pixel level height of the solution in the pixel coordinate system, I w is the pixel position of the center of the counterweight in the vertical direction in the pixel coordinate system, l m The pixel length of the alcohol meter in the pixel coordinate system.
[0052] In a second aspect, an embodiment of the present invention provides an online alcohol content measurement device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the online alcohol content measurement method.
[0053] (III) Beneficial effects
[0054] The beneficial effects of the present invention are as follows: the present invention's alcohol content online measurement method uses the relative position of the converted liquid level on the alcohol meter to estimate the current alcohol content. Compared with the prior art, it can automatically detect the alcohol content of the solution in real time during the wine picking process without manual cooperation. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 This is a flow chart of an online alcohol content measurement method according to Example 1 of the present invention;
[0056] Figure 2 This is a structural diagram of an online alcohol content measurement method according to Example 2 of the present invention;
[0057] Figure 3 Schematic diagram of the structure of an online alcohol content measuring device according to Example 2 of the present invention. DETAILED DESCRIPTION
[0058] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below through specific implementation modes in conjunction with the accompanying drawings.
[0059] An online alcohol content measurement method proposed in an embodiment of the present invention uses the relative position of the converted liquid level on the alcohol meter to estimate the current alcohol content. Compared with the prior art, it can automatically detect the alcohol content of the solution in real time during the wine picking process without manual cooperation.
[0060] In order to better understand the above technical solution, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a clearer and more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0061] Embodiment 1
[0062] This embodiment provides an online alcohol content measurement method. Figure 1 As shown, including:
[0063] S01. Fix the alcohol meter and the alcohol container, adjust the image acquisition device so that the alcohol container always remains vertical in the original image acquired by the image acquisition device; then calibrate the parameters of the image acquisition device and convert the world coordinate system to the image coordinate system. Generally, the image acquisition device is a black and white camera, and the alcohol meter is vertically set inside a transparent alcohol container (the alcohol meter can float up and down based on the solubility of the alcohol solution). Establish a mapping relationship between the pixel coordinate system and the world coordinate system to facilitate the subsequent parameter conversion.
[0064] S02, based on the relative position of any scale of the alcohol meter pre-set in the world coordinate system on the alcohol meter, establish a mapping table in which each relative position of the scale on the alcohol meter has a one-to-one correspondence between an alcohol content and the position. The mapping table is:
[0065] ;
[0066] Among them, Y s is the relative position of any alcohol meter scale in the vertical direction of the alcohol meter, V s is the alcohol content corresponding to the scale, Y smin , Y s1 …, Y smax are the relative positions of the scales from small to large on the vertical direction of the alcohol meter, V smin , V s1 , …, V smax Y smin , Y s1 , …, Y smax The corresponding alcohol content.
[0067] The corresponding relationship between the relative position of the scale on the alcohol meter and the alcohol content is established in advance to facilitate direct calling later.
[0068] S11. Acquire a first original image through a preset image acquisition device.
[0069] S12. Binarize the first original image to generate a first process image in which the alcohol meter counterweight position is 1 and the other positions are 0, perform morphological filtering on the first process image, and obtain the contour information of the alcohol meter counterweight in the first process image after morphological filtering based on the contour search algorithm; obtain the minimum circumscribed rectangle of the alcohol meter counterweight based on the above contour information; finally, obtain the pixel position of the center of the minimum circumscribed rectangle in the vertical direction of the pixel coordinate system based on the pixel position of the minimum circumscribed rectangle of the counterweight in the pixel coordinate system, that is, the pixel position of the center of the counterweight in the vertical direction of the pixel coordinate system.
[0070] S13, according to the pre-calibrated mapping relationship between the pixel coordinate system and the world coordinate system and the pre-set actual length of the alcohol meter in the world coordinate system, the pixel length of the alcohol meter in the pixel coordinate system is obtained. The mapping relationship between the pixel coordinate system and the world coordinate system is directly used to transform the relevant parameters.
[0071] S14, using a pre-set solution pixel height detection method to obtain the pixel liquid level height of the solution in the pixel coordinate system; wherein the solution pixel height detection method generally includes visual detection or distance measurement tool detection (ultrasonic distance measurement, infrared distance measurement). Specifically:
[0072] When using visual detection, after Gaussian filtering and edge detection of the original image, edge connection of the edge map is performed to connect the broken edges into complete edge lines. According to the contrast between the liquid and the background, the upper and lower edges of the liquid are determined by analyzing the edge information in the image, thereby calculating the pixel liquid level height of the solution in the pixel coordinate system;
[0073] When a distance measuring tool is used for detection, the distance measuring tool is pre-set at a preset position above the alcohol container, and the actual liquid level height of the solution in the world coordinate system is obtained by formula 1 according to the actual distance of the alcohol container in the preset world coordinate system, the actual distance from the distance measuring device to the alcohol container in the vertical direction, and the actual distance from the distance measuring device to the liquid surface of the solution in the vertical direction measured by the distance measuring device;
[0074] Obtaining the pixel liquid level height of the solution in the pixel coordinate system according to the actual liquid level height of the solution in the world coordinate system and the pre-calibrated mapping relationship between the pixel coordinate system and the world coordinate system;
[0075] The formula 1 is:
[0076] ;
[0077] Among them, h w is the actual liquid level of the solution in the world coordinate system, Hw is the actual height of the alcohol container in the world coordinate system, X w is the actual distance from the distance measuring device to the alcohol container in the vertical direction in the world coordinate system, d w It is the actual distance from the distance measuring device to the liquid surface of the solution measured by the distance measuring device in the world coordinate system.
[0078] S15. According to the pixel liquid level height of the solution in the pixel coordinate system, the pixel length of the alcohol meter in the pixel coordinate system and the pixel position of the center of the counterweight in the vertical direction in the pixel coordinate system, the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the pixel coordinate system is obtained by formula 3, and the mapping relationship between the pixel coordinate system and the world coordinate system is used to convert it into the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system; formula 3 is:
[0079] ;
[0080] Among them, Y w is the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the pixel coordinate system, h w is the pixel level height of the solution in the pixel coordinate system, I w is the pixel position of the center of the counterweight in the vertical direction in the pixel coordinate system, l m The pixel length of the alcohol meter in the pixel coordinate system.
[0081] Traversing the mapping table, determining whether there is a scale in the mapping table that is the same as the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system;
[0082] If it exists, the alcohol content corresponding to the same scale as the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system is used as the alcohol content of the current solution;
[0083] If it does not exist, traverse the mapping table to obtain the relative positions of the two scales closest to the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system, and obtain the alcohol content of the current solution according to the preset formula 2;
[0084] The formula 2 is:
[0085] ;
[0086] Among them, V c is the alcohol content of the current solution, Y c is the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system, Y i and Y jV is the relative position of the two scales in the mapping table that are closest to the relative position of the liquid level of the solution in the world coordinate system in the vertical direction of the alcohol meter. i and V j Y i and Y j The corresponding alcohol content.
[0087] The present embodiment provides an online alcohol content measurement method, which estimates the current alcohol content by converting the relative position of the liquid level on the alcohol meter, rather than directly reading the current alcohol content by reading the alcohol meter scale. This realizes real-time and automatic detection of the alcohol content of the solution during the wine picking process without manual cooperation and without considering the error caused by reading the alcohol meter scale, making the wine picking intelligent and improving the efficiency and accuracy of the wine picking, thereby improving the quality of the liquor.
[0088] Embodiment 2
[0089] This embodiment provides an online alcohol content measurement method, the structure of which is as follows: Figure 2 As shown, the method is applied to an online alcohol content measurement device, which provides a method for real-time measurement of alcohol content during wine picking. The online alcohol content measurement device includes: a black and white camera (image acquisition device), an alcohol container and an alcohol meter; wherein the alcohol container, such as Figure 3 As shown, it includes a first chamber provided with a water inlet and a water outlet and a second chamber provided with an alcohol meter, the first chamber and the second chamber are separated by a baffle, and the inner wall and the outer wall of the alcohol container are both transparent; the alcohol meter includes a scale and a counterweight, wherein the scale has uneven graduations and the counterweight contains black iron sand to ensure that the image taken by the black and white camera is binarized or color extracted to obtain an image of the counterweight.
[0090] Record the relative position of the scale marks in the vertical direction of the alcohol meter and create a mapping table:
[0091] ;
[0092] Record the relative position Y of the center of the counterweight in the vertical direction in the world coordinate system w .
[0093] Fix the black and white camera, alcohol meter and alcohol container so that the alcohol meter online measuring device is vertical in the camera screen, perform camera calibration, convert the world coordinate system to the pixel coordinate system, and obtain the pixel length l of the alcohol meter in the pixel coordinate system m .
[0094] Since the alcohol meter counterweight contains black iron sand, the color of the counterweight is obviously different from the background environment, so the position of the counterweight can be located by color characteristics. The process is as follows:
[0095] The original image of the online alcohol meter measuring device is captured when it is running. After the original image is binarized, morphological filtering is performed and the contour search algorithm is used to search for the contour with the largest area to obtain the pixel position of the center of the minimum circumscribed rectangle in the vertical direction in the pixel coordinate system, that is, the pixel position I of the center of the counterweight in the vertical direction in the pixel coordinate system. w .
[0096] Measure the liquid level in the alcohol container by any method, such as visual detection or distance measurement tool detection (ultrasonic distance measurement, infrared distance measurement), as follows:
[0097] During visual inspection, after Gaussian filtering and edge detection of the original image, edge connection of the edge map is performed to connect the broken edges into complete edge lines. According to the contrast between the liquid and the background, the upper and lower edges of the liquid are determined by analyzing the edge information in the image, thereby obtaining the pixel liquid level height of the solution in the pixel coordinate system.
[0098] When the distance measuring tool is used for detection, the alcohol content online measuring device further includes a distance measuring device arranged above the alcohol container in the vertical direction, and according to the actual distance of the alcohol container in the preset world coordinate system, the actual distance from the distance measuring device to the alcohol container in the vertical direction, and the actual distance from the distance measuring device to the liquid surface of the solution in the vertical direction measured by the distance measuring device, the actual liquid level height of the solution in the world coordinate system is obtained by formula 1;
[0099] Obtaining the pixel liquid level height of the solution in the pixel coordinate system according to the actual liquid level height of the solution in the world coordinate system and the pre-calibrated mapping relationship between the pixel coordinate system and the world coordinate system;
[0100] The formula 1 is:
[0101] ;
[0102] Among them, h w is the actual liquid level of the solution in the world coordinate system, H w is the actual height of the alcohol container in the world coordinate system, X w is the actual distance from the distance measuring device to the alcohol container in the vertical direction in the world coordinate system, d w It is the actual distance from the distance measuring device to the liquid surface of the solution measured by the distance measuring device in the world coordinate system.
[0103] The relative position of the solution level in the vertical direction of the alcohol meter in the pixel coordinate system , where Y w is the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the pixel coordinate system, h w is the pixel level height of the solution in the pixel coordinate system, I wis the pixel position of the center of the counterweight in the vertical direction in the pixel coordinate system, l m is the pixel length of the alcohol meter in the pixel coordinate system, and according to the mapping relationship between the pixel coordinate system and the world coordinate system, it is converted into the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system.
[0104] Traversing the mapping table, and determining whether there is a scale in the mapping table that is the same as the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system;
[0105] If it exists, the alcohol content corresponding to the same scale as the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system is used as the alcohol content of the current solution;
[0106] If it does not exist, then in Y s Traverse the list to find the two values Y with the smallest relative position difference with the liquid level of the solution in the world coordinate system in the vertical direction of the alcohol meter i and Y j , then look for Y in the mapping table i and Y j Corresponding alcohol content V i and V j , obtain the alcohol content of the current solution according to the preset formula 2;
[0107] The formula 2 is:
[0108] ;
[0109] Among them, V c is the alcohol content of the current solution, Y c is the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system, Y i and Y j V is the relative position of the two scales in the mapping table that are closest to the relative position of the liquid level of the solution in the world coordinate system in the vertical direction of the alcohol meter. i and V j Y i and Y j The corresponding alcohol content.
[0110] Embodiment 3
[0111] This embodiment provides an online alcohol content measurement device, including a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement an online alcohol content measurement method described in Example 1 or Example 2.
[0112] The present embodiment provides an online alcohol content measurement method, which estimates the current alcohol content by converting the relative position of the liquid level on the alcohol meter, rather than directly reading the current alcohol content by reading the alcohol meter scale. This realizes real-time and automatic detection of the alcohol content of the solution during the wine picking process without manual cooperation and without considering the error caused by reading the alcohol meter scale, making the wine picking intelligent and improving the efficiency and accuracy of the wine picking, thereby improving the quality of the liquor.
[0113] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0114] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like 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 an indirect connection through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0115] In the present invention, unless otherwise clearly specified and limited, when a first feature is “on” or “below” a second feature, it may be that the first and second features are in direct contact, or that the first and second features are in indirect contact through an intermediate medium. Moreover, when a first feature is “above”, “above” or “above” a second feature, it may be that the first feature is directly above or obliquely above the second feature, or it may simply mean that the first feature is higher in level than the second feature. When a first feature is “below”, “below” or “below” a second feature, it may be that the first feature is directly below or obliquely below the second feature, or it may simply mean that the first feature is lower in level than the second feature.
[0116] In the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0117] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may alter, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A method for online measurement of alcohol content, characterized in that: The method is applied to real-time detection of the alcohol content of a solution during wine picking, and the method comprises: S11. Acquire a first original image using a pre-set image acquisition device, wherein the first original image includes a transparent alcohol container and an alcohol meter disposed inside the alcohol container; the color of the alcohol meter counterweight is significantly different from the background environment; S12. Acquire contour information of the counterweight of the alcohol meter in the first original image according to a preset contour search algorithm, and acquire a pixel position of the center of the counterweight in a vertical direction in a pixel coordinate system according to the contour information; S13, obtaining the pixel length of the alcohol meter in the pixel coordinate system according to a pre-calibrated mapping relationship between the pixel coordinate system and the world coordinate system and a preset actual length of the alcohol meter in the world coordinate system; S14, obtaining the pixel liquid level height of the solution in the pixel coordinate system according to a preset solution pixel height detection method; S15-1. Obtaining the relative position of the liquid level of the solution in the vertical direction of the alcoholmeter in the pixel coordinate system based on the pixel liquid level height of the solution in the pixel coordinate system, the pixel length of the alcoholmeter in the pixel coordinate system, and the pixel position of the center of the counterweight in the vertical direction in the pixel coordinate system; S15-2. Obtaining the relative position of the solution level in the world coordinate system in the vertical direction of the alcohol meter based on the pre-calibrated mapping relationship between the pixel coordinate system and the world coordinate system and the relative position of the solution level in the pixel coordinate system in the vertical direction of the alcohol meter; S15-3, traversing the mapping table, and determining whether there is a scale in the mapping table that is the same as the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system; If it does not exist, traverse the mapping table to obtain the relative positions of the two scales closest to the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system, and obtain the alcohol content of the current solution according to the preset formula 2; The second formula is: ; Among them, V c is the alcohol content of the current solution, Y c Y is the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system, i and Y j V is the relative position of the two scales in the mapping table that are closest to the relative position of the liquid level of the solution in the world coordinate system in the vertical direction of the alcohol meter, i and V j Y i and Y j The corresponding alcohol content.
2. The alcohol content online measurement method according to claim 1, wherein The S11 and S12 also include: S01. Acquire a second original image through an image acquisition device, and calibrate parameters of the image acquisition device based on the second original image so that the alcohol container in the second original image is always vertical, and establish a mapping relationship between a pixel coordinate system and a world coordinate system.
3. The alcohol content online measurement method according to claim 1, wherein The S11 and S12 also include: S02. Based on the relative position of any scale mark on the alcohol meter pre-set in the world coordinate system, a mapping table is established in which each relative position of the scale mark on the alcohol meter has a one-to-one correspondence between an alcohol content and the position.
4. The method for online measuring of alcohol content according to claim 1, wherein The S12 includes: S12-1, performing binarization processing on the first original image to generate a first process image of the alcohol meter counterweight; S12-2, performing morphological filtering on the first process image, and obtaining contour information of the alcohol meter counterweight in the first process image after morphological filtering according to a preset contour search algorithm; S12-3, obtaining a minimum circumscribed rectangle of the alcohol meter counterweight according to the contour information of the alcohol meter counterweight in the first process image; S12-4. According to the pixel position of the minimum circumscribed rectangle of the counterweight in the pixel coordinate system, obtain the pixel position of the center of the minimum circumscribed rectangle in the vertical direction of the pixel coordinate system, that is, the pixel position of the center of the counterweight in the vertical direction of the pixel coordinate system.
5. The method for online measuring of alcohol content according to claim 1, wherein The S14 includes: Performing Gaussian filtering and edge detection on the first original image to obtain a second process image; The solution in the second process image has a complete upper edge and a complete lower edge; According to the upper edge and the lower edge of the solution in the second process image, the pixel liquid level height of the solution in the pixel coordinate system is obtained.
6. The method for online measuring of alcohol content according to claim 1, wherein The S14 includes: The actual liquid level of the solution in the world coordinate system is obtained by formula 1 based on the actual distance of the alcohol container in the preset world coordinate system, the actual distance in the vertical direction from the distance measuring device to the alcohol container, and the actual distance in the vertical direction from the distance measuring device to the solution surface measured by the distance measuring device; Obtaining the pixel level height of the solution in the pixel coordinate system according to the actual liquid level height of the solution in the world coordinate system and the pre-calibrated mapping relationship between the pixel coordinate system and the world coordinate system; The formula 1 is: ; Among them, h w is the actual liquid level of the solution in the world coordinate system, H w is the actual height of the alcohol container in the world coordinate system, X w is the actual distance from the distance measuring device to the alcohol container in the vertical direction in the world coordinate system, d w It is the actual distance from the distance measuring device to the solution surface measured by the distance measuring device in the world coordinate system.
7. The method for online measuring of alcohol content according to claim 1, wherein Said S15-3 also includes: If it exists, the alcohol content corresponding to the same scale as the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the world coordinate system is used as the alcohol content of the current solution; The mapping table is: ; Among them, Y s is the relative position of any alcohol meter scale in the vertical direction of the alcohol meter, V s is the alcohol content corresponding to the scale, Y smin , Y s1 ,…,Y smax V is the relative position of the alcohol meter scale in the vertical direction after the scales are arranged from small to large. smin , V s1 ,…,V smax Y smin , Y s1 ,…,Y smax The corresponding alcohol content.
8. The method for online measuring alcohol content according to claim 7, wherein: The S15-1 includes: According to the preset formula 3, the relative position of the liquid level of the solution in the vertical direction of the alcohol meter in the pixel coordinate system is obtained; The formula three is: ; Among them, Y w is the relative position of the solution level in the vertical direction of the alcohol meter in the pixel coordinate system, h w is the pixel level height of the solution in the pixel coordinate system, I w is the pixel position of the center of the counterweight in the vertical direction in the pixel coordinate system, l m The pixel length of the alcohol meter in the pixel coordinate system.
9. An online alcohol content measuring device comprising a memory, a processor, and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the online alcohol content measurement method according to any one of claims 1 to 8.
