A method for measuring the volume of distiller's grains, a computing device and a storage medium

The non-contact laser scanner is used to obtain the point cloud data of distiller's grains, and perform downsampling and integral calculation, which solves the accuracy and automation problems of distiller's grain volume measurement in the existing technology, improves the intelligence level of brewing equipment, and ensures the wine yield and product quality. quality.

CN115183668BActive Publication Date: 2024-10-15FUDAN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210461719.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-28
Publication Date
2024-10-15
Estimated Expiration
2042-04-28

AI Technical Summary

Technical Problem

The existing distiller's grain volume measurement method is based on mass or volume distribution of grains, which has the problem of not considering the moisture content and relying on manpower, which affects the wine yield and product quality.

Method used

Using a non-contact measurement method, point cloud data is obtained through a laser scanner, and downsampling, point cloud segmentation, coordinate transformation and integral calculation are performed to accurately measure the volume of distiller's grains.

Benefits of technology

It achieves high-precision and automated measurement of the volume of distiller's grains, improves the intelligence level of brewing equipment, and ensures wine yield and product quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115183668B_ABST
    Figure CN115183668B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for measuring the volume of wine lees. In the method, firstly, first point cloud data of the wine lees surface and second point cloud data of the wine lees container are collected; then, the first point cloud data and the second point cloud data are downsampled to obtain first sampling data and second sampling data respectively; then, the second sampling data is segmented based on a region growing algorithm to obtain third point cloud data of the bottom of the wine lees container; then, the minimum bounding box of the third point cloud data is calculated to obtain a transformation matrix; the first sampling data can be transformed based on the transformation matrix to obtain third sampling data; the second sampling data can be transformed based on the transformation matrix to obtain fourth sampling data; finally, the volume of the wine lees is calculated based on the integration of the third sampling data and the fourth sampling data in a coordinate system parallel to the bottom of the container. The solution can measure the volume of wine lees in real time during the production process and improve the accuracy of volume measurement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automated measurement technology, and in particular to a method for measuring the volume of distiller's grains, a computing device and a storage medium. Background Art

[0002] Wine lees are the residues left after brewing grains such as sorghum, rice, and wheat. In the actual brewing production process, on the one hand, wine lees volume measurement can provide data support for the recycling of wine lees resources. On the other hand, the amount of wine lees used is directly related to the speed of fermentation. If the amount of wine lees used is small, the fermentation temperature will be fierce, and more acid will be produced in the later stage, the fermentation will be slow, and there will be more residual starch, which will affect the wine yield. The amount of wine lees used is also related to the production of flavor components in the wine, which affects the quality of the product. The existing wine lees blending methods are: first, the wine lees are weighed, and then the wine lees are blended by calculating the proportion of grain lees. This method does not take into account that the moisture content also accounts for a part of the weight of the wine lees, resulting in too small a proportion of grain lees, which cannot completely fill the distiller, affecting the wine yield; the second is based on volume lees blending, but this method relies on the sensory cognition and experience accumulation of the staff, and requires a large amount of manpower, which is difficult to match with intelligent brewing equipment.

[0003] Therefore, an intelligent method for measuring the volume of distiller's grains is developed, which can automatically measure the volume of distiller's grains, so that the volume ratio of distiller's grains and grains can be set based on the volume of distiller's grains, thereby achieving quantitative supply of brewed mash to solve the problems existing in the above-mentioned prior art. Summary of the invention

[0004] In view of the above problems, the present invention is proposed to provide a method for measuring the volume of lees, a computing device and a storage medium that overcome the above problems or at least partially solve the above problems.

[0005] According to one aspect of the present invention, a method for measuring the volume of wine lees is provided, in which first, first point cloud data of the wine lees surface and second point cloud data of the wine lees container are collected; then, the first point cloud data is downsampled to obtain first sampling data, and the second point cloud data is downsampled to obtain second sampling data; then, the second sampling data is point cloud segmented based on a region growing algorithm to obtain third point cloud data of the bottom of the wine lees container; then, the minimum bounding box of the third point cloud data is calculated to obtain a transformation matrix; the first sampling data is coordinate transformed based on the transformation matrix to obtain third sampling data; the second sampling data is coordinate transformed based on the transformation matrix to obtain fourth sampling data; finally, the volume of the wine lees is calculated based on the integration of the third sampling data and the fourth sampling data in a coordinate system parallel to the bottom of the container.

[0006] This solution adopts a non-contact measurement method to collect point cloud data in real time, and performs downsampling, point cloud segmentation, coordinate transformation and other processing on the point cloud data to make the calculation of the lees volume more accurate.

[0007] Optionally, a laser scanner may be used to obtain the first point cloud data and the second point cloud data in a pixel coordinate system; then, based on the coordinate transformation relationship between the world coordinate system and the pixel coordinate system, the calibration parameters of the laser scanner are determined, and the coordinate transformation relationship is:

[0008]

[0009] in Represents the coordinates of the target point in the pixel coordinate system, Z c is the scale factor, d x and d y Represents the physical size of each pixel in the x-axis and y-axis directions, u o 、v o Respectively represent the number of horizontal pixels and vertical pixels that differ between the center pixel coordinates and the origin pixel coordinates, f represents the focal length of the camera in the laser scanner, and R and T represent the rotation matrix and translation matrix of the camera relative to the world coordinate system. Finally, based on the calibration parameters and the projection matrix from the world coordinate system to the pixel coordinate system, the first point cloud data and the second point cloud data in the pixel coordinate system are converted into the first point cloud data and the second point cloud data in the world coordinate system. In this way, the two-dimensional coordinates in the pixel coordinate system obtained by the laser scanner can be converted into three-dimensional coordinates in the world coordinate system, thereby obtaining three-dimensional point cloud data.

[0010] Optionally, the first point cloud data can be downsampled based on the following steps: first, the minimum enclosing cube of the first point cloud data is calculated; then, according to a preset resolution, the minimum enclosing cube of the first point cloud data is divided into multiple first voxels; then, based on the coordinates of the midpoint of each first voxel, the center of gravity of each first voxel is calculated; finally, the center of gravity of each first voxel replaces the point cloud data in the first voxel to obtain first sampling data.

[0011] Optionally, the second point cloud data can be downsampled based on the following steps: first, the minimum enclosing cube of the second point cloud data is calculated; then, according to a preset resolution, the minimum enclosing cube of the second point cloud data is divided into multiple second voxels; then, based on the coordinates of the midpoint of each second voxel, the center of gravity of each second voxel is calculated; finally, the point cloud data in each second voxel is replaced by the center of gravity of the second voxel to obtain second sampling data.

[0012] Downsampling the original point cloud data can speed up point cloud processing and achieve real-time measurement.

[0013] Optionally, a segmentation algorithm based on region growing may include: S1, calculating the curvature value and normal of each point in the second sampling data; S2, sorting the points in the second sampling data based on the curvature value, and taking the point with the smallest curvature value as the initial seed point; S3, calculating the angle between the normal of the initial seed point and the normal of each adjacent point within a predetermined range of the initial seed point, and when the angle is less than an angle threshold and the curvature value of the adjacent point is less than a difference threshold, adding the corresponding adjacent point to the seed set; S4, repeating S3 with the corresponding adjacent point as a new seed point until no point that meets the conditions is used as a seed point, and the region growing ends to obtain the third point cloud data of the bottom of the segmented container.

[0014] The purpose of point cloud segmentation is to obtain the point cloud at the bottom of the container, so as to obtain the minimum bounding box based on the point cloud at the bottom of the container and thus obtain the transformation matrix.

[0015] Optionally, a PCA principal component analysis method may be used to obtain three main directions of the third point cloud data; then, based on the main directions and the centroid of the third point cloud data, a minimum bounding box of the third point cloud data is established to obtain a transformation matrix.

[0016] Optionally, the three main directions of the third point cloud data can be obtained by the following steps: first, obtain the center of mass of the third point cloud data, and calculate the covariance between each point in the third point cloud data and the center of mass to obtain the covariance matrix; then, calculate the eigenvalues ​​and eigenvectors of the covariance matrix, and use the eigenvectors as the main directions; finally, sort the eigenvalues ​​in descending order, and use the eigenvectors corresponding to the first three eigenvalues ​​as the three main directions of the third point cloud data.

[0017] The three main directions of the third point cloud data coincide with the coordinate axes in the origin coordinate system, so that the point cloud data in the original coordinate system can be transformed into the point cloud data in the origin coordinate system.

[0018] Optionally, the volume of the lees can be calculated by an integration method: the surface parallel to the inner bottom surface of the container is the yz surface, the direction perpendicular to the inner bottom surface of the container is the x-axis, the maximum and minimum values ​​in the y-axis direction and the maximum and minimum values ​​in the z-axis direction are determined based on the fourth sampling data to obtain the integration area; the integration step is set to divide the yz surface into several small areas, and the volume of each small area along the x-axis is solved based on the third sampling data; the entire integration area is traversed to sum the volume of each small area along the x-axis to obtain the volume of the lees.

[0019] According to another aspect of the present invention, there is provided a computing device, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be suitable for being executed by the at least one processor, and the program instructions include instructions for executing the above method.

[0020] According to another aspect of the present invention, a readable storage medium storing program instructions is provided. When the program instructions are read and executed by a computing device, the computing device executes the above method.

[0021] According to the solution of the present invention, a non-contact measurement method is adopted to obtain point cloud data of the lees surface in real time, and by segmenting the regular point cloud at the bottom of the container, its minimum bounding box is solved and the transformation matrix is ​​calculated, thereby converting the original point cloud to a horizontal coordinate system. Then, an integral step is set for the transformed point cloud to solve the triple integral to calculate the volume of the point cloud object, which can improve the accuracy and efficiency of lees volume measurement.

[0022] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0024] Figure 1 A schematic diagram of an algorithm flow of a method for measuring lees volume according to an embodiment of the present invention is shown;

[0025] Figure 2 A block diagram of a computing device 200 according to an embodiment of the present invention is shown;

[0026] Figure 3 A schematic flow chart of a method 300 for measuring lees volume according to an embodiment of the present invention is shown;

[0027] Figure 4 A schematic diagram showing the relationship between coordinate systems in a binocular stereo vision model is shown;

[0028] Figure 5 The comparison of the original point cloud data before and after downsampling in the experimental scenario is shown;

[0029] Figure 6 The segmentation map of the container point cloud in the experimental scenario is shown;

[0030] Figure 7 The point cloud image of the bottom of the container in the experimental scenario is shown;

[0031] Figure 8 A schematic diagram showing the position of the container point cloud before and after the transformation. DETAILED DESCRIPTION

[0032] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0033] There are two main methods for measuring the volume of three-dimensional objects: contact and non-contact. Currently, non-contact measurement methods are widely used. Non-contact measurement methods mainly include laser method, image vision method, photoelectric diffuse reflection method and ultrasonic measurement method. One of the use scenarios of photoelectric diffuse reflection is in the yield data monitoring of combine harvesters. The height data of grains on the scraper is obtained through sensors, and then the volume of grains is calculated based on the volume model. Photoelectric diffuse reflection can only indirectly measure the volume of irregular objects. The technology of theoretical model correction is used, which will increase the uncertainty of real-time measurement and cause large random errors in the measurement results. Ultrasonic volume measurement is mainly used in forestry and canopy volume calculation of fruit trees. It has problems such as sensitivity to distance and low sampling frequency. Image vision method is used to measure the surface area and volume of agricultural products and grade agricultural products by splicing or directly processing multiple images. Image vision method is affected by light and cannot guarantee stability.

[0034] The laser method for measuring volume has long been used in the measurement of tree canopy parameters, the measurement of crop surface models, and the monitoring of combine harvester yield. By combining laser and image, a high-precision three-dimensional point cloud of the object surface can be obtained, and the volume of the object to be measured can be calculated using the three-dimensional coordinates of the point cloud. At the same time, the coordinates of the three-dimensional point cloud can be used to perform three-dimensional reconstruction to obtain a three-dimensional model of the object to be measured. Based on the advantages of the laser method for measuring volume, the present invention provides a method for measuring the volume of wine lees, which can automatically measure the volume of wine lees in actual production.

[0035] Figure 1 FIG. 2 is a schematic diagram showing an algorithm flow chart of a method for measuring the volume of lees according to an embodiment of the present invention. Figure 1As shown, the first step is to collect point cloud data. Point cloud data can be collected using binocular cameras, laser radars, RGBD cameras, SAR aperture radars, laser scanners and other devices. Each point in the point cloud data contains three-dimensional coordinate information, that is, three elements of X, Y, and Z, and can also contain color information, reflection intensity information, echo number information, etc. In an embodiment of the present invention, the original point cloud data of the upper surface of the lees and the original point cloud data of the lees container can be obtained respectively. Then, the collected original point cloud data is downsampled to obtain the downsampled lees upper surface point cloud P1 and the lees container point cloud P2. Since the point cloud data collected by the device can reach millions, if the original point cloud data is directly processed, the algorithm execution time will be greatly increased, and it is difficult to achieve real-time measurement, so it is necessary to first downsample the original point cloud data to speed up the point cloud processing.

[0036] Since the original point cloud data is an original coordinate system with the center of the laser scan as the origin, this coordinate system is not parallel to the bottom of the lees container. In order to facilitate the subsequent point cloud volume calculation, the original point cloud needs to be rotated and translated in space first, that is, the original coordinate system is converted into a coordinate system parallel to the bottom of the lees.

[0037] Therefore, it is necessary to perform point cloud segmentation on the wine lees container point cloud P2 to obtain the point cloud data of the bottom of the container. The segmentation algorithm can be any one of attribute clustering segmentation, machine learning segmentation, edge detection segmentation, region growth segmentation, etc. Then, the coordinate transformation matrix T can be obtained by calculating the minimum bounding box of the bottom point cloud of the wine lees container.

[0038] Then, based on the obtained transformation matrix T, the original coordinate system can be transformed into a coordinate system parallel to the bottom of the lees. That is, the point cloud P3 of the lees upper surface after the coordinate transformation is obtained: P3 = T*P1, and the point cloud P4 of the lees container after the coordinate transformation is obtained: P4 = T*P2. After the above process, both point cloud data have been converted to a coordinate system parallel to the bottom of the container. Finally, the volume of the lees is calculated using the integral method.

[0039] The above method for measuring the volume of lees can be performed in a computing device. Figure 2 FIG. 2 shows a block diagram of a computing device 200 according to an embodiment of the present invention. In an embodiment of the present invention, the computing device 200 may be a main controller MCU of an automobile. Figure 2 As shown, in a basic configuration 202, computing device 200 typically includes a system memory 206 and one or more processors 204. A memory bus 208 may be used for communication between processor 204 and system memory 206.

[0040] Depending on the desired configuration, the processor 204 can be any type of processor, including but not limited to: a microprocessor (μP), a microcontroller (μC), a digital information processor (DSP), or any combination thereof. The processor 204 can include one or more levels of cache such as a primary cache 210 and a secondary cache 212, a processor core 214, and registers 216. An example processor core 214 can include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An example memory controller 218 can be used with the processor 204, or in some implementations, the memory controller 218 can be an internal part of the processor 204.

[0041] Depending on the desired configuration, the system memory 206 can be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.) or any combination thereof. The physical memory in the computing device usually refers to the volatile memory RAM, and the data in the disk needs to be loaded into the physical memory before it can be read by the processor 204. The system memory 206 may include an operating system 220, one or more applications 222, and program data 224. The application 222 is actually a plurality of program instructions, which are used to instruct the processor 204 to perform corresponding operations. In some embodiments, in some embodiments, the application 222 may be arranged to execute instructions on the operating system by one or more processors 204 using the program data 224. The operating system 220 may be, for example, Linux, Windows, etc., which includes program instructions for processing basic system services and performing tasks that depend on hardware. The application 222 includes program instructions for implementing various user-desired functions, and the application 222 may be, for example, a browser, instant messaging software, a software development tool (such as an integrated development environment IDE, a compiler, etc.), etc., but is not limited thereto. When the application 222 is installed into the computing device 200 , a driver module may be added to the operating system 220 .

[0042] When the computing device 200 starts running, the processor 204 reads and executes the program instructions of the operating system 220 from the memory 206. The application 222 runs on the operating system 220 and uses the interfaces provided by the operating system 220 and the underlying hardware to implement various functions desired by the user. When the user starts the application 222, the application 222 is loaded into the memory 206, and the processor 204 reads and executes the program instructions of the application 222 from the memory 206.

[0043] The computing device 200 also includes a storage device 232 including a removable storage 236 and a non-removable storage 238 , both of which are connected to the storage interface bus 234 .

[0044] The computing device 200 may also include an interface bus 240 that facilitates communication from various interface devices (e.g., output devices 242, peripheral interfaces 244, and communication devices 246) to the basic configuration 202 via the bus / interface controller 230. Example output devices 242 include a graphics processing unit 248 and an audio processing unit 250. They can be configured to facilitate communication with various external devices such as a display or speakers via one or more A / V ports 252. Example peripheral interfaces 244 may include a serial interface controller 254 and a parallel interface controller 256, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 258. Example communication devices 246 may include a network controller 260, which may be arranged to facilitate communication with one or more other computing devices 262 via a network communication link via one or more communication ports 264.

[0045] A network communication link can be an example of a communication medium. Communication media can generally be embodied as computer-readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A "modulated data signal" can be a signal in which one or more of its data sets or its changes can be carried out in a manner that encodes information in the signal. As non-limiting examples, communication media can include wired media such as a wired network or a dedicated line network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer-readable medium used herein can include both storage media and communication media.

[0046] The computing device 200 also includes a storage interface bus 234 connected to the bus / interface controller 230. The storage interface bus 234 is connected to a storage device 232, which is suitable for data storage. Example storage devices 232 may include removable storage 236 (such as CD, DVD, USB flash drive, removable hard disk, etc.) and non-removable storage 238 (such as hard disk drive HDD, etc.).

[0047] In the computing device 200 according to the present invention, the application 222 includes a plurality of program instructions for executing the method 300. Next, each process of the method for measuring the volume of lees is described in detail. Figure 3 A flow chart of a method 300 for measuring the volume of wine lees according to an embodiment of the present invention is shown. The method 300 begins with step S310, collecting first point cloud data of the wine lees surface and second point cloud data of the wine lees container. The point cloud data is a set of vectors in a three-dimensional coordinate system, and each point may contain RGB color information or reflection intensity information in addition to the three-dimensional coordinates. Usually, a color image of a three-dimensional object is obtained by a camera, and then the pixel color information of the corresponding position is assigned to the corresponding point. The acquisition of intensity information is the echo intensity collected by the laser scanner receiving device, and the echo intensity is related to the material, roughness, incident angle, emission energy of the scanner, laser wavelength, etc. of the surface of the target object. The three-dimensional laser scanner can provide three-dimensional point cloud data of the surface of an object based on a binocular stereo vision model. Through the images collected by the left and right cameras, a high-resolution binocular image and a corresponding depth map can be output in real time at a high frame rate. Figure 4 Figure 2 shows a schematic diagram of the relationship between coordinate systems in the binocular stereo vision model. Figure 4 As shown, the world coordinate system is X w Y w Z w , the origin is O w , Xw, Yw, and Zw are mutually perpendicular, and the coordinates of the target point P in the world coordinate system are P(x w ,y w ,z w ), represents the coordinates of the object in the real world. The camera coordinate system takes the optical center of the camera as the origin, and the left camera coordinate system in the binocular camera is X l Y l Z l , the right camera coordinate system is X r Y r Z r , origin O l , O r Represents the optical center of the left and right cameras, Z l , Z r are the optical axes of the left and right cameras respectively. With the intersection O of the optical axes of the left and right cameras and their respective imaging planes as the origin of the imaging plane, the image plane coordinate system is established. The coordinates of point P in the image plane coordinate system can be expressed as p1(x l ,y l ),p2(x r ,y r The pixel coordinate system is a two-dimensional coordinate system with the upper left corner of the imaging plane of the left and right cameras as the origin. The u and v directions are parallel to the x and y directions respectively. The unit is in pixels. The coordinates of point p in the pixel coordinate system can be expressed as p1'(u l ,v l ),p2'(u r ,vr ). According to the above coordinate system relationship, the transformation formula from the world coordinate system to the pixel coordinate system is:

[0048]

[0049] In the formula To transform the world coordinate system to the camera coordinate system, To transform the camera coordinate system to the image plane coordinate system, To convert the image plane coordinate system to the pixel coordinate system, Represents the coordinates of the target point in the pixel coordinate system, Represents the coordinates of the target point in the world coordinate system, Z c is the scale factor, d x and d y Represents the physical size of each pixel in the x-axis and y-axis directions, f represents the focal length of the camera, u o 、v o They represent the horizontal and vertical pixel numbers that differ between the center pixel coordinates of the image and the pixel coordinates of the image origin, respectively. R and T represent the rotation matrix and translation matrix of the camera relative to the world coordinate system, respectively.

[0050] Among them, d x d y 、u o 、v o It is only related to the structure of the camera, which is called the camera's internal parameters; R and T represent the rotation matrix and translation matrix of the camera relative to the world coordinate system, respectively, which are called the camera's external parameters. Camera calibration is the process of determining the internal and external parameters. Opencv can be used for camera calibration. The external parameter obtained is the rotation vector. The rotation vector and the rotation matrix can be converted through the Rodrigues formula transformation. After determining the calibration parameters of the two cameras, the coordinates of point p in the pixel coordinate system of the left camera and the right camera are p1(u l ,v l ), p2(u r ,v r ).

[0051]

[0052] M l 、M r are the projection matrices from the world coordinate system to the left camera and the right camera respectively. Based on the projection matrices from the world coordinate system to the left and right cameras and the least squares method, the coordinates x of the spatial point P in the world coordinate system can be obtained. w ,y w ,z wThe collection of these spatial points is the original 3D point cloud data.

[0053] Then, step S320 is executed to downsample the first point cloud data to obtain first sampling data, and downsample the second point cloud data to obtain second sampling data.

[0054] Since the point cloud data collected by laser scanners can reach millions, for example, the Photoneo depth camera can obtain 3 million points in one observation (1 frame). On the one hand, if the collected point cloud data is directly processed, it will greatly increase the algorithm execution time and it will be difficult to achieve real-time measurement. Therefore, it is necessary to downsample the collected point cloud data first; on the other hand, in order to reduce the calculation errors caused by uneven point density distribution, the density of the point cloud needs to be evenly distributed in each spatial coordinate, so the point cloud data can be downsampled.

[0055] Point cloud downsampling is to grid the three-dimensional space, also known as voxelization. After gridding, each grid is called a voxel. The basic idea of ​​downsampling is to check each voxel. If there is a point in the voxel, a point is used to replace the point set in the voxel. The coordinates of this point can be the center coordinates of the voxel or the expectation of the point set coordinates. In each voxel, all points can be approximated by the center of gravity. This method can reduce the number of point clouds, reduce computational complexity, and maintain the shape characteristics of point clouds. It plays an important role in improving registration, surface reconstruction, shape recognition, etc. Specifically, first calculate a cube that can just wrap the point cloud data, that is, obtain the maximum value x on the X, Y, and Z coordinate axes. max ,y max 、z max and the minimum value x min ,y min 、z min Then, the side length l of the minimum volume surrounding the point cloud data is calculated based on the maximum and minimum values ​​on each coordinate axis. x , l y , l z :

[0056]

[0057] Thus, a cube that can just enclose the point cloud data is determined. Then, the cube is divided into different small cubes according to the set resolution. Assuming that the voxel grid size v is given, the X, Y, and Z coordinate axes can be divided into L, M, and N parts, and a total of L*M*N voxel grids are generated:

[0058]

[0059] All voxel grids are numbered as (i, j, k):

[0060]

[0061] Each data point is divided into its own voxel grid. Next, for each point in the small cube, their centroid is calculated and recorded as c i,j,k :

[0062]

[0063] Where n is the number of data points in the voxel grid, p i As data points, the coordinates of the centroid are used to approximate several points in the cube. When the centroid does not exist, all data in the voxel are replaced by the point cloud data closest to the centroid in terms of the voxel internal distance. After the above steps, the point cloud data is downsampled. The voxel_grid function of the PCL (point cloud library) point cloud library can be used to perform voxel filtering on the input point cloud data to complete the downsampling of the point cloud data.

[0064] Then, step S330 is executed to perform region growing segmentation on the second sampling data to obtain the third point cloud data of the bottom of the wine lees container. Since the bottom of the wine lees is a regular object such as a rectangle, square, or circle, the transformation matrix can be obtained by solving its minimum bounding box, but the inner bottom data is connected to the entire container, so it should be segmented first. The segmentation algorithm based on region growing is based on the comparison of the angles between the point normals, attempting to merge adjacent points that meet the smoothness constraint and output them in the form of a cluster of point sets. Each cluster of point sets is considered to belong to the same plane. First, find a seed point as the starting point of growth for each area to be segmented. Usually, the point with the smallest curvature value is selected as the seed point to start regional growth; then the points in the neighborhood around the seed point that have the same or similar properties as the seed are merged into the area where the seed pixel is located. The new point continues to grow around as a seed until no more pixels that meet the conditions can be included, and a region is grown. The region growing algorithm can be implemented by the pcl::RegionGrowing class. The specific segmentation process algorithm is as follows:

[0065] 1) Input: point cloud {P}, point cloud normal vector {N}, point cloud curvature value {c}, neighbor point search method Ω(.), point cloud curvature threshold c th , point cloud angle threshold θ th

[0066] 2) Initialization: Initialize the neighbor point set to be empty: Initialize the point cloud list sorted by curvature: {A}←{1,…,|P|}.

[0067] 3) Algorithm calculation:

[0068] 1. Determine whether the point cloud list {A} is empty. If not, loop (2)-(18) continuously;

[0069] 2. Set the set of domain points that are currently smaller than the angle threshold to be empty, that is,

[0070] 3. Set the current seed point set to empty, that is

[0071] 4. Take the point cloud with the smallest curvature in the list {A}→P min ;

[0072] 5. Add it to the current seed point set {S c}←{S c}∪P min ;

[0073] 6. Add the neighbor point set {R c}←{R c}∪P min ;

[0074] 7. Delete the minimum curvature point from the list {A}←{A}\P min ;

[0075] 8. Traverse the seed point set S c ;

[0076] 9. Find neighbor points for the current seed point {B c}←Ω(S c {i});

[0077] 10. Traverse neighbor points {B c};

[0078] 11. Take out one of the neighbor points P j ←B c {j};

[0079] 12. Determine whether it is included in the list and whether the angle between it and the normal vector of the seed point is less than the threshold;

[0080] 13.P j Add the neighbor point set that meets the angle threshold, {R c}←{R c}∪P j ;

[0081] 14.P j Remove {A}←{A}\P from the list j ;

[0082] 15. If c{P j} <c th ,{S c}←{S c}∪P j ;

[0083] 16. End the loop (10);

[0084] 17. Add the point set that meets the angle threshold (i.e., the segmented class) to the set of all segmentations, i.e., {R}←{R}∪R c ;

[0085] 18. End loop (1) and return {R}. Finally, the third point cloud data of the bottom of the lees container is obtained by segmentation.

[0086] Then, step S340 is executed to calculate the minimum bounding box of the third point cloud data to obtain the transformation matrix. The PCL point cloud library can be used to solve the minimum bounding box of the third point cloud data. At the same time, the vertex coordinates and deflection angle of the bounding box need to be obtained. The calculation process of the minimum bounding box is as follows:

[0087] 1. The three main directions of the third point cloud data {P} can be obtained using the PCA principal component analysis method Get the centroid, calculate the covariance, obtain the covariance matrix C, and find the eigenvalues ​​and eigenvectors of the covariance matrix C. The eigenvector is the main direction. Assume that the input point cloud is X n*3 , subtract the mean from each row of X to get Covariance matrix Then calculate its eigenvalues ​​and eigenvectors, and take the eigenvectors corresponding to the first three largest eigenvalues ​​as the main directions

[0088] 2. Using the main direction and centroid obtained, transform the input third point cloud data to the origin, and the main direction coincides with the direction of the coordinate system, and establish the bounding box of the third point cloud data transformed to the origin. At the same time, obtain the transformation matrix T.

[0089] Then, step S350 is executed to perform matrix transformation on the first sampling data based on the transformation matrix to obtain third sampling data; and to perform matrix transformation on the second sampling data based on the transformation matrix to obtain fourth sampling data. In this way, the first sampling data in the original coordinate system is transformed into the third sampling data in the coordinate system parallel to the bottom of the container; and the third sampling data in the original coordinate system is transformed into the fourth sampling data in the coordinate system parallel to the bottom of the container.

[0090] Finally, step S360 is performed to calculate the volume of the lees based on the integration of the third sampling data and the fourth sampling data in a coordinate system parallel to the bottom of the container.

[0091] At present, the research algorithms for solving the volume of physical models based on three-dimensional point clouds are roughly as follows: Convex hull algorithm: First use the convex hull model to approximate irregular objects, then decompose the convex hull model into two upper and lower triangular mesh surfaces, and use the positive projection method to obtain the corresponding projection volume, and the difference is the required volume. This method is suitable for convex models, and the error of non-convex models is large. Triangular patch reconstruction method: After obtaining the point cloud data, the volume is obtained by using triangular patches to construct a physical model. This algorithm is greatly affected by the point cloud density, the number of generated triangular meshes, and the point accuracy, and it is easy to produce holes. Slicing method: Slice the point cloud along a certain coordinate axis, then calculate the area of ​​the upper and lower surfaces of the slice, and calculate the total volume by accumulating the slice volume. This method is affected by the thickness of the slice. The thinner the slice, the higher the calculation accuracy, but it will lead to a decrease in calculation efficiency. Integration method: The integration method is similar to the slicing method. First, the bottom surface is cut into small squares, and then the volume of the small column corresponding to the small square is accumulated to obtain the total volume.

[0092] This solution can use the integration method to calculate the volume of the lees, taking the surface parallel to the bottom surface of the container as the surface and the direction perpendicular to the bottom surface of the container as the axis, and determining the maximum and minimum values ​​in the y-axis direction and the maximum and minimum values ​​in the z-axis direction based on the fourth sampling data to obtain the integral area. Then, set the integral step Δ, divide the yz surface into several small areas, and for each area y≥y i &&y≤y i +Δ and z≥z j &&z≤z j +Δ, solve the volume v of each small area along the x-axis based on the third sampling data i,j Finally, traverse the entire integral area and sum the volume of each small area along the x-axis to obtain the volume V of the lees: V = ∑ i,j v i,j

[0093] In order to verify the measurement accuracy of this scheme, a small instrument and experimental material (sand pile) similar in appearance to those used in actual production were built in a laboratory environment to perform volume measurement. The volume measurement was mainly carried out by obtaining three-dimensional point cloud data of the dune surface through the laser method, and the experimental results were compared and analyzed.

[0094] Before the experiment begins, you can select standard fine sand as the measurement object and adjust the laser scanner to a suitable collection height. At the same time, pour the fine sand into the standard measuring container cylinder, pouring 550ml each time. Collect the point cloud of the empty container before pouring, and collect a frame of point cloud each time after pouring the fine sand. The surface shape of the sand will change randomly each time. For the same volume data, 3 frames of data can be collected for horizontal comparison. The whole process will collect six groups of point cloud data of 550ml, 1100ml, 1650ml, 2200ml, 2750ml, and 3300ml, and each group will collect 3 frames of point cloud with different sand surface shapes.

[0095] During the measurement process, the visualization of the experimental results can effectively verify whether there are errors in the intermediate process. The visualization results are analyzed separately below. Figure 5 The figure shows the comparison of the original point cloud data before and after downsampling in the experimental scenario. Figure 5 As shown in the figure, the original container point cloud and fine sand surface point cloud before downsampling are very dense, while the container point cloud and fine sand surface point cloud after downsampling retain their original features and the amount of data is greatly reduced. Figure 6 The segmentation diagram of the container point cloud is shown. It can be seen that the region growing algorithm effectively divides the container into 5 regions. By setting the height threshold as prior information, the bottom point cloud of the container can be extracted. Figure 7 A point cloud diagram of the inner bottom of the container is shown. Through the point cloud of the inner bottom of the container, a transformation matrix can be solved to transform the point cloud to a new coordinate system perpendicular to the inner bottom container. Figure 8 The schematic diagram of the position of the point cloud before and after the transformation is shown. Figure 8 As shown in the figure, the container is tilted before the transformation, and the bottom of the container is parallel to the plane after the transformation, which shows that the transformation result is valid. Next, you can set the integration step size and solve the volume of the fine sand through integration.

[0096] According to an embodiment of the present invention, the experiment is divided into six rounds, and 550ml of fine sand can be poured in each time, so they are 550ml, 1100ml, 1650ml, 2200ml, 2750ml, and 3300ml respectively. There are 3 groups of controls in each round to form a horizontal comparison. The first row of the table represents the integration step length in mm, and the volume calculation result unit is mm 3 The volume calculation results are shown in Table 1. At the same time, the relative error calculation results are shown in Table 2. The calculation method of relative error is: relative error = |measured value-true value| / true value.

[0097] Table 1 Volume measurement results in experimental scenarios

[0098]

[0099]

[0100] Table 2 Calculation results of relative measurement error in experimental scenarios

[0101]

[0102]

[0103] It can be seen from Tables 1 and 2 that the maximum relative error of the dune volume measurement in the laboratory scene is 2.18%, the minimum relative error is 0.14%, and the average relative error is 1.59%. It can be seen that the volume measurement method of this scheme can improve the accuracy of volume measurement of three-dimensional objects with no fixed shape.

[0104] It should be noted that, in addition to measuring the volume of wine lees, this solution can also measure the volume of other three-dimensional objects with no fixed shape, such as sand dunes, grain piles, etc.

[0105] Through the above scheme, a non-contact measurement method is adopted to obtain the point cloud data of the lees surface in real time, and by segmenting the regular point cloud at the bottom of the container, its minimum bounding box is solved and the transformation matrix is ​​calculated, so as to convert the original point cloud into a horizontal coordinate system. Then, the integral step is set for the transformed point cloud to solve the triple integral to calculate the volume of the point cloud object, which can improve the accuracy and efficiency of lees volume measurement.

[0106] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0107] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.

[0108] Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in the devices described in the embodiment, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or may be divided into multiple submodules.

[0109] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0110] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0111] In addition, some of the embodiments are described herein as a combination of methods or method elements that can be implemented by a processor of a computer system or by other devices that perform functions. Therefore, a processor with necessary instructions for implementing a method or method element forms a device for implementing the method or method element. In addition, the elements described herein of the device embodiment are examples of devices that are used to implement the functions performed by the elements for the purpose of implementing the invention.

[0112] As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe common objects merely indicates that different instances of similar objects are involved, and is not intended to imply that the objects so described must have a given order in time, space, order, or in any other manner.

[0113] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is illustrative and not restrictive with respect to the scope of the present invention, and the scope of the present invention is defined by the appended claims.

Claims

1. A method for measuring the volume of lees, suitable for execution in a computing device, characterized in that: The method comprises: The first point cloud data of the lees surface and the second point cloud data of the lees container are collected, which includes: using a laser scanner to obtain the first point cloud data and the second point cloud data in a pixel coordinate system; based on the coordinate transformation relationship between the world coordinate system and the pixel coordinate system, determining the calibration parameters of the laser scanner, wherein the coordinate transformation relationship is: in, is the scale factor, and Represents each pixel in Axis and Physical dimensions in the axial direction, , Respectively represent the horizontal and vertical pixel numbers that differ between the center pixel coordinates and the origin pixel coordinates. represents the focal length of the camera in the laser scanner, and Respectively represent the rotation matrix and translation matrix of the camera relative to the world coordinate system; based on the calibration parameters and the projection matrix from the world coordinate system to the pixel coordinate system, convert the first point cloud data and the second point cloud data in the pixel coordinate system into the first point cloud data and the second point cloud data in the world coordinate system respectively; The first point cloud data is downsampled to obtain first sampling data, which includes: calculating the minimum enclosing cube of the first point cloud data; dividing the minimum enclosing cube of the first point cloud data into a plurality of first voxels according to a preset resolution; calculating the center of gravity of each first voxel based on the coordinates of the midpoint of each first voxel; replacing the point cloud data in the first voxel with the center of gravity of each first voxel to obtain the first sampling data; the second point cloud data is downsampled to obtain second sampling data, which includes: calculating the minimum enclosing cube of the second point cloud data; dividing the minimum enclosing cube of the second point cloud data into a plurality of second voxels according to a preset resolution; calculating the center of gravity of each second voxel based on the coordinates of the midpoint of each second voxel; replacing the point cloud data in the second voxel with the center of gravity of each second voxel to obtain the second sampling data; Performing point cloud segmentation on the second sampling data based on a region growing algorithm to obtain third point cloud data of the bottom of the wine lees container; Calculate the minimum bounding box of the third point cloud data to obtain a transformation matrix; Performing coordinate transformation on the first sampling data based on the transformation matrix to obtain third sampling data, and performing coordinate transformation on the second sampling data based on the transformation matrix to obtain fourth sampling data; The volume of the lees is calculated based on the integration of the third sampling data and the fourth sampling data in a coordinate system parallel to the bottom of the container.

2. The method for measuring the volume of lees according to claim 1, characterized in that: The step of segmenting the second sampled data based on the region growing algorithm to obtain the third point cloud data comprises: S1, calculating the curvature value and normal line of each point in the second sampling data; S2, sorting the points in the second sampling data based on the curvature value of each point, and taking the point with the smallest curvature value as the initial seed point; S3, calculating the angle between the normal line of the initial seed point and the normal line of each adjacent point within a predetermined range of the initial seed point, and when the angle is less than the angle threshold and the curvature value of the adjacent point is less than the difference threshold, adding the corresponding adjacent point to the seed set; S4, using the corresponding adjacent points as new seed points and repeating S3 until no points satisfying the conditions are used as seed points, the region growing is terminated, and the third point cloud data of the bottom of the segmented container is obtained.

3. The method for measuring the volume of lees according to claim 1, characterized in that: The step of calculating the minimum bounding box of the third point cloud data to obtain a transformation matrix comprises: The three main directions of the third point cloud data are obtained using the PCA principal component analysis method; Based on the main direction and the center of mass of the third point cloud data, a minimum bounding box of the third point cloud data is established to obtain a transformation matrix.

4. The method for measuring the volume of lees according to claim 3, characterized in that: The step of obtaining three main directions of the third point cloud data by using the PCA principal component analysis method includes: Obtaining the centroid of the third point cloud data, and calculating the covariance between each point in the third point cloud data and the centroid to obtain a covariance matrix; Calculate the eigenvalues ​​and eigenvectors of the covariance matrix, and use the eigenvectors as the main directions; The eigenvalues ​​are sorted in descending order, and the eigenvectors corresponding to the first three eigenvalues ​​are used as the three main directions of the third point cloud data.

5. The method for measuring the volume of lees according to claim 1, characterized in that: The step of calculating the volume of the lees based on the integration of the third sampling data and the fourth sampling data in a coordinate system parallel to the bottom of the container comprises: Taking the surface parallel to the inner bottom surface of the container as the yz surface, and the direction perpendicular to the inner bottom surface of the container as the x-axis, determining the maximum value and the minimum value in the y-axis direction, and the maximum value and the minimum value in the z-axis direction based on the fourth sampling data, and obtaining the integral area; Set the integration step size, divide the yz plane into several small areas, and solve the volume of each small area along the x-axis based on the third sampling data; Traverse the entire integral area and sum the volumes of each small area along the x-axis to obtain the volume of the lees.

6. A computing device comprising: at least one processor; A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, and the program instructions include instructions for executing the method for measuring the volume of lees according to any one of claims 1 to 5.

7. A readable storage medium storing program instructions, when the program instructions are read and executed by a computing device, the computing device executes the method for measuring the volume of lees according to any one of claims 1 to 5.