Optical detection method and device for fruit defects
By using striped light at different frequencies to predict the appearance of the fruit and combining polarized light to remove the reflective area, the problem of misjudgment or missed detection in fruit surface defect detection is solved, and higher detection accuracy is achieved.
Patent Information
- Application Number
- CN202510222272.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-02-27
AI Technical Summary
The prior art has problems of misjudgment or missed detection in the detection of fruit surface defects, especially when moisture and impurities are generated on the surface during refrigeration and transportation of fruits.
The fruit profile is predicted by different frequencies without phase shifting, and combined with polarized light to remove the reflected area, generating a more realistic surface image, thereby improving detection accuracy.
This method can more accurately reflect the defects on the fruit surface, improve detection accuracy, and ensure that all surface defects of the fruit are detected.
Smart Images

Figure CN119715602B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of optical detection of agricultural products, and in particular to an optical detection method and equipment for fruit defects. Background Art
[0002] In the sorting and processing of agricultural products, the quality of fruits can be quickly judged by non-contact optical detection. The inventor's prior patent CN117347312B discloses a continuous detection method and device for citrus based on multi-spectral structured light. Through color images and structured light images, the surface three-dimensional pixels of fruits are reconstructed, which facilitates the continuous detection of fruits. The patent does not disclose the recognition and surface reconstruction methods of surface images. In order to capture the changes on the surface of fruits, the Chinese patent application with publication number CN112686885A discloses a method and system for detecting defects on the fruit skin. The method determines whether there are defects on the fruit skin by depth image processing and peduncle calyx area segmentation, combining the relationship between the number of defect candidate areas and the number of peduncle calyx areas. The method only uses the depth image to obtain the depth data of the fruit surface, and distinguishes the peduncle calyx area accordingly, but the processing of the depth image is highly dependent on external conditions. During the refrigeration and transportation of fruits, moisture and impurities are inevitably generated on the surface of fruits. These moisture and impurities will produce abnormal reflection areas, which may lead to misjudgment or missed detection of fruit quality. Therefore, it is necessary to further improve the prior art. Summary of the invention
[0003] In response to the above problems, the present invention proposes an optical detection method and equipment for fruit defects. The method predicts the shape of the fruit through stripe lights of different frequencies without phase shift, and then combines polarized light to eliminate the reflective area, so that the surface image more realistically reflects the surface defects of the fruit, thereby improving the accuracy of fruit detection.
[0004] The invention objectives of this application can be achieved through the following technical solutions:
[0005] An optical detection method for fruit defects comprises the following steps:
[0006] Step 1: The fruit is placed in a tray, and the tray moves to the first detection station. The first light transmitter sends three groups of first stripe lights with the same frequency and different phase offsets to the fruit, and the first light receiver receives the three groups of first stripe images and generates first phase data;
[0007] Step 2: The tray moves to the second inspection station and the third inspection station in sequence, and first phase data of different frequencies are generated respectively, and a first absolute phase diagram is generated according to the three sets of the first phase data;
[0008] Step 3: Predict the first shape data and dimension data based on the first absolute phase diagram, generate the first polarization parameter according to the first shape data, and generate the rotation parameter according to the dimension data;
[0009] Step 4: The tray moves to the fourth detection station, the second light emitter emits three groups of first polarized light, the second light receiver generates the first polarization data, and based on the first polarization parameter, the reflection area is extracted from the first polarization data and the first surface image is generated;
[0010] Step 5: The tray rotates the fruit based on the rotation parameter, the tray moves to the fifth detection station, the sixth detection station and the seventh detection station in sequence, the first light emitter emits the second stripe light, the first light receiver generates three groups of second phase data, and then generates the second absolute phase diagram;
[0011] Step 6: Predict the second shape data according to the second absolute phase diagram, and generate the second polarization parameter according to the second shape data;
[0012] Step 7: The tray moves to the eighth detection station, the second light emitter emits three groups of second polarized light, the second light receiver generates the second polarization data, and based on the second polarization parameter, the reflection area is extracted from the second polarization data and the second surface image is generated;
[0013] Step 8: Construct a three-dimensional model of the fruit based on the first shape data and the second shape data, and fill the pixel points of the first surface image and the second surface image into the three-dimensional model to generate a three-dimensional structure diagram;
[0014] Step 9: Identify the surface defect area and shape defect value of the three-dimensional structure diagram and generate the quality grade, and then classify the fruit into the collection device corresponding to the quality grade.
[0015] In the present invention, in Step 1, the first phase value of the pixel point (x, y) in the first phase data , where I1(x, y), I2(x, y), and I3(x, y) are the light intensity values of the pixel point (x, y) on the first stripe images with phase offsets of 0, 2π / 3, and 4π / 3 respectively.
[0016] In the present invention, in Step 2, three frequencies f1, f2, and f3 are selected, where f1 < f2 < f3. The first phase data with frequency f1 is used as the low-frequency continuous phase, the sub-frequency continuous phase is calculated according to the low-frequency continuous phase and the first phase data with frequency f2, the high-frequency continuous phase is calculated according to the sub-frequency continuous phase and the first phase data with frequency f3, and the high-frequency continuous phase of the pixel point (x, y) is the absolute phase value of the pixel point. The absolute phase values of all pixel points are combined to generate the first absolute phase diagram.
[0017] In the present invention, in step 3, the size data is the edge coordinates of the fruit outline, the minimum circumscribed circle is found according to the edge coordinates, the fruit diameter of the minimum circumscribed circle is calculated, and the rotation parameter ɵ=πA1 / 2A2, wherein A1 is the fruit diameter and A2 is the roller diameter of the tray.
[0018] In the present invention, in step 3, the depth value of the pixel point (x, y) is calculated , where δ3(x, y) is the absolute phase value, H is the baseline distance between the first light emitter and the first light receiver, the pixel point (x, y) is converted into a normalized plane coordinate relative to the first light receiver, and the three-dimensional coordinate of the pixel point (x, y) is calculated according to the depth value and the normalized plane coordinate.
[0019] In the present invention, in step 3, the first shape data is the three-dimensional coordinates of each pixel point of the fruit, the normal vector of the three-dimensional coordinates is calculated, the incident angle β of the pixel point is calculated according to the axis of the first light emitter and the normal vector, and then the polarization parameter cosβ of each pixel point is calculated.
[0020] In the present invention, in step 4, the first initial image and three sets of light intensity data are extracted from the first polarization data, the light intensity data and polarization parameters are combined to generate a corrected polarization degree, and the first initial image is corrected to a first surface image according to the corrected polarization degree.
[0021] In the present invention, in step 4, the three sets of light intensity data are G1, G2, G3, and the pixel polarization degree , where S0=G1+G2+G3, S1=2G1-S0, S2=2G2-S0, S3=2G3-S0, corrected polarization degree D2=cosβD1, extract the reflection area in the first initial image where the corrected polarization degree D2 is greater than the reference value, and generate the first surface image after updating the reflection area.
[0022] In the present invention, in step 9, the surface defect candidate areas of the three-dimensional structure diagram are identified. If there are only two surface defect candidate areas, the fruit does not have a surface defect area. If there are more than two surface defect candidate areas, the fruit stalk area and the calyx area are segmented according to the texture features to obtain the surface defect area.
[0023] A detection device for implementing the optical detection method of fruit defects, comprising:
[0024] A testing device, comprising a tray, a transmission device and eight consecutive testing stations, wherein the transmission device is used to transmit the tray to the corresponding testing station;
[0025] A first light emitter, used for emitting a first stripe of light and a second stripe of light toward the fruit;
[0026] A first optical receiver, configured to receive a first fringe image to generate first phase data, and receive a second fringe image to generate second phase data;
[0027] a second light emitter, for emitting a first polarized light and a second polarized light toward the fruit;
[0028] A second optical receiver, configured to generate first polarization data and second polarization data;
[0029] An image generating unit, configured to generate a first phase map according to the three sets of first phase data, generate a second phase map according to the three sets of second phase data, generate a first surface image according to the first polarization data, and generate a second surface image according to the second polarization data;
[0030] An image processing unit, configured to generate a three-dimensional model according to the first phase image and the second phase image, and to generate a three-dimensional structure image according to the first surface image, the second surface image and the three-dimensional model;
[0031] An image analysis unit for identifying surface defect areas and shape defect values of a three-dimensional structure image and generating a quality grade;
[0032] The execution unit is used to receive the instruction of the image analysis unit and sort the fruits into the collection device corresponding to the quality grade according to the instruction.
[0033] The optical detection method and device of fruit defects of the present invention have the following beneficial effects: the present invention predicts the shape of the fruit through stripe light and generates polarization parameters and rotation parameters, removes the mirror reflection area by combining the polarization parameters and polarized light, and then reconstructs the surface image, so that the surface image more truly reflects the surface defects of the fruit, and improves the accuracy of fruit detection. Furthermore, the present invention predicts the outline of the fruit based on the size data, and then generates the rotation parameters by combining the fruit outline, which can ensure that all surface defects of the fruit are detected. The present invention calculates the phase data of the fruit based on three phase-shifted stripe lights of the same frequency, calculates the shape data of the fruit based on the phase data of three different frequencies, and then constructs a three-dimensional model of the fruit. After the pixels of the first surface image and the second surface image are filled into the three-dimensional model, a three-dimensional structure diagram is generated, and then the surface defect area and shape defect value are identified according to the three-dimensional structure diagram and a quality grade is generated. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 is a flow chart of the optical detection method of fruit defects of the present invention;
[0035] Figure 2 is a schematic diagram of a first detection station of the present invention;
[0036] Figure 3 is a schematic diagram of the minimum circumscribed circle of the fruit of the present invention;
[0037] Figure 4 A schematic diagram of one direction of the pallet of the present invention;
[0038] Figure 5 is a schematic diagram of a fourth inspection station of the present invention;
[0039] Figure 6 A schematic diagram of the tray of the present invention in another direction;
[0040] Figure 7 A schematic diagram of selecting a surface defect candidate area based on a color threshold in the present invention;
[0041] Figure 8 is a schematic diagram of the Euclidean distance of the present invention;
[0042] Fig. 9 A block diagram of a detection device for implementing the optical detection method of fruit defects of the present invention;
[0043] Fig.10 This is a schematic diagram of the structure of the detection equipment for implementing the optical detection method for fruit defects of the present invention. DETAILED DESCRIPTION
[0044] In order to better implement the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0045] In the prior art, the surface of fruits is prone to condensation or impurities during cold storage or picking, resulting in specular reflection. The present invention selects three frequencies in integral ratio, and for each frequency, pre-generates striped light with different phase offsets of the same frequency by a computer, projects the striped light onto the fruit, and the light receiver obtains the striped image of the fruit, and then calculates the absolute phase value of each pixel point in the striped image, calculates the three-dimensional coordinates of the surface point of the fruit based on the absolute phase value, and then generates polarization parameters, combines the polarization parameters and polarized light to screen out the reflection area, removes the reflection area in the surface image, and reconstructs the surface image based on the interpolation method. Embodiment 1
[0046] Reference Figure 1 The optical detection method for fruit defects of the present invention described in detail in this embodiment comprises the following steps:
[0047] Step 1: The fruit is placed in the tray, and the tray moves to the first detection station. The first light transmitter sends three sets of first stripe lights with the same frequency and different phase offsets to the fruit. The first light receiver receives the three sets of first stripe images and generates first phase data. In this embodiment, apples are selected as the target fruit for detection. The transmission device drives the tray to move to the corresponding detection station. Figure 2, The first light emitter and the first light receiver are located above the apple. The vertical distance between the first light emitter and the first light receiver and the fruit is set according to the size range of the apple and the resolution of the first light receiver. The vertical distance is, for example, 60 cm. A circular array calibration plate is used to calibrate the first light emitter and the first light receiver to determine the geometric relationship between the first light emitter and the first light receiver.
[0048] The phase offsets of the first stripe light of three groups with the same frequency are 0, 2π / 3, and 4π / 3 respectively. The first stripe image is converted into a grayscale image, and the grayscale value of the pixel point (x, y) in the grayscale image is the light intensity value of this pixel point. The first phase value of the pixel point (x, y) in the first phase data , where I1(x, y), I2(x, y), and I3(x, y) are the light intensity values of the pixel point (x, y) on the first stripe images with phase offsets of 0, 2π / 3, and 4π / 3 respectively. The first phase values of all pixel points are combined to generate the first phase data.
[0049] Step 2: The tray is sequentially moved to the second detection station and the third detection station to generate first phase data with different frequencies respectively. A first absolute phase map is generated according to the three groups of the first phase data. The multi-frequency phase shift method and multiple first phase data are used to determine a unique first absolute phase map. Three frequencies f1, f2, and f3 are selected, where f1 < f2 < f3, and the frequency ratio of f1, f2, and f3 is an integer ratio. The frequency f1 is, for example, 1 / 100 pixel -1 , the frequency f3 is, for example, 1 / 50 pixel -1 , the frequency f3 is, for example, 1 / 25 pixel -1 . The first phase data with the frequency f1 is used as the low-frequency continuous phase. The sub-frequency continuous phase is calculated according to the low-frequency continuous phase and the first phase data with the frequency f2. The high-frequency continuous phase is calculated according to the sub-frequency continuous phase and the first phase data with the frequency f3. The high-frequency continuous phase of the pixel point (x, y) is the absolute phase value of this pixel point. The absolute phase values of all pixel points are combined to generate the first absolute phase map.
[0050] Step 3: Predict the first shape data and size data according to the first absolute phase map. Generate the first polarization parameter according to the first shape data, and generate the rotation parameter according to the size data. Refer to Figure 3 , the size data is the edge coordinates of the fruit contour. The minimum circumscribed circle is found according to the edge coordinates, and the fruit diameter of the minimum circumscribed circle is calculated. The rotation parameter ɵ = πA1 / 2A2, where A1 is the fruit diameter and A2 is the roller diameter of the tray. Refer to Figure 4 , the contact point between the roller and the fruit is generally located at the middle position on the side of the roller. Then, the cross-sectional diameter at the middle position on the side of the roller is selected as the roller diameter.
[0051] Calculate the depth value of the pixel (x, y) , where δ3(x,y) is the absolute phase value and H is the baseline distance between the first light transmitter and the first light receiver. According to the conversion relationship The pixel point (x, y) is converted from the image coordinates to the normalized plane coordinates (x c ,y c ). Then the three-dimensional coordinates (X, Y, Z) corresponding to the pixel point (x, y) can be calculated according to It is concluded that (X c ,Y c ,Z c ) is the world coordinate system of the first light receiver, K c is the internal parameter matrix of the first light receiver. The first shape data is the three-dimensional coordinates of each pixel of the fruit, the normal vector of the three-dimensional coordinates is calculated, the incident angle β of the pixel is calculated according to the axis of the first light transmitter and the normal vector, and then the polarization parameter cosβ of each pixel is calculated.
[0052] Step 4: The tray moves to the fourth inspection station, the second light transmitter sends three groups of first polarized light, the second light receiver generates first polarization data, and the reflection area is extracted from the first polarization data based on the first polarization parameter to generate a first surface image. Figure 5 The second light emitter and the second light receiver of the fourth detection station are located on both sides of the fruit, respectively. The three groups of first polarized light are three groups of polarized light with different polarization states, and the three groups of first polarized light are right-handed circularly polarized light, left-handed circularly polarized light and linearly polarized light. The first initial image and three groups of light intensity data are extracted from the first polarization data. The first initial image is the sum of the three groups of light intensity data and does not contain polarization information.
[0053] The three sets of light intensity data are G1, G2, G3, pixel polarization , S0=G1+G2+G3, S1=2G1-S0, S2=2G2-S0, S3=2G3-S0, match the three-dimensional coordinates in the first shape data with the pixel points in the first initial image according to the external parameter matrix of the first light receiver and the second light receiver, then the corrected polarization degree D2=cosβD1, extract the reflection area in the first initial image where the corrected polarization degree D2 is greater than the reference value, and the reference value D is 0.6. The mirror reflection generated in the reflection area will cause local overexposure or loss of details in the image, affecting the image accuracy. First, extract the effective neighborhood pixels around the reflection area, and based on the brightness distribution and texture characteristics of the neighborhood pixels, use a progressive interpolation algorithm to generate a correction pixel matrix, and then cover the reflection area in the first initial image with the correction pixel matrix, and finally generate the first surface image that eliminates the interference of mirror reflection.
[0054] Step 5: The tray rotates the fruit based on the rotation parameter, and the tray moves to the fifth inspection station, the sixth inspection station, and the seventh inspection station in sequence. The first light transmitter sends a second stripe light, and the first light receiver generates three sets of second phase data, and then generates a second absolute phase map. Figure 6 In order to ensure that the fruit can be stably placed on the tray and passively rotate with the active rotation of the roller, the surface of the roller should have sufficient friction. The material of the roller is, for example, rubber, and the roller rotates ɵ radians. The method for generating the second phase data refers to the first phase data, and the method for generating the second absolute phase map refers to the first absolute phase map.
[0055] Step 6: Predict the second shape data according to the second absolute phase map, and generate the second polarization parameter according to the second shape data. Similarly, refer to the generation method of the first shape data and the first polarization parameter to generate the second shape data and the second polarization parameter respectively. The second shape data is the three-dimensional coordinates of each pixel point on the other side of the fruit.
[0056] Step 7: The tray moves to the eighth inspection station, the second light transmitter sends three sets of second polarized light, the second light receiver generates second polarization data, and the reflection area is extracted from the second polarization data based on the second polarization parameter and a second surface image is generated. Similarly, the second polarization data is generated with reference to the generation method of the first polarization data, and the second surface image is generated with reference to the generation method of the first surface image.
[0057] Step 8: Construct a three-dimensional model of the fruit based on the first shape data and the second shape data, and generate a three-dimensional structure diagram after filling the pixels of the first surface image and the second surface image into the three-dimensional model. The front point cloud data of the fruit contains the three-dimensional coordinates of all the pixels of the first shape data. Similarly, the back point cloud data of the fruit is obtained according to the second shape data. Then, according to the relative position relationship between the front point cloud data and the back point cloud data, the front point cloud data and the back point cloud data are spliced using the point cloud splicing ICP algorithm, and the spliced point cloud data are smoothed and the holes are filled to generate a complete three-dimensional model of the fruit. Set a calibration object with known size, shape and three-dimensional coordinates, find the corresponding relationship between the first surface image and the three-dimensional model according to the calibration object, and then map the pixel values of the pixels in the first surface image to the three-dimensional model. Similarly, map the pixel values of the pixels in the second surface image to the three-dimensional model.
[0058] Step 9: Identify the surface defect area and shape defect value of the three-dimensional structure image and generate a quality grade, and then sort the fruit into the collection device corresponding to the quality grade. Extract the surface defect candidate area of the three-dimensional structure image based on the color threshold, and segment the pedicel calyx area from the surface defect candidate area based on the texture feature to obtain the surface defect area. Figure 7, the area beyond the color threshold is the surface defect candidate area. If there are only two surface defect candidate areas, then the fruit does not have a surface defect area. If there are more than two surface defect candidate areas, the pedicel calyx area is segmented according to the texture features to obtain the surface defect area. In this embodiment, the pedicel and calyx both have specific texture features, and a group of pedicel calyx sample images are obtained. Then, the grayscale co-occurrence matrix of the pedicel calyx sample images is calculated, and the energy, entropy, correlation and contrast of the grayscale co-occurrence matrix are extracted as the texture features of the pedicel calyx area. According to the texture features of the pedicel calyx area, the surface defect area is further separated from the surface defect candidate area.
[0059] The centroid of the fruit is calculated based on the three-dimensional structure diagram, and then the shape defect value is calculated based on the centroid and the three-dimensional structure diagram. The three-dimensional structure diagram contains the three-dimensional coordinate set of the surface points of the fruit. The coordinate average of each dimension is calculated based on the three-dimensional coordinate set to obtain the centroid. The shape defect value is the distance variance from the surface point of the fruit to the centroid. Figure 8 The three-dimensional coordinates of the surface point are (X n ,Y n ,Z n ), then the centroid C(X c ,Y c ,Z c ) According to the formula Calculate and then calculate the surface point (X n ,Y n ,Z n ) to the centroid C(X c ,Y c ,Z c ) , and then calculate the average value of the Euclidean distance , then the shape defect value , where N is the number of surfaces. The shape defect value can be used to measure the irregularity of the fruit shape.
[0060] The fruits are graded according to the surface defect area and shape defect value. A shape defect threshold can be set. If the shape defect value exceeds the shape defect threshold, it means that the current fruit has shape defects. In this embodiment, apples with surface defect areas are bad fruits and enter the first classification bin, apples without surface defect areas but with shape defects are inferior fruits and enter the second classification bin, that is, apples without surface defect areas and shape defects are good fruits and enter the third classification bin. In another embodiment, bad fruits are further classified according to the number and area of surface defect areas. Embodiment 2
[0061] This embodiment further discloses a method of generating first phase data according to three groups of first fringe images, and then generating a first absolute phase map according to the first phase data of three frequencies.
[0062] Extract the main region of the fruit. Calculate the modulation contrast of the pixel point (x, y) , where I1(x, y), I2(x, y), and I3(x, y) are the light intensity values of the pixel point (x, y) on the first stripe image with phase offsets of 0, 2π / 3, and 4π / 3, respectively. The modulation contrast of the background region is relatively low, and the changes in the surface curvature and color of the apple will cause the first stripe light to show obvious intensity changes, so the modulation contrast on the apple surface is relatively high. Distinguish the background region and the main region of the fruit according to the modulation contrast threshold.
[0063] Generate the first phase data of the main region. Calculate the first phase value of the pixel point (x, y) in the main region , and combine the first phase values of all pixel points to generate the first phase data. Select three frequencies f1, f2, and f3, where f1 < f2 < f3, and generate the first phase values γ1(x, y), γ2(x, y), and γ3(x, y) corresponding to the frequencies f1, f2, and f3 respectively according to the above formula for calculating the first phase value, and then generate three sets of first phase data with different frequencies.
[0064] Generate the first absolute phase map of the main region. The low-frequency continuous phase of the pixel point (x, y) at the frequency f1 , the sub-frequency fringe order of the pixel point (x, y) at the frequency f2 , then the sub-frequency continuous phase , and then obtain the high-frequency fringe order of the frequency f3 , then the high-frequency continuous phase , and the high-frequency continuous phase δ3(x, y) of the pixel point (x, y) is the absolute phase value of the pixel point (x, y). Combine the absolute phase values of all pixel points to generate the first absolute phase map. Embodiment 3
[0065] Refer to Fig. 9 and Fig.10, this embodiment discloses a detection device for implementing the optical detection method of fruit defects, including a detection device, a tray, a transmission device, a first light transmitter, a first light receiver, a second light transmitter, a second light receiver, an image generation unit, an image processing unit, an image analysis unit and an execution unit. Among them, the detection device includes eight consecutive detection stations. The tray is used to hold the fruit and includes a roller, which is used to drive the fruit to rotate. The transmission device is used to transmit the tray to the corresponding detection station. The first light transmitter is used to emit a first stripe light and a second stripe light to the fruit. The first light receiver is used to receive the first stripe image to generate a first phase data, and receive the second stripe image to generate a second phase data. The second light transmitter is used to emit a first polarized light and a second polarized light to the fruit. The second light receiver is used to generate a first polarization data and a second polarization data. The image generation unit is used to generate a first phase map according to three sets of first phase data, generate a second phase map according to the second phase data, generate a first surface image according to the first polarization data, and generate a second surface image according to the second polarization data. The image processing unit is used to generate a three-dimensional model according to the first phase map and the second phase map, and then generate a three-dimensional structure map according to the first surface image, the second surface image and the three-dimensional model. The image analysis unit is used to identify the surface defect area and shape defect value of the three-dimensional structure image and generate a quality grade. The execution unit is used to receive the instruction of the image analysis unit and sort the fruits into the collection device corresponding to the quality grade according to the instruction. In this embodiment, the collection device includes a first classification bin, a second classification bin and a third classification bin, the first classification bin collects bad fruits, the second classification bin collects inferior fruits, and the third classification bin collects good fruits.
[0066] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An optical detection method for fruit defects, characterized in that: The following steps are involved: Step 1: The fruit is placed in a tray, and the tray moves to the first detection station. The first light transmitter sends three groups of first stripe lights with the same frequency and different phase offsets to the fruit, and the first light receiver receives the three groups of first stripe images and generates first phase data; Step 2: The tray moves to the second inspection station and the third inspection station in sequence, and first phase data of different frequencies are generated respectively, and a first absolute phase diagram is generated according to the three sets of the first phase data; Step 3: predicting first shape data and size data according to the first absolute phase map, generating first polarization parameters according to the first shape data, and generating rotation parameters according to the size data; Step 4: the tray moves to the fourth inspection station, the second light transmitter sends three groups of first polarized lights, the second light receiver generates first polarization data, and the reflection area is extracted from the first polarization data based on the first polarization parameter to generate a first surface image; Step 5: The tray rotates the fruit based on the rotation parameter, and the tray moves to the fifth inspection station, the sixth inspection station, and the seventh inspection station in sequence, the first light transmitter sends the second stripe light, the first light receiver generates three sets of second phase data, and then generates a second absolute phase map; Step 6: predicting second shape data according to the second absolute phase map, and generating second polarization parameters according to the second shape data; Step 7: the tray moves to the eighth inspection station, the second light transmitter sends three groups of second polarized lights, the second light receiver generates second polarization data, and the reflection area is extracted from the second polarization data based on the second polarization parameter to generate a second surface image; Step 8: construct a three-dimensional model of the fruit based on the first shape data and the second shape data, and fill the pixels of the first surface image and the second surface image into the three-dimensional model to generate a three-dimensional structure diagram; Step 9: Identify the surface defect area and shape defect value of the three-dimensional structure image and generate a quality grade, and then sort the fruit into the collection device corresponding to the quality grade. The first shape data is the three-dimensional coordinates of each pixel of the fruit, the normal vector of the three-dimensional coordinates is calculated, the incident angle β of the pixel is calculated according to the axis of the first light emitter and the normal vector, and then the first polarization parameter cosβ of each pixel is calculated. Extracting a first initial image and three sets of light intensity data from the first polarization data, generating a corrected polarization degree by combining the light intensity data and the first polarization parameter, and correcting the first initial image to a first surface image according to the corrected polarization degree, The three sets of light intensity data are G1, G2, G3, pixel polarization , S0=G1+G2+G3, S1=2G1-S0, S2=2G2-S0, S3=2G3-S0, correct polarization degree D2=cosβD1, extract the reflection area in the first initial image where the correction polarization degree D2 is greater than the reference value, generate a correction pixel matrix, and then cover the reflection area in the first initial image with the correction pixel matrix, and generate the first surface image after updating the reflection area, The second shape data and the second polarization parameter are generated respectively by the generation method of the first shape data and the first polarization parameter, the second polarization data is generated by the generation method of the first polarization data, and the second surface image is generated by the generation method of the first surface image.
2. The optical detection method of fruit defects according to claim 1, characterized in that: In step 1, the first phase value of the pixel point (x, y) in the first phase data , where I1(x,y), I2(x,y), and I3(x,y) are the light intensity values of the pixel point (x,y) on the first fringe image with phase shifts of 0, 2π / 3, and 4π / 3, respectively.
3. The optical detection method of fruit defects according to claim 2, characterized in that: In step 2, three frequencies f1, f2, and f3 are selected, where f1 < f2 < f3. The first phase data of frequency f1 is used as the low-frequency continuous phase. The sub-frequency continuous phase is calculated based on the low-frequency continuous phase and the first phase data of frequency f2. The high-frequency continuous phase is calculated based on the sub-frequency continuous phase and the first phase data of frequency f3. The high-frequency continuous phase of the pixel point (x, y) is the absolute phase value of this pixel point. The absolute phase values of all pixel points are combined to generate the first absolute phase map.
4. The optical detection method of fruit defects according to claim 1, characterized in that: In step 3, the dimension data is the edge coordinates of the fruit contour. The minimum circumscribed circle is found according to the edge coordinates, and the fruit diameter of the minimum circumscribed circle is calculated. The rotation parameter ɵ = πA1 / 2A2, where A1 is the fruit diameter and A2 is the roller diameter of the tray.
5. The optical detection method of fruit defects according to claim 3, characterized in that: In step 3, the depth value of the pixel (x, y) is calculated , where δ3(x, y) is the absolute phase value, H is the baseline distance between the first light emitter and the first light receiver, the pixel point (x, y) is converted into a normalized plane coordinate relative to the first light receiver, and the three-dimensional coordinate of the pixel point (x, y) is calculated according to the depth value and the normalized plane coordinate.
6. The optical detection method of fruit defects according to claim 1, characterized in that: In step 9, the surface defect candidate regions of the three-dimensional structure diagram are identified. If there are only two surface defect candidate regions, then there is no surface defect region for this fruit. If there are more than two surface defect candidate regions, then the stalk region and the calyx region are segmented according to the texture features to obtain the surface defect region.
7. A detection device for implementing the optical detection method of fruit defects according to claim 1, characterized in that: Including: A detection device, including a tray, a transmission device, and eight consecutive detection stations. The transmission device is used to convey the tray to the corresponding detection station; A first light emitter, which is used to emit the first stripe light and the second stripe light to the fruit; A first light receiver, which is used to receive the first stripe image to generate the first phase data and receive the second stripe image to generate the second phase data; A second light emitter, which is used to emit the first polarized light and the second polarized light to the fruit; A second light receiver, which is used to generate the first polarization data and the second polarization data; An image generation unit, which is used to generate the first phase map according to the three groups of first phase data, generate the second phase map according to the three groups of second phase data, generate the first surface image according to the first polarization data, and generate the second surface image according to the second polarization data; An image processing unit, which is used to generate a three-dimensional model according to the first phase map and the second phase map, and generate a three-dimensional structure diagram according to the first surface image, the second surface image, and the three-dimensional model; An image analysis unit, which is used to identify the surface defect region and the shape defect value of the three-dimensional structure diagram and generate the quality grade; An execution unit, which is used to receive the instruction of the image analysis unit and classify the fruit into the collection device corresponding to this quality grade according to the instruction.
Citation Information
Patent Citations
Fruit peel defect detection method and system
CN112686885A
Residual piece detecting and removing device and method
CN118527377A
Metasurface-based highlight elimination method and system
CN118654600A