Method, device and equipment for detecting position of to-be-discharged fermented grain ground cylinder and storage medium
Based on the Huber -based loss function, the processor calculates the residual values and loss values of the data point in the three -dimensional point cloud image of the ground tank, and solves the problem of the accuracy of the positioning of the group point point in the existing technology, and realizes it. Higher position detection accuracy.
Patent Information
- Application Number
- CN202411659999.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-11-20
AI Technical Summary
In the prior art, the three-dimensional point cloud image of the cylinder to be discharged contains more outliers, which affects the accuracy of the cylinder to be discharged, making it difficult to achieve accurate position determination.
Using the processor's method based on the Huber loss function, by calculating the residual value and loss value of the data points of the target point cloud image, combined with the characteristics of absolute error loss and square error loss, the target parameters are iteratively calculated to determine the quality of the fermented grains to be produced. Location.
It improves the accuracy of the position detection of the ground cylinder position, avoids the effects of departure data on the position determination, and ensure that the automatic handling equipment can accurately identify the position of the ground cylinder and perform the operation.
Smart Images

Figure CN119359794A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of position detection of a vat for producing mash, and in particular to a method, device, equipment and storage medium for position detection of a vat for producing mash. Background Art
[0002] At present, in the field of liquor brewing, there are mainly two types of liquor fermentation containers: cellars and ground tanks. Cellars are mainly used for the fermentation of strong-flavor liquor and sauce-flavor liquor. After the fermentation is completed, it is more convenient to realize the automation of the mash discharge. Ground tanks are mostly used for the fermentation of light-flavor liquor and Laobaigan-flavor liquor. Because they are buried underground and have a small internal space, the mash discharge environment is relatively complex. To realize the automation of the mash discharge from the ground tank, not only a reasonable and safe mash discharge terminal is required, but also the accurate perception of the position of the ground tank. Moreover, there are a large number of ground tanks at the mash discharge site, and it is not easy to accurately perceive the position of the ground tank to be discharged. Therefore, an efficient and accurate method of sensing the spatial position of the ground tank can greatly improve the working efficiency of the mash discharge equipment, which is conducive to the automation transformation of the liquor production process.
[0003] In the prior art, the processor fits the center point coordinates of the three-dimensional point cloud image of the jar to be discharged from the mash by the least squares method, and determines the position of the jar to be discharged from the mash according to the center point coordinates of the three-dimensional point cloud image of the jar to be discharged from the mash.
[0004] However, the three-dimensional point cloud image of the earthen jar for brewing the mash in the above method includes many outliers, which have a great influence on the accuracy of the center point coordinates in the obtained three-dimensional point cloud image of the earthen jar for brewing the mash. The accurate position of the earthen jar for brewing the mash cannot be obtained by the least squares method, which is an urgent problem to be solved. Summary of the invention
[0005] In view of this, the purpose of the present application is to provide a method, device, equipment and storage medium for detecting the position of a ground cylinder for producing mash to solve the above-mentioned problems and achieve accurate positioning of the ground cylinder for producing mash to be produced.
[0006] In a first aspect, an embodiment of the present application provides a method for detecting the position of a vat to be used for producing fermented grains, which is applied to a processor, and the method includes: The processor acquires a target point cloud image; wherein the target point cloud image is a three-dimensional point cloud image of a cross section at an nth height of a ground cylinder to be used for producing mash; The processor inputs the coordinates of the i-th data point of the target point cloud image into the residual model to obtain the residual value of the i-th data point of the target point cloud image; The processor calculates the loss value of the i-th data point of the target point cloud image based on the Huber loss function and according to the residual value of the i-th data point of the target point cloud image:
[0007] in, is the loss value of the i-th data point of the target point cloud image, is the residual value of the i-th data point of the target point cloud image, A threshold to control the smoothness of the loss function; The processor sums I data points of the target point cloud image to obtain a total loss value of the I data points of the target point cloud image; The processor calculates a target gradient according to the total loss value of I data points of the target point cloud image; wherein the target gradient is the gradient of the total loss value of I data points of the target point cloud image; The processor iterates the initial parameters of the target gradient to obtain target parameters; wherein the target parameters include the coordinates of the center of the ellipse model corresponding to the target point cloud image; The processor determines the position of the vat where the mash is to be discharged according to N target parameters.
[0008] Preferably, the step of the processor acquiring the target point cloud image comprises: The processor acquires a depth image of each ground cylinder and a color image of each ground cylinder; The processor labels the color image of each ground cylinder to obtain a target color image of each ground cylinder; The processor inputs the target color image of each ground vat into the trained neural network model, so that the neural network model outputs the mask image of the ground vat to be used for producing mash; The processor performs AND operations on pixel values of the mask image of the ground vat to be discharged and pixel values of the depth images of J ground vats in sequence to obtain J first operation results; If the j-th first operation result is 1, the processor determines the depth image of the j-th ground vat as the depth image of the ground vat to be used for producing the mash; The processor performs AND operations on the pixel values of the mask image of the ground vat to be discharged and the pixel values of the color images of the M ground vats in sequence to obtain M second operation results; If the mth second operation result is 1, the processor determines the color image of the mth ground jar as the color image of the ground jar to be used for producing the mash; The processor transforms the coordinates of the pixel points of the depth image of the jar to be discharged from the mash to obtain the three-dimensional space points corresponding to the pixel points of the depth image of the jar to be discharged from the mash; The processor fuses the three-dimensional space points corresponding to the pixel points of the depth image of the jar to be discharged from the mash with the pixel points of the color image of the jar to be discharged from the mash to obtain a three-dimensional point cloud image of the jar to be discharged from the mash; The processor cuts the three-dimensional point cloud image of the vat to be used for producing fermented grains in a horizontal direction to obtain the target point cloud image.
[0009] Preferably, the method further comprises: If the j-th first operation result is 0, the processor determines the depth image of the j-th ground vat as the depth image of the ground vat that is not to be used for producing mash.
[0010] Preferably, the method further comprises: If the m-th second operation result is 0, the processor determines the color image of the m-th ground jar as a color image of a ground jar that is not to be used for producing mash.
[0011] Preferably, the processor determines the position of the vat to be discharged from the mash according to N target parameters, comprising: The processor calculates the average value of the horizontal coordinates of the center of the ellipse model corresponding to the N target point cloud images and the average value of the vertical coordinates of the center of the ellipse model corresponding to the N target point cloud images according to the following formula:
[0012] in, is the average value of the horizontal coordinates of the center of the ellipse model corresponding to the N target point cloud images, is the average value of the ordinate of the center of the ellipse model corresponding to the N target point cloud images, is the horizontal coordinate of the center of the ellipse model corresponding to the nth target point cloud image, is the ordinate of the center of the ellipse model corresponding to the nth target point cloud image; The processor determines the coordinates of the center of the ellipse model corresponding to the N target point cloud images according to the average value of the abscissa of the center of the ellipse model corresponding to the N target point cloud images and the average value of the ordinate of the center of the ellipse model corresponding to the N target point cloud images; The processor determines the coordinates of the center of the ellipse model corresponding to the N target point cloud images as the position of the vat where the mash is to be discharged.
[0013] Preferably, the method further comprises: The processor obtains an initial depth image of each ground cylinder sent by the TOF camera; The processor filters the initial depth image of each ground cylinder through a Gaussian filter to obtain a depth image of each ground cylinder.
[0014] The method for detecting the position of the ground vat for discharging fermented grains provided in the present application brings the following beneficial effects: The present application provides a method for detecting the position of a jar to be discharged from the mash. In the method, the processor is based on the Huber loss function. When the experimental data is near more outliers, the absolute error loss calculation method is used to obtain the loss value of the i-th data point of the target point cloud image according to the residual value of the i-th data point of the target point cloud image; when the experimental data is near less outliers, the square error loss calculation method is used to obtain the loss value of the i-th data point of the target point cloud image according to the residual value of the i-th data point of the target point cloud image. The method has high accuracy and can avoid the accuracy of determining the position of the jar to be discharged from the mash due to too much outlier data, so that when the mash is discharged, the automatic handling equipment can accurately identify the position of the jar to be discharged from the mash and take the mash in the jar to be discharged from the jar.
[0015] In a second aspect, the present application further provides a device for detecting the position of a vat for discharging fermented grains, the device comprising: An acquisition module, used for acquiring a target point cloud image; wherein the target point cloud image is a three-dimensional point cloud image of a cross section at the nth height of the ground vat to be discharged from the mash; A data processing module, used for inputting the coordinates of the i-th data point of the target point cloud image into the residual model to obtain the residual value of the i-th data point of the target point cloud image; A calculation module is used to calculate the loss value of the i-th data point of the target point cloud image based on the Huber loss function according to the residual value of the i-th data point of the target point cloud image:
[0016] in, is the loss value of the i-th data point of the target point cloud image, is the residual value of the i-th data point of the target point cloud image, A threshold to control the smoothness of the loss function; The calculation module is further used to sum I data points of the target point cloud image to obtain a total loss value of I data points of the target point cloud image; and calculate a target gradient according to the total loss value of I data points of the target point cloud image; wherein the target gradient is the gradient of the total loss value of I data points of the target point cloud image; The data processing module is further used to iterate the initial parameters of the target gradient to obtain target parameters; wherein the target parameters include the coordinates of the center of the ellipse model corresponding to the target point cloud image; The detection module is used to determine the position of the vat to be used for discharging the mash according to N target parameters.
[0017] The position detection device for the ground vat for discharging mash provided in the embodiment of the present application has the same technical features as the position detection method for the ground vat for discharging mash provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.
[0018] In a third aspect, the present application provides a computing device, including a memory and a processor; One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method as described in any one of the first aspects.
[0019] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method as described in any one of the first aspects.
[0020] In a fifth aspect, the present application provides a computer program product, wherein the computer program product comprises one or more computer instructions, and when the computer instructions are executed by a computer, the computer executes the method as described in any one of the first aspects.
[0021] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application are realized and obtained by the structures particularly pointed out in the description and the drawings.
[0022] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0024] Figure 1 A schematic flow chart of a method for detecting the position of a vat to be used for discharging fermented grains provided in an embodiment of the present application; Figure 2 A flowchart of a method for a processor to obtain a target point cloud image provided in an embodiment of the present application; Figure 3 A schematic diagram of a target color image of each ground cylinder provided in an embodiment of the present application; Figure 4A schematic diagram of an AND operation provided in an embodiment of the present application; Figure 5 Another AND operation schematic diagram provided for an embodiment of the present application; Figure 6 A schematic diagram of the structure of a device for detecting the position of a vat for discharging fermented grains provided in an embodiment of the present application; Figure 7 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0026] To facilitate understanding of this embodiment, the embodiments of the present application are described in detail below.
[0027] The present application embodiment provides a method for detecting the position of a vat to be used for producing fermented grains, which is applied to a processor, such as Figure 1 As shown, Figure 1 A schematic flow chart of a method for detecting the position of a jar for discharging fermented grains provided in an embodiment of the present application. The method comprises the following steps: S101, the processor obtains a target point cloud image.
[0028] The target point cloud image is a three-dimensional point cloud image of the cross section at the nth height of the jar where the mash is to be produced.
[0029] Specifically, the above-mentioned target point cloud image is a collection of a large number of discrete points in space, including the three-dimensional coordinate (X, Y, Z) information of the cross-sections of the ground vat at different heights for producing the mash, which directly reflects the true shape and structure of the cross-section of the ground vat for producing the mash, and provides technicians with detailed geometric, shape and scale information of the ground vat for producing the mash.
[0030] S102, the processor inputs the coordinates of the i-th data point of the target point cloud image into the residual model to obtain the residual value of the i-th data point of the target point cloud image.
[0031] Specifically, the calculation formula (residual model) of the residual value of the i-th data point of the target point cloud image is as follows:
[0032] in, is the residual value of the i-th data point of the target point cloud image, is the length of the major semi-axis of the cross section at the nth height of the jar where the mash is to be discharged, is the length of the minor semi-axis of the cross section at the nth height of the jar where the mash is to be discharged, is the horizontal coordinate of the i-th data point of the target point cloud image, is the ordinate of the i-th data point of the target point cloud image, is the horizontal coordinate of the center point of the cross section at the nth height of the vat where the mash is to be discharged, It is the ordinate of the center point of the cross section at the nth height of the vat where the mash is to be discharged.
[0033] The following example illustrates the calculation process of the residual value of the ith data point of the target point cloud image. For example, the abscissa of the ith data point of the target point cloud image is 5, the ordinate of the ith data point of the target point cloud image is 8, the major semi-axis length of the cross section at the nth height of the earthen jar to be produced is 2, the minor semi-axis length of the cross section at the nth height of the earthen jar to be produced is 1.5, the abscissa of the center point of the cross section at the nth height of the earthen jar to be produced is 6, and the ordinate of the center point of the cross section at the nth height of the earthen jar to be produced is 9, then the residual value of the ith data point of the target point cloud image is -0.31.
[0034] S103, the processor calculates the loss value of the i-th data point of the target point cloud image based on the Huber loss function and the residual value of the i-th data point of the target point cloud image.
[0035]
[0036] in, is the loss value of the i-th data point of the target point cloud image, is the residual value of the i-th data point of the target point cloud image, is the threshold for controlling the smoothness of the loss function.
[0037] Specifically, the following example introduces the calculation process of the loss value of the i-th data point of the target point cloud image. For example, the threshold for controlling the smoothness of the loss function is set to 1. If the residual value of the i-th data point of the target point cloud image is -0.31, -0.31 , then -0.31 is substituted into Calculate in and get the loss value of the i-th data point of the target point cloud image is 0.04805; if the residual value of the i-th data point of the target point cloud image is 3.25, 3.25 , then substitute 3.25 into Calculated in, the loss value of the i-th data point of the target point cloud image is 2.75.
[0038] With such settings, when the experimental data are mostly near outliers, that is, when the residual value of the i-th data point of the target point cloud image is greater than or equal to the threshold that controls the smoothness of the loss function, the absolute error loss calculation method is used to obtain the loss value of the i-th data point of the target point cloud image; when the experimental data are less near outliers, that is, when the residual value of the i-th data point of the target point cloud image is less than the threshold that controls the smoothness of the loss function, the square error loss calculation method is used to obtain the loss value of the i-th data point of the target point cloud image.
[0039] The above Huber loss function combines the characteristics of square error loss and absolute error loss, and can classify and discuss the experimental data, and obtain the accurate loss value of the i-th data point of the target point cloud image for different situations of the experimental data. The accuracy of the error analysis is improved, and the problem that the three-dimensional point cloud image of the mash jar to be discharged includes many outliers, which has a great influence on the accuracy of the center point coordinates in the obtained three-dimensional point cloud image of the mash jar to be discharged is effectively solved.
[0040] S104, the processor sums the I data points of the target point cloud image to obtain the total loss value of the I data points of the target point cloud image.
[0041] Specifically, the calculation formula for the total loss value of I data points of the target point cloud image is as follows:
[0042] in, is the total loss value of I data points of the target point cloud image, is the loss value of the i-th data point of the target point cloud image.
[0043] S105, the processor calculates the target gradient according to the total loss value of I data points of the target point cloud image.
[0044] Among them, the target gradient is the gradient of the total loss value of I data points of the target point cloud image.
[0045] Specifically, the target gradient represents the direction and rate of change of the total loss value of I data points of the target point cloud image. In multidimensional space, the target gradient is a vector, each component of which represents the total loss value of I data points of the target point cloud image relative to , , , The partial derivative of .
[0046] The calculation formula of the above target gradient is as follows:
[0047] in, is the target gradient, is the total loss value of I data points of the target point cloud image, For the first The length of the semi-major axis of the cross section at height, For the first The length of the minor semi-axis of the cross section at height, For the first Height of the cross section center point abscissa, For the first Height of the center point of the cross section.
[0048] S106: The processor iterates the initial parameters of the target gradient to obtain target parameters.
[0049] Among them, the target parameters include the coordinates of the center of the ellipse model corresponding to the target point cloud image ( , ).
[0050] Specifically, the above target parameters also include: and , the initial parameters also include: and .
[0051] The calculation formula for the above target parameters is as follows:
[0052] in, is the target parameter, is the number of iterations, For the t- Initial parameters after 1 iteration, For the t- The target gradient after 1 iteration, is the learning rate, which is used to control the update amplitude of the initial parameters. Reasonable setting of the learning rate can accelerate the convergence of the initial parameters and obtain the optimal solution, i.e., the target parameters, as soon as possible.
[0053] S107, the processor determines the position of the vat where the mash is to be discharged according to the N target parameters.
[0054] Specifically, the processor calculates the average value of the horizontal coordinates of the center of the ellipse model corresponding to the N target point cloud images and the average value of the vertical coordinates of the center of the ellipse model corresponding to the N target point cloud images according to the following formula:
[0055] in, is the average value of the horizontal coordinates of the center of the ellipse model corresponding to the N target point cloud images, is the average value of the ordinate of the center of the ellipse model corresponding to the N target point cloud images, is the horizontal coordinate of the center of the ellipse model corresponding to the nth target point cloud image, is the ordinate of the center of the ellipse model corresponding to the nth target point cloud image; according to the average value of the abscissa of the center of the ellipse model corresponding to the N target point cloud images and the average value of the ordinate of the center of the ellipse model corresponding to the N target point cloud images, determine the center coordinate of the plane where the ground vat to be discharged is located; the center coordinate of the plane where the ground vat to be discharged is located is determined as the position of the ground vat to be discharged.
[0056] From the above, it can be seen that according to the N target parameters, the coordinates of the center of the elliptical model corresponding to the target point cloud images at N heights can be obtained. In order to reduce the error, the processor obtains the center coordinates of the plane where the entire ground vat for the mash to be produced is located, that is, the position of the ground vat for the mash to be produced, based on the average value of the coordinates of the center of the elliptical model corresponding to the target point cloud images at N heights.
[0057] This setting can accurately determine the position of the jar where the mash is to be discharged. Since the data at multiple heights (the coordinates of the center of the ellipse model corresponding to the target point cloud image) are used for processing, the inaccurate positioning result caused by a single data anomaly can be avoided. The method of averaging the data has a certain degree of robustness and can resist a certain degree of noise interference.
[0058] The embodiment of the present application provides a method for detecting the position of a jar to be discharged from the mash. In the method, the processor uses the Huber loss function. When the experimental data is near the outliers, the absolute error loss calculation method is used to obtain the loss value of the i-th data point of the target point cloud image according to the residual value of the i-th data point of the target point cloud image; when the experimental data is near the outliers, the square error loss calculation method is used to obtain the loss value of the i-th data point of the target point cloud image according to the residual value of the i-th data point of the target point cloud image. Compared with the prior art, in which the coordinates of the center point in the three-dimensional point cloud image of the jar to be discharged from the mash are fitted by the least squares method, and the position of the jar to be discharged from the mash is determined according to the coordinates of the center point in the three-dimensional point cloud image of the jar to be discharged from the mash, the method has higher accuracy, can avoid the accuracy of the position determination of the jar to be discharged from the mash due to too many outlier data, so that when the mash is discharged, the automatic handling equipment can accurately identify the position of the jar to be discharged from the mash, and take the mash in the jar to be discharged from the jar. The method can flexibly select the calculation mode, reduce unnecessary data calculation process, avoid generating redundant calculation data in the fitting process of the position of the ground jar for producing the mash, and thus avoid excessive occupation of the processor's memory resources. It has high pertinence and flexibility and saves fitting time.
[0059] The following is an introduction to the way the processor obtains the target point cloud image. Figure 2 As shown, Figure 2 This is a flow chart of a method for a processor to obtain a target point cloud image provided in an embodiment of the present application. The above step S101 specifically includes the following sub-steps: S1011, the processor obtains a depth image of each ground cylinder and a color image of each ground cylinder.
[0060] Specifically, the above-mentioned processor obtains the depth image of each ground cylinder and the color image of each ground cylinder through TOF (Time of Flight Camera). TOF is a distance imaging camera system that uses time-of-flight technology. Before shooting, the internal and external parameters of TOF need to be calibrated so that the images obtained by the color lens and depth lens of TOF can be spatially aligned. Among them, the internal parameters are used to describe the internal imaging characteristics of TOF, such as focal length, principal point coordinates, and distortion coefficients, which can be calibrated by a single TOF; the external parameters are used to describe the position and posture of TOF in three-dimensional space, such as rotation matrix and translation vector, which can be calibrated between multiple TOFs.
[0061] TOF emits laser pulses to each ground cylinder. After the laser pulses hit each ground cylinder, they return to TOF. Using the speed of light and the time difference between the round trip of the light beam, the distance between each ground cylinder and TOF is calculated, thereby obtaining a depth image of each ground cylinder. TOF obtains a color image of each ground cylinder through an RGB (red, green, and blue) sensor.
[0062] S1012: The processor labels the color image of each ground cylinder to obtain a target color image of each ground cylinder.
[0063] Specifically, Figure 3 As shown, Figure 3 Schematic diagram of the target color image of each ground cylinder provided in the embodiment of the present application. The target color image of each ground cylinder mentioned above includes: a first annotated area 301 (a color image of the ground cylinder to be produced with an annotation) and a second annotated area 302 (a color image of the ground cylinder not to be produced with an annotation). It should be noted that in this step, the staff finds the position of the ground cylinder to be produced by TOF, and annotates the position of the ground cylinder to be produced. The first annotated area 301 obtained is not the exact position of the ground cylinder to be produced.
[0064] The purpose of such setting is to facilitate the subsequent output of the mask image of the ground jar to be produced through the neural network model based on the target color image of each ground jar.
[0065] S1013, the processor inputs the target color image of each ground jar into the trained neural network model, so that the neural network model outputs the mask image of the ground jar to be produced.
[0066] Specifically, the neural network is a YOLOv7 model, which introduces model reparameterization technology, effectively reduces the computational burden by reorganizing the network structure and optimizing parameters, while maintaining a high detection accuracy. The mask image of the above-mentioned jar to be discharged is a binary or Boolean image with the same size as the target color image of each jar and the depth image of each jar.
[0067] The above-mentioned YOLOv7 model has excellent target detection capabilities. The mask image of the ground jar to be produced by the trained YOLOv7 model has high accuracy. In addition, this process does not require human intervention, which improves the efficiency of obtaining the mask image of the ground jar to be produced.
[0068] S1014: The processor performs AND operations on the pixel values of the mask image of the ground vat to be used for producing mash with the pixel values of the depth images of the J ground vats in sequence to obtain J first operation results.
[0069] S1015: If the j-th first operation result is 1, the depth image of the j-th ground vat is determined as the depth image of the ground vat to be used for producing the mash.
[0070] S1016: If the j-th first operation result is 0, the depth image of the j-th ground jar is determined as the depth image of the ground jar that is not to be used for producing mash.
[0071] Specifically, Figure 4 As shown, Figure 4 A schematic diagram of an AND operation provided in an embodiment of the present application. The mask image of the above-mentioned ground jar to be discharged includes a first region of interest 501 and a first region of no interest 502, and the depth image of the J ground jars includes a third region of interest 603 and a third region of no interest 604. The pixel values of the first region of interest 501 and the third region of interest 603 are both set to 1, and the pixel values of the first region of no interest 502 and the third region of no interest 604 are both set to 0. The pixel values of the mask image of the ground vat to be discharged (pixel values of the first area of interest 501 and the first area of non-interest 502) are sequentially ANDed (compared) with the pixel values of the depth images of J ground vats (pixel values of the third area of interest 603 and the third area of non-interest 604). If the j-th first operation result is 1, it means that the area where the depth image of the j-th ground vat is located is the third area of interest 603, thereby determining that the depth image of the j-th ground vat is the depth image 605 of the ground vat to be discharged. If the j-th first operation result is 0, it means that the area where the depth image of the j-th ground vat is located is the third area of non-interest 604, thereby determining that the depth image of the j-th ground vat is the depth image 606 of the ground vat not to be discharged.
[0072] S1017, the processor performs AND operations on the pixel values of the mask image of the ground vat to be used for producing mash with the pixel values of the color images of the M ground vats in sequence to obtain M second operation results.
[0073] S1018: If the m-th second operation result is 1, the color image of the m-th earthenware jar is determined as the color image of the earthenware jar to be used for producing the mash.
[0074] S1019: If the m-th second operation result is 0, the color image of the m-th earthen jar is determined as a color image of a non-earthen jar for producing mash. Specifically, Figure 5 As shown, Figure 5Another AND operation schematic diagram provided for an embodiment of the present application. The mask image of the above-mentioned ground jar to be discharged includes a first region of interest 501 and a first region of no interest 502, and the color images of the R ground jars include a second region of interest 503 and a second region of no interest 504. The pixel values of the first region of interest 501 and the second region of interest 503 are both set to 1, and the pixel values of the first region of no interest 502 and the second region of no interest 504 are both set to 0. The pixel values of the mask image of the ground vat to be discharged (pixel values of the first region of interest 501 and the first region of non-interest 502) are sequentially ANDed (compared) with the pixel values of the color images of R ground vats (pixel values of the second region of interest 503 and the second region of non-interest 504). If the m-th second operation result is 1, it means that the region where the color image of the m-th ground vat is located is the second region of interest 503, thereby determining that the color image of the m-th ground vat is the color image 505 of the ground vat to be discharged. If the m-th second operation result is 0, it means that the region where the color image of the m-th ground vat is located is the second region of non-interest 504, thereby determining that the color image of the m-th ground vat is the color image 506 of the ground vat not to be discharged.
[0075] S1020: The processor transforms the coordinates of the pixel points of the depth image of the earthen vat from which the mash is to be produced, and obtains three-dimensional space points corresponding to the pixel points of the depth image of the earthen vat from which the mash is to be produced.
[0076] Specifically, the calculation formula (coordinate conversion formula) of the three-dimensional space point corresponding to the pixel point of the depth image of the above-mentioned jar to be discharged is as follows:
[0077] in, is the three-dimensional space point corresponding to the pixel point of the depth image of the jar where the fermented grains are to be discharged, is the depth value of the depth image of the jar where the fermented grains are to be discharged, is the focal length abscissa of TOF, is the focal length ordinate of TOF, is the horizontal coordinate of the principal point, is the ordinate of the main point, u is the abscissa of the pixel point of the depth image of the jar to be used for brewing. It is the vertical coordinate of the pixel point of the depth image of the vat where the mash is to be discharged.
[0078] S1021, the processor fuses the three-dimensional space points corresponding to the pixel points of the depth image of the earthen jar where the mash is to be produced with the pixel points of the color image of the earthen jar where the mash is to be produced, to obtain a three-dimensional point cloud image of the earthen jar where the mash is to be produced.
[0079] Specifically, the processor assigns the color value (R, G, B) of the pixel point extracted from the color image of the jar to be produced to the three-dimensional space point corresponding to the pixel point of the depth image of the jar to be produced, thereby obtaining a complete three-dimensional point cloud image of the jar to be produced. The three-dimensional point cloud image of the jar to be produced is finally saved as a colored three-dimensional point cloud format, such as ply format or pcd format.
[0080] S1022: The processor cuts the three-dimensional point cloud image of the jar for producing fermented grains in the horizontal direction to obtain a target point cloud image.
[0081] Specifically, the depth image obtained by TOF has a low resolution, and the depth value of the depth image is easily affected by noise, resulting in missing depth information in some areas, which in turn causes holes of varying sizes to appear in the three-dimensional point cloud image of the jar where the mash is to be produced. This not only affects the integrity of the three-dimensional point cloud image of the jar where the mash is to be produced, but also creates certain difficulties for subsequent detection work.
[0082] Therefore, it is necessary to cut the three-dimensional point cloud image of the earthenware jar to be produced in the horizontal direction, and analyze the obtained three-dimensional point cloud images of the cross sections of the earthenware jar at multiple heights (target point cloud images) to avoid the holes in the three-dimensional point cloud image of the earthenware jar to be produced, so as to ensure the accuracy of the position of the earthenware jar to be produced after fitting. Because the earthenware jar to be produced is a cylindrical shape with a regular shape, the differences between the three-dimensional point cloud images of the cross sections of the earthenware jar at multiple heights are not large, which is convenient for fitting the center coordinates (position) of the earthenware jar to be produced after fitting.
[0083] In addition, since the TOF cannot completely ensure that the lens is completely parallel to the ground during shooting, there is a certain inclination angle between the image of the ground plane captured and the image of the real ground plane. Therefore, there is also a certain inclination angle between the point cloud image of the ideal ground plane generated based on the image of the ground plane captured and the point cloud image of the real ground plane.
[0084] If the three-dimensional point cloud image of the mash jar to be produced is cut using the point cloud image of the plane where the ideal ground is located as the reference plane, there will be a tilt angle between the target point cloud image obtained by cutting and the point cloud image of the plane where the real ground is located, which will affect the subsequent determination of the coordinates of the center of the elliptical model corresponding to the N target point cloud images.
[0085] In order to further ensure the accuracy of the detection, the point cloud image of the plane where the ideal ground is located needs to be rotated to eliminate the tilt angle. The above processor performs plane fitting on the point cloud image of the plane where the ideal ground is located through the RANSAC method to obtain the normal vector of the point cloud image of the plane where the ideal ground is located. Because the normal vector of the point cloud image of the plane where the real ground is located is (0,0,1), it is necessary to make the point cloud image of the plane where the ideal ground is located coincide with the normal vector (0,0,1) of the point cloud image of the plane where the real ground is located after the rotation transformation. Among them, the basic principle of rotating the point cloud image of the plane where the ideal ground is located is to calculate the rotation matrix according to the Rodriguez rotation formula, so that the point cloud image of the plane where the ideal ground is located takes the preset point as the rotation center, and realizes the rotation transformation through the rotation matrix.
[0086] In one embodiment, the processor obtains an initial depth image of each ground cylinder sent by the TOF camera; and filters the initial depth image of each ground cylinder through a Gaussian filter to obtain a depth image of each ground cylinder.
[0087] Specifically, the initial depth image of each ground cylinder obtained by TOF may contain noise or errors, which will affect the subsequent fitting results. Therefore, it is necessary to filter out the noise of the initial depth image of each ground cylinder through a Gaussian filter to obtain a smooth initial depth image of each ground cylinder.
[0088] In this method, the Gaussian filter is a smoothing filter that has a certain retention effect on the edge of the initial depth image of each floor cylinder, so while reducing the noise of the initial depth image of each floor cylinder, the important structural information of the initial depth image of each floor cylinder will not be significantly destroyed. This method can effectively reduce the noise of the initial depth image of each floor cylinder, making the initial depth image of each floor cylinder clearer and more accurate.
[0089] On the basis of the above method embodiment, the present application embodiment also provides a position detection device for the vat to be discharged. Figure 6 As shown, Figure 6 A schematic diagram of the structure of a position detection device for a ground cylinder to be discharged from a mash provided in an embodiment of the present application. The device includes: an acquisition module 61, a data processing module 62, a calculation module 63 and a detection module 64. The functions of each module are as follows: The acquisition module 61 is used to acquire a target point cloud image; wherein the target point cloud image is a three-dimensional point cloud image of a cross section at the nth height of the ground vat where the mash is to be discharged; The data processing module 62 is used to input the coordinates of the i-th data point of the target point cloud image into the residual model to obtain the residual value of the i-th data point of the target point cloud image; The calculation module 63 is used to calculate the loss value of the i-th data point of the target point cloud image based on the Huber loss function according to the residual value of the i-th data point of the target point cloud image:
[0090] in, is the loss value of the i-th data point of the target point cloud image, is the residual value of the i-th data point of the target point cloud image, A threshold to control the smoothness of the loss function; The calculation module 63 is further used to sum I data points of the target point cloud image to obtain a total loss value of I data points of the target point cloud image; and calculate a target gradient according to the total loss value of I data points of the target point cloud image; wherein the target gradient is the gradient of the total loss value of I data points of the target point cloud image; The data processing module 62 is further used to iterate the initial parameters of the target gradient to obtain the target parameters; wherein the target parameters include the coordinates of the center of the ellipse model corresponding to the target point cloud image; The detection module 64 is used to determine the position of the vat where the mash is to be discharged according to N target parameters.
[0091] Preferably, the acquisition module 61 is specifically used to acquire the depth image of each ground cylinder and the color image of each ground cylinder; annotate the color image of each ground cylinder to obtain the target color image of each ground cylinder; input the target color image of each ground cylinder into the trained neural network model, so that the neural network model outputs the mask image of the ground cylinder to be produced; the pixel values of the mask image of the ground cylinder to be produced are sequentially ANDed with the pixel values of the depth images of J ground cylinders to obtain J first operation results; if the jth first operation result is 1, the depth image of the jth ground cylinder is determined as the depth image of the ground cylinder to be produced; the pixel values of the mask image of the ground cylinder to be produced are sequentially ANDed with the pixel values of the color images of M ground cylinders to obtain M second operation results. Operation result; if the m-th second operation result is 1, the color image of the m-th earthen jar is determined as the color image of the earthen jar to be discharged; the coordinates of the pixel points of the depth image of the earthen jar to be discharged are transformed to obtain the three-dimensional space points corresponding to the pixel points of the depth image of the earthen jar to be discharged; the three-dimensional space points corresponding to the pixel points of the depth image of the earthen jar to be discharged are merged with the pixel points of the color image of the earthen jar to be discharged to obtain the three-dimensional point cloud image of the earthen jar to be discharged; the three-dimensional space points corresponding to the pixel points of the depth image of the earthen jar to be discharged are merged with the pixel points of the color image of the earthen jar to be discharged to obtain the three-dimensional point cloud image of the earthen jar to be discharged; the three-dimensional point cloud image of the earthen jar to be discharged is cut along the horizontal direction to obtain the target point cloud image.
[0092] Preferably, the acquisition module 61 is further used to determine the depth image of the j-th ground vat as the depth image of the ground vat not to be discharged with mash if the j-th first operation result is 0.
[0093] Preferably, the acquisition module 61 is further used to determine the color image of the mth earthen jar as the color image of the earthen jar not to be discharged if the mth second operation result is 0.
[0094] Preferably, the detection module 64 is specifically used to calculate the average value of the horizontal coordinates of the center of the ellipse model corresponding to the N target point cloud images and the average value of the vertical coordinates of the center of the ellipse model corresponding to the N target point cloud images according to the following formula:
[0095] in, is the average value of the horizontal coordinates of the center of the ellipse model corresponding to the N target point cloud images, is the average value of the ordinate of the center of the ellipse model corresponding to the N target point cloud images, is the horizontal coordinate of the center of the ellipse model corresponding to the nth target point cloud image, is the ordinate of the center of the ellipse model corresponding to the nth target point cloud image; according to the average value of the abscissa of the center of the ellipse model corresponding to the N target point cloud images and the average value of the ordinate of the center of the ellipse model corresponding to the N target point cloud images, determine the coordinates of the center of the ellipse model corresponding to the N target point cloud images; the coordinates of the center of the ellipse model corresponding to the N target point cloud images are determined as the position of the ground jar to be discharged from the mash.
[0096] Preferably, the acquisition module 61 is also used to acquire an initial depth image of each ground cylinder sent by the TOF camera; The data processing module 62 is also used to filter the initial depth image of each ground cylinder through a Gaussian filter to obtain a depth image of each ground cylinder.
[0097] The position detection device for the ground vat for discharging mash provided in the embodiment of the present application has the same technical features as the position detection method for the ground vat for discharging mash provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.
[0098] The present application also provides a computing device. Figure 7 As shown, this figure is a schematic diagram of a computing device provided in an embodiment of the present application, and the computing device 400 includes a bus 401, a processor 402, a communication interface 403 and a memory 404. The processor 402, the memory 404 and the communication interface 403 communicate with each other through the bus 401.
[0099] The bus 401 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0100] The processor 402 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0101] The communication interface 403 is used for communicating with the outside. The memory 404 may include a volatile memory, such as a random access memory (RAM). The memory 404 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid state drive (SSD).
[0102] The memory 404 stores executable codes, and the processor 402 executes the executable codes to perform the aforementioned method for detecting the position of the vat to be used for discharging mash.
[0103] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned method for detecting the position of the vat to be discharged.
[0104] The embodiment of the present application further provides a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part.
[0105] The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center via wired (e.g., coaxial cable, optical fiber) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0106] When the computer program product is executed by a computer, the computer executes any of the aforementioned methods for detecting the position of the vat to be discharged. The computer program product may be a software installation package, and when any of the aforementioned methods for detecting the position of the vat to be discharged is needed, the computer program product may be downloaded and executed on a computer.
[0107] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0108] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application.
Claims
1. A method for detecting the position of a vat for discharging fermented grains, characterized in that: Applied to a processor, the method comprises: The processor acquires a target point cloud image; wherein the target point cloud image is a three-dimensional point cloud image of a cross section at an nth height of a ground cylinder to be used for producing mash; The processor inputs the coordinates of the i-th data point of the target point cloud image into the residual model to obtain the residual value of the i-th data point of the target point cloud image; The processor calculates the loss value of the i-th data point of the target point cloud image based on the Huber loss function and according to the residual value of the i-th data point of the target point cloud image: in, is the loss value of the i-th data point of the target point cloud image, is the residual value of the i-th data point of the target point cloud image, A threshold to control the smoothness of the loss function; The processor sums I data points of the target point cloud image to obtain a total loss value of the I data points of the target point cloud image; The processor calculates a target gradient according to the total loss value of I data points of the target point cloud image; wherein the target gradient is the gradient of the total loss value of I data points of the target point cloud image; The processor iterates the initial parameters of the target gradient to obtain target parameters; wherein the target parameters include the coordinates of the center of the ellipse model corresponding to the target point cloud image; The processor determines the position of the vat where the mash is to be discharged according to N target parameters.
2. The method for detecting the position of the jar for discharging fermented grains according to claim 1, characterized in that: The step of the processor acquiring the target point cloud image comprises: The processor acquires a depth image of each ground cylinder and a color image of each ground cylinder; The processor labels the color image of each ground cylinder to obtain a target color image of each ground cylinder; The processor inputs the target color image of each ground vat into the trained neural network model, so that the neural network model outputs the mask image of the ground vat to be used for producing mash; The processor performs AND operations on pixel values of the mask image of the ground vat to be discharged and pixel values of the depth images of J ground vats in sequence to obtain J first operation results; If the j-th first operation result is 1, the processor determines the depth image of the j-th ground vat as the depth image of the ground vat to be used for producing the mash; The processor performs AND operations on the pixel values of the mask image of the ground vat to be discharged and the pixel values of the color images of the M ground vats in sequence to obtain M second operation results; If the mth second operation result is 1, the processor determines the color image of the mth ground jar as the color image of the ground jar to be used for producing the mash; The processor transforms the coordinates of the pixel points of the depth image of the jar to be discharged from the mash to obtain the three-dimensional space points corresponding to the pixel points of the depth image of the jar to be discharged from the mash; The processor fuses the three-dimensional space points corresponding to the pixel points of the depth image of the jar to be discharged from the mash with the pixel points of the color image of the jar to be discharged from the mash to obtain a three-dimensional point cloud image of the jar to be discharged from the mash; The processor cuts the three-dimensional point cloud image of the vat to be used for producing fermented grains in a horizontal direction to obtain the target point cloud image.
3. The method for detecting the position of the jar for discharging fermented grains according to claim 2, characterized in that: The method further comprises: If the j-th first operation result is 0, the processor determines the depth image of the j-th ground vat as the depth image of the ground vat that is not to be used for producing mash.
4. The method for detecting the position of the jar for discharging fermented grains according to claim 2, characterized in that: The method further comprises: If the m-th second operation result is 0, the processor determines the color image of the m-th ground jar as a color image of a ground jar that is not to be used for producing mash.
5. The method for detecting the position of the jar for discharging fermented grains according to claim 1, characterized in that: The processor determines the position of the vat to be discharged from the mash according to N target parameters, comprising: The processor calculates the average value of the horizontal coordinates of the center of the ellipse model corresponding to the N target point cloud images and the average value of the vertical coordinates of the center of the ellipse model corresponding to the N target point cloud images according to the following formula: in, is the average value of the horizontal coordinates of the center of the ellipse model corresponding to the N target point cloud images, is the average value of the ordinate of the center of the ellipse model corresponding to the N target point cloud images, is the horizontal coordinate of the center of the ellipse model corresponding to the nth target point cloud image, is the ordinate of the center of the ellipse model corresponding to the nth target point cloud image; The processor determines the coordinates of the center of the ellipse model corresponding to the N target point cloud images according to the average value of the abscissa of the center of the ellipse model corresponding to the N target point cloud images and the average value of the ordinate of the center of the ellipse model corresponding to the N target point cloud images; The processor determines the coordinates of the center of the ellipse model corresponding to the N target point cloud images as the position of the vat where the mash is to be discharged.
6. The method for detecting the position of the jar for discharging fermented grains according to claim 2, characterized in that: The method further comprises: The processor obtains an initial depth image of each ground cylinder sent by the TOF camera; The processor filters the initial depth image of each ground cylinder through a Gaussian filter to obtain a depth image of each ground cylinder.
7. A device for detecting the position of a vat for discharging fermented grains, characterized in that: The device comprises: An acquisition module, used for acquiring a target point cloud image; wherein the target point cloud image is a three-dimensional point cloud image of a cross section at the nth height of the ground vat to be discharged from the mash; A data processing module, used for inputting the coordinates of the i-th data point of the target point cloud image into the residual model to obtain the residual value of the i-th data point of the target point cloud image; A calculation module is used to calculate the loss value of the i-th data point of the target point cloud image based on the Huber loss function according to the residual value of the i-th data point of the target point cloud image: in, is the loss value of the i-th data point of the target point cloud image, is the residual value of the i-th data point of the target point cloud image, A threshold to control the smoothness of the loss function; The calculation module is further used to sum I data points of the target point cloud image to obtain a total loss value of I data points of the target point cloud image; and calculate a target gradient according to the total loss value of I data points of the target point cloud image; wherein the target gradient is the gradient of the total loss value of I data points of the target point cloud image; The data processing module is further used to iterate the initial parameters of the target gradient to obtain target parameters; wherein the target parameters include the coordinates of the center of the ellipse model corresponding to the target point cloud image; The detection module is used to determine the position of the vat to be used for discharging the mash according to N target parameters.
8. A computing device, characterized in that including memory and processor; One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method as claimed in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product comprises one or more computer instructions. When the computer instructions are executed by a computer, the computer performs the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Visual perception system and method of fermented grain discharging robot for complex environment
CN117325184A
Building deformation monitoring system and method based on three-dimensional laser scanning technology
CN118857134A
Method, device, and non-transitory computer-readable storage medium for reconstructing a three-dimensional model
US20240046557A1