A method for detecting and grading edible rate of grapefruit fruit based on X-ray images
Through X-ray image acquisition and image processing technology, the two-dimensional edible rate of grapefruit in longitudinal and transverse directions is obtained, and a prediction model is established through fruit shape index correction, which solves the problem of time-consuming and labor-intensive detection of grapefruit edible rate in the prior art, and achieves fast, accurate and lossless detection of grapefruit edible rate.
Patent Information
- Application Number
- CN202210449518.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-26
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2042-04-26
AI Technical Summary
The prior art lacks a non-destructive, fast and effective method for detecting the edible rate of grapefruit fruits. The traditional manual measurement method is time-consuming and labor-intensive and easy to damage the grapefruit.
The original X-ray image acquisition equipment was used to collect the longitudinal and transverse X-ray images of grapefruit. After noise reduction and grayscale stretching, the two-dimensional edible rate in the longitudinal and transverse directions were obtained, and the fruit shape index correction was used to establish a predictive model of the edible rate of grapefruit fruit for detection.
It realizes rapid non-destructive testing of the edible rate of grapefruit fruits, saves time and labor costs, improves detection accuracy, effectively avoids grapefruit damage, and supports high-quality grapefruit screening.
Smart Images

Figure CN114913136B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for detecting and grading the edible rate of pomelo fruit based on X-ray images, which is mainly used in the post-harvest commercial processing process of pomelo. The pomelo is graded according to its internal quality (edible rate) to create a superior fruit brand effect, thereby improving the economic benefits of the pomelo industry. Background Art
[0002] my country is a major producer of pomelo, with total output ranking first in the world, accounting for more than half of the global total output. Many studies and practices have shown that the detection and grading technology of the internal and external quality of fruits plays an important role in improving the economic benefits of the fruit industry.
[0003] Edible rate is one of the important indicators of the internal quality of pomelo. It is difficult to distinguish the quality of the internal flesh only from the appearance. Research on the edible rate detection method of pomelo fruit is also very rare at home and abroad.
[0004] Huang Ling et al. (2010) (Huang Ling, Shi Yuqiu, Hu Bo. Estimation of edible rate of pomelo fruit based on GMDH algorithm [J]. Anhui Agricultural Sciences, 2010(12):2.) Based on the data processing combination method (GMDH), the two features of pomelo volume and weight were used as the input of the network in the edible rate estimation, and the estimated edible rate was used as the output of the network. The average absolute value of the error in the estimated edible rate of 16 pomelo fruits was 4.45%.
[0005] Geng Yiman (2012) (Geng Yiman. Research on the application of X-ray nondestructive testing technology in grapefruit quality inspection [D]. Fujian Agriculture and Forestry University, 2012.) used X-rays to obtain the grayscale image of the grapefruit equatorial plane, established the thickness model and volume model of the pulp, and then obtained the pulp mass based on the average density of the pulp, calculated the estimated edible rate, and divided the 64 grapefruit samples into three levels (65% and 70% as the dividing line), with an error rate of 7.81%.
[0006] Grapefruits with low edible rates often have problems such as thick skin and incomplete flesh, which reduces the consumer's purchasing experience. The traditional manual method of measuring edible rates is extremely time-consuming and labor-intensive. According to the national standard GB / T27633-2011 for Guanxi honey pomelo, the quality of the whole fruit, outer peel, sponge layer and seeds needs to be measured. This method not only causes destructive damage to the grapefruit, but also fails to meet the industry's needs for online testing.
[0007] The prior art lacks a non-destructive, rapid and effective method for detecting edible rate. Summary of the invention
[0008] In order to solve the problems and needs existing in the background technology, the present invention provides a method for detecting and grading the edible rate of pomelo fruit based on X-ray images.
[0009] The technical solution adopted by the present invention is as follows:
[0010] 1) Image acquisition: Using X-ray image acquisition equipment, collect original X-ray images A of grapefruit in both longitudinal and transverse directions;
[0011] The transverse direction is parallel to the equatorial plane of the pomelo, and the longitudinal direction is perpendicular to the equatorial plane of the pomelo.
[0012] 2) Image enhancement: Denoise and grayscale stretch the original X-ray image A in the longitudinal and transverse directions to obtain enhanced X-ray images B that are clear and have high contrast in both longitudinal and transverse directions;
[0013] 3) Acquisition of two-dimensional edible rate: The longitudinal and transverse enhanced X-ray images B are processed respectively to obtain the longitudinal two-dimensional edible rate and the transverse two-dimensional edible rate;
[0014] 4) Obtaining the fruit shape index: The longitudinal and transverse diameters of the enhanced X-ray image B are extracted by image processing, and the ratio of the longitudinal diameter to the transverse diameter is calculated as the fruit shape index for correcting the two-dimensional edible rate. The fruit shape index is used to correct the two-dimensional edible rate obtained in the longitudinal direction;
[0015] 5) Based on the three characteristics of longitudinal two-dimensional edible rate, transverse two-dimensional edible rate and fruit shape index, a prediction model for the edible rate of grapefruit fruit is established to predict the fruit edible rate. The fruit shape index is used in the prediction model to correct the two-dimensional edible rate. The longitudinal two-dimensional edible rate, transverse two-dimensional edible rate and fruit shape index of the actual grapefruit to be tested are input into the prediction model to obtain the predicted fruit edible rate;
[0016] 6) Grading of edible rate of pomelo fruit: According to the preset edible rate classification threshold of pomelo fruit, the predicted fruit edible rate obtained in step 5) is used to determine the grading result of the edible rate of pomelo fruit, that is, to determine whether the edible rate of pomelo fruit is qualified or excellent.
[0017] In the step 3), threshold segmentation is performed on both the longitudinal and transverse enhanced X-ray images B, and the images are segmented into three parts: background area, peel area (including sponge layer) and pulp area using two preset thresholds. The extracted pulp area and peel area are subjected to specific image processing to obtain two-dimensional edible rates. The two-dimensional edible rates corresponding to the longitudinal and transverse enhanced X-ray images B are respectively used as the longitudinal two-dimensional edible rate and the transverse two-dimensional edible rate.
[0018] In step 3), the total number of pixels N in the pulp area is first calculated. F and the total number of pixels in the peel area N P , and then the 2D edible rate of grapefruit under X-ray image is obtained according to the following formula;
[0019]
[0020] The processing of the flesh region and the peel region in the longitudinal enhanced X-ray image B and the processing of the flesh region and the peel region in the transverse enhanced X-ray image B are the same.
[0021] The prediction model in step 5) is established as the following formula:
[0022] y=A+Bx1+Cx2+Dx3
[0023] Among them, y represents the predicted fruit edible rate of grapefruit, x1 represents the longitudinal two-dimensional edible rate, x2 represents the transverse two-dimensional edible rate, x3 represents the fruit shape index, and A, B, C, and D represent the first, second, third, and fourth fitting parameters of the prediction model, respectively.
[0024] The first, second, third and fourth fitting parameters A, B, C and D can all be obtained through prior test calibration fitting.
[0025] The present invention utilizes an X-ray imaging system to collect original longitudinal and transverse grayscale images of pomelo, obtains clear and high-contrast pomelo X-ray images after noise reduction and grayscale stretching, then obtains the two-dimensional edible rate and fruit shape index of the X-ray image of the pomelo, and uses this as a feature to establish and verify a pomelo fruit edible rate prediction model, finally uses the prediction model to train and calibrate fitting parameters, and classifies pomelo based on the edible rate.
[0026] The present invention has the following beneficial effects:
[0027] The present invention can effectively avoid grapefruit damage. By combining X-ray images with image processing technology, rapid detection can be achieved, saving a lot of time and labor costs. At the same time, images in the longitudinal and transverse directions are introduced to further improve the accuracy of the prediction of the edible rate of grapefruit fruit, which can provide technical support for the high-quality screening of grapefruit.
[0028] The present invention proposes the acquisition and processing of "two-dimensional edible rate" based on X-ray images, and introduces a fruit shape index to correct the problem that the longitudinal two-dimensional edible rate is greatly affected by the fruit shape. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is the overall flow chart of the present invention;
[0030] Figure 2 is the original longitudinal X-ray image of grapefruit of the present invention;
[0031] Figure 3 is the original transverse X-ray image of grapefruit of the present invention;
[0032] Figure 4 The present invention Figure 2 Enhanced image;
[0033] Figure 5 The present invention Figure 3 Enhanced image;
[0034] Figure 6 The present invention Figure 4 Image after threshold segmentation;
[0035] Figure 7 The present invention Figure 5 Image after threshold segmentation;
[0036] Figure 8 is a scatter plot of the prediction model of the present invention;
[0037] Fig. 9 It is the classification result diagram of the classifier of the present invention. DETAILED DESCRIPTION
[0038] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0039] The present invention selects honey pomelo as an embodiment:
[0040] like Figure 1 As shown, the present invention comprises the following steps:
[0041] 1) Image acquisition:
[0042] like Figure 2 and Figure 3 As shown, using an X-ray image acquisition device, the original longitudinal and transverse X-ray images A of the grapefruit are acquired;
[0043] 2) Image enhancement:
[0044] like Figure 4 and Figure 5 As shown, the obtained grapefruit X-ray original image A is subjected to denoising and grayscale stretching. The denoising method is to use a Wiener filter with a window size of 9×9. The grayscale stretching method is to linearly and smoothly stretch the grayscale range of the transverse image A from 30-109 to 38-251, and the grayscale range of the longitudinal image A from 29-112 to 34-253, so as to obtain a clear and high-contrast enhanced X-ray image B.
[0045] 3) Obtaining 2D edible rate:
[0046] like Figure 6 and Figure 7As shown in FIG. 1 , an 8-bit grayscale (grayscale value 0-255, 0 represents black, 255 represents white) enhanced X-ray image B is adaptively thresholded and segmented. The adaptive threshold segmentation method is to first find the peak value I1 with the grayscale closest to 255 in the grayscale histogram corresponding to the enhanced X-ray image B, and define the pixel points with grayscale values greater than I1 as the background, that is, the grayscale value is adjusted to 255; then calculate the proportion of each grayscale value in the foreground in the total matrix and the grayscale mean of the foreground, and cyclically search for the grayscale value I2 starting from the grayscale value 0. - Used to segment the foreground, I2 satisfies the requirement that the two parts after foreground segmentation have the maximum inter-class variance; finally, the pixels with grayscale values less than I2 are defined as the pulp area, that is, the grayscale value is adjusted to 0, and the grayscale of other pixels remains unchanged. Figure 7 For example, two thresholds of 210 and 111 are obtained. The first threshold 210 is used to segment the image into two parts: background and fruit. The second threshold 111 is used to segment the fruit part into two parts: peel (including sponge layer) and flesh. Finally, three parts of background, peel and flesh are obtained. In the figure, white represents background, gray represents peel, and black represents flesh.
[0047] Then the number of pixels in the pulp area N is counted / is 1378320, the number of pixels in the peel area N0 is 604323, and the number of pixels in the whole fruit is 1982643. According to the following formula, the ratio of the number of pixels in the flesh area to the number of pixels in the whole fruit is 0.6952, that is, the lateral two-dimensional edible rate of the grapefruit is 69.52%. Figure 6 The longitudinal two-dimensional edible rate of the grapefruit was 65.09%;
[0048]
[0049] 4) Fruit shape index acquisition: Extraction using image processing methods Figure 6 The longitudinal and transverse diameters of the grapefruit were measured, and the ratio of the longitudinal diameter to the transverse diameter, namely the fruit shape index, was calculated to correct the two-dimensional edible rate obtained from the longitudinal X-ray image;
[0050] 5) If Figure 8 As shown in the figure, based on the three characteristics of longitudinal two-dimensional edible rate, transverse two-dimensional edible rate and fruit shape index, a total of 202 grapefruit data were selected, of which the calibration set and prediction set accounted for 70% and 30% of the total grapefruit number, respectively, to establish a multiple linear regression model of grapefruit fruit edible rate. The formula is as follows:
[0051] y=-3.5676+0.4393x1+0.5559x2+5.5734x3
[0052] Among them, y represents the predicted edible rate of grapefruit fruit (%), x1 represents the longitudinal two-dimensional edible rate (%), x2 represents the transverse two-dimensional edible rate (%), and x3 represents the fruit shape index.
[0053] The coefficient of determination R of the prediction set p 2 is 0.876, the root mean square error RMSEP of the prediction set is 1.72%, and the relative analytical error RPD of the model is 2.87;
[0054] 6) Grading of edible rate of pomelo fruit: According to the national standard GB / T 27633-2011, the edible rate of honey pomelo is divided into two categories, with edible rate greater than or equal to 60% being qualified, i.e., grade 1, and less than 60% being unqualified, i.e., grade 0; Fig. 9 As shown, a total of 202 grapefruit data were selected, and the grapefruit fruit edible rate obtained in step 5) was used for classification and discrimination. The calibration set misclassified 4 samples, and the classification accuracy was 97.2%. The prediction set misclassified 3 samples, and the classification accuracy was 95.0%.
[0055] The present invention can realize the edible rate detection and grading of pomelo, and can solve the current situation that the traditional pomelo fruit edible rate detection is time-consuming, labor-intensive and destructive, so as to achieve rapid non-destructive detection that saves a lot of time and labor costs, improve the economic benefits of the pomelo industry, and also provide a certain reference for the edible rate detection of other fruits and vegetables.
[0056] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any slight modification, equivalent substitution and improvement made to the above embodiment based on the technical essence of the present invention should be included in the protection scope of the technical solution of the present invention.
Claims
1. A method for detecting and grading edible rate of grapefruit fruit based on X-ray images, characterized in that: The method comprises the following steps: 1) Image acquisition: Using X-ray image acquisition equipment, collect original X-ray images A of grapefruit in both longitudinal and transverse directions; 2) Image enhancement: Denoise and grayscale stretch the original X-ray image A in the longitudinal and transverse directions to obtain enhanced X-ray images B in the longitudinal and transverse directions; 3) Acquisition of two-dimensional edible rate: The longitudinal and transverse enhanced X-ray images B are processed respectively to obtain the longitudinal two-dimensional edible rate and the transverse two-dimensional edible rate; 4) Obtaining the fruit shape index: Using image processing to extract the longitudinal diameter and transverse diameter of the longitudinal enhanced X-ray image B, the ratio of the longitudinal diameter to the transverse diameter is calculated as the fruit shape index for correcting the two-dimensional edible rate; 5) Based on the three characteristics of longitudinal two-dimensional edible rate, transverse two-dimensional edible rate and fruit shape index, a prediction model for the edible rate of grapefruit fruit is established, and the longitudinal two-dimensional edible rate, transverse two-dimensional edible rate and fruit shape index of the actual grapefruit to be tested are input into the prediction model to obtain the predicted fruit edible rate; 6) Grading of edible rate of pomelo fruit: According to the preset edible rate classification threshold of pomelo fruit, the predicted fruit edible rate obtained in step 5) is used to determine the grading result of the edible rate of pomelo fruit.
2. The method for detecting and grading edible rate of grapefruit fruit based on X-ray images according to claim 1, characterized in that: In the step 3), threshold segmentation is performed on both the longitudinal and transverse enhanced X-ray images B, and the images are segmented into three parts: background area, peel area and pulp area using a preset threshold. The extracted pulp area and peel area are subjected to image processing to obtain a two-dimensional edible rate. The two-dimensional edible rates corresponding to the longitudinal and transverse enhanced X-ray images B are respectively used as the longitudinal two-dimensional edible rate and the transverse two-dimensional edible rate.
3. The method for detecting and grading edible rate of grapefruit fruit based on X-ray images according to claim 1, characterized in that: In step 3), the total number of pixels N in the pulp area is first calculated. F and the total number of pixels in the peel area N P , and then the two-dimensional edible rate 2D ediblerate is obtained according to the following formula;
Citation Information
Patent Citations
Overall quality detection method for winter jujube fruits
CN107505325A
Honey pomelo longitudinal section and transverse section peel thickness measuring method based on image processing
CN113763266A