Pomelo fruit edible rate measurement method and device based on machine vision and x-ray imaging
Patent Information
- Application Number
- PCT/CN2024/106108
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-05
- Filing Date
- 2024-07-18
- Publication Date
- 2025-10-02
AI Technical Summary
The existing technology for detecting the edible rate of pomelo fruit lacks accuracy and efficiency, making it difficult to achieve non-destructive, accurate and rapid detection.
A method based on machine vision and X-ray imaging was used, combined with B-spline curve interpolation to fit the outer contour of pomelo slices, and a three-dimensional model was established. The edible rate was calculated by fitting the function of the pulp thickness map and the X-ray grayscale map, and rapid detection was achieved using a conveyor belt.
It achieves rapid, efficient and accurate detection of the edible rate of pomelo fruit, reduces equipment costs, and improves detection accuracy and practicality.
Smart Images

Figure CN2024106108_02102025_PF_FP_ABST
Abstract
Description
Method and device for measuring edible rate of pomelo fruit based on machine vision and X-ray imaging Technical Field
[0001] The present invention relates to image processing, and more particularly to a method and device for measuring the edible rate of pomelo fruit based on machine vision and X-ray imaging. Background Art
[0002] Agricultural product quality testing and grading are crucial for improving the industry's economic efficiency and upgrading its development. Edible rate is a key indicator of pomelo fruit's internal quality, representing the amount of pulp in the fruit. However, due to the randomness of fruit growth, i.e., varying fruit shapes, thick skin, and large fruit, edible rate testing suffers from inaccurate and inefficient accuracy. Currently, there are few reports on non-destructive testing methods for pomelo fruit edible rate, and these methods have not been effectively applied in actual production. To meet the pomelo fruit industry's requirements for accurate and rapid non-destructive testing of edible rate, this paper proposes a pomelo fruit edible rate measurement algorithm based on machine vision and X-ray imaging.
[0003] Summary of the Invention
[0004] In view of this, the present invention provides a method and device for measuring the edible rate of pomelo fruit based on machine vision and X-ray imaging.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A method for measuring the edible rate of pomelo fruit based on machine vision and X-ray imaging comprises the following steps:
[0007] Step 1: Collecting pomelo appearance images;
[0008] Step 2: segment the pomelo appearance image and remove the pomelo background image;
[0009] Step 3: Slice the pomelo fruit appearance image, determine endpoints on the slices, and determine the outer contour of the pomelo fruit slices using a B-spline curve interpolation fitting method based on the endpoints;
[0010] Step 4: Based on the outer contour of the pomelo slice, with the horizontal diameter and vertical diameter being the x-axis and y-axis directions respectively, a flesh model thickness map is established for the flesh area in the pomelo 3D model along the X-ray image shooting direction;
[0011] Step 5: The value of each point in the flesh model thickness map represents the flesh thickness at that point along the shooting direction of the X-ray image.
[0012] Preferably, the method for measuring the edible rate of pomelo fruit comprises the following steps:
[0013] Step 1: collecting an appearance image of the pomelo fruit, an X-ray image of the pomelo fruit in a direction perpendicular to the longitudinal diameter of the pomelo fruit, and the weight of the pomelo fruit;
[0014] Step 2: segment the pomelo appearance image and remove the pomelo background image;
[0015] Step 3: Slice the pomelo fruit appearance image, determine endpoints on the slices, and use a B-spline curve interpolation fitting method to determine the outer contour of the pomelo fruit slice based on the endpoints to obtain a three-dimensional model of the outer contour of the pomelo fruit;
[0016] Step 4: Based on the outer contour of the pomelo fruit slice, with the horizontal diameter and the vertical diameter being the x-axis and y-axis directions respectively, the three-dimensional model of the outer contour of the pomelo fruit and the X-ray image are combined to obtain the pulp area in the three-dimensional model of the pomelo fruit; and a pulp model thickness map is established by tracing the pulp area in the three-dimensional model of the pomelo fruit along the shooting direction of the X-ray image.
[0017] Step 5: The value of each point in the flesh model thickness map represents the flesh thickness at that point along the shooting direction of the X-ray image;
[0018] Using a fitting algorithm, a fitting function is calculated between the grayscale of corresponding points in the flesh model thickness map and the grayscale map of the X-ray image;
[0019] Using a fitting function, the grayscale image of the X-ray image is corrected to obtain a corrected grayscale image of the X-ray image;
[0020] The edible rate was calculated based on the weight of the pomelo fruit, the fitting function, the grayscale of each point of the pulp part in the grayscale image of the corrected X-ray image, the pulp density of the pomelo fruit, and the width and height of the X-ray image of the pomelo fruit.
[0021] Preferably, the width and height of the X-ray image of the pomelo fruit are obtained based on the grayscale image of the corrected X-ray image.
[0022] Optionally, before collecting the pomelo appearance image, Zhang calibration is performed using the RGB camera, and distortion correction is performed based on the camera's intrinsic parameters, extrinsic parameters, and distortion coefficients.
[0023] Optionally, perform correction based on geometric relationships to obtain the actual width D of the pomelo:
[0024] Where w is the pixel width of the pomelo fruit in the image; d is the distance from the pomelo fruit to the camera. The distance d between other pomelo fruits and the camera after correction is defined as:
[0025] Where d m is the distance between a medium-sized pomelo and the camera, w m is the pixel width of a medium-sized pomelo, and f is the focal length of the camera.
[0026] Optionally, in step 2, a threshold segmentation method is used to intercept the pomelo fruit area, and a dual-channel fusion processing method is used to convert the appearance image of the pomelo fruit from the RGB color space to the HSI color space, and the hue H channel and the lightness I channel are extracted and threshold segmented respectively. The two parts are superimposed to obtain the complete pomelo fruit area.
[0027] Optionally, in step 4, in the X-ray image, the pixel thicknesses t1 and t2 of the peel at both ends of each slice are obtained, and the average value is taken as the average pixel thickness t of the pomelo slice. The thickness t is shrunk inward on the outer contour of the pomelo slice, that is, the polar radius of each point of the outer contour is reduced by t, and the new contour line obtained can be used as the contour of the flesh slice.
[0028] A device for measuring the edible rate of pomelo fruit based on machine vision and X-ray imaging utilizes a method for measuring the edible rate of pomelo fruit based on machine vision and X-ray imaging. The device comprises: a conveyor belt, an RGB camera, a camera bracket, and an X-ray detection device. The RGB camera is fixed to the camera bracket and is used to adjust the position of the pomelo fruit. The conveyor belt is used to transport the pomelo fruit. The X-ray detection device is provided with a radiation source and is used to perform X-ray detection on the pomelo fruit.
[0029] It can be seen from the above technical solution that, compared with the prior art, the present invention provides a method and device for measuring the edible rate of pomelo fruit based on machine vision and X-ray imaging, which has the following beneficial effects:
[0030] 1. Using a conveyor belt, the edible rate of pomelo can be quickly and efficiently detected while it is moving.
[0031] 2. Only one X-ray image needs to be collected for one pomelo fruit, with a simple structure and fast detection.
[0032] 3. X-ray imaging technology can obtain internal image information of pomelo fruit and has accurate detection effect.
[0033] In addition, the present invention has the following further beneficial effects:
[0034] The present invention reconstructs a 3D model of a pomelo based on B-splines to measure its volume, and simultaneously fits the pulp thickness and X-ray grayscale value to measure its edible rate. This method eliminates the need for multi-directional X-CT scanning imaging required in traditional technologies, effectively reducing equipment costs. Furthermore, the method of the present invention has high accuracy and strong practicality. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0036] FIG1 is a schematic structural diagram of the present invention;
[0037] FIG2 is a schematic diagram of image segmentation and matching;
[0038] FIG3a is a schematic diagram showing an implementation of the slice integration method;
[0039] FIG3 b is a schematic diagram of a slice of a pomelo fruit during the process of establishing a three-dimensional model of the present embodiment;
[0040] FIG3 c is a schematic diagram of extracting endpoints from three appearance images during the process of building a three-dimensional model of a pomelo fruit according to this embodiment;
[0041] FIG3 d is a schematic diagram of a 3D model of the outer contour of a pomelo fruit obtained by using a B-spline curve fitting contour measurement method during the process of establishing the 3D model of the pomelo fruit in this embodiment;
[0042] Figure 4a is a schematic diagram of the pixel thickness of the peel at both ends of each slice in the X-ray image in the 3DMM algorithm;
[0043] Figure 4b is a schematic diagram of the outline of the pulp slice in the 3DMM algorithm;
[0044] Figure 4c is a schematic diagram of the three-dimensional model of pomelo fruit with pulp in the 3DMM algorithm;
[0045] Figure 5 is a fitting diagram of a pomelo fruit slice;
[0046] Figure 6 is a graph showing the fitted X-ray grayscale and pulp model thickness;
[0047] Figure 7a is a graph showing the relationship between the measured volume of the fruit pulp obtained by the 3DMM algorithm and the measured weight;
[0048] Figure 7b is a graph showing the relationship between the measured volume of the pulp obtained by the GTFM algorithm and the measured weight;
[0049] FIG8 a is a graph showing the edible rate measurement results obtained by the 3DMM algorithm;
[0050] FIG8 b is a graph showing the edible rate measurement results obtained by the 3DMM algorithm.
[0051] 1-Camera stand, 2-RGB camera, 3-Conveyor belt, 4-Pomelo fruit, 5-X-ray detection equipment, 6-Radiation source, 7-Conveyor belt direction. DETAILED DESCRIPTION
[0052] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0053] The present invention discloses a method for measuring the edible rate of pomelo fruit based on machine vision and X-ray imaging. The method of this embodiment is divided into the following parts and discussed in sequence: 1. Construction of a pomelo fruit detection platform; 2. Image acquisition and processing; 3. Volume algorithm; 4. Edible rate algorithm;
[0054] 1. Construction of pomelo fruit testing platform
[0055] As shown in Figure 1, 1 is the camera holder, 2 is the RGB camera, 3 is the conveyor belt, 4 is the pomelo, 5 is the X-ray inspection equipment, 6 is the radiation source, and 7 is the conveyor belt orientation. Pomelo fruit 4 enters from the left end of the conveyor belt, and an appearance image of the fruit is first acquired. This appearance image is acquired using three RGB cameras 2 with 8mm lenses. Camera A is pointed vertically downward, capturing the top of the fruit; cameras B and C are each positioned at a 30° angle to the horizontal plane, capturing the left and right sides of the fruit, respectively. To minimize external light interference, appearance image acquisition is performed in a darkroom. To more uniformly fix the posture, the pomelo fruit is placed flat on a special round tray. After the appearance image acquisition is completed, the fruit is transported along the conveyor belt to the X-ray inspection equipment 5. To ensure a more accurate fit between the X-ray image and the appearance image, the pomelo's posture at this point should remain consistent with that during appearance image acquisition.
[0056] 2. Image Acquisition and Processing
[0057] Before collecting image data, the RGB camera is calibrated by Zhang and distortion correction is performed based on the camera's intrinsic parameters, extrinsic parameters, and distortion coefficients. The actual width D of the pomelo can be obtained by performing correction based on the geometric relationship:
[0058] Where w is the pixel width of the pomelo in the image; d is the distance from the pomelo to the camera.
[0059] The error in the actual distance between the object and the camera has a certain impact on measurement accuracy. Due to the large size of pomelo, the distance between different pomelo fruits and the camera can vary significantly depending on the fruit size. To minimize this error, the distance between the camera and the fruit needs to be calibrated based on the fruit size. Since the pomelo fruit is approximately circular in its transverse diameter, the vertical height change caused by the fruit size can be expressed as the horizontal width change. Therefore, the distance between a medium-sized pomelo fruit and the camera is used as the benchmark. The calibrated distance d between the other pomelo fruits and the camera can be defined as:
[0060] Where d m is the distance between a medium-sized pomelo and the camera, w m is the pixel width of a medium-sized pomelo, and f is the focal length of the camera.
[0061] The principles of appearance image segmentation and matching are as follows:
[0062] Image segmentation is required to extract the pomelo fruit region in the image. The pomelo fruit is clearly distinct from the background in the image, so threshold segmentation is used to extract the pomelo fruit region. Using a dual-channel fusion process achieves higher segmentation accuracy. Referring to Figure 2, the pomelo fruit appearance image is converted from RGB color space to HSI color space. The hue H channel accurately extracts the darker outline of the pomelo fruit (a in Figure 2), while the I channel accurately extracts bright areas such as surface highlights (c in Figure 2). The hue H channel and the lightness I channel are extracted and threshold segmented separately. The superposition of the two parts yields the complete pomelo fruit region (b in Figure 2). Bilinear interpolation is used to uniformly define the pomelo fruit pixel height in the appearance image.
[0063] The principles of X-ray image segmentation and matching are as follows:
[0064] The grayscale values of the flesh, peel, and background in X-ray images vary significantly. Similarly, threshold segmentation can accurately identify the whole fruit and flesh regions in the X-ray image. To facilitate edible rate measurement, bilinear interpolation is also used to unify the pomelo pixel heights in both the X-ray image and the appearance image.
[0065] 3. Volume Algorithm
[0066] The volume measurement algorithm is as follows:
[0067] The slice integration method is a common method for machine vision-based fruit volume measurement. Based on the principles of calculus, a pomelo fruit can be divided into several thin slices along its longitudinal diameter, as shown in Figure 3a. Each slice's outline is a closed curve and nearly circular. The volume of the entire fruit can be calculated by summing the volumes of each slice. However, since each slice is not a perfect circle, the measurement results are not accurate.
[0068] Slice integration method reference: M. Omid, M. Khojastehnazhand and A. Tabatabaeefar, Estimating volume and mass of citrus fruits by image processing technique, J FOOD ENG 2 (2010) 315-321.
[0069] S.Jana, R.Parekh and B.Sarkar, A De novo approach for automatic volume and mass estimation of fruits and vegetables, OPTIK(2020)163443.
[0070] This embodiment uses an improved volume measurement algorithm to establish a three-dimensional model of pomelo fruit. The specific method is as follows:
[0071] Based on the idea of slice integration, a new slice contour fitting method is proposed to establish a new method for measuring the volume of pomelo fruit. As shown in Figure 3b, the pomelo fruit area of the appearance image is divided into n equal slices from top to bottom. In order to fit the three appearance images in three-dimensional space, it is necessary to determine the baseline in the image. Several points at the top of the fruit stem are selected, and the average value of the horizontal coordinates of these points, i.e., u, is calculated. M At point (u M ,0) draw a vertical line downward as the baseline. The left endpoint L of the i-th slice can be calculated i The distance to the baseline is D Li , left endpoint R i The distance to the baseline is D Ri The three appearance images collected for each pomelo fruit can extract six endpoints of the slice, namely A L 、A R 、B L 、B R 、C L and C R With the reference line M as the pole and the distance from the endpoint to the reference line as the polar radius, the polar angle is determined based on the angle between the camera and the horizontal plane, thereby determining the position of each endpoint of the slice in polar coordinates as shown in Figure 3c. Based on these endpoints, different fitting methods can be used to determine the outer contour of the pomelo slice. In this embodiment, four methods are selected as follows:
[0072] 1) Average Radius Circle Fitting: Fit the slice to a circle. Take the average distance from the six endpoints to the extreme point as the radius, and use the extreme point as the center of the circle to fit the circle.
[0073] 2) Least squares circle fitting: The slice is fitted into a circle using the least squares method based on the known endpoints.
[0074] 3) Least squares ellipse fitting: The slice is fitted into an ellipse using the least squares method based on the known endpoints.
[0075] For the least squares circle fitting algorithm and the least squares ellipse fitting algorithm, please refer to the literature: W. Gander, GH Golub and R. Strebel, Least-squares fitting of circles and ellipses, BIT 4 (1994) 558-578.
[0076] 4) Spline curve interpolation fitting: Use B-spline curve to interpolate and fit the known endpoints to obtain a closed curve as the outer contour of the slice.
[0077] For more information on the spline curve interpolation fitting algorithm, please refer to the following reference: J. Fang and C. Hung, An improved parameterization method for B-spline curve and surface interpolation, Computer aided design 6 (2013) 1005-1028.
[0078] Different fitting methods were used to explore the influence of different fitting methods on volume measurement results using the original image resolution of 1000×750 pixels, including average radius circle fitting, least squares circle fitting, least squares ellipse fitting, and B-spline curve fitting. The volume measurement results of the test set pomelo fruit are shown in Table 1. The volume measurement results of pomelo fruit with four fitting methods R 2 The average relative errors of the four fitting methods are 2.15%, 2.22%, 2.09% and 1.87%, respectively.
[0079] Among them, the measurement method using B-spline curve to fit the contour has the highest accuracy (MAPE=1.87%, RMSE=53.94mL). B-spline is a piecewise polynomial that uses a linear combination of basis functions, and these basis functions themselves are also piecewise polynomials. Compared with circles or ellipses, the shape of B-spline curves has higher flexibility and can be closer to the true contour of the pomelo fruit. The result of ellipse fitting is better than the two circular fittings because the circle is a special case of the ellipse and its fitting ability is more limited. In addition, according to the ellipse formula, at least 5 discrete points are required to fit the ellipse using the least squares method, so images need to be collected from at least three perspectives. Therefore, the maximum R2 of the volume measurement obtained by this method is 0.985, which is slightly lower than the measurement accuracy of the fitting method finally adopted in this embodiment. The volume measurement results of the two fitting circles using the average diameter and the least squares method are similar. This is because the cross-sectional shape of the pomelo fruit is not an ideal circle, and the method of using circle fitting slices is suitable for measuring the volume of a single camera;
[0080] The specific results can be found in Table 1;
[0081] Table 1 Results of different fitting algorithms
[0082] Integrating the fitted slice contour along the baseline can ultimately form a three-dimensional model of the pomelo fruit's outer contour as shown in Figure 3d.
[0083] The formula for calculating the volume of pomelo fruit is as follows:
[0084] Where H P is the number of slices of the whole pomelo fruit; N i is the number of pixels enclosed by the outer contour of the i-th pomelo slice; Z A is the distance from camera A to the pomelo.
[0085] The three-dimensional model of pomelo fruit determined in this way will be used in the subsequent edible rate algorithm.
[0086] 4. Edible Rate Algorithm
[0087] Edible rate algorithms are divided into three-dimensional model method (3DMM) and grayscale and thickness fitting method (GTFM). The following is divided into two parts to discuss the advantages and disadvantages of these two algorithms.
[0088] 4.1 Three-Dimensional Model Method (3DMM)
[0089] Based on the 3D appearance model established by the volume measurement algorithm and the X-ray image, a 3D model of the fruit pulp can be further constructed to calculate the edible rate. According to Pascal's principle, if the pomelo fruit is considered a sealed container, the pressure exerted by the flesh on the peel during its growth will be transmitted simultaneously and equally to all points on the peel. Therefore, the peel thickness in the same slice can be assumed to be approximately equal. In the X-ray image, the pixel thicknesses t1 and t2 of the peel at each end of each slice can be obtained, as shown in Figure 4a. The average of these two values is taken as the average pixel thickness t of the pomelo slice. Based on the fitted outer contour of the pomelo slice obtained above, the thickness t is contracted inward, that is, the outer radius of each point of the outer contour is reduced by t. The resulting new contour line can be used as the outline of the fruit pulp slice, as shown in Figure 4b.
[0090] By using the above method, all pomelo slices with flesh outlines are obtained, and the integration along the baseline can finally form a three-dimensional model of pomelo with flesh as shown in Figure 4c. The flesh volume V can be calculated through this model. F Such as:
[0091] Where H F is the number of slices of pulp; M i is the number of pixels surrounded by the outline of the i-th pulp slice; Z A is the distance from camera A to the pomelo. x and f y is the focal length of camera A. Since the commercial pomelo product line has a specific step to measure the weight of the whole fruit, the edible rate can be directly calculated using the weight of the whole fruit and the weight of the flesh. The edible rate E1 of the pomelo fruit can be calculated using the pomelo three-dimensional model method as shown in formula (5):
[0092] Where ρ F is the density of pomelo pulp, m P It is the weight of the whole pomelo fruit.
[0093] It should be noted that: in the present invention and subsequent formulas, density ρ F It is the average value obtained by analyzing destructive sampling of multiple samples.
[0094] 4.2 Grayscale and Thickness Fitting Method (GTFM)
[0095] In the X-ray image, the pixel thicknesses t1 and t2 of the peel at each end of each slice can be obtained, as shown in Figure 5. The average of these two values is taken as the average pixel thickness t of the pomelo slice. Based on the fitted pomelo slice outline obtained above, the thickness t is contracted inward, that is, the polar radius of each point of the outer contour is reduced by t. The resulting new contour line can be used as the flesh slice outline, as shown in Figure 5. The flesh region in the pomelo fruit 3D model can be obtained using the 3D model method (3DMM).
[0096] With the horizontal diameter and vertical diameter as the x-axis and y-axis directions respectively, the flesh area in the three-dimensional model of the pomelo (a in Figure 6) is taken along the direction of the X-ray image to establish a flesh model thickness map as shown in Figure 3b, where the value of each point in the two-dimensional map represents the flesh thickness of that point along the direction of the X-ray image. The flesh area in the X-ray image is intercepted as the flesh X-ray grayscale map as shown in Figure 6d. The flesh thickness image and each point in the flesh X-ray image have a one-to-one correspondence in the actual flesh. Therefore, an appropriate fitting method can be used to solve the function formula of the thickness of a certain point in the flesh in the thickness map and the grayscale in the X-ray image as shown in Figure 6e. The flesh grayscale map is corrected using the fitting function to obtain the corrected flesh thickness map as shown in Figure 6f. At this time, the value of each point in the image is the fitted flesh thickness of that point, and the sum of the values of all points in the image is the optimized flesh volume.
[0097] According to GTFM, the final corrected edible rate E can be obtained c Such as:
[0098] Where ρ F is the density of pomelo pulp, m P is the weight of the whole grapefruit; g ij is the grayscale value of the i-th row and j-th column in the pulp X-ray image; H and W are the height and width of the pulp X-ray image, respectively; f is the fitting function of thickness and grayscale.
[0099] Regarding the grayscale and thickness fitting function f, we used linear fitting, polynomial fitting, and exponential function fitting to establish the fitting relationship between the pulp model thickness and the X-ray image grayscale, and calculated the edible rate based on this. The results are shown in Table 2. The edible rate measurement accuracy using the above fitting methods is relatively small and R 2 All of them are greater than 0.90, among which the grayscale fitting method using cubic polynomial fitting has the highest accuracy (R 2 =0.923, RMSE=2.85%). The pomelo pulp was cut into cuboids of different thicknesses and X-ray images were collected. The functional relationship between thickness and grayscale was analyzed. The linear function, exponential function and logarithmic function were used to fit the R 2 All above 0.970;
[0100] The linear fitting algorithm and the polynomial fitting algorithm can be found in the literature: L. Pothuaud, P. Carceller and D. Hans, Correlations between grey-level variations in 2D projection images (TBS) and 3D microarchitecture: Applications in the study of human trabecular bone microarchitecture, BONE 4 (2008) 775-787.
[0101] For exponential function fitting algorithms, see J.Hu, L.Liang, X.Liu and H.Dai, Research on Penetrated Thickness and Gray Model of Radiographic Digital Imaging, Acta Optica Sinica 10 (2021) 222-227.
[0102] Table 2 Experimental results of the influence of different grayscale and thickness fitting function f on the results
[0103] It can be seen from the above description that based on the relationship between the grayscale and thickness of the X-ray image of the object, any algorithm in this field can be used with relatively high accuracy.
[0104] The pulp volume measurement values of the training set were calculated using the 3DMM algorithm and the GTFM algorithm based on the 3DMM algorithm, and their relationships with the actual pulp mass values are shown in Figures 7a and 7b.
[0105] Figure 7a is a graph showing the relationship between the measured volume of the fruit pulp obtained by the 3DMM algorithm and the measured weight;
[0106] Figure 7b is a graph showing the relationship between the measured volume of the pulp obtained by the GTFM algorithm and the measured weight;
[0107] R of the measured pulp volume and actual weight obtained by 3DMM and GTFM 2 The pulp volume and mass have a strong linear relationship, that is, the density of pomelo is approximately constant. The pulp density calculated by the two methods is 0.945 g / cm 3 and 0.980g / cm 3 .
[0108] In addition, the pulp density calculated by 3DMM is lower, which is in line with expectations. Therefore, the pulp volume measured by GTFM is more accurate. Based on formulas (5) and (6), the edible rate measurement results of the two methods for the test set of pomelo fruits are shown in Figures 8a and 8b.
[0109] FIG8 a is a graph showing the edible rate measurement results obtained by the 3DMM algorithm;
[0110] FIG8 b is a graph showing the edible rate measurement results obtained by the 3DMM algorithm;
[0111] 3DMM measurement edible rate R 2 is 0.876, and the RMSE is 3.59%. GTFM (R 2 =0.923, RMSE=2.85%), a cubic polynomial was selected as the fitting function, which has higher accuracy than 3DMM.
[0112] The X-ray image of the fruit pulp used by GTFM contains information about the pomelo fruit's central cavity and the surface undulations of the flesh, significantly improving detection accuracy. These results indicate that GTFM offers superior measurement accuracy, and therefore it was selected for subsequent analysis. However, this method also exhibits certain measurement errors, which may be due to the following reasons. First, because the algorithm uses only a single X-ray image rather than Xay-CT, it cannot determine the peel thickness at all locations on the pomelo fruit. It assumes that the peel thickness within the same slice is uniform, which differs from the actual slice. Second, the flesh region captured by X-rays is actually a projection of the peel, flesh, and valves. However, because the flesh and valves are so closely intertwined, image processing cannot be used to eliminate the influence of the valves on edible yield measurements.
[0113] Summarize:
[0114] In this example, the accuracy and efficiency of pomelo fruit quality detection in practical applications are insufficient. A rapid detection algorithm for pomelo fruit volume and edible rate based on image fusion is proposed. The algorithm fuses the appearance image of the pomelo fruit with the X-ray image information, fits the pomelo fruit contour based on B-spline curve interpolation, and establishes a pomelo fruit three-dimensional model. The volume (R 2 =0.989, MAPE=1.87%); Comparing the two edible rate measurement methods of three-dimensional model method and grayscale thickness fitting method, the experiment shows that the grayscale fitting method is more accurate in edible rate measurement (R 2 =0.923, RMSE =2.85%). The pulp volume measured by GTFM has a strong linear relationship with the measured weight, R 2 is 0.977, so the pulp density can be calculated to be 0.980 g / cm 3The volume and edible rate measurement method proposed in this embodiment using pomelo as an example is also applicable to the sorting of other fruits, providing an effective technical approach for non-destructive detection of fruit volume and edible rate.
[0115] Referring to Figure 1, this embodiment discloses a device for measuring the edible rate of pomelo fruit based on machine vision and X-ray imaging, and utilizes a method for measuring the edible rate of pomelo fruit based on machine vision and X-ray imaging, comprising: a conveyor belt, an RGB camera, a camera bracket, and an X-ray detection device; the RGB camera is fixed to the camera bracket and is used to adjust the position of the pomelo fruit; the conveyor belt is used to transport the pomelo fruit; and the X-ray detection device is provided with a radiation source for performing X-ray detection on the pomelo fruit.
[0116] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0117] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for measuring the edible rate of pomelo fruit based on machine vision and X-ray imaging, characterized in that: The following steps are involved: Step 1: Collecting pomelo appearance images; Step 2: segment the pomelo appearance image and remove the pomelo background image; Step 3: Slice the pomelo fruit appearance image, determine endpoints on the slices, and determine the outer contour of the pomelo fruit slices using a B-spline curve interpolation fitting method based on the endpoints; Step 4: Based on the outer contour of the pomelo slice, with the horizontal diameter and vertical diameter being the x-axis and y-axis directions respectively, a flesh model thickness map is established for the flesh area in the pomelo 3D model along the X-ray image shooting direction; Step 5: The value of each point in the flesh model thickness map represents the flesh thickness at that point along the shooting direction of the X-ray image.
2. The method for measuring the edible rate of pomelo fruit based on machine vision and X-ray imaging according to claim 1, wherein: Before collecting images of pomelo appearance, the RGB camera was calibrated using Zhang’s method, and distortion correction was performed based on the camera’s intrinsic parameters, extrinsic parameters, and distortion coefficients.
3. The method for measuring the edible rate of pomelo fruit based on machine vision and X-ray imaging according to claim 1, characterized in that: Correct according to the geometric relationship to obtain the actual width D of the pomelo: Where w is the pixel width of the pomelo fruit in the image; d is the distance from the pomelo fruit to the camera. The distance d between other pomelo fruits and the camera after correction is defined as: Where d m is the distance between a medium-sized pomelo and the camera, w m is the pixel width of a medium-sized pomelo, and f is the focal length of the camera.
4. The method for measuring the edible rate of pomelo fruit based on machine vision and X-ray imaging according to claim 1, wherein: In step 2, the threshold segmentation method is used to intercept the pomelo fruit area, and the appearance image of the pomelo fruit is converted from the RGB color space to the HSI color space using a dual-channel fusion process. The hue H channel and the lightness I channel are extracted and threshold segmented separately. The two parts are superimposed to form the complete pomelo fruit area.
5. The method for measuring the edible rate of pomelo fruit based on machine vision and X-ray imaging according to claim 1, characterized in that: In step 4, in the X-ray image, the pixel thicknesses t1 and t2 of the peel at both ends of each slice are obtained, and the average value is taken as the average pixel thickness t of the pomelo slice. The thickness t is shrunk inward on the outer contour of the pomelo slice, that is, the polar radius of each point of the outer contour is reduced by t. The new contour line obtained can be used as the contour of the flesh slice.
6. A device for measuring the edible rate of pomelo fruit based on machine vision and X-ray imaging, utilizing any one of the methods for measuring the edible rate of pomelo fruit based on machine vision and X-ray imaging according to claims 1 to 5, comprising: Conveyor belts, RGB cameras, camera stands, and X-ray inspection equipment; The RGB camera is fixed on the camera bracket and is used to adjust the position of the pomelo fruit; The conveyor belt is used to convey pomelo fruit; The X-ray detection equipment is provided with a radiation source and is used to perform X-ray detection on pomelo fruit.