High-throughput measurement method for transverse diameter and longitudinal diameter of pineapple fruit based on image processing

Through the combination of OpenCV image processing technology and vernier caliper measurement, the problem of low efficiency and large error in manual measurement of horizontal and vertical diameters of pineapple fruits is solved, and a high-throughput and accurate measurement method of pineapple fruits is realized, providing support for the evaluation of pineapple germplasm resources and the selection and breeding of new varieties.

CN120538385APending Publication Date: 2025-08-26SOUTH SUBTROPICAL CROP RES INST CHINA ACAD OF TROPICAL AGRI SCI

Patent Information

Application Number
CN202510606840.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

In the prior art, the manual measurement methods of the horizontal and vertical diameters of pineapple fruits are inefficient and are susceptible to artificial errors, making it difficult to achieve high-throughput and accurate measurement.

Method used

Using OpenCV-based image processing method, a high-throughput measurement method is established by constructing a horizontal and vertical diameter model of pineapple fruit, a digital camera is used to collect image data, and combined with vernier caliper measurement and image processing algorithms, pineapple fruit profile extraction and calibration are carried out to establish a high-throughput measurement method.

Benefits of technology

It realizes efficient and accurate measurement of the horizontal and vertical diameters of pineapple fruits, reduces artificial errors, provides high-throughput accurate evaluation methods, laying the foundation for the evaluation of pineapple germplasm resources and the selection and breeding of new varieties.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120538385A_ABST
    Figure CN120538385A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of agronomy, and provides a high-throughput measurement method for the transverse diameter and the longitudinal diameter of a pineapple fruit based on image processing, which comprises the following steps: measuring the transverse diameter and the longitudinal diameter of the pineapple fruit by using a vernier caliper to obtain transverse diameter and longitudinal diameter data of the fruit, and constructing a training set and a test set; the method for automatically measuring the longitudinal stem and the transverse diameter of the pineapple fruit based on an open source computer vision library (OpenCV) is established, an efficient and accurate method is provided for high-throughput accurate evaluation of pineapple germplasm resource fruits, and accurate data support is provided for genetic analysis and gene mining of pineapple fruit size characters. And a good foundation is laid for the breeding of a new variety of the large-fruit pineapple.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of agronomy, and particularly relates to a high-throughput determination method for the transverse diameter and longitudinal diameter of a pineapple fruit based on image processing. Background Art

[0002] The horizontal and vertical diameters of pineapples are significantly correlated with single-fruit weight and are key indicators of yield. Traditionally, fruit size measurement relies on manual methods such as calipers and weighing. These methods are inefficient and labor-intensive, and are also prone to errors that can lead to inaccurate measurements.

[0003] Computer vision technology, as a non-contact measurement method, has been successfully applied to fruit size measurement for apples, lychees, grapes, and other fruit trees due to its advantages of high efficiency, good repeatability, and quantification. Mainstream research methods include the YOLO series of object detection algorithms, 3D point cloud reconstruction technology, and deep convolutional neural networks (CNNs). However, these methods require complex model tuning and system configuration, placing high demands on the user's computer skills, limiting their application to fruit trees. In contrast, the open source computer vision library (OpenCV) uses mature image processing algorithms to rapidly extract fruit size, requiring only basic image acquisition equipment and general programming knowledge. Summary of the Invention

[0004] To solve the above technical problems, the present invention provides a high-throughput determination method for the horizontal and vertical diameters of pineapple fruits based on image processing to solve the problems in the prior art. The technical solution adopted by the present invention is:

[0005] A high-throughput method for measuring the transverse and longitudinal diameters of pineapple fruits based on image processing comprises the following steps:

[0006] Step 1: Constructing a model of the fruit's horizontal and vertical diameters: Measure the maximum horizontal and vertical diameters of the pineapple. Use some of the measurement results as a training set for the OpenCV model, and the remaining measurement results for validation.

[0007] Step 2: Image acquisition: Illuminate the pineapple with a soft light source and use a digital camera to capture pineapple image data, including the pineapple fruit, ruler, and label;

[0008] Step 3: Analyze the horizontal and vertical diameters of pineapple fruits: Measure the vertical and horizontal diameters of pineapple fruits in the pineapple image data and use them to construct a training set for the OpenCV model for cluster analysis.

[0009] Step 4: Image processing: Use cv2 to find the outline of the object in the image and select the filtered pixels;

[0010] Step 5: Model evaluation: Calibrate the model based on manual measurements of the pineapple fruit's transverse diameter and OpenCV model measurements, and compare the accuracy of the OpenCV model in measuring the transverse and longitudinal diameters of the pineapple fruit before and after calibration.

[0011] Step 6: Model verification: Use an independent test set to verify the OpenCV model.

[0012] Furthermore, in step 1, the coefficient of determination R 2 Hejun Root square error

[0013] The indicator performs statistical analysis on the accuracy changes of OpenCV algorithm measurement values ​​and manual measurement values ​​before and after model calibration; through the residual analysis system, residual analysis and residual histogram analysis are used

[0014]

[0015] Furthermore, in step three, the longitudinal and transverse diameters of the pineapple fruit were measured using a vernier caliper; the longitudinal diameter ranged from 37.29 to 246.68 mm, with an average longitudinal diameter of 124.07 mm; the transverse diameter ranged from 28.27 to 150.65 mm, with an average transverse diameter of 108.11 mm.

[0016] Furthermore, in step 4, cv2 is used to find the contours of objects in the image, and objects with less than 100,000 pixels are selected for filtering, and morphological dilation processing is performed. When the dilation coefficients are 1, 2, and 3, the contour extraction completeness is 0.99990252-0.999999574, and the fruit contour is not complete; when the dilation coefficient iterations is 4, the contour extraction completeness is 1, indicating that the fruit contour extraction is complete.

[0017] Furthermore, in step 5, before calibration, the measurement results of the longitudinal and transverse diameters determine the coefficient R 2 The values ​​are 0.94 and 0.90 respectively, indicating that there is a high linear correlation between the OpenCV measurement values ​​and the manual measurement values. The root mean square error of the longitudinal diameter is 46.90 mm, and the root mean square error of the transverse diameter is 32.09 mm, indicating that the model has significant systematic measurement deviations.

[0018] Furthermore, in step six, an independent test set was used for verification, and the deviation between the predicted longitudinal diameter and the manually measured value was ±20 mm.

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

[0020] The present invention uses a vernier caliper to measure the transverse and longitudinal diameters of pineapple fruits, obtains fruit transverse and longitudinal diameter data, constructs a training set and a test set, and establishes an automatic measurement method for the longitudinal stem and transverse diameter of pineapple fruits based on an open source computer vision library (OpenCV). The method provides an efficient and accurate method for high-throughput and precise evaluation of pineapple germplasm resources and fruits, and also provides accurate data support for genetic analysis and gene mining of pineapple fruit size traits, laying a good foundation for the selection and breeding of new large-fruited pineapple varieties. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 This is the cluster analysis of pineapple fruits of the present invention, wherein A is the cluster analysis of the longitudinal diameter of pineapple fruits, and B is the cluster analysis of the transverse diameter of pineapple fruits;

[0022] Figure 2 The size range of pineapple fruit;

[0023] Figure 3 Extraction of pineapple fruit outline;

[0024] Figure 4 Linear analysis of predicted and measured values ​​of pineapple fruit transverse diameter;

[0025] Figure 5 The residual analysis and residual histogram analysis of the longitudinal diameter of pineapple fruit are shown;

[0026] Figure 6 This is the residual analysis and residual histogram analysis of pineapple fruit diameter. DETAILED DESCRIPTION

[0027] The following is a combination of the embodiments of the present invention Figures 1-6 , the technical solutions in the embodiments of the present invention are described clearly and completely. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Unless otherwise specified, the technical means used in the embodiments are conventional means well known to those skilled in the art.

[0028] A high-throughput method for measuring the transverse and longitudinal diameters of pineapple fruits based on image processing comprises the following steps:

[0029] Step 1: Constructing a model of the fruit's horizontal and vertical diameters: Measure the maximum horizontal and vertical diameters of the pineapple. Use some of the measurement results as a training set for the OpenCV model, and the remaining measurement results for validation.

[0030] Specifically, referring to the DUS testing procedures in the "Guidelines for Plant Variety Specificity, Uniformity, and Stability Testing for Pineapples," an electronic digital caliper with an accuracy of 0.01 mm was used to measure the maximum horizontal and vertical diameters of pineapples (excluding the crown bud and fruit neck). A total of 960 pineapples were collected. Of these, 706 fruits served as the training set for the OpenCV model, and 254 were used for model validation.

[0031] The present invention adopts a multi-dimensional verification strategy to systematically evaluate the reliability of the model. First, the coefficient of determination (R 2 ) and both Root square error (RMSE)

[0032] The indicator statistically analyzes the accuracy changes of the OpenCV algorithm measurement value (Ymeasured) and the manual measurement value (Ymanual) before and after model calibration. Secondly, in terms of error distribution analysis, the residual analysis system (Residual = Ymeasured-Ymanual) is used to analyze the residual analysis and residual histogram analysis.

[0033] The feasibility of the method was further analyzed.The above analysis was completed using R language.

[0034] Step 2: Image acquisition: Illuminate the pineapple with a soft light source and use a digital camera to capture pineapple image data, including the pineapple fruit, ruler, and label;

[0035] Specifically, the image acquisition device consists of a camera box and a digital camera (Canon 70D). The light box is a 60cm × 60cm × 60cm photography box containing two soft light sources (20W, color temperature 4500K). The box's sides and top are covered with silver diffuse reflective cloth, and a 15cm Φ shooting hole is retained at the top. The pineapple fruit, ruler, and label are placed on a black, non-reflective background cloth. The camera is in PC mode, and the captured image includes the pineapple fruit, ruler, and label, and is saved in JPEG format.

[0036] Step 3: Analyze the horizontal and vertical diameters of pineapple fruits: Measure the vertical and horizontal diameters of pineapple fruits in the pineapple image data and use them to construct a training set for the OpenCV model for cluster analysis.

[0037] Specifically, the vertical diameter (Length) and horizontal diameter (Width) of the pineapple fruit were measured using a vernier caliper. The vertical diameter ranged from 37.29 to 246.68 mm, with an average of 124.07 mm; the horizontal diameter ranged from 28.27 to 150.65 mm, with an average of 108.11 mm. Figure 2The pineapple fruits used to construct the model training set were clustered and analyzed. The results showed that pineapple fruits were divided into 5 categories according to their longitudinal stems and transverse diameters ( Figure 1 A and Figure 1 B) in.

[0038] Step 4: Image processing: Use cv2 to find the outline of the object in the image and select the filtered pixels;

[0039] Specifically: Use cv2 to find the outline of the object in the picture. The smallest pineapple at present is 'Yulinglong', which has 170742 pixels in the picture. Therefore, we choose to filter objects with less than 100000 pixels. This can not only find the outline of the pineapple fruit, but also separate the target fruit from the background debris. Figure 3 Directly extracting the contour is incomplete. Further morphological dilation processing is performed. When the dilation coefficient iterations are 1, 2, and 3, the contour extraction completeness is 0.99990252-0.999999574, indicating that the fruit contour is still incomplete; when the dilation coefficient iterations is 4, the contour extraction completeness is 1, indicating that the fruit contour extraction is complete, as shown in Table 1:

[0040] Table 1 Completeness of pineapple fruit contour extraction

[0041]

[0042] Extract the custom color lower limit [150,50,50] and upper limit [165,255,255] of the ruler. The horizontal diameter of each color grid of the ruler is 1 cm. The model automatically obtains the ruler color pixel points and converts them into 1 cm, thereby mapping the actual size of the maximum horizontal and vertical diameters of the pineapple fruit. For example, Figure 3 .

[0043] Step 5: Model evaluation: Calibrate the model based on manual measurements of the pineapple fruit's transverse diameter and OpenCV model measurements, and compare the accuracy of the OpenCV model in measuring the transverse and longitudinal diameters of the pineapple fruit before and after calibration.

[0044] Specifically, based on the manual measurement values ​​and OpenCV measurement values ​​of the horizontal diameter of 706 pineapple fruits, the determination coefficient (R 2 ) were 0.94 and 0.90, respectively, indicating that there was a high linear correlation between the OpenCV measurement values ​​and the manual measurement values; however, their root mean square error (RMSE) was high, reaching 46.90 mm (longitudinal diameter) and 32.09 mm (horizontal diameter), respectively, indicating that the model had significant systematic measurement bias ( Figure 3 After calibration, the model maintains the original linear correlation stability (longitudinal diameter R 2 Slightly decreased from 0.94 to 0.92, the horizontal diameter R2 The RMSE was significantly reduced to 7.54 mm (vertical diameter) and 6.93 mm (horizontal diameter), and the average error was reduced by 81%, indicating that the calibration effectively eliminated the systematic bias. Figure 4 , the horizontal and vertical diameters of the fruit are randomly distributed near the zero line, indicating that the model fits well. Figure 5 、 Figure 6 The residual histogram exhibits a normal distribution (i.e., a bell shape), indicating that the model's linear assumption is reasonable. These results demonstrate that the OpenCV-based measurement model, after systematic error correction, not only retains the strong linear correlation characteristics of the original data but also achieves millimeter-level measurement accuracy (RMSE < 8 mm). This model can be used to measure the horizontal and vertical diameters of pineapple fruit.

[0045] Step 6: Model verification: Use an independent test set to verify the OpenCV model.

[0046] Specifically, to evaluate the model's universality, an independent test set (254 pineapple fruit samples not included in the modeling) was used for validation. The results showed that the deviation between the predicted longitudinal diameter and the manually measured value was ±20 mm. Of these, 144 samples had a deviation of ±6.66 mm, accounting for 56.69% of the total test set; 87 samples had a deviation between ±6.66 and 13.32 mm, accounting for 34.25% of the total test set; and 23 samples had a deviation between ±13.32 and 20 mm, accounting for 9.06% of the test set. The deviation between the predicted transverse diameter and the manually measured value was ±20 mm. Of these, 131 samples had a deviation of ±6.66 mm, accounting for 51.57%; 97 samples had a deviation between ±6.66 and 13.32 mm, accounting for 38.19%; and 26 samples had a deviation between ±13.32 and 20 mm, accounting for 10.24%. These results demonstrate that the model maintains stable measurement accuracy across independent samples.

[0047] The embodiments described above are merely descriptions of preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the spirit of the present invention, various deformations, modifications, and substitutions made to the technical solutions of the present invention by ordinary technicians in this field should fall within the scope of protection determined by the claims of the present invention.

Claims

1. A high-throughput determination method for the transverse and longitudinal diameters of pineapple fruits based on image processing, characterized in that: The following steps are involved: Step 1: Constructing a model of the fruit's horizontal and vertical diameters: Measure the maximum horizontal and vertical diameters of the pineapple. Use some of the measurement results as a training set for the OpenCV model, and the remaining measurement results for validation. Step 2: Image acquisition: Illuminate the pineapple with a soft light source and use a digital camera to capture pineapple image data, including the pineapple fruit, ruler, and label; Step 3: Analyze the horizontal and vertical diameters of pineapple fruits: Measure the vertical and horizontal diameters of pineapple fruits in the pineapple image data and use them to construct a training set for the OpenCV model for cluster analysis. Step 4: Image processing: Use cv2 to find the outline of the object in the image and select the filtered pixels; Step 5: Model evaluation: Calibrate the model based on manual measurements of the pineapple fruit's transverse diameter and OpenCV model measurements, and compare the accuracy of the OpenCV model in measuring the transverse and longitudinal diameters of the pineapple fruit before and after calibration. Step 6: Model verification: Use an independent test set to verify the OpenCV model.

2. a kind of high-throughput determination method of pineapple fruit transverse diameter and longitudinal diameter based on image processing according to claim 1, is characterized in that, In step 1, the coefficient of determination R 2 Hejun Root square error The indicator performs statistical analysis on the accuracy changes of OpenCV algorithm measurement values ​​and manual measurement values ​​before and after model calibration; through the residual analysis system, residual analysis and residual histogram analysis are used 3. a kind of high-throughput determination method of pineapple fruit transverse diameter and longitudinal diameter based on image processing according to claim 1, is characterized in that, In step three, the longitudinal and transverse diameters of the pineapple fruits were measured using a vernier caliper; the longitudinal diameter ranged from 37.29 to 246.68 mm, with an average longitudinal diameter of 124.07 mm; the transverse diameter ranged from 28.27 to 150.65 mm, with an average transverse diameter of 108.11 mm.

4. a kind of high-throughput determination method of pineapple fruit transverse diameter and longitudinal diameter based on image processing according to claim 1, is characterized in that, In step 4, cv2 is used to find the contours of objects in the image, and objects with less than 100,000 pixels are selected for filtering, and morphological dilation processing is performed. When the dilation coefficients are 1, 2, and 3, the contour extraction completeness is 0.99990252-0.999999574, and the fruit contour is not complete; when the dilation coefficient iterations is 4, the contour extraction completeness is 1, indicating that the fruit contour extraction is complete.

5. a kind of high-throughput determination method of pineapple fruit transverse diameter and longitudinal diameter based on image processing according to claim 1, is characterized in that, In step 5, before calibration, the measurement results of the longitudinal and transverse diameters determine the coefficient R 2 The values ​​are 0.94 and 0.90 respectively, indicating that there is a high linear correlation between the OpenCV measurement values ​​and the manual measurement values. The root mean square error of the longitudinal diameter is 46.90 mm, and the root mean square error of the transverse diameter is 32.09 mm, indicating that the model has significant systematic measurement deviations.

6. A high-throughput determination method for pineapple fruit transverse diameter and longitudinal diameter based on image processing according to claim 1, characterized in that, In step six, an independent test set was used for verification, and the deviation between the predicted longitudinal diameter and the manual measurement value was ±20 mm.

Citation Information

Patent Citations

  • Pear fruit transverse and longitudinal diameter measuring method based on image processing

    CN110751689A

  • Method for estimating single fruit weight of tomato by using longitudinal and transverse diameters of fruit

    CN117455114A

  • Apple damage volume prediction method, and device, storage medium and processor

    WO2025025549A1

Cited By

  • High-throughput counting method for small pineapple fruits

    CN121170485A