Egg shape index extraction method and system based on binocular structured light
Through a binocular structured light method, multiple sets of phase shift stripe patterns are projected and combined with three-dimensional correction and multi-frequency phase expansion algorithms, the three-dimensional point cloud data of eggs is reconstructed, solving the accuracy and efficiency of egg appearance detection in the existing technology, and achieving high-precision and efficient industrial applications.
Patent Information
- Application Number
- CN202510906987.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-02
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-07-02
AI Technical Summary
The prior art has problems of insufficient accuracy, low efficiency and poor robustness in egg shape detection, which is difficult to meet the needs of high precision, high efficiency and industrial applications.
Using a binocular structured light method, by projecting multiple sets of phase shifted stripe patterns at different frequencies, combining stereo correction and multi-frequency phase expansion algorithms, the three-dimensional point cloud data of the egg is reconstructed, and the reference plane is fitted through spatial geometric analysis to calculate the egg shape index.
It realizes high accuracy, high efficiency and robustness of egg shape detection. It is suitable for industrial applications. The measurement accuracy is close to manual measurement and the error is less than 0.6mm.
Smart Images

Figure CN120403491A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of egg shape index detection, and in particular relates to a method and a system for extracting an egg shape index based on binocular structured light. Background Art
[0002] Egg quality inspection is a critical step in the commercialization process. The egg shape index, a key indicator of egg appearance, directly impacts sorting efficiency and product value. Existing computer vision-based inspection methods fall into two main categories: two-dimensional image analysis and three-dimensional reconstruction.
[0003] In the field of two-dimensional image detection, the technical solution disclosed in patent CN202410219252, for example, captures a two-dimensional image of an egg through a single shot and extracts the egg shape index based on image features. While this method simplifies the operational process, it relies on two-dimensional projection information and is susceptible to interference from factors such as camera shooting angle and uneven lighting, leading to significant measurement errors. For example, when an egg is placed at a slight tilt, the two-dimensional image cannot accurately reflect its true three-dimensional contour, and the calculated egg shape index may deviate by more than 10%, making it difficult to meet high-precision sorting requirements.
[0004] To overcome the limitations of two-dimensional technology, three-dimensional reconstruction methods have gradually been introduced. Patent CN202510158786 proposes a binocular vision-based 3D reconstruction solution that uses multi-view imaging to acquire point cloud data from the egg surface and calculate the egg shape index. While this method improves measurement accuracy (with an error of approximately 0.5mm), it requires multiple adjustments to the camera or egg position to capture multi-view images. This results in long single-sample detection times and low efficiency, making it unsuitable for the high-throughput requirements of industrial production lines. Furthermore, multi-view imaging requires high levels of device synchronization and environmental stability, increasing system complexity and cost.
[0005] In recent years, structured light technology has been applied to 3D inspection due to its high precision and non-contact nature. However, traditional binocular structured light systems typically require the projection of multiple sets of high-frequency stripes and the integration of complex phase unwrapping algorithms, resulting in high data processing requirements and poor real-time performance. Furthermore, existing solutions often rely on fixed threshold screening or simple geometric fitting for point cloud processing, lacking robustness to anomalies such as localized surface depressions and ambient light interference, limiting their practical application.
[0006] Therefore, there is an urgent need for a three-dimensional detection method that combines high precision, high efficiency and strong robustness, which can quickly reconstruct the surface morphology of eggs under single-shot conditions and accurately extract appearance indicators to meet the stringent requirements of agricultural sorting and industrial quality inspection. Summary of the Invention
[0007] The purpose of the present invention is to provide a simple-structured and reasonably designed method and system for extracting the egg shape index based on binocular structured light to solve the above problems.
[0008] The present invention realizes the above purpose through the following technical solutions: The first aspect of this application provides a method for extracting the egg shape index based on binocular structured light, and this method includes: Projecting multiple groups of phase-shifted fringe patterns with different frequencies onto the surface of the object to be measured; Synchronously acquiring the fringe image data on the object surface through at least two image acquisition devices, and performing stereo rectification to obtain the rectified image data; Calculating the wrapped phase of the fringe image in the image data based on the phase-shift method, obtaining the absolute phase through the multi-frequency phase unwrapping algorithm, and reconstructing the three-dimensional point cloud data of the object in combination with the principle of stereo vision; Extracting a subset of the point cloud of the target area from the three-dimensional point cloud data, fitting a reference plane through spatial geometric analysis, and projecting the original point cloud onto the local coordinate system defined by the reference plane; Screening the candidate point set along the target direction on the projection plane, calculating the first outer dimension of the object, and calculating the second outer dimension after translating the projection plane based on the normal vector direction of the reference plane; Generating the outer shape index of the object according to the first outer dimension and the second outer dimension; The outer shape index of the object includes the egg shape index.
[0009] As a further optimized scheme of the present invention, the frequency range of multiple groups of phase-shifted fringe patterns is from 1 / 70 to 1 / 45, and the difference between adjacent frequencies is not less than 1 / 100.
[0010] As a further optimized scheme of the present invention, multiple groups of phase-shifted fringe patterns are three groups of fringe patterns, and the selected frequencies are respectively: 1 / 64, 1 / 56, 1 / 49.
[0011] As a further optimized scheme of the present invention, the light intensity expression of the phase-shifted fringe pattern is: ; where N = 12, n = 0, 1, 2,..., N - 1.
[0012] As a further optimized scheme of the present invention, the image acquisition device is a CCD camera; the resolution of the CCD camera is 2592×1944 Pixel.
[0013] As a further optimized scheme of the present invention, the wrapped phase calculates the phase value by the following formula: ; where is the intensity value of the nth group of fringes; N = 12.
[0014] As a further optimization scheme of the present invention, a point cloud subset of the target area is extracted from the three-dimensional point cloud data: ; where Z i is the Z coordinate value of the point cloud, Z min is the minimum Z coordinate value, and t is a threshold, with a value range of 0.03 to 0.07.
[0015] As a further optimization scheme of the present invention, the spatial geometric analysis is PCA analysis, the normal vector of the reference plane is determined by the direction of the third principal component, and the original point cloud is aligned to the local coordinate system through a rotation matrix.
[0016] As a further optimization scheme of the present invention, the target direction is the X-axis direction of the projection plane, and the screening condition for the candidate point set is the polar angle range: θ i ∈[-θ tol , θ tol ∪ [π - θ tol , π + θ tol ; where θ tol has a value range of 3° to 10°.
[0017] The second aspect of the present application provides an egg shape index extraction system based on binocular structured light, which implements the above-mentioned egg shape index extraction method, including: A structured light projection module for generating a multi-frequency phase-shifted fringe pattern; A multi-view image acquisition module including at least two synchronously triggered industrial cameras; A data processing module configured to perform three-dimensional reconstruction, point cloud analysis, and calculation of shape indexes.
[0018] The beneficial effects of the present invention are as follows: Through the optimized binocular structured light technology and point cloud analysis algorithm, the present invention significantly improves the accuracy, efficiency, and robustness of the detection of the shape indexes of eggs and other ellipsoids, while taking into account the technical generality and industrial application potential. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a schematic flow chart of the steps of the egg shape index extraction method based on binocular structured light of the present invention; Figure 2 is a schematic diagram of the experimental device of the present invention; Figure 3 is a software calculation simulation view of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0020] The present application will be further described in detail below in conjunction with the accompanying drawings. It is necessary to point out here that the following specific embodiments are only used to further illustrate the present application and should not be construed as limiting the protection scope of the present application. Those skilled in the art can make some non-essential improvements and adjustments to the present application based on the above application content.
[0021] Embodiment 1
[0022] Reference Figure 1 The method flow shown, an egg shape index extraction method based on binocular structured light, the method includes, Projecting multiple sets of phase-shifted fringe patterns with different frequencies onto the surface of the object to be measured; Synchronously acquiring the fringe image data on the object surface through at least two image acquisition devices, and performing stereo rectification to obtain the rectified image data; Calculating the wrapped phase of the fringe image in the image data based on the phase-shift method, obtaining the absolute phase through the multi-frequency phase unwrapping algorithm, and reconstructing the three-dimensional point cloud data of the object in combination with the principle of stereo vision; Extracting a point cloud subset of the target area from the three-dimensional point cloud data, fitting a reference plane through spatial geometric analysis, and projecting the original point cloud onto the local coordinate system defined by the reference plane; Screening a candidate point set along the target direction on the projection plane, calculating the first outer dimension of the object, and calculating the second outer dimension after translating the projection plane based on the normal vector direction of the reference plane; Generating the shape index of the object according to the first outer dimension and the second outer dimension; The shape index of the object includes the egg shape index.
[0023] It should be noted that this method realizes high-precision and high-efficiency three-dimensional reconstruction through the combination of structured light and stereo vision, and is particularly suitable for the detection of ellipsoids or symmetric objects with smooth surfaces and no textures (such as eggs, industrial parts). In the present application, the egg shape index of an egg is understood in a broad sense, and it can actually be understood as the egg shape index, which is used to express the ellipticity or symmetry of the object; however, in this embodiment, the object is illustrated by taking an egg in eggs as an example.
[0024] In this embodiment: The multiple sets of phase-shifted fringe patterns are three sets of fringe patterns, and the selected frequencies are: 1 / 64, 1 / 56, 1 / 49.
[0025] Among them, the light intensity expression of the phase-shifted fringe pattern is: ; Where N = 12, n = 0, 1, 2, …, N - 1; where (x, y) represents the coordinates of a pixel in the fringe pattern; I(x, y) represents the light intensity on the pixel with coordinates (x, y); A(x, y) represents the background light intensity on the pixel with coordinates (x, y); B(x, y) represents the modulated light intensity on the pixel with coordinates (x, y). is the wrapped phase to be solved during the phase unwrapping process; n represents the nth fringe pattern of phase shift; N is the number of phase shift steps required for the phase shift method used.
[0026] The image acquisition device is a CCD camera. The left and right CCD cameras synchronously acquire pictures of the egg under the fringe pattern illumination mode, save the image data, and then perform epipolar correction on the acquired pictures and save the corrected images. In this example, the camera shooting is controlled by a computer, and the fringe projection is controlled by a single-chip microcomputer connected to the computer. The image acquisition is completed in a completely light-shielded environment. The projector is the main light source, and light-absorbing materials are deployed within the field of view of the projector and the camera to reduce the interference of ambient light on the structured light decoding. During acquisition, the egg is placed horizontally on the stage; the resolution of the CCD camera is 2592×1944 Pixel.
[0027] Specifically, the wrapped phase of the image is calculated by the phase shift method, and the phase is unwrapped by the multi-frequency heterodyne method to obtain the absolute phase. Then, according to the binocular structured light imaging principle, a three-dimensional point cloud map is obtained. The wrapped phase calculates the phase value by the following formula: ; where is the intensity value of the nth group of fringes; N = 12.
[0028] The multi-frequency heterodyne method here is the multi-frequency phase unwrapping algorithm, the purpose of which is to eliminate the periodic jumps of the wrapped phase and generate a continuous absolute phase, and project fringe patterns with different frequencies (fringe densities) (such as high frequency, medium frequency, low frequency).
[0029] Solve the phase using the frequency difference: High-frequency fringes: Provide high-precision but noise-sensitive phase information; Low-frequency fringes: The phase changes slowly and are used to assist in the unwrapping of high-frequency phases; Phase unwrapping formula: Calculate the absolute phase by the multi-frequency heterodyne method (Multi-Frequency Heterodyne): (k is determined by the low-frequency phase).
[0030] That is, if fringes with frequencies f1, f2, and f3 are used, a virtual low-frequency fringe f h = f1 - f2 can be generated, combined with f l = f1 - f2, and the global phase is gradually solved.
[0031] Among them, the method of generating three-dimensional coordinates by the binocular structured light imaging principle is a prior art and will not be elaborated here.
[0032] Furthermore, a point cloud subset of the target area is extracted from the three-dimensional point cloud data: ; where Z i is the Z coordinate value of the point cloud, Z min is the minimum Z coordinate value, t is a threshold, and its value range is from 0.03 to 0.07; in this embodiment, t is 0.05.
[0033] After the valid point cloud basePoints, PCA analysis is performed to obtain the feature vector matrix M, where the third principal component is the plane normal vector n = (a, b, c), representing the vertical direction of the plane; the centroid C = (x c , y c , z c ) is the geometric center of the point cloud, used to locate the plane position, and the plane fitting equation is: a(x - x c ) + b(y - y c ) + c(z - z c ) = 0.
[0034] Then, a rotation matrix R is constructed to project the original point cloud onto the fitted plane. The role of the rotation matrix R is to rotate the original coordinate system to a local coordinate system based on the fitted plane, so that the normal vector of the plane is aligned with the Z-axis of the new coordinate system. The rotation matrix R is composed of three principal components, and its column vectors are the X, Y, and Z-axis directions of the new coordinate system respectively. The projected point cloud can be obtained by the following formula: P proj = (P original - C) × R; where, P proj is the projected point cloud, P original is the original point cloud. Finally, the Z coordinate of the projected point cloud is set to 0 to ensure that a two-dimensional plane is obtained.
[0035] Figure 3 is the software calculation simulation view. After that, an angular tolerance threshold θ tol is set, which defines the maximum angular deviation allowed from the theoretical X-axis direction. According to the actual measurement requirements, this threshold is set to 5°, and it is converted to the radian value θ range = θ tol × π / 180. For all points p pro = (x i , y i ) on the projected plane and the projected geometric center c pro = (x c , y c ), the relative coordinate offset is calculated: △xi = x i -x c , Δy i = y i -y c ; Calculate the polar angle: θ i = arctan2(Δy i , Δx i ); where θ i ∈ (-π, π], representing the direction angle of the point relative to the geometric center. Then, filter the candidate points in the positive / negative X-axis directions. The positive X-direction region restricts the polar angle within [-θ tol , θ tol , and the negative X-direction region restricts the polar angle within [π - θ tol , π + θ tol . Subsequently, calculate the maximum distance from the candidate points in the positive and negative directions to the geometric center: .
[0036] Finally, take the larger value of the maximum radii in the positive and negative directions and calculate the final diameter D (the minor axis of the egg): D = 2 * max(d 正 , d 负 ).
[0037] Based on the plane normal vector n and the pre-calculated maximum radius D / 2, translate the fitting plane along the normal vector direction by a distance equal to the maximum radius of the target geometry to ensure that all subsequent point clouds can be vertically projected onto the target plane in the horizontal plane. Then, project the original three-dimensional point cloud of the egg onto this plane and extract the Y coordinates of all points from the projected point cloud P′ , calculate the extreme difference Δy in the Y direction as the major axis of the egg: .
[0038] This method uses manual measurement as a sample, and the experimental comparison results are as follows:
[0039] Based on the above experimental results, it can be seen that: this method has high measurement accuracy and is highly consistent with manual measurement. Compared with manual measurement, the mean error of the major axis measurement result of the method of the present invention is 0.18 mm (the maximum error is 0.54 mm), and it is verified by t-test (p = 0.32) that there is no significant difference. The mean error of the minor axis is 0.15 mm (the maximum error is 0.58 mm), p = 0.45, indicating that the measurement result is highly reliable; the standard deviation of the egg shape index error ≤0.02 (such as 1.28 for both manual and system in Sample 1), verifying the reliability of the shape quantization index.
[0040] Example 2
[0041] Reference Figure 2 As shown in the structure, an egg shape index extraction system based on binocular structured light, implementing the above-mentioned egg shape index extraction method, includes: A structured light projection module for generating multi-frequency phase-shifted fringe patterns; A multi-view image acquisition module including at least two synchronously triggered industrial cameras; A data processing module configured to perform three-dimensional reconstruction, point cloud analysis, and shape index calculation.
[0042] Among them, the structured light projection module is the projector 1 in Figure 2 , and the multi-view image acquisition module is the right camera 2 and the left camera 3. Figure 2 It also includes a stage 4 in
[0043] It should be noted that for this egg shape index extraction method and system based on binocular structured light, during use, through the optimized binocular structured light technology and point cloud analysis algorithm, the accuracy, efficiency, and robustness of the shape index detection of eggs and other ellipsoids are significantly improved. At the same time, the technical generality and industrial application potential are taken into account.
[0044] In the description of this specification, the description of reference terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic description of the above terms should not be understood as necessarily referring to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0045] Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.
[0046] The above-described embodiments only represent several implementation manners of the present invention. Their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the patent of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several deformations and improvements can still be made, and these all belong to the protection scope of the present invention.
Claims
1. An egg shape index extraction method based on binocular structured light, characterized in that, The method includes: projecting multiple sets of phase-shifted fringe patterns with different frequencies onto the surface of the object to be measured; synchronously acquiring the fringe image data on the object surface through at least two image acquisition devices, and performing stereo calibration to obtain the calibrated image data; calculating the wrapped phase of the fringe images in the image data based on the phase-shift method, obtaining the absolute phase through a multi-frequency phase unwrapping algorithm, and reconstructing the three-dimensional point cloud data of the object in combination with the principle of stereo vision; extracting a point cloud subset of the target area from the three-dimensional point cloud data, fitting a reference plane through spatial geometric analysis, and projecting the original point cloud onto the local coordinate system defined by the reference plane; screening a candidate point set along the target direction on the projection plane, calculating the first outer dimension of the object, and calculating the second outer dimension after translating the projection plane based on the normal vector direction of the reference plane; generating an outer shape index of the object according to the first outer dimension and the second outer dimension; The outer shape index of the object includes an egg shape index.
2. The method for extracting the egg shape index based on binocular structured light according to claim 1, wherein: The frequency range of the multiple sets of phase-shifted fringe patterns is from 1 / 70 to 1 / 45, and the difference between adjacent frequencies is not less than 1 / 100.
3. The method for extracting the egg shape index based on binocular structured light according to claim 2, wherein: The multiple sets of phase-shifted fringe patterns are three fringe patterns, and the selected frequencies are 1 / 64, 1 / 56, and 1 / 49 respectively.
4. The method for extracting the egg shape index based on binocular structured light according to any one of claims 1-3, characterized in that: The light intensity expression of the phase-shifted fringe pattern is as follows: ; Among them, N = 12, n = 0, 1, 2, …, N - 1; where, (x, y) represents the coordinates of the pixel in the fringe pattern; I(x, y) represents the light intensity on the pixel with coordinates (x, y); A(x, y) represents the background light intensity on the pixel with coordinates (x, y); B(x, y) represents the modulated light intensity on the pixel with coordinates (x, y). is the wrapped phase to be solved in the phase unwrapping process; n represents the fringe pattern of the nth phase shift; N is the number of phase shift steps required for the phase shift method used.
5. The method for extracting the egg shape index based on binocular structured light according to claim 1, wherein: The image acquisition device is a CCD camera; the resolution of the CCD camera is 2592×1944 Pixel.
6. The method for extracting the egg shape index based on binocular structured light according to claim 4, wherein: The wrapped phase calculates the phase value according to the following formula: ; where is the intensity value of the fringes in the nth group; N = 12.
7. The method for extracting the egg shape index based on binocular structured light according to claim 6, characterized in that: Extracting a point cloud subset of the target area from the three-dimensional point cloud data: ; wherein, Z i is the Z coordinate value of the point cloud, Z min is the minimum Z coordinate value, and t is a threshold value with a value range of 0.03 to 0.
07.
8. The method for extracting the egg shape index based on binocular structured light according to claim 7, wherein: The spatial geometric analysis is PCA analysis, the normal vector of the reference plane is determined by the direction of the third principal component, and the original point cloud is aligned to the local coordinate system through a rotation matrix.
9. The method for extracting the egg shape index based on binocular structured light according to claim 8, characterized in that: The target direction is the X-axis direction of the projection plane, and the screening condition for the candidate point set is the polar angle range: θ i ∈[-θ tol , θ tol ∪ [π - θ tol , π + θ tol ; where θ tol ranges from 3° to 10°.
10. An egg shape index extraction system based on binocular structured light, which implements the egg shape index extraction method according to any one of claims 1-9, characterized in that, The system includes: a structured light projection module for generating multi-frequency phase-shifted fringe patterns; a multi-view image acquisition module including at least two synchronously triggered industrial cameras; a data processing module configured to perform three-dimensional reconstruction, point cloud analysis, and outer shape index calculation.
Citation Information
Patent Citations
Method and device for obtaining volumes of target objects, terminal equipment and storage medium
CN108416804A
Binocular stereoscopic vision three-dimensional measurement method and system, server and storage medium
CN110567398A
Implicit phase-parallax mapping binocular measurement missing point cloud interpolation method
CN111649694A
Binocular vision three-dimensional point cloud reconstruction measurement method for sinusoidal grating and speckle mixed pattern projection
CN112595263A
Stripe structured light three-dimensional reconstruction method based on virtual binocular
CN114111637A