Method, device and equipment for predicting quality of fruits and vegetables

By acquiring images of fruits and vegetables and utilizing linear regression and residual allocation algorithms, the problem of low efficiency in weighing fruits and vegetables by category in existing technologies has been solved. This enables simultaneous weighing of multiple fruits and vegetables, improving weighing efficiency and reducing labor costs.

CN116295742BActive Publication Date: 2026-02-03HARBIN ENG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310281891.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-22
Publication Date
2026-02-03
Estimated Expiration
2043-03-22

AI Technical Summary

Technical Problem

Existing technologies can only weigh fruits and vegetables one category at a time, resulting in low weighing efficiency, long weighing time, and high labor costs.

Method used

By acquiring images of fruits and vegetables, obtaining the outline area of ​​the fruits and vegetables, and using the pre-obtained linear regression relationship between the outline area of ​​fruits and vegetables and quality to predict quality, and combining it with the residual allocation algorithm for correction, multiple fruits and vegetables can be weighed simultaneously.

Benefits of technology

It enables the simultaneous weighing of multiple fruits and vegetables, improving weighing efficiency and saving time and labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116295742B_ABST
    Figure CN116295742B_ABST
Patent Text Reader

Abstract

The present application provides a fruit and vegetable quality prediction method, device and equipment, which belongs to the technical field of quality measurement, and in particular relates to the quality measurement of fruit and vegetables. The present application solves the problem of low weighing efficiency, long weighing time and high labor cost caused by the fact that the existing weighing method can only weigh multiple fruit and vegetables one by one, but cannot weigh multiple fruit and vegetables at the same time. The fruit and vegetable quality prediction method obtains the quality prediction value of any one fruit and vegetable according to the type of the fruit and vegetable and the fruit and vegetable contour area, and obtains the corresponding fruit and vegetable contour area and quality regression expression obtained in advance. It is mainly used for measuring the quality of multiple fruit and vegetables at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of quality measurement technology, and in particular to the quality measurement of fruits and vegetables. Background Technology

[0002] Currently, in the fruit and vegetable sales industry, most products improved by artificial intelligence technology are concentrated in the field of fruit and vegetable identification, while neglecting the weighing process of fruits and vegetables in daily sales.

[0003] In the fruit and vegetable weighing process, the traditional method of weighing by category is mostly adopted. This method can only weigh fruits and vegetables in sequence according to their type and does not have the function of weighing multiple fruits and vegetables at the same time, resulting in problems such as low weighing efficiency, long weighing time and high labor costs. Summary of the Invention

[0004] This invention proposes a method, device, and equipment for predicting the quality of fruits and vegetables, which solves the problems of low weighing efficiency, long weighing time, and high labor costs caused by existing weighing methods, which can only weigh multiple fruits and vegetables sequentially and cannot weigh multiple fruits and vegetables simultaneously.

[0005] The technical solution of the fruit and vegetable quality prediction method of the present invention is as follows:

[0006] A method for predicting the quality of fruits and vegetables, the method specifically including:

[0007] Step 1: Collect images of the fruits and vegetables in the pile to be weighed. The pile contains m fruits and vegetables of a total of n varieties, where m and n are both positive integers greater than or equal to 1.

[0008] Step 2: Based on the fruit and vegetable image, obtain the outline area of ​​any one fruit or vegetable in the pile of fruits and vegetables to be weighed;

[0009] Step 3: Based on the type of any fruit or vegetable and the outline area of ​​the fruit or vegetable, retrieve the corresponding pre-obtained regression expression of the outline area and quality of the fruit or vegetable to obtain the predicted quality value of any fruit or vegetable.

[0010] Furthermore, a preferred embodiment is provided, the technical solution of which is as follows:

[0011] The fruit and vegetable quality prediction method is used to predict the quality of all fruits and vegetables for which the outline area and quality have a linear regression relationship. The fruits and vegetables include fruits and vegetables.

[0012] Furthermore, a preferred embodiment is provided, the technical solution of which is as follows:

[0013] Step 2 specifically includes:

[0014] Step 2.1: For any single fruit or vegetable image, define its color tone range and lock the fruit or vegetable region of any one fruit or vegetable in the pile of fruits and vegetables to be weighed;

[0015] Step 2.2: Perform morphological transformation on the fruit and vegetable area. First, perform a closing operation to remove small holes in the fruit and vegetable area, and then perform an opening operation to remove edge burrs in the fruit and vegetable area to obtain the processed fruit and vegetable area.

[0016] Step 2.3: Perform edge detection on the processed fruit and vegetable area to obtain all the outermost edges of the processed fruit and vegetable area, and calculate the area enclosed by all the outermost edges to obtain the fruit and vegetable outline area of ​​any one fruit or vegetable.

[0017] Furthermore, a preferred embodiment is provided, the technical solution of which is as follows:

[0018] The regression expression for the outline area and mass of fruits and vegetables obtained in step 3 is as follows:

[0019]

[0020] Where ki represents the number of the i-th type of fruit and vegetable in the pile of fruits and vegetables to be weighed, and k1+k2+…+kn=m; S is the predicted quality value of the j-th fruit and vegetable among the i-th types of fruits and vegetables. i j Let a be the fruit and vegetable outline area of ​​the j-th fruit and vegetable in the i-th type of fruit and vegetable. i Let b be the slope of the fitted relationship for the i-th type of fruit and vegetable. i The intercept of the fitted relationship expression for the i-th type of fruit and vegetable is given.

[0021] Furthermore, a preferred embodiment is provided, the technical solution of which is as follows:

[0022] The pre-obtained regression expression for the fruit and vegetable outline area and quality in step 3 is obtained through the following method:

[0023] Based on the pre-collected contour area and mass data of each fruit and vegetable in the pile to be sampled, obtain the contour area and mass samples of the fruits and vegetables.

[0024] The fruit and vegetable outline area and quality samples are divided into fruit and vegetable outline area and quality datasets corresponding to each fruit and vegetable type.

[0025] Statistical analysis was performed on the fruit and vegetable outline area and quality dataset corresponding to each fruit and vegetable type. The least squares method was used to obtain the regression expression for the fruit and vegetable outline area and quality corresponding to each fruit and vegetable type.

[0026] Furthermore, a preferred embodiment is provided, the technical solution of which is as follows:

[0027] The method for predicting the quality of fruits and vegetables also includes the following steps:

[0028] Step 4: Use the residual allocation algorithm to correct the quality prediction value to obtain the final quality prediction value of any one of the fruits and vegetables.

[0029] Furthermore, a preferred embodiment is provided, the technical solution of which is as follows:

[0030] The residual allocation algorithm is as follows:

[0031] Measure the actual total mass W0 of the pile of fruits and vegetables to be weighed;

[0032] Calculate the predicted total mass of the pile of fruits and vegetables to be weighed. The predicted total mass The sum of the predicted mass values ​​of all fruits and vegetables in the pile to be weighed;

[0033] Based on the actual total mass value W0 and the predicted total mass value The residual δ is calculated using the following expression:

[0034]

[0035] in, To predict the total mass, W0 is the total weighed mass, and δ is the difference between the actual mass and the predicted mass;

[0036] Based on the residual δ and the slope a of the fitting relationship between the i-th type of fruit and vegetable i And the fruit and vegetable outline area S of the j-th fruit and vegetable of the i-th type of fruit and vegetable. i j For the predicted quality value Make corrections to obtain the final predicted quality value for any one of the fruits and vegetables. The expression is:

[0037]

[0038] S = [S k1 ,S k2 ,…,S kn S is a vector composed of the outline areas of all fruits and vegetables in the pile to be weighed, where S ki =[S i 1 , i 2 ,…, i ki ], S kiIt is a vector composed of the outline areas of all fruits and vegetables in the i-th type of fruit and vegetable;

[0039] a = [a k1 ,k2,…, kn ], where a is a vector composed of the slopes of the fitted relationship expressions of all fruits and vegetables in the pile to be weighed, where a ki It is made of ki a i The vector formed by the vector.

[0040] This invention also proposes a fruit and vegetable quality prediction device, the technical solution of which is as follows:

[0041] Fruit and vegetable quality prediction device, the device specifically includes:

[0042] Module 1: Used to acquire images of fruits and vegetables in a pile to be weighed, wherein the pile contains m fruits and vegetables of a total of n varieties, where m and n are both positive integers greater than or equal to 1.

[0043] Module 2: Used to obtain the outline area of ​​any one fruit or vegetable in the pile of fruits and vegetables to be weighed based on the fruit and vegetable image;

[0044] Module 3: Used to retrieve the corresponding pre-obtained regression expression of fruit and vegetable outline area and quality based on the type of any fruit or vegetable and the outline area of ​​the fruit or vegetable, and obtain the quality prediction value of any fruit or vegetable.

[0045] Furthermore, a preferred embodiment is provided, the technical solution of which is as follows:

[0046] The fruit and vegetable quality prediction device also includes the following modules:

[0047] Module 4: Used to correct the quality prediction value using a residual allocation algorithm to obtain the final quality prediction value of any one of the fruits and vegetables.

[0048] This invention also proposes a fruit and vegetable quality prediction device, the technical solution of which is as follows:

[0049] Fruit and vegetable quality prediction equipment includes: an image acquisition unit, a microprocessor, and a storage medium.

[0050] The storage medium is used to store the executable instructions of the microprocessor;

[0051] The microprocessor is configured to execute the above-described fruit and vegetable quality prediction method by executing the executable instructions;

[0052] The image acquisition unit is used to acquire a single image of any one fruit or vegetable in the pile to be weighed, and send the single image to the microprocessor.

[0053] The present invention has the following beneficial effects:

[0054] This invention captures images of fruits and vegetables, extracts their outline area, and combines this with a linear regression relationship between the outline area and the weight to predict the weight of fruits and vegetables. It can simultaneously weigh multiple fruits and vegetables, resulting in high weighing efficiency and saving time and labor costs.

[0055] The fruit and vegetable quality prediction method, apparatus, and equipment described in this invention are suitable for simultaneously measuring the quality of multiple fruits and vegetables. Attached Figure Description

[0056] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0057] Figure 1 A flowchart of a method for predicting the quality of multiple fruits and vegetables is provided in a preferred embodiment of the present invention.

[0058] Figure 2 This is a schematic diagram of the fruit and vegetable area to be processed in a preferred embodiment of the present invention;

[0059] Figure 3 This is a schematic diagram of the vegetable region after morphological transformation, as shown in a preferred embodiment of the present invention.

[0060] Figure 4 This is a schematic diagram of the outline of the fruit and vegetable area in a preferred embodiment of the present invention.

[0061] Figure 5 In a preferred embodiment of the present invention, a regression diagram of the relationship between the outline area and mass of apples, pears, and oranges is shown.

[0062] Figure 6 In a preferred embodiment of the present invention, a regression diagram of the fruit and vegetable outline area and mass of cherry tomatoes and plums is shown. Detailed Implementation

[0063] To make the technical solutions and advantages of the present invention clearer, the specific embodiments of the present invention will be described in further detail and completely below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0064] Implementation Method 1: Combination Figure 1This embodiment describes a method for predicting the quality of fruits and vegetables. The specific implementation details are as follows:

[0065] The method specifically includes:

[0066] Step 1: Collect images of the fruits and vegetables in the pile to be weighed. The pile contains m fruits and vegetables of a total of n varieties, where m and n are both positive integers greater than or equal to 1.

[0067] Step 2: Based on the fruit and vegetable image, obtain the outline area of ​​any one fruit or vegetable in the pile of fruits and vegetables to be weighed;

[0068] Step 3: Based on the type of any fruit or vegetable and the outline area of ​​the fruit or vegetable, retrieve the corresponding pre-obtained regression expression of the outline area and quality of the fruit or vegetable to obtain the predicted quality value of any fruit or vegetable.

[0069] In this embodiment, by capturing images of fruits and vegetables, extracting the outline area of ​​the fruits and vegetables, and combining the linear regression relationship between the outline area of ​​the fruits and vegetables and their quality, the quality prediction of fruits and vegetables can be realized. Multiple fruits and vegetables can be weighed simultaneously, resulting in high weighing efficiency and saving time and labor costs.

[0070] In this embodiment, the fruit and vegetable quality prediction method is used to predict the quality of all fruits and vegetables whose outline area and quality have a linear regression relationship. The fruits and vegetables refer to fruits and vegetables, such as apples, pears and oranges, and vegetables include potatoes, cucumbers and tomatoes.

[0071] Implementation Method Two: Combination Figure 1 This embodiment further defines step 2 of the fruit and vegetable quality prediction method described in Embodiment 1. The specific implementation details are as follows:

[0072] Step 2 is described in detail below:

[0073] Step 2.1: For any single fruit or vegetable image, define its color tone range and lock the fruit or vegetable region of any one fruit or vegetable in the pile of fruits and vegetables to be weighed;

[0074] Step 2.2: Perform morphological transformation on the fruit and vegetable area. First, perform a closing operation to remove small holes in the fruit and vegetable area, and then perform an opening operation to remove edge burrs in the fruit and vegetable area to obtain the processed fruit and vegetable area.

[0075] Step 2.3: Perform edge detection on the processed fruit and vegetable area to obtain all the outermost edges of the processed fruit and vegetable area, and calculate the area enclosed by all the outermost edges to obtain the fruit and vegetable outline area of ​​any one fruit or vegetable.

[0076] In this embodiment, an image analysis function can be used to obtain the outline area of ​​any one fruit or vegetable in the pile to be weighed based on the fruit and vegetable image. Specifically:

[0077] The Scalar function in the OpenCV library can be called to define the tonal range of the fruit and vegetable image and lock the fruit and vegetable region of any one fruit or vegetable in the pile to be weighed; wherein, the fruit and vegetable image is an image obtained by taking a picture of all the fruits and vegetables in the pile to be weighed together; the fruit and vegetable region refers to the imaging area of ​​each fruit or vegetable in the fruit and vegetable image;

[0078] The morphologyEx function can be used to perform morphological transformation on the fruit and vegetable region. First, a closing operation is performed to remove small holes in the fruit and vegetable region, and then an opening operation is performed to remove edge burrs in the fruit and vegetable region to obtain the processed fruit and vegetable region.

[0079] The findContours function can be used to detect all the outermost edges of the processed fruit and vegetable area and save all the outermost edges as a point set.

[0080] The contourArea function can be used to calculate the area enclosed by all the outermost edges, thus obtaining the outline area of ​​any given fruit or vegetable.

[0081] Implementation Method 3: Combination Figure 1 This embodiment further defines the regression expression for the pre-obtained fruit and vegetable outline area and quality in step 3 of the fruit and vegetable quality prediction method described in Embodiment 2. The specific implementation details are as follows:

[0082] The regression expression for the outline area and mass of fruits and vegetables obtained in step 3 is as follows:

[0083] i∈[1,n],j∈[1,ki];

[0084] Where ki represents the number of the i-th type of fruit and vegetable in the pile of fruits and vegetables to be weighed, and k1+k2+…+kn=m; S is the predicted quality value of the j-th fruit and vegetable among the i-th types of fruits and vegetables. i j Let a be the fruit and vegetable outline area of ​​the j-th fruit and vegetable in the i-th type of fruit and vegetable. i Let b be the slope of the fitted relationship for the i-th type of fruit and vegetable. i The intercept of the fitted relationship expression for the i-th type of fruit and vegetable is given.

[0085] Implementation Method 4: Combination Figure 1This embodiment further defines the regression expression of the pre-obtained fruit and vegetable outline area and quality in step 3 of the fruit and vegetable quality prediction method described in Embodiment 3. The specific implementation details are as follows:

[0086] The pre-obtained regression expression for the fruit and vegetable outline area and quality in step 3 is obtained through the following method:

[0087] Based on the pre-collected contour area and mass data of each fruit and vegetable in the pile to be sampled, obtain the contour area and mass samples of the fruits and vegetables.

[0088] The fruit and vegetable outline area and quality samples are divided into fruit and vegetable outline area and quality datasets corresponding to each fruit and vegetable type.

[0089] Statistical analysis was performed on the fruit and vegetable outline area and quality dataset corresponding to each fruit and vegetable type. The least squares method was used to obtain the regression expression for the fruit and vegetable outline area and quality corresponding to each fruit and vegetable type.

[0090] In this embodiment, the contour area of ​​different types of fruits and vegetables can be extracted using a camera combined with image processing software, and the quality data of different types of fruits and vegetables can be extracted using an electronic scale.

[0091] Implementation Method 5: Combination Figure 1 This embodiment further defines the fruit and vegetable quality prediction method described in Embodiment 4. The specific implementation details are as follows:

[0092] The method for predicting the quality of fruits and vegetables also includes the following steps:

[0093] Step 4: Use the residual allocation algorithm to correct the quality prediction value to obtain the final quality prediction value of any one of the fruits and vegetables.

[0094] In this embodiment, when weighing multiple fruits and vegetables simultaneously, a residual allocation algorithm is used to redistribute the prediction error, reducing the prediction error caused by camera distortion and further improving the prediction accuracy when weighing multiple fruits and vegetables.

[0095] In a further embodiment, the residual allocation algorithm is as follows:

[0096] Measure the actual total mass W0 of the pile of fruits and vegetables to be weighed;

[0097] Calculate the predicted total mass of the pile of fruits and vegetables to be weighed. The predicted total mass The sum of the predicted mass values ​​of all fruits and vegetables in the pile to be weighed;

[0098] Based on the actual total mass value W0 and the predicted total mass value The residual δ is calculated using the following expression:

[0099]

[0100] in, To predict the total mass, W0 is the total weighed mass, and δ is the difference between the actual mass and the predicted mass;

[0101] Based on the residual δ and the slope a of the fitting relationship between the i-th type of fruit and vegetable i And the fruit and vegetable outline area S of the j-th fruit and vegetable of the i-th type of fruit and vegetable. i j For the predicted quality value Make corrections to obtain the final predicted quality value for any one of the fruits and vegetables. The expression is:

[0102]

[0103] S = [S k1 ,S k2 ,…,S kn S is a vector composed of the outline areas of all fruits and vegetables in the pile to be weighed, where S ki =[S i 1 ,S i 2 ,…,S i ki ], S ki It is a vector composed of the outline areas of all fruits and vegetables in the i-th type of fruit and vegetable;

[0104] a = [a k1 ,a k2 ,…,a kn ], where a is a vector composed of the slopes of the fitted relationship expressions of all fruits and vegetables in the pile to be weighed, where a ki It is made of ki a i The vector formed by the vector.

[0105] In this embodiment, when multiple fruits and vegetables are weighed simultaneously, camera distortion will cause deviations in the predicted quality values ​​of each fruit and vegetable, so it is necessary to correct the predicted quality values ​​of the fruits and vegetables.

[0106] The residual allocation algorithm has the following basic process: First, based on the actual total mass of fruits and vegetables, calculate the residual between the actual mass and the predicted mass; then, according to the slope vector of the fitted relationship and the area vector of the fruit and vegetable outline, redistribute the residual to obtain the final predicted mass of each fruit and vegetable, so as to reduce the prediction error.

[0107] When weighing multiple fruits and vegetables simultaneously, using a residual allocation algorithm to correct the quality prediction value can reduce the quality prediction error caused by camera distortion and improve the accuracy of quality prediction.

[0108] Implementation Method Six: Combination Figure 1 This embodiment describes a fruit and vegetable quality prediction device, and the specific implementation details are as follows:

[0109] Fruit and vegetable quality prediction device, the device specifically includes:

[0110] Module 1: Used to acquire images of fruits and vegetables in a pile to be weighed, wherein the pile contains m fruits and vegetables of a total of n varieties, where m and n are both positive integers greater than or equal to 1.

[0111] Module 2: Used to obtain the outline area of ​​any one fruit or vegetable in the pile of fruits and vegetables to be weighed based on the fruit and vegetable image;

[0112] Module 3: Used to retrieve the corresponding pre-obtained regression expression of fruit and vegetable outline area and quality based on the type of any fruit or vegetable and the outline area of ​​the fruit or vegetable, and obtain the quality prediction value of any fruit or vegetable.

[0113] In this embodiment, the fruit and vegetable quality prediction device is used to implement the fruit and vegetable quality prediction method described in Embodiment 1.

[0114] In a further embodiment, the fruit and vegetable quality prediction device also includes the following modules:

[0115] Module 4: Used to correct the quality prediction value using a residual allocation algorithm to obtain the final quality prediction value of any one of the fruits and vegetables.

[0116] In this embodiment, the fruit and vegetable quality prediction device is used to implement the fruit and vegetable quality prediction method described in Embodiment 5.

[0117] Implementation Method Seven: Combination Figure 1 This embodiment describes an example of the fruit and vegetable quality prediction method described in Embodiment 1. The specific implementation details are as follows:

[0118] The following example uses a pile of five kinds of fruits and vegetables—apples, pears, oranges, cherry tomatoes (also known as small tomatoes or fruit and vegetable tomatoes, belonging to the genus *Solanum*), and plums—to illustrate the method for predicting the quality of fruits and vegetables. For simplicity, each type of fruit and vegetable is represented by only one example, as follows:

[0119] Appendix Figure 5 and attached Figure 6The graphs show the linear regression relationship between the outline area and weight of five fruits and vegetables: apples, pears, oranges, cherry tomatoes, and plums.

[0120] Through append Figure 5 and attached Figure 6 It can be seen that the outline area and weight of the five fruits and vegetables have a good linear relationship. The following formula is the regression expression for the outline area and weight of the five fruits and vegetables:

[0121]

[0122] The subscripts have the following meanings: 1-Apple, 2-Pear, 3-Orange, 4-Cherry Tomato, 5-Plum; the superscript indicates that there is only one of each fruit or vegetable.

[0123] Implementation Method 8: Combination Figure 1 This embodiment describes an example of the residual allocation algorithm in the fruit and vegetable quality prediction method described in Embodiment 5. The specific implementation details are as follows:

[0124] Using the residual allocation algorithm, the final predicted quality value of each fruit and vegetable can be obtained. The following example, taking a single fruit or vegetable (plum, pear, orange, and cherry tomato) weighed simultaneously, demonstrates the quality prediction effect before and after correction using the residual allocation algorithm on the quality prediction value obtained from the regression expression of the fruit / vegetable outline area and quality:

[0125] The relevant data is shown in Table 1 below.

[0126] Table 1. Results of Residual Allocation Algorithm

[0127]

[0128] As shown in the table above, when using only the regression expression of fruit and vegetable outline area and weight to predict the weight of the four types of fruits and vegetables, the total predicted weight of the fruits and vegetables was 512.26g, while the actual total weight of the fruits and vegetables was 508g, a difference of 4.26g. After correcting the predicted weight of the fruits and vegetables using the residual allocation algorithm, the final predicted weight of the fruits and vegetables was 507.62g, with an error of only 0.07%, which improved the accuracy of the prediction.

[0129] The above description of several specific embodiments further details the technical solution provided by the present invention in order to highlight the advantages and benefits of the technical solution provided by the present invention. However, the above-described specific embodiments are not intended to limit the present invention. Any reasonable modifications and improvements to the present invention, reasonable combinations of embodiments, and equivalent substitutions based on the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for predicting the quality of fruits and vegetables, characterized in that, The method specifically includes: Step 1: Collect images of the fruits and vegetables in the pile to be weighed. The pile contains m fruits and vegetables of a total of n varieties, where m and n are both positive integers greater than or equal to 1. Step 2: Based on the fruit and vegetable image, obtain the outline area of ​​any one fruit or vegetable in the pile of fruits and vegetables to be weighed; Step 3: Based on the type of any fruit or vegetable and the outline area of ​​the fruit or vegetable, retrieve the corresponding pre-obtained regression expression of the outline area and quality of the fruit or vegetable to obtain the predicted quality value of any fruit or vegetable. The fruit and vegetable quality prediction method is used to predict the quality of all fruits and vegetables whose outline area has a linear regression relationship with quality, and the fruits and vegetables include fruits and vegetables. Step 2 specifically includes: Step 2.1: Define the color range of the fruit and vegetable image and lock the fruit and vegetable area of ​​any one fruit or vegetable in the pile to be weighed; Step 2.2: Perform morphological transformation on the fruit and vegetable area. First, perform a closing operation to remove small holes in the fruit and vegetable area, and then perform an opening operation to remove edge burrs in the fruit and vegetable area to obtain the processed fruit and vegetable area. Step 2.3: Perform edge detection on the processed fruit and vegetable area to obtain all the outermost edges of the processed fruit and vegetable area, and calculate the area enclosed by all the outermost edges to obtain the fruit and vegetable outline area of ​​any one fruit and vegetable. The regression expression for the outline area and mass of fruits and vegetables obtained in step 3 is as follows: in, This indicates the number of the i-th type of fruit and vegetable in the pile to be weighed. ; This is the predicted quality value of the j-th fruit or vegetable among the i-th types of fruits and vegetables. Let J be the fruit and vegetable outline area of ​​the j-th fruit and vegetable in the i-th type of fruit and vegetable. Let be the slope of the fitted relationship expression for the i-th type of fruit and vegetable. The intercept of the fitted relationship for the i-th type of fruit and vegetable; The pre-obtained regression expression for the fruit and vegetable outline area and quality in step 3 is obtained through the following method: Based on the pre-collected contour area and mass data of each fruit and vegetable in the pile to be sampled, obtain the contour area and mass samples of the fruits and vegetables. The fruit and vegetable outline area and quality samples are divided into fruit and vegetable outline area and quality datasets corresponding to each fruit and vegetable type. Statistical analysis was performed on the fruit and vegetable outline area and quality dataset corresponding to each fruit and vegetable type. The least squares method was used to obtain the regression expression of the fruit and vegetable outline area and quality corresponding to each fruit and vegetable type. The method for predicting the quality of fruits and vegetables also includes the following steps: Step 4: Use the residual allocation algorithm to correct the quality prediction value to obtain the final quality prediction value of any one of the fruits and vegetables; The residual allocation algorithm is as follows: Measure the actual total mass of the pile of fruits and vegetables to be weighed. ; Calculate the predicted total mass of the pile of fruits and vegetables to be weighed. The total mass prediction value The sum of the predicted mass values ​​of all fruits and vegetables in the pile to be weighed; Based on the actual value of the total mass and the total mass prediction value Calculate the residual The expression is as follows: in, To predict the total mass, The total mass is the weight. The difference between the actual quality and the predicted quality; According to the residual The slope of the fitting relationship between the i-th type of fruit and vegetable And the fruit and vegetable outline area of ​​the j-th fruit and vegetable of the i-th type of fruit and vegetable. For the predicted quality value Make corrections to obtain the final predicted quality value for any one of the fruits and vegetables. The expression is: , Let be a vector consisting of the outline areas of all fruits and vegetables in the pile to be weighed, where , It is a vector composed of the outline areas of all fruits and vegetables in the i-th type of fruit and vegetable; , Let be a vector composed of the slopes of the fitted relationships between all fruits and vegetables in the pile to be weighed, where It is made by ki The vector formed by the vector.

2. A fruit and vegetable quality prediction device, characterized in that, The device specifically includes: Module 1: Used to acquire images of fruits and vegetables in a pile to be weighed, wherein the pile contains m fruits and vegetables of a total of n varieties, where m and n are both positive integers greater than or equal to 1. Module 2: Used to obtain the outline area of ​​any one fruit or vegetable in the pile of fruits and vegetables to be weighed based on the fruit and vegetable image; Module 3: Used to retrieve the corresponding pre-obtained fruit and vegetable outline area and quality regression expression based on the type of any one fruit and vegetable and the outline area of ​​the fruit and vegetable, and obtain the quality prediction value of any one fruit and vegetable; The fruit and vegetable quality prediction device also includes the following modules: Module 4: Used to correct the quality prediction value using a residual allocation algorithm to obtain the final quality prediction value of any one of the fruits and vegetables; The residual allocation algorithm is the residual allocation algorithm of the fruit and vegetable quality prediction method according to claim 1.

3. Fruit and vegetable quality prediction equipment, including: The image acquisition unit, microprocessor, and storage medium are characterized by: The storage medium is used to store the executable instructions of the microprocessor; The microprocessor is configured to execute the fruit and vegetable quality prediction method of claim 1 by executing the executable instructions; The image acquisition unit is used to acquire a single image of any one fruit or vegetable in the pile of fruits and vegetables to be weighed, and send the single image of the fruit or vegetable to the microprocessor.

Citation Information

Patent Citations

  • Fruit and vegetable weighing method based on neural network, storage medium and device

    CN111160450A

  • Egg weight detection method and device based on deep learning

    CN115731236A