A method and system for two-dimensional positioning of images in structured light
Through the combination of telecentric projection and imaging equipment, combined with computer dephasing and feature point positioning technology, the offset and rotation problems caused by product inconsistency in three-dimensional measurements are solved, and a high-precision and efficient two-dimensional positioning method is achieved.
Patent Information
- Application Number
- CN202210503955.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-10
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2042-05-10
AI Technical Summary
In three-dimensional measurement, the differences in the product lead to the incoming material being unable to meet consistency, and there are problems with lateral and longitudinal offsets and rotation angles. In the prior art, the contact type method has low positioning accuracy and may damage the product, while the non-contact type method has complex structure and requires additional hardware mechanisms.
The telecentric projection equipment and telecentric imaging equipment are used in combination to perform structured light projection imaging of the product to be tested to form a stripe pattern with multiple pairs of encoded information. Through computer dephasing and processing, a complete original picture is obtained, and feature points are selected for positioning marking, and horizontal and vertical offsets and rotation offsets are calculated.
It realizes accurate calculation of product offset and rotation information without changing the structure and positioning fixture, improving measurement accuracy and efficiency, and avoiding measurement errors caused by positioning fixture accuracy.
Smart Images

Figure CN114926380B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image positioning technology, and in particular to a method and system for two-dimensional image positioning in structured light. Background Art
[0002] There are many methods in the field of 3D measurement, including contact and non-contact methods. Contact methods include three-dimensional coordinate measuring machines, and non-contact methods include line lasers and structured light. Among them, structured light projection technology is a method of projecting a fringe pattern with coded information, and then obtaining the 3D information of the object through algorithm decomposition. Its main features are surface scanning, high precision, and high speed. It can quickly form 3D shapes and accurately calculate heights. It is widely used in 3C, electronics, materials and other fields.
[0003] In actual online 3D measurement, due to the differences in products, the incoming materials cannot meet the consistency requirements, and there will be offsets in the horizontal and vertical directions, as well as a certain rotation angle. These have a relatively large impact on high-precision measurement. At present, there are two processing methods to ensure the inconsistency of products: the first is the contact method, which usually uses a jig (fixture) to mechanically locate the incoming position of the product. This method is simple to operate, but the mechanical positioning method itself has relatively low positioning accuracy and will cause certain damage to the product. It will also bring certain complexity to the mechanism structure; the second is to use an external ring light source, external lighting, and collect the original 2D image of the product by designing the acquisition control process, so as to perform the positioning algorithm to obtain the product's offset and rotation information. However, this method has a complex structure and requires an external hardware mechanism. The control design process requires the acquisition of 2D images, which is relatively complicated. Summary of the invention
[0004] The object of the present invention is to provide a method and system for two-dimensional positioning of an image in structured light, so as to solve the problems raised in the above background technology.
[0005] In order to solve the above technical problems, the present invention provides the following technical solutions: a method for two-dimensional positioning of an image in structured light, comprising the following steps:
[0006] S1. Use a telecentric projection device and a telecentric imaging device in combination to perform structured light projection imaging processing on the product to be tested, and form multiple fringe patterns with coded information;
[0007] S2, sending multiple fringe images with coded information to a computer, which performs phase deconvolution on the images, superimposes and fuses them, and then obtains a complete original image;
[0008] S3, the original image obtained in step S2 is positioned and marked, and the feature points of the original image are selected for marking. The coordinate range of the feature points is G{(x 1 ~x 2 ), (y 1 ~y 2 )};
[0009] S4, refining and dividing the feature point coordinates into a number of refined marking point coordinates to form a reference benchmark for positioning markings of image feature points;
[0010] S5. When the product changes, the coordinates of the feature points on the image are marked. The coordinate range of the feature points after the change is G{(x 3 ~x 4 ), (y 3 ~y 4 )};
[0011] S6. Refine and divide the changed feature point coordinates into a number of refined changed mark point coordinates; and calculate the lateral offset, longitudinal offset and rotational offset based on the image feature point positioning mark reference.
[0012] Further, in step S1, the bar graph with the coded information is formed into sinusoidal stripes by formula ①;
[0013] I(X,Y)=A+B cos(2πfu+δ) ①;
[0014] I(X, Y) is the light intensity distribution of the grating stripes; f is the frequency of the grating stripes; δ is the phase shift; A is the DC component, B is the amplitude, (X, Y) is the projector pixel coordinate; u is a rectangular wave.
[0015] Further, in step S4, the coordinates of the marking points are refined to F(J i , K s );J i Calculated by formula ②; K s Calculated by formula ③; forming a reference benchmark for positioning mark of image feature points;
[0016]
[0017]
[0018] T i =n;
[0019] L s =m;
[0020] Both n and m are number sequences.
[0021] Further, n = {1, 2, 34, 5, 6, 7, 8, 9, 10};
[0022] m={1, 2, 34, 5, 6, 7, 8, 9, 10}.
[0023] Further, in step S6, the coordinates of the marking point after refinement and change are F(P i , Q s );P i Calculated by formula ②; Q s Calculated by formula ③;
[0024]
[0025]
[0026] Furthermore, the lateral offset is calculated by formula ⑥; the longitudinal offset is calculated by formula ⑦; and the rotational offset is calculated by formula ⑧;
[0027] The lateral offset is C;
[0028] The longitudinal offset is D;
[0029] The rotation offset is E;
[0030] The present invention also provides a system for two-dimensional image positioning, including a computer, a telecentric projection module, a telecentric imaging module, an image dephasing module, a point cloud generation module, and an image positioning module. The telecentric projection module, the telecentric imaging module, the image dephasing module, the point cloud generation module, and the image positioning module are respectively connected to the computer for communication data. The computer integrates, analyzes, and calculates the data. The telecentric projection module is used to perform telecentric projection processing on the product to be tested. The telecentric imaging module is used to perform telecentric imaging processing on the product to be tested. The image dephasing module is used to perform dephasing and superposition processing on an image with sinusoidal stripes to obtain an original image of the product to be tested. The point cloud generation module performs point cloud marking processing on the original image of the product to be tested. The image positioning module is used to perform marking and positioning processing on image feature points, and calculates the lateral offset, longitudinal offset, and rotational offset before and after the product to be tested.
[0031] Furthermore, the telecentric projection module is a Sham double telecentric lens, and the telecentric imaging module is an imaging double telecentric lens.
[0032] Furthermore, the image dephasing module includes: an image sinusoidal fringe calculation unit, an image sinusoidal fringe projection unit, and an image superposition and fusion unit. The image sinusoidal fringe calculation unit is used to calculate and process the sinusoidal fringes to be projected on the image, the image sinusoidal fringe projection unit is used to project the sinusoidal fringes onto the telecentric image, and the image superposition and fusion unit is used to superimpose and fuse the image of the projected sinusoidal fringes to form the original image of the product to be tested.
[0033] Furthermore, the image positioning module includes: a feature point positioning unit, a feature point refinement and segmentation unit, and an offset analysis unit. The feature point positioning unit is used to locate, extract, collect and process the feature points. The feature point refinement and segmentation unit is used to refine and segment the feature points and position and mark the feature points after the segmentation processing. The offset analysis unit calculates the lateral offset, longitudinal offset and rotational offset based on the feature point positioning information and the feature points after the refinement and segmentation processing.
[0034] Compared with the prior art, the beneficial effects achieved by the present invention are:
[0035] 1. The present invention proposes a method of fusing 2D fringe images, and then positioning the point cloud through a positioning algorithm to achieve the accuracy of product calculation, without changing the structure and without a positioning fixture; the present invention proposes to superimpose and fuse two projected fringe images, and then obtain a complete original image. In order to improve the measurement and calculation accuracy, a telecentric projection module and a telecentric imaging module system are used, and then a 2D positioning algorithm is used to obtain the positioning information of the product, including the lateral and longitudinal offsets and the rotation angle relative to the upper frame data, so as to compensate for the measurement error caused by the product offset; the present invention proposes a method of combining 2D positioning to compensate for 3D measurement; superimposing two images can make the entire image in the same phase state; by performing a 2D positioning algorithm on the fused image, the positioning information (lateral, longitudinal and rotation angle) of the two times before and after is obtained; by performing feature point positioning, acquisition and extraction on the image, the feature points are refined and segmented and positioned as a reference template for calculation, and then when the product to be measured is rotated and offset again, the corresponding rotation and translation parameters are obtained according to the reference template, thereby compensating for the measurement error caused by the product offset;
[0036] 2. The present invention adopts a method for synthesizing a two-dimensional image using a stripe coded picture; the present invention adopts a two-dimensional positioning method based on a stripe picture, without the need for additional operating procedures; the present invention can directly use a coded picture to obtain a two-dimensional image; the present invention is a method for generating a two-dimensional image comparable to that obtained by ring light illumination under dual projection or more projections; the present invention adopts a method of superimposing and synthesizing stripe pictures, which directly superimposes and synthesizes, and does not require an external 2D camera to take pictures again, thus saving overhead. At the same time, the positioning method is used to avoid measurement errors caused by the accuracy of the positioning jig (fixture), which can effectively improve the overall efficiency and accuracy of the measurement. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0038] Figure 1 It is a schematic diagram of system connection in the present invention;
[0039] Figure 2 It is the principle diagram of structured light 3D in the present invention;
[0040] Figure 3 It is a schematic diagram of the superposition of sinusoidal fringes in the present invention;
[0041] Figure 4 It is an internal schematic diagram of the image deconvolution module in the present invention;
[0042] Figure 5 is an internal schematic diagram of the image positioning module in the present invention;
[0043] In the figure: 1. Telecentric projection module; 2. Telecentric imaging module; 3. Computer; 4. Image deconvolution module; 5. Point cloud generation module; 6. Image positioning module. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] like Figure 1-Figure 5 A method for two-dimensional positioning of an image in structured light as shown includes the following steps:
[0046] S1. Use a telecentric projection device and a telecentric imaging device in combination to perform structured light projection imaging processing on the product to be tested, and form multiple fringe patterns with coded information;
[0047] The bar graph with coded information forms sinusoidal stripes through formula ①;
[0048] I(X,Y)=A+B cos(2πfu+δ) ①;
[0049] I(X, Y) is the light intensity distribution of the grating stripes; f is the frequency of the grating stripes; δ is the phase shift; A is the DC component, B is the amplitude, (X, Y) is the projector pixel coordinate; u is a rectangular wave; the phase shift of the grating stripes in this system is Because the step period of the fringe pattern is That is 90°, so the first and third (or second and fourth) images are in opposite phases. The superposition of the two images can make the entire image in the same phase (that is, the light and dark parts of the two images are superimposed, that is, both are illuminated, and the effect is a 2D image). The resulting image is as follows Figure 3 As shown;
[0050] S2, sending multiple fringe images with coded information to a computer, which performs phase deconvolution on the images, superimposes and fuses them, and then obtains a complete original image;
[0051] S3, the original image obtained in step S2 is positioned and marked, and the feature points of the original image are selected for marking. The coordinate range of the feature points is G{(x 1 ~x 2 ), (y 1 ~y 2 )};
[0052] S4, refining and dividing the feature point coordinates into a number of refined marking point coordinates to form a reference benchmark for positioning markings of image feature points;
[0053] The coordinates of the refined marker points are F(J i , K s );J i Calculated by formula ②; K s Calculated by formula ③; forming a reference benchmark for positioning mark of image feature points;
[0054]
[0055]
[0056] T i =n;
[0057] L s =m;
[0058] Both n and m are number sequences.
[0059] n={1, 2, 34, 5, 6, 7, 8, 9, 10};
[0060] m={1, 2, 34, 5, 6, 7, 8, 9, 10};
[0061] S5. When the product changes, the coordinates of the feature points on the image are marked. The coordinate range of the feature points after the change is G{(x 3 ~x 4 ), (y 3 ~y 4 )};
[0062] S6, refining and dividing the changed feature point coordinates into a number of refined changed mark point coordinates; calculating the lateral offset, longitudinal offset and rotational offset based on the image feature point positioning mark reference;
[0063] The coordinates of the marker point after refinement are F(P i , Q s );P i Calculated by formula ②; Q s Calculated by formula ③;
[0064]
[0065]
[0066] The lateral offset is calculated by formula ⑥; the longitudinal offset is calculated by formula ⑦; the rotational offset is calculated by formula ⑧;
[0067] The lateral offset is C;
[0068] The longitudinal offset is D;
[0069] The rotation offset is E;
[0070] The present invention also provides a system for two-dimensional image positioning, including a computer 3, a telecentric projection module 1, a telecentric imaging module 2, an image dephasing module 4, a point cloud generation module 5, and an image positioning module 6. The telecentric projection module 1, the telecentric imaging module 2, the image dephasing module 4, the point cloud generation module 5, and the image positioning module 6 are respectively connected to the computer 3 for data communication. The computer 3 integrates, analyzes, and calculates the data. The telecentric projection module 1 is used to perform telecentric projection processing on the product to be tested. The telecentric imaging module 2 is used to perform telecentric imaging processing on the product to be tested. The image dephasing module 4 is used to perform dephasing and superposition processing on the image with sinusoidal stripes to obtain the original image of the product to be tested. The point cloud generation module 5 performs point cloud marking processing on the original image of the product to be tested. The image positioning module 6 is used to perform marking and positioning processing on the image feature points, and calculate the lateral offset, longitudinal offset, and rotational offset before and after the product to be tested. The telecentric projection module 1 is a Sham double Telecentric lens, the telecentric imaging module 2 is an imaging double telecentric lens; the image dephasing module 4 includes: an image sinusoidal fringe calculation unit, an image sinusoidal fringe projection unit, and an image superposition and fusion unit. The image sinusoidal fringe calculation unit is used to calculate and process the sinusoidal fringes to be projected on the image, the image sinusoidal fringe projection unit is used to project the sinusoidal fringes onto the telecentric image, and the image superposition and fusion unit is used to superimpose and fuse the image of the projected sinusoidal fringes to form the original image of the product to be tested; the image positioning module 6 includes: a feature point positioning unit, a feature point refinement and segmentation unit, and an offset analysis unit. The feature point positioning unit is used to locate, extract, and collect feature points, the feature point refinement and segmentation unit is used to refine and segment feature points, and locate and mark the feature points after segmentation, and the offset analysis unit calculates the lateral offset, longitudinal offset, and rotational offset according to the feature point positioning information and the feature points after refinement and segmentation.
[0071] The beneficial effects of the present invention are:
[0072] The present invention proposes a method of fusing 2D fringe patterns, and then positioning the point cloud through a positioning algorithm to achieve accurate product calculation, without changing the structure or positioning a fixture; the present invention proposes to superimpose and fuse two projected fringe patterns, and then obtain a complete original image. In order to improve the measurement and calculation accuracy, a telecentric projection module is used, and a telecentric imaging module system is added, and then a 2D positioning algorithm is used to obtain the positioning information of the product, including the lateral and longitudinal offsets and the rotation angle relative to the upper frame data, so as to compensate for the measurement error caused by the product offset; the present invention proposes a method of combining 2D positioning to compensate for 3D measurement; 3D structured light projects multiple fringe patterns with coded information, and because the step cycle of the fringe pattern is That is, 90°, so the first and third (or second and fourth) images are in opposite phases, and the two images can be superimposed to make the entire image in the same phase (that is, the light and dark parts of the two images are superimposed, that is, both are illuminated, and the resulting effect is a 2D image); by performing a 2D positioning algorithm on the fused image, the positioning information of the previous and subsequent images (horizontal, vertical, and rotation angle) is obtained; by performing feature point positioning, acquisition, and extraction on the image, the feature points are refined, segmented, and positioned as a reference template for calculation, and then when the product to be tested is rotated and offset again, the corresponding rotation and translation parameters are obtained according to the reference template. And then compensate for the measurement error caused by product deviation; the present invention adopts a method of synthesizing a two-dimensional image using a stripe coded picture; the present invention adopts a two-dimensional positioning method based on a stripe picture, without the need for additional operating procedures; the present invention can directly use the coded picture to obtain a two-dimensional image; the present invention is a method for generating a two-dimensional image comparable to that obtained by ring light illumination under the condition of dual projection or more projections; the present invention adopts a method of superimposing and synthesizing stripe pictures, which directly superimposes and synthesizes, and does not require an external 2D camera to shoot and take pictures again, thus saving expenses. At the same time, the positioning method is used to avoid measurement errors caused by the accuracy of the positioning jig (fixture), which can effectively improve the overall efficiency and accuracy of the measurement.
[0073] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for two-dimensional positioning of an image in structured light, characterized by: The following steps are involved: S1. Use a telecentric projection device and a telecentric imaging device in combination to perform structured light projection imaging processing on the product to be tested, and form multiple fringe patterns with coded information; S2, sending multiple fringe images with coded information to a computer, which performs phase deconvolution on the images, superimposes and fuses them, and then obtains a complete original image; S3, performing positioning and marking processing on the original image obtained in step S2, selecting feature points of the original image for marking processing, and the coordinate range of the feature points is G{(x1~x2, (y1~y2)}; S4, refining and dividing the feature point coordinates into a number of refined marking point coordinates to form a reference benchmark for positioning markings of image feature points; S5. When the product changes, the coordinates of the feature points on the image are marked, and the coordinate range of the feature points after the change is G{(x3~x4), (y3~y4)}; S6. Refine and divide the changed feature point coordinates into a number of refined changed mark point coordinates; and calculate the lateral offset, longitudinal offset and rotational offset based on the image feature point positioning mark reference.
2. A method for two-dimensional positioning of an image in structured light according to claim 1, characterized in that: In step S1, the bar graph with coded information is formed into sinusoidal stripes by formula ①; I(X,Y)=A+B cos(2πfu+δ) ①; I(X, Y) is the light intensity distribution of the grating stripes; f is the frequency of the grating stripes; δ is the phase shift; A is the DC component, B is the amplitude, (X, Y) is the projector pixel coordinates; u is a rectangular wave.
3. The method for two-dimensional positioning of an image in structured light according to claim 1, characterized in that: In step S4, the coordinates of the marking points are refined to F(J i , K s );J i Calculated by formula ②; K s Calculated by formula ③; forming a reference benchmark for positioning mark of image feature points; T i =n; L s =m; Both n and m are number sequences.
4. The method for two-dimensional positioning of an image in structured light according to claim 3, characterized in that: n={1,2,34,5,6,7,8,9,10}; m={1,2,34,5,6,7,8,9,10}。 5. The method for two-dimensional positioning of an image in structured light according to claim 4, characterized in that: In step S6, the coordinates of the marking point after refinement and change are F(P i , Q s );P i Calculated by formula ②; Q s Calculated by formula ③; 6. The method for two-dimensional positioning of an image in structured light according to claim 5, characterized in that: The lateral offset is calculated by formula ⑥; the longitudinal offset is calculated by formula ⑦; the rotational offset is calculated by formula ⑧; The lateral offset is C; The longitudinal offset is D; The rotation offset is E; 7. The structured light for image two-dimensional positioning system according to claim 1, characterized in that: The invention comprises a computer (3), a telecentric projection module (1), a telecentric imaging module (2), an image dephasing module (4), a point cloud generating module (5), and an image positioning module (6). The telecentric projection module (1), the telecentric imaging module (2), the image dephasing module (4), the point cloud generating module (5), and the image positioning module (6) are respectively connected to the computer (3) for data communication. The computer (3) performs integrated analysis and calculation processing on the data. The telecentric projection module (1) is used to perform telecentric projection processing on the product to be tested. The telecentric imaging module (2) is used to perform telecentric imaging processing on the product to be tested. The image dephasing module (4) is used to perform dephasing and superposition processing on an image with sinusoidal stripes to obtain an original image of the product to be tested. The point cloud generating module (5) performs point cloud marking processing on the original image of the product to be tested. The image positioning module (6) is used to perform marking and positioning processing on image feature points to calculate the lateral offset, longitudinal offset, and rotation offset of the product to be tested.
8. The method and system for two-dimensional positioning of an image in structured light according to claim 7, characterized in that: The telecentric projection module (1) is a Sham double telecentric lens, and the telecentric imaging module (2) is an imaging double telecentric lens.
9. The method and system for two-dimensional positioning of an image in structured light according to claim 7, characterized in that: The image dephasing module (4) comprises: an image sinusoidal fringe calculation unit, an image sinusoidal fringe projection unit, and an image superposition and fusion unit. The image sinusoidal fringe calculation unit is used to perform calculation processing on the sinusoidal fringe to be projected on the image, the image sinusoidal fringe projection unit is used to project the sinusoidal fringe onto the telecentric image, and the image superposition and fusion unit is used to superimpose and fuse the image of the projected sinusoidal fringe to form an original image of the product to be tested.
10. The method and system for two-dimensional positioning of an image in structured light according to claim 7, characterized in that: The image positioning module (6) comprises: a feature point positioning unit, a feature point refinement and segmentation unit, and an offset analysis unit. The feature point positioning unit is used to perform positioning, extraction, and acquisition processing on feature points. The feature point refinement and segmentation unit is used to perform refinement and segmentation processing on feature points and perform positioning marking on feature points after segmentation processing. The offset analysis unit calculates lateral offset, longitudinal offset, and rotational offset based on feature point positioning information and feature points after refinement and segmentation processing.
Citation Information
Patent Citations
Structured light three-dimensional measurement method for encoding fringe level based on phase shift amount
CN109974626A
Structured light coding method based on stripe width modulation
CN112945089A