A phase deviation detection method, system, electronic device and medium

By employing a phase deflection detection method in traditional structured light scanning technology, and utilizing stripe image mapping and normal vector calculation, the problem of insufficient detection accuracy of traditional methods is solved, achieving high-precision three-dimensional shape reconstruction and defect detection, thus improving detection accuracy and efficiency.

CN117710311BActive Publication Date: 2026-11-06RONGCHEER IND TECH (SUZHOU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311721377.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-14
Publication Date
2026-11-06
Estimated Expiration
2043-12-14

AI Technical Summary

Technical Problem

Traditional structured light scanning technology has low detection accuracy for surface defects and cannot meet the needs of high-precision defect detection.

Method used

By obtaining the reflection image of the object under different phases of the fringe image, the wrapping phase is determined, the continuous phase points are solved, the normal vector is calculated, the contour is adjusted by integration, the surface contour is optimized and reconstructed, and the fringe parameters are adjusted by combining the ambient lighting and the object size, so as to achieve high-precision three-dimensional shape reconstruction and defect detection.

Benefits of technology

It achieves high-precision and high-quality 3D shape reconstruction, improves the accuracy of detecting product appearance defects, can automatically identify and classify defect areas, and reduces the cost of manual judgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117710311B_ABST
    Figure CN117710311B_ABST
Patent Text Reader

Abstract

A phase fold detection method, system, electronic device and medium, relating to the technical field of visual detection. The method comprises: obtaining a mirror image mapped by an object to be detected under different phase fringe images; determining the wrapped phase of each mirror image, solving the wrapped phase to obtain a plurality of continuous phase points; obtaining a normal vector at each target position of the object to be detected according to each continuous phase point and the target position; and determining the appearance contour of the object to be detected according to each normal vector. The effect of improving the accuracy of detecting product appearance defects is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of visual inspection technology, specifically to a phase deflection detection method, system, electronic device, and medium. Background Technology

[0002] With the rapid development of modern manufacturing and technology, the requirements for product quality are becoming increasingly stringent. Especially in precision engineering fields such as aerospace, automotive manufacturing, biomedicine, and microelectronics manufacturing, the accurate measurement and control of the appearance and contours of the object being inspected has become crucial. Particularly when it comes to product functionality, reliability, and aesthetics, even the slightest deviation in shape and appearance can lead to a decline in overall performance or functional failure.

[0003] Currently, traditional contour measurement methods typically employ structured light 3D scanning technology to rapidly acquire 3D information about an object's surface, enabling non-contact surface inspection with advantages such as high detection speed. However, traditional structured light scanning technology has low accuracy in detecting surface defects, failing to meet the demands for high-precision defect detection. Summary of the Invention

[0004] This application provides a phase deflection detection method, system, electronic device, and medium, which can improve the accuracy of detecting product appearance defects.

[0005] In a first aspect, this application provides a phase deflection detection method, comprising: Obtain the reflection image of the object to be detected mapped under stripe images of different phases; Determine the wrapping phase of each of the reflected images, solve the wrapping phase, and obtain multiple consecutive phase points; Based on each of the continuous phase points and the target position of the object under test, the normal vector at each of the target positions is obtained; The external contour of the object to be detected is determined based on each of the stated normal vectors.

[0006] By employing the above technical solution, reflection images corresponding to different phase fringes are obtained, acquiring sufficient image information. Then, the wrapping phase of each image is solved, and a precise phase point distribution is obtained through continuity analysis. These phase points contain rich 3D structural details. Next, based on the target's position, the normal vector of each phase point is calculated. This normal vector accurately expresses the detailed geometry of the 3D contour. Finally, the reconstructed surface contour is optimized based on the normal vector results, avoiding error accumulation caused by direct fitting and resulting in a smoother and more natural reconstructed contour. This solution, through phase analysis and normal vector adjustment, achieves high-precision, high-quality 3D shape reconstruction, making the reconstruction effect more accurate and smooth, and improving the accuracy of detecting product appearance defects.

[0007] Optionally, multiple stripe images with different phases are set, and each stripe image is projected onto the target position of the object to be detected through a beam splitter; according to a preset shooting angle, an industrial camera is used to shoot the object to be detected to obtain the reflection image of the object to be detected mapped under the stripe images with different phases.

[0008] By employing the above technical solution, multiple images of fringe patterns with different phases can be set to illuminate the object from different directions. A beam splitter is used to project the different phase fringes sequentially onto the object's surface. By changing the camera's shooting angle and taking multiple shots of the object along a preset trajectory, multiple sets of image information of the object under different directions and different phase fringes can be obtained. By processing these multi-angle fringe images, the three-dimensional shape of the object can be comprehensively acquired, and an accurate three-dimensional model can be constructed. Therefore, this solution achieves a more comprehensive and seamless three-dimensional scan of the object, obtaining richer surface details and further improving the accuracy of structural measurements.

[0009] Optionally, the brightness equations of the reflected images at the same pixel are simultaneously established, and the brightness equations are solved to obtain the wrapping phase; the phase difference between each adjacent pixel in the wrapping phase is determined, and the unwrapping value is calculated based on the phase difference; if the unwrapping value does not exceed the standard unwrapping value range, the adjacent pixels corresponding to the unwrapping value are taken as each of the consecutive phase points.

[0010] By employing the above technical solution, a system of brightness equations for multiple reflected images at the same pixel location is established simultaneously. This system integrates information from various images to accurately solve for the wrapping phase of each pixel. Then, the phase difference between adjacent pixels is calculated. If the phase difference is within an acceptable range, the phase is considered continuous, and the point is retained as a valid phase point. By setting a threshold to determine phase continuity, distorted points caused by noise or errors can be effectively filtered out. Finally, the pixels corresponding to the phase unpacking results after continuity verification represent a precise and continuous effective phase distribution. This technical solution improves the accuracy of phase calculation by establishing a system of simultaneous equations and verifies the unpacking quality by using phase difference judgment, ensuring continuous and accurate phase results and improving the reliability of phase calculation.

[0011] Optionally, the phase period, phase start point coordinates, and lens calibration parameters are obtained, and target parameters are determined based on the phase period, phase start point coordinates, and lens calibration parameters; the reference plane position is determined based on the target parameters and the target position of the object under test; the target distance is determined based on the position of the phase point and the position of the reference plane, and the target gradient is determined based on the prime number target distance; the normal vector is determined based on the target gradient.

[0012] By employing the aforementioned technical solution, prior data such as phase information and camera parameters are acquired, and target parameters and a reference plane are determined based on this known data, establishing a unified coordinate system. Then, based on the target's position, the distance from each phase point to the reference plane is calculated. This distance calculation directly reflects the 3D structure, avoiding the accumulation of errors from normal fitting. By analyzing the distribution of distances from points to the plane, the normal direction of each point can be accurately determined. The resulting normal vectors avoid the accumulation of normal fitting errors, providing accurate and reliable surface normal vector information. This technical solution achieves high-precision normal vector acquisition through coordinate and distance calculation, providing accurate surface detail data for subsequent 3D reconstruction and modeling, thus improving reconstruction quality.

[0013] Optionally, the initial surface contour of the object to be detected is obtained; the difference vector of each pixel position in the initial surface contour is determined according to each normal vector; the difference vector is integrated to obtain an adjustment amount; and the initial surface contour is adjusted according to the adjustment amount to obtain the appearance contour of the object to be detected.

[0014] By employing the above technical solution, the initial contour of the detected object is obtained as a foundation. Then, the difference in the normal vector of each contour point is calculated as an adjustment vector. Integrating this adjustment vector yields a smooth and continuous pixel adjustment amount. Compared to direct fitting, integration comprehensively considers both local and global shape features. Next, the initial contour is optimized based on the integrated adjustment amount, achieving an accurate and natural contour representation. This integral contour adjustment technique avoids the contour ringing phenomenon caused by direct fitting, resulting in a smooth and accurate contour. The refined contour obtained through this optimization provides a high-quality shape representation for subsequent modeling and analysis. Overall, this alternative solution achieves high-precision contour optimization through integral adjustment, making the reconstruction effect more accurate and natural, thus improving the quality of reconstruction and modeling.

[0015] Optionally, the ambient light intensity, the surface color of the object to be detected, and the object size are obtained; the stripe color of the stripe image is determined based on the light intensity and the surface color of the object to be detected; the stripe width of the stripe image is determined based on the object size; and the stripe image is generated based on the stripe color and the stripe width.

[0016] By employing the above technical solution, a suitable stripe color is determined based on ambient lighting conditions and the object's surface material. An appropriate stripe width is selected based on the object's size to ensure scanning resolution. A corresponding stripe pattern is generated based on the determined color and width. Using optimized stripe parameters for 3D scanning yields a clear stripe image. In this way, adjusting the stripes for the scene and object improves stripe contrast and recognition. Therefore, this solution enhances the effect and accuracy of 3D scanning, leading to more accurate subsequent structure extraction.

[0017] Optionally, based on the appearance contour of the object to be detected and the standard appearance contour, the contour curvature of each region in the appearance contour is determined; if the contour curvature of the target region in each region is greater than a preset curvature, the target region is regarded as a defect region, and the defect detection type is determined based on the contour characteristics of the defect region.

[0018] By employing the above technical solution, the curvature information of the actual shape contour of the object is calculated. The actual contour is compared with a standard contour to determine the curvature deviation. When the curvature of a local area significantly exceeds a threshold, it is identified as a defect area. Based on the contour characteristics of the defect area, the defect category is automatically identified. In this way, defect detection and classification can be automated. This solution enables rapid location of product quality problems, improves detection efficiency, and reduces the cost of manual judgment.

[0019] A second aspect of this application provides a system for a phase deflection detection method.

[0020] The image acquisition module is used to obtain the reflection image of the object to be detected mapped under stripe images of different phases; An image processing module is used to determine the wrapping phase of each of the reflection images, solve the wrapping phase, and obtain multiple consecutive phase points; The normal vector calculation module is used to obtain the normal vector at each of the continuous phase points and the target position of the object under test. The appearance detection module is used to determine the appearance contour of the object to be detected based on each of the normal vectors.

[0021] A third aspect of this application provides an electronic device.

[0022] A phase deflection detection system includes a memory, a processor, and a program stored in the memory and executable on the processor. When the program is loaded and executed by the processor, it implements a phase deflection detection method.

[0023] A fourth aspect of this application provides a computer-readable storage medium.

[0024] A computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement a phase deflection detection method.

[0025] In summary, one or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. This application obtains sufficient image information by acquiring reflection images corresponding to different phase fringes. Then, it solves for the wrapping phase of each image and obtains a precise phase point distribution through continuity analysis. These phase points contain rich 3D structural details. Next, based on the target's position, it calculates the normal vector for each phase point. This normal vector accurately expresses the detailed geometry of the 3D contour. Finally, it optimizes the reconstructed surface contour based on the normal vector results, avoiding error accumulation caused by direct fitting and making the reconstructed contour smoother and more natural. This scheme achieves high-precision, high-quality 3D shape reconstruction through phase analysis and normal vector adjustment, resulting in more accurate and smoother reconstruction effects and improving the accuracy of detecting product appearance defects.

[0026] 2. This application obtains parameters affecting normal vector calculation, including phase period, initial coordinates, and lens calibration parameters. Based on these parameters and the object's position, a reference plane for calculating the normal vector is determined. The distance from each sampling point to the reference plane is calculated to obtain the target distance. The magnitude and direction of the normal vector, i.e., the target gradient, are derived from the target distance. The precise normal vector for each sampling point is calculated based on the normal vector gradient. In this way, various key influencing factors are considered, achieving accurate calculation of the normal vector. This scheme improves the accuracy of normal vector extraction.

[0027] 3. This application uses the initial contour of the detected object as a foundation. Then, the difference in the normal vector of each contour point is calculated as an adjustment vector. Integrating this adjustment vector yields a smooth and continuous pixel adjustment amount. Compared to direct fitting, integration comprehensively considers both local and global shape features. Next, the initial contour is optimized based on the integrated adjustment amount, achieving a precise and natural contour representation. This integral contour adjustment technique avoids the contour ringing phenomenon caused by direct fitting, resulting in a smooth and accurate contour. The refined contour obtained through this optimization provides a high-quality shape representation for subsequent modeling and analysis. Overall, this scheme achieves high-precision contour optimization through integral adjustment, making the reconstruction effect more accurate and natural, thus improving the quality of reconstruction and modeling. Attached Figure Description

[0028] Figure 1 This is a schematic flowchart of a phase deflection detection method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a phase deflection detection system disclosed in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application.

[0029] Explanation of reference numerals in the attached drawings: 300, electronic device; 301, processor; 302, communication bus; 303, user interface; 304, network interface; 305, memory. Detailed Implementation

[0030] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0031] In the description of the embodiments of this application, the words "for example" or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design that is described as "for example" or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design options. Rather, the use of the words "for example" or "for instance" is intended to present the relevant concepts in a specific manner.

[0032] In the description of the embodiments of this application, the term "multiple" means two or more. For example, multiple systems means two or more systems, and multiple screen terminals means two or more screen terminals. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0033] To facilitate understanding of the methods and systems provided in the embodiments of this application, the background of the embodiments of this application will be introduced before introducing the embodiments of this application.

[0034] Currently, traditional contour measurement methods typically employ structured light 3D scanning technology to rapidly acquire 3D information about an object's surface, enabling non-contact surface inspection with advantages such as high detection speed. However, traditional structured light scanning technology has low accuracy in detecting surface defects, failing to meet the demands for high-precision defect detection.

[0035] This application discloses a phase deflection detection method. By mapping stripe images of different phases onto the surface of the object to be detected, a reflection image is obtained. Continuous phase points are then solved from this reflection image, and a normal vector is calculated based on these continuous phase points. Integrating the normal vector yields the external contour of the object to be detected. This method primarily addresses the problem that traditional structured light scanning technology has low detection accuracy for surface defects, failing to meet the demands for high-precision defect detection.

[0036] Having read the background information above, those skilled in the art can understand the problems existing in the prior art. The technical solutions in the embodiments of this application will be described in detail below with reference to the accompanying drawings. The described embodiments are only some embodiments of this application, and not all embodiments.

[0037] Reference Figure 1 A phase deflection detection method, comprising steps S10 to S40, specifically including the following steps: S10: Obtain the reflection image of the object to be detected mapped under stripe images of different phases.

[0038] Among them, stripe images with different phases refer to multiple sets of stripe images. These stripe images have the same stripe width and spacing, but different stripe starting positions, which causes the position of the boundary between the bright and dark stripes on the image to be phase-shifted.

[0039] Specifically, based on the surface color, ambient lighting conditions, and object size, the stripe color and width of the stripe image are determined, and multiple sets of stripe images with different initial phases are generated. This ensures the clarity of the reflection image. Through a beam splitter in the optical path, the stripe images of different phases are sequentially projected onto the target position of the object. After aligning the optical path, the industrial camera is set at a preset angle to capture the desired reflection image. Once the stripe image projection and camera alignment are in place, the camera is activated to capture the reflection images of the object under different phase stripe images. The obtained reflection images contain information about the brightness variations of the object's surface under different phases. By obtaining multiple sets of reflection images of stripes with different phases, a data foundation can be established for subsequent wrapping phase extraction and normal vector calculation, thereby accurately solving the object's surface contour, achieving high-precision defect detection, and improving the detection effect.

[0040] Based on the above embodiments, the specific steps for obtaining the reflection image further include S11 to S12: S11: Set multiple stripe images with different phases, and project each stripe image onto the target position of the object to be detected through a beam splitter.

[0041] For example, based on the determined fringe parameter requirements, a computer generates multiple sets of fringe images with different phase starting points but the same fringe width and spacing. The fringe images of different phases are sequentially added to a projection device, which includes a gradient beam splitter. The projection device is aligned with the target position on the surface of the object to be detected, ensuring the optical path is collimated. The projection device is activated, and the different phase fringe images generated in the computer are sequentially projected onto the object surface through the beam splitter. Through this process, fringe images with different starting phases can be obtained on the object surface. When the object surface has undulations or deformations, the fringe images will undergo corresponding displacement and deformation. Based on the reflection effect of the different phase fringe images on the object surface collected by the sensing device, the three-dimensional morphological information of the object surface can be extracted, providing a data foundation for subsequent detailed identification and analysis.

[0042] S12: Based on the preset shooting angle, an industrial camera is used to take a picture of the object to be inspected, and the reflection image of the stripe image on the object to be inspected is obtained.

[0043] For example, after the stripe image projection device is in place, an image acquisition device corresponding to its optical path needs to be set up. In this embodiment, a stable industrial camera is selected to ensure the quality of the captured images. Considering the requirements of subsequent image processing algorithms, a suitable shooting angle needs to be preset according to the object's size, position, and surface properties to obtain a clear stripe reflection image. Then, the orientation of the industrial camera is adjusted so that its normal is approximately perpendicular to the normal of the object's surface, meeting the preset shooting angle requirements. The industrial camera is then activated to capture the light intensity distribution effect formed on the object's surface under illumination by different phase stripe images. By taking turns capturing the reflection images corresponding to different phase stripes, all the necessary raw data can be obtained. Using an industrial camera with a preset orientation to capture reflection images ensures the acquisition of clear and comprehensive stripe deformation data, laying the foundation for subsequent accurate extraction of surface shape information.

[0044] In one optional embodiment of this application, before obtaining the reflection image mapped from the stripe images of the object to be detected under different phases, there is a stripe image determination process, specifically including steps S13 to S14: S13: Obtain the ambient light intensity, the surface color of the object to be detected, and the size of the object; determine the stripe color of the stripe image based on the light intensity and the surface color of the object to be detected.

[0045] For example, the current lighting conditions in the environment are detected to obtain illuminance information and determine the overall ambient brightness intensity. Based on the actual size of the object to be detected and combined with the surface material parameters, the reflectivity of the surface to different colors of light is simulated and calculated. The imaging effects under different stripe colors are compared and analyzed, and the stripe color with high reflectivity contrast and clear imaging is selected. According to the selected stripe color parameters, the stripe generator is controlled to output an ideal color stripe image. Through this process, a method for selecting appropriate stripe colors for specific detection scenarios is realized. Reasonable color selection can improve the contrast and recognition of stripes and enhance the accuracy of shape reconstruction.

[0046] S14: Determine the stripe width of the stripe image based on the object size; generate the stripe image based on the stripe color and stripe width.

[0047] For example, the fringe resolution that can be imaged on the object's surface is calculated based on the actual size of the object to be detected. According to the resolution requirements, the ideal period length of the fringe is determined, and the suitable width value for a single fringe is calculated. The determined fringe color is combined with the calculated fringe width to generate stripe parameters. The stripe parameters are input into a fringe generator, which outputs a fringe image with the ideal width and color. This process enables a method for selecting an appropriate fringe width for a specific object size. A reasonable fringe width ensures image sharpness, avoids fringe blending, and improves the accuracy of subsequent analysis.

[0048] S20: Determine the wrapping phase of each reflection image, solve for the wrapping phase, and obtain multiple consecutive phase points.

[0049] Because phase is periodic, the absolute phase for locating the boundary between a bright and dark fringe can be ambiguous with multiple phase values. Wrapping the phase value within a period eliminates ambiguity and yields a unique phase value.

[0050] Specifically, the reflection image corresponding to each phase stripe image is extracted sequentially, and a brightness equation is established at the same pixel position in each reflection image. By solving the system of equations, the wrapping phase at each pixel position can be obtained. The wrapping phase difference between adjacent pixels is analyzed, and a threshold is used to determine whether the phase difference is continuous. If continuous, the phase point is recorded. After processing and comparing the entire image, complete and continuous multiple sets of phase point information can be extracted. Through this process, the wrapping phase can be accurately obtained from the stripe reflection image, and the data of multiple phase sampling points on the object surface can be continuously recovered. This provides a foundation for subsequent determination of normal vectors and contours.

[0051] Based on the above embodiments, the specific steps for determining consecutive phase points further include S21 to S23: S21: Solve the brightness equations of the reflection images at the same pixel to obtain the wrapping phase.

[0052] The brightness equation is a mathematical expression describing the relationship between the brightness of each pixel in an image and influencing factors. In stripe image technology, the following factors are mainly considered: stripe phase, which determines the stripe alternation period; ambient light intensity, the overall background lighting conditions; and material reflectivity, the light reflectance of the material. By establishing a brightness equation for each pixel, including parameters such as phase, light intensity, and reflectivity, the phase can be solved, thereby recovering the shape of the object's surface.

[0053] For example, a multi-phase fringe reflection image is extracted, and a set of image brightness equations is established for each image according to pixel position. This set of equations expresses the light intensity relationship of each pixel under illumination by different phase fringes and includes a phase function term. Using mathematical derivation, the constant term is eliminated from the brightness equations for each pixel position, and a linear set of equations including phase is formed. Solving this set of equations using Gaussian elimination directly yields the wrapping phase value for each pixel. This method achieves the extraction of wrapping phase from the fringe reflection image. The obtained continuous wrapping phase distribution can be used to determine the coordinates of multiple phase sampling points on the object surface, which is the basis for subsequent shape restoration.

[0054] S22: Determine the phase difference between each adjacent pixel in the wrapped phase, and calculate the unwrapping value based on the phase difference.

[0055] For example, the unpacked phase matrix is ​​retrieved, and the phase difference between adjacent pixels is calculated pixel by pixel. The phase difference reflects the height variation information between adjacent points on the object's surface. The calculated phase difference is then unpacked to obtain the phase unpacking result. Based on a pre-set unpacking threshold range, it is determined whether the unpacking result is within a reasonable continuous range. The determination result is processed, retaining phases with unpacked values ​​within the threshold range as valid phase points, while filtering out phase points outside the threshold range. This step effectively filters out discontinuous phase noise points and retains true continuous phase sampling points, laying the foundation for accurately restoring the object's three-dimensional shape.

[0056] S23: If the unpacked value does not exceed the standard unpacked value range, then the adjacent pixels corresponding to the unpacked value are taken as each consecutive phase point.

[0057] For example, a preset threshold range for the continuity of unpacked values ​​is used, such as setting [-0.5, 0.5] as the standard phase continuity interval. The unpacked values ​​calculated for each pixel position are sequentially retrieved and compared with the standard interval. Only when the unpacked value falls within this interval is the phase considered continuous, and the phase point is recorded. After judging the continuity of the unpacked values ​​of all pixels in the image, all phase points within the continuous interval are retained. The coordinates of these phase points are the continuous three-dimensional sampling points on the object surface. Through this process, anisotropic discrete phase noise can be filtered out, obtaining a true continuous phase distribution and calibrating a large number of phase sampling points, laying the foundation for subsequent surface fitting.

[0058] S30: Based on each continuous phase point and the target position of the object under test, obtain the normal vector at each target position.

[0059] Specifically, based on camera intrinsic parameters and calibration parameters, combined with the target position of the object under test, a reference plane for normal vector calculation is determined. The coordinates of the extracted continuous phase points are retrieved and compared with the reference plane position. The distance from each phase point to the reference plane is calculated, which is the target distance of the normal vector. Based on the vector relationship between the phase point coordinates and the distance to the reference plane, the direction and magnitude of the normal vector at each point can be calculated. This process is repeated to obtain normal vector data for all target positions. This scheme enables the calculation of normal vectors at multiple target positions on the surface of the object under test. These normal vectors reflect the precise three-dimensional structure and contour information of the object's surface at each point, and can be used for high-precision surface fitting and defect identification.

[0060] Based on the above embodiments, the specific steps for determining the normal vector further include S31 to S33: S31: Obtain the phase period, phase start point coordinates, and lens calibration parameters, and determine the target parameters based on the phase period, phase start point coordinates, and lens calibration parameters.

[0061] For example, the phase period of the fringe image is obtained, which is the length of a complete bright and dark fringe period. This parameter affects the transformation relationship between the phase coordinates of each sampling point and the actual distance. The initial phase coordinates of the fringe image are obtained. This coordinate point represents the starting position of the phase and is a reference for determining the absolute phase. The intrinsic and extrinsic calibration parameters of the optical lens are obtained, including information such as focal length and optical center position. These parameters affect the transformation from sampling point coordinates to actual physical coordinates. By obtaining the above phase period, initial coordinates, and lens calibration parameters, a corresponding model from phase space to actual three-dimensional space can be established, and the target parameters required for normal vector calculation can be determined, laying the foundation for accurately obtaining the normal vector.

[0062] S32: Determine the position of the reference plane based on the target parameters and the target position of the object to be measured.

[0063] For example, based on the acquired phase image parameters and lens calibration parameters, a transformation relationship between pixel coordinates and physical coordinates is established. Combining the target position coordinates of the object under test, the plane equation corresponding to the target position in the image coordinate system can be calculated through the coordinate transformation relationship. The normal vector portion of this plane equation is extracted as a reference normal vector, and the position perpendicular to this plane is determined as the reference plane. Through this process, the reference plane is calculated and determined based on the target parameters and object position, providing a benchmark for subsequent calculations of specific normal vectors. The relationship between the normal vector and the reference plane determines the three-dimensional spatial coordinates of the surface points.

[0064] S33: Determine the target distance based on the position of the phase point and the position of the reference plane, and determine the target gradient based on the prime target distance; determine the normal vector based on the target gradient.

[0065] For example, after determining the reference plane, the normal vector of each sampling point can be calculated. The specific process includes sequentially extracting the coordinate values ​​of each consecutive phase point obtained in the preceding steps. The distance from this phase point to the target position determined by the reference plane is calculated as the target distance for the normal vector. Based on the coordinate position of the point and the target distance, the direction of the normal vector can be determined. Combining the distance and direction, the specific magnitude of the normal vector at that point can be calculated. This process is repeated to calculate the normal vector data for each phase sampling point. This scheme achieves the determination of the surface normal vectors of the object under test. These normal vectors reflect the precise three-dimensional structural information of the object's surface at each point, serving as the foundational data for subsequent fitting and recognition.

[0066] S40: Determine the outline of the object to be detected based on each normal vector.

[0067] In the process of 3D reconstruction using fringe phase, the normal vector represents the surface orientation of each sampling point in 3D space. That is, a vector perpendicular to the tangent plane of the surface is derived from each sampling point, indicating the surface orientation at that point and reflecting the 3D structure of the object's surface.

[0068] Specifically, the normal vector data of each calculated sampling point is extracted sequentially, and a three-dimensional coordinate system is established. Based on the magnitude and direction of the normal vector, the precise position coordinates of each sampling point in the three-dimensional coordinate system can be determined. Using all determined three-dimensional coordinate points as a basis, a three-dimensional surface fitting algorithm, such as three-dimensional surface discrete point fitting, is applied to obtain the optimal fitting solution. Contour lines are extracted from this fitting solution to determine the continuous three-dimensional contour of the object's surface. Through this method, the process of determining the three-dimensional appearance contour of an object based on normal vector calculation is realized. The obtained precise contour information can be used for subsequent three-dimensional structural analysis and defect identification.

[0069] Based on the above embodiments, the specific steps for determining the external contour of the object to be detected further include S41 to S43: S41: Obtain the initial surface contour of the object to be detected; determine the difference vector of each pixel position in the initial surface contour based on each normal vector.

[0070] For example, a 3D design model of the object to be inspected is acquired, and detailed initial contour information of the object's surface is extracted from it. The normal vector information of each sampling point calculated in the preceding process is retrieved and mapped to the initial contour. The deviation between the normal vector direction of each sampling point and the theoretical direction of the initial contour is analyzed point by point, and the difference vector between the two is calculated. The difference vectors of the normal vectors of all sampling points are mapped onto the initial contour to obtain the difference vector information of each pixel position of the initial contour. This method obtains the difference information between the actual surface of the object and the theoretical design, providing basic data for subsequent defect identification and analysis.

[0071] S42: Integrate each difference vector to obtain the adjustment amount; adjust the initial surface contour according to the adjustment amount to obtain the appearance contour of the object to be detected.

[0072] For example, the difference vector results of each sampling point on the initial contour are extracted. The difference vector of each sampling region is numerically integrated to obtain the contour adjustment amount for that region. The adjustment amounts of all sampling regions are superimposed onto the corresponding positions of the initial contour to perform vector adjustment. After vector adjustment of each point on the contour, the actual three-dimensional contour information of the object is obtained. Through this process, the determination from the theoretical initial contour to the actual contour is achieved. The obtained actual contour reflects the precise three-dimensional structural information of the object and can be used for subsequent defect identification and analysis.

[0073] Based on the above embodiments, after obtaining the external outline of the object to be detected, there is still a process for detecting defects, specifically including steps S43 to S44: S43: Determine the curvature of each region in the appearance contour based on the appearance contour of the object to be detected and the standard appearance contour.

[0074] For example, a 3D design model of the object is obtained, and a standard ideal outline is extracted. The actual appearance outline of the object obtained earlier is then superimposed on the standard outline. Multiple sampling areas of the outline are selected, and the deviation between the actual outline and the standard outline is calculated in each area. Based on the distribution of the outline deviation points, the outline curvature information of each area can be quantified. Through this process, the outline curvature of different surface areas can be calculated. The curvature can determine whether there are defects on the surface and the severity of the defects.

[0075] S44: If the contour curvature of the target area in each region is greater than the preset curvature, then the target area is regarded as a defect area, and the defect detection type is determined according to the contour characteristics of the defect area.

[0076] For example, a preset threshold for the contour curvature of normal surface areas is used as the judgment criterion. The actual contour curvature results of each sampling area are analyzed and compared with the preset threshold. When the curvature of a certain area is significantly greater than the threshold, the area is determined to be abnormal and identified as a defect area. Based on the determined contour characteristics of the defect area, such as depressions, burrs, cracks, etc., the specific detection type of the defect is determined. Through this process, the identification and classification of defect areas on the object surface are realized. The defect type results can be used to formulate subsequent quality control and improvement processes.

[0077] Reference Figure 2 This application provides a phase deflection detection system, which includes: an image acquisition module, an image processing module, a normal vector calculation module, and an appearance detection module, wherein: The image acquisition module is used to obtain the reflection image of the object to be detected mapped under stripe images of different phases; The image processing module is used to determine the wrapping phase of each reflection image, solve for the wrapping phase, and obtain multiple consecutive phase points. The normal vector calculation module is used to obtain the normal vector at each target position based on each continuous phase point and the target position of the object under test. The appearance inspection module is used to determine the external contour of the object to be inspected based on each normal vector. Based on the above embodiments, the image acquisition module is also used to set multiple stripe images with different phases, and project each stripe image onto the target position of the object to be detected through a beam splitter; according to the preset shooting angle, an industrial camera is used to shoot the object to be detected to obtain the reflection image of the object to be detected mapped under the stripe images with different phases.

[0078] Based on the above embodiments, the image processing module is also used to simultaneously establish the brightness equations of each reflection image at the same pixel, solve the brightness equations to obtain the wrapping phase; determine the phase difference of each adjacent pixel in the wrapping phase, and calculate the unwrapping value based on the phase difference; if the unwrapping value does not exceed the standard unwrapping value range, then the adjacent pixels corresponding to the unwrapping value are taken as each consecutive phase point.

[0079] Based on the above embodiments, the normal vector calculation module is also used to obtain the phase period, the coordinates of the phase start point, and the lens calibration parameters, and to determine the target parameters based on the phase period, the coordinates of the phase start point, and the lens calibration parameters; to determine the reference plane position based on the target parameters and the target position of the object to be measured; to determine the target distance based on the position of the phase point and the position of the reference plane, and to determine the target gradient based on the prime target distance; and to determine the normal vector based on the target gradient.

[0080] Based on the above embodiments, the appearance detection module is also used to obtain the initial surface contour of the object to be detected; determine the difference vector of each pixel position in the initial surface contour according to each normal vector; integrate each difference vector to obtain the adjustment amount; adjust the initial surface contour according to the adjustment amount to obtain the appearance contour of the object to be detected.

[0081] Based on the above embodiments, the image acquisition module further includes acquiring the ambient light intensity, the surface color of the object to be detected, and the object size; determining the stripe color of the stripe image based on the light intensity and the surface color of the object to be detected; determining the stripe width of the stripe image based on the object size; and generating the stripe image based on the stripe color and the stripe width.

[0082] Based on the above embodiments, the appearance inspection module further includes determining the contour curvature of each region in the appearance contour according to the appearance contour of the object to be inspected and the standard appearance contour; if the contour curvature of the target region in each region is greater than the preset curvature, the target region is regarded as a defect region, and the defect detection type is determined according to the contour characteristics of the defect region.

[0083] It should be noted that the above embodiments of the apparatus are only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0084] This application also discloses an electronic device. (See reference...) Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application. The electronic device 300 may include: at least one processor 301, at least one network interface 304, a user interface 303, a memory 305, and at least one communication bus 302.

[0085] The communication bus 302 is used to enable communication between these components.

[0086] The user interface 303 may include a display interface and a camera interface. Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.

[0087] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0088] The processor 301 may include one or more processing cores. The processor 301 connects to various parts of the server using various interfaces and lines, and performs various server functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 305, and by calling data stored in the memory 305. Optionally, the processor 301 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 301 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface graphics, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 301 and may be implemented as a separate chip.

[0089] The memory 305 may include random access memory (RAM) or read-only memory. Optionally, the memory 305 may include a non-transitory computer-readable storage medium. The memory 305 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 305 may also be at least one storage device located remotely from the aforementioned processor 301. (Refer to...) Figure 3 The memory 305, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an application program for a phase deflection detection method.

[0090] exist Figure 3In the illustrated electronic device 300, the user interface 303 is mainly used to provide an input interface for the user and acquire user input data; while the processor 301 can be used to call an application program of a phase deflection detection method stored in the memory 305. When executed by one or more processors 301, the electronic device 300 performs one or more methods as described in the above embodiments. It should be noted that, for the foregoing method embodiments, for the sake of simplicity, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0091] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0092] In the various embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some service interface; the indirect coupling or communication connection between apparatuses or units may be electrical or other forms.

[0093] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0094] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0095] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, portable hard drives, magnetic disks, or optical disks.

[0096] The above are merely exemplary embodiments of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Other embodiments of this disclosure will readily conceive of those skilled in the art upon consideration of the specification and the disclosure of practical truths.

[0097] This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described in this disclosure. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.

Claims

1. A phase deflection detection method, characterized in that, include: Obtain the reflection image of the object to be detected mapped under stripe images of different phases; Determine the wrapping phase of each of the reflected images, solve the wrapping phase, and obtain multiple consecutive phase points; Based on each of the continuous phase points and the target position of the object to be detected, the normal vector at each of the target positions is obtained; The external contour of the object to be detected is determined based on each of the normal vectors. The step of obtaining the normal vector at each target position based on each of the consecutive phase points and the target position of the object to be detected includes: The phase period, phase start point coordinates, and lens calibration parameters are obtained, and the target parameters are determined based on the phase period, phase start point coordinates, and lens calibration parameters. The reference plane position is determined based on the target parameters and the target position of the object to be detected; Based on the position of the phase point and the position of the reference plane, the target distance is determined, and based on the target distance, the target gradient is determined. The normal vector is determined based on the target gradient; Determining the external contour of the object to be detected based on each of the normal vectors includes: Obtain the initial surface contour of the object to be detected; Based on the aforementioned normal vectors, determine the difference vector of each pixel position in the initial surface contour; Integrate each of the aforementioned difference vectors to obtain the adjustment amount; The initial surface profile is adjusted according to the adjustment amount to obtain the appearance profile of the object to be detected.

2. The phase deflection detection method according to claim 1, characterized in that, The process of obtaining the reflection image mapped from the stripe images of the object to be detected at different phases includes: Multiple stripe images with different phases are set, and each stripe image is projected onto the target position of the object to be detected through a beam splitter; According to a preset shooting angle, an industrial camera is used to photograph the object to be detected, and the reflection image of the object to be detected is obtained by mapping the stripe images of different phases.

3. The phase deflection detection method according to claim 1, characterized in that, The process involves determining the wrapping phase of each of the reflected images, solving for the wrapping phase, and obtaining multiple consecutive phase points, including: By simultaneously solving the brightness equations of the reflected images at the same pixel and solving the brightness equations, the wrapping phase is obtained. Determine the phase difference between each adjacent pixel in the wrapped phase, and calculate the unpacking value based on the phase difference; If the unpacking value does not exceed the standard unpacking value range, then the adjacent pixels corresponding to the unpacking value are taken as each of the consecutive phase points.

4. The phase deflection detection method according to claim 1, characterized in that, Before obtaining the reflection image of the object to be detected mapped under stripe images of different phases, the method further includes: Acquire ambient light intensity and the surface color and size of the object to be detected; The stripe colors of the stripe image are determined based on the light intensity and the surface color of the object to be detected. The stripe width of the stripe image is determined based on the size of the object; The stripe image is generated based on the stripe color and the stripe width.

5. The phase deflection detection method according to claim 1, characterized in that, After determining the external contour of the object to be detected based on each of the normal vectors, the method further includes: Based on the external contour of the object to be detected and the standard external contour, determine the contour curvature of each region in the external contour; If the contour curvature of the target region in each of the regions is greater than a preset curvature, then the target region is regarded as a defect region, and the defect detection type is determined according to the contour features of the defect region.

6. A phase deflection detection system, characterized in that, The system includes: The image acquisition module is used to obtain the reflection image of the object to be detected mapped under stripe images of different phases; An image processing module is used to determine the wrapping phase of each of the reflection images, solve the wrapping phase, and obtain multiple consecutive phase points; The normal vector calculation module is used to obtain the normal vector at each target position based on each of the continuous phase points and the target position of the object to be detected; The appearance detection module is used to determine the appearance contour of the object to be detected based on each of the normal vectors. The step of obtaining the normal vector at each target position based on each of the consecutive phase points and the target position of the object to be detected includes: The phase period, phase start point coordinates, and lens calibration parameters are obtained, and the target parameters are determined based on the phase period, phase start point coordinates, and lens calibration parameters. The reference plane position is determined based on the target parameters and the target position of the object to be detected; Based on the position of the phase point and the position of the reference plane, the target distance is determined, and based on the target distance, the target gradient is determined. The normal vector is determined based on the target gradient; Determining the external contour of the object to be detected based on each of the normal vectors includes: Obtain the initial surface contour of the object to be detected; Based on the aforementioned normal vectors, determine the difference vector of each pixel position in the initial surface contour; Integrate each of the aforementioned difference vectors to obtain the adjustment amount; The initial surface profile is adjusted according to the adjustment amount to obtain the appearance profile of the object to be detected.

7. An electronic device, characterized in that, The device includes a processor, a memory, a user interface, and a network interface. The memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory to cause the electronic device to perform the phase deflection detection method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed, perform the steps of the phase deflection detection method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Structured light measuring system calibration method based on sinusoidal grating

    CN103234482A

  • Method of implementing pattern reflection to measure contour of object surface

    TW200938804A