CN109816738B - Stripe boundary extraction method based on coded structured light - Google Patents

Stripe boundary extraction method based on coded structured light Download PDF

Info

Publication number
CN109816738B
CN109816738B CN201811525725.7A CN201811525725A CN109816738B CN 109816738 B CN109816738 B CN 109816738B CN 201811525725 A CN201811525725 A CN 201811525725A CN 109816738 B CN109816738 B CN 109816738B
Authority
CN
China
Prior art keywords
code
coding
stripe
structured light
projection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811525725.7A
Other languages
Chinese (zh)
Other versions
CN109816738A (en
Inventor
梁艳玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CN201811525725.7A priority Critical patent/CN109816738B/en
Publication of CN109816738A publication Critical patent/CN109816738A/en
Application granted granted Critical
Publication of CN109816738B publication Critical patent/CN109816738B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Length Measuring Devices By Optical Means (AREA)

Abstract

The invention discloses a stripe boundary extraction algorithm based on coded structured light, which comprises the following steps of S1: selecting a structured light coding mode; s2: establishing a standard model, projecting a structured light pattern onto the model according to a selected scheme, and coding the model according to a selected coding mode; s3: projecting a structured light pattern onto the object to be measured according to the selected scheme, and coding the photo of the object to be measured according to the selected coding mode; s4: searching the photo code in the step S3 in the model code in the step S2 to obtain target stripes; s5: setting a target stripe code diagram, and extracting boundaries from the code diagram; the method can effectively extract the fringe boundary line after the structured light is coded, solves the interference of noise points generated in the coding process on fringe center extraction while assisting in searching the matching relation between the pixel points and the fringe line, avoids the defects of the traditional method, and is faster, more convenient and more accurate.

Description

Stripe boundary extraction method based on coded structured light
Technical Field
The invention relates to the technical field of computer algorithms, in particular to a stripe boundary extraction method based on coded structured light.
Background
The acquisition of three-dimensional information of a scene has important research and application values for computer vision and robotics, and has been widely used, the three-dimensional information acquisition technology can be divided into an active method and a passive method, the active method requires a special optical projector to generate a certain coding pattern, and for the coding pattern, the position of a characteristic point is the boundary of an image; the existing boundary detection methods include a boundary detection method based on differentiation, a boundary detection method based on binarization and a stripe boundary detection method based on positive and negative patterns.
The differential boundary detection operator has the conditions of losing the boundary, failing to suppress noise or having a pseudo boundary and a continuous boundary; the boundary detection method based on the binarization method has the problems that the boundary of the projected coding pattern is not an ideal step boundary, but a gray level gradual change process exists due to the influence of external factors such as ambient light and the like and internal factors such as object surface characteristics and the like in the actual measurement process, and the determination of a threshold value is not small; the stripe boundary detection method based on the positive and negative patterns can double the time of image acquisition because all positive coding patterns are back projected once, and if the number of the coding patterns is large, a lot of time is wasted.
Disclosure of Invention
The invention aims to solve the technical problems that the existing boundary detection method has defects, the process is complicated, the stripe boundary can not be obtained rapidly, rapidly and accurately, and the stripe boundary extraction method based on the coded structured light is provided, so that the problems are solved.
In order to solve the technical problems, the invention provides the following technical scheme:
the invention provides a stripe boundary extraction method based on coded structured light, which comprises the following steps,
s1: selecting a structured light projection scheme and a coding mode;
s2: establishing a standard model, projecting a structured light pattern onto the model according to a selected scheme, and coding the model according to a selected coding mode;
s3: projecting a structured light pattern onto the object to be measured according to the selected scheme, and coding the photo of the object to be measured according to the selected coding mode;
s4: searching the photo code in the step S3 in the model code in the step S2 to obtain target stripes;
s5: setting a target stripe code diagram, and extracting boundaries from the code diagram.
In the step S1, the projection scheme of the structured light is encoded by combining the gray code encoding and the Line Shifting encoding.
As a preferable technical scheme of the invention, the Gray Code is encoded into n projection patterns, wherein n is not less than 1; two strips with black and white intervals are arranged in the first projection pattern, four strips with black and white intervals are arranged in the second projection pattern, and accordingly, 2n strips with black and white intervals are arranged in the nth projection pattern; for the same point on the model, n projection patterns are respectively used for projection, the point is marked as 0 in a black stripe, the point is marked as 1 in a white stripe, and each point corresponds to an n-bit long code.
As a preferable technical scheme of the invention, the Line Shifting code is provided with 28-n black-white alternate ladder-shaped stripes with the width of 28-n, after scanning once, the stripes are shifted to the left by 1pixel to form a new pattern, and as the next scanning, the stripes are shifted for 28-n times to form 28-n patterns; for the same point on the model, 28-n projection patterns are respectively used for projection, the point is marked as 0 in black stripes, the point is marked as 1 in white stripes, and each point corresponds to a code with the length of 28-n bits.
As a preferable technical scheme of the invention, n in Gray Code coding in a structured light coding mode is set to be 5, and five-bit coding is obtained through Gray Code coding; when n=5, the pattern width of the Line Shifting code is 8 pixels, and the pattern is shifted to the left 7 times to obtain the same group as the pattern in the first shift; and 5 pairs of Gray Code coding patterns and 7 pairs of LineStifting coding patterns are arranged together, and a 12-bit Code is obtained after projection.
In the step S2, a flat whiteboard is set in the computer, the surface of the whiteboard is smooth and has no other color and is equal to the projection pattern, and the size of the projection pattern is set to 256×640pixel; the model is encoded using the encoding scheme in step S1.
In a preferred embodiment of the present invention, in the step S3, the photograph of the object to be measured projected on the model is encoded using the encoding method in the step S1.
In the step S4, retrieving the model created in the step S2 by the code obtained in the step S3 to obtain all the conforming target stripes, and extracting all the conforming target stripes to obtain a target stripe code diagram; in the model of step S2, the codes of the stripes are arranged in order, and the stripes conforming to the codes are proposed as a continuous stripe pattern when the search is performed in step S3.
In the step S5, when more than 1pixel point corresponding to the same code is encountered in a row of the code map, the pixel point adjacent to the next code is taken as a point on the stripe corresponding to the code; and searching for the coding phases at two sides of the stripe boundary line as an integral mutual binding.
The beneficial effects achieved by the invention are as follows: when the stripe boundary is extracted, the stripe line corresponding to the two adjacent correct target codes is extracted, so that the interference of noise points is effectively avoided. The binarization method needs to use a threshold value to distinguish different areas when extracting the image boundary, but the determination of the threshold value is a great problem. The stripe boundary detection method based on the positive and negative patterns can double the time of image acquisition because the positive coding patterns are all back projected once, but the method only needs to project the coding patterns once, thereby saving time and being easy to operate. Meanwhile, the three methods can determine the position of the fringe boundary by processing the image information, and the standard model established by the invention can directly position the position of the fringe boundary, so that the fringe boundary is extracted more efficiently.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate the invention and together with the embodiments of the invention, serve to explain the invention.
In the drawings:
FIG. 1 is a schematic overall flow chart of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described below with reference to the accompanying drawings, it being understood that the preferred embodiments described herein are for illustration and explanation of the present invention only, and are not intended to limit the present invention.
Examples: as shown in fig. 1, the present invention provides a stripe boundary extraction method based on coded structured light, comprising the steps of,
s1: selecting a structured light projection scheme and a coding mode, wherein the structured light projection scheme adopts Gray Code coding and LineShifting coding to Code;
s2: establishing a standard model, projecting a structured light pattern onto the model according to a selected scheme, and coding the model according to a selected coding mode;
s3: projecting a structured light pattern onto the object to be measured according to the selected scheme, and coding the photo of the object to be measured according to the selected coding mode;
s4: searching the photo code in the step S3 in the model code in the step S2 to obtain target stripes;
s5: setting a target stripe code diagram, and extracting boundaries from the code diagram.
Further, the Gray Code is encoded to set n projection patterns, wherein n is not less than 1; two strips with black and white intervals are arranged in the first projection pattern, four strips with black and white intervals are arranged in the second projection pattern, and accordingly, 2n strips with black and white intervals are arranged in the nth projection pattern; for the same point on the model, n projection patterns are respectively used for projection, the point is marked as 0 in a black stripe, the point is marked as 1 in a white stripe, and each point corresponds to an n-bit long code.
Further, the Line Shifting code is provided with 28-n black-and-white alternate ladder-shaped stripes with the width of 28-n, after scanning once, the stripes are shifted to the left by 1pixel to form a new pattern, and the stripes are shifted for 28-n times as the next scanning to form 28-n patterns; for the same point on the model, 28-n projection patterns are respectively used for projection, the point is marked as 0 in black stripes, the point is marked as 1 in white stripes, and each point corresponds to a code with the length of 28-n bits.
Further, n in Gray Code coding in a structured light coding mode is set to be 5, and five-bit coding is obtained through Gray Code coding; when n=5, the pattern width of the Line Shifting code is 8 pixels, and the pattern is shifted to the left 7 times to obtain the same group as the pattern in the first shift; and 5 pairs of Gray Code coding patterns and 7 lines of Line Shifting coding patterns are arranged together, and a 12-bit Code is obtained after projection.
In step S2, a flat whiteboard is set in the computer, the surface of the whiteboard is bright and clean and has no other color and is as large as the projection pattern, and the size of the projection pattern is set to 256×640pixel; the model is encoded using the encoding scheme in step S1.
Further, in the step S3, the picture of the object to be measured projected on the model is encoded by using the encoding method in the step S1.
Further, in the step S4, retrieving the model created in the step S2 by the code obtained in the step S3 to obtain all the conforming target stripes, and extracting all the conforming target stripes to obtain a target stripe code diagram; in the model of step S2, the codes of the stripes are arranged in order, and the stripes conforming to the codes are proposed as a continuous stripe pattern when the search is performed in step S3.
Further, in the step S5, in a row of the code map, when more than 1pixel point corresponding to the same code is encountered, the pixel point adjacent to the next code is taken as a point on the stripe corresponding to the code; and searching for the coding phases at two sides of the stripe boundary line as an integral mutual binding.
Specific: in the step S1, a projection scheme of structured light is set to encode by combining Gray Code encoding and Line Shifting encoding, and a technical scheme is determined to encode by combining 5 pairs of Gray Code projection patterns and 7 pairs of Line Shifting projection patterns; s2, a whiteboard model is opened up in a computer for projection of a target photo, the dimension of the whiteboard model is 256 multiplied by 640pixel, the surface of the whiteboard is smooth and free from external interference, noise points are avoided from being influenced, and error codes are generated in the subsequent projection coding process; the method comprises the steps that through the scheme described in the step S1, the model is projected, and all encoding stripes of the model are obtained; in step S3, projecting the target photo to obtain the encoding stripes of the photo; in step S4, searching is carried out on the model aiming at the code of the photo, and all target stripes which are the same as the code of the photo are obtained, and all target stripes form a target stripe code diagram; in step S5, codes on both sides of the boundary to be extracted are set, and the codes are searched as a whole, and the boundary is searched; for example, the stripe codes at two sides of the boundary are respectively a or b, and if only a or b is searched, when the code arrangement is aaa, the boundary cannot be searched; it is also the principle that only b is searched and ab is searched as a whole, so that the boundary between two stripes, which is the boundary to be extracted, is obtained.
The invention mainly projects through the smooth whiteboard model, an ideal environment is constructed manually, the reasons that the dead angle of measurement is not completely removed, the influence of external light is avoided, and the like, the error of the binary sequence is possibly caused, an error code is generated, meanwhile, the situation that the projection pattern cannot be completely and equally projected when the projector projects the projection pattern on the surface of the measured object, and the pattern projected on the surface of the measured object is possibly amplified is avoided, and a foundation is provided for the accurate acquisition of the subsequent target code. Has the advantages of assisting in extracting stripes and accelerating the extraction speed; the influence of noise points is effectively avoided, and the noise immunity is achieved; the standard model can truly reflect the correctly encoded information, has good stability, simple and convenient method, easy implementation, only needs to project the encoding pattern once, and short image acquisition time.
Finally, it should be noted that: the above is only a preferred embodiment of the present invention, and the present invention is not limited thereto, but it is to be understood that the present invention is described in detail with reference to the foregoing embodiments, and modifications and equivalents of some of the technical features described in the foregoing embodiments may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (5)

1. A stripe boundary extraction method based on coded structured light is characterized by comprising the following steps,
s1: selecting a structured light projection scheme and a coding mode;
s2: establishing a standard model, projecting a structured light pattern onto the model according to a selected scheme, and coding the model according to a selected coding mode;
s3: projecting a structured light pattern onto the object to be measured according to the selected scheme, and coding the photo of the object to be measured according to the selected coding mode;
s4: searching the photo code in the step S3 in the model code in the step S2 to obtain target stripes;
s5: setting a target stripe code diagram, and extracting boundaries from the code diagram;
in the step S1, the projection scheme of the structured light adopts Gray Code coding and Line Shifting coding to carry out coding in combination;
the Gray Code is encoded into n projection patterns, wherein n is not less than 1; two strips with black and white intervals are arranged in the first projection pattern, four strips with black and white intervals are arranged in the second projection pattern, and accordingly, 2n strips with black and white intervals are arranged in the nth projection pattern; the same point on the model is respectively subjected to projection removal by n projection patterns, the point is marked as 0 in a black stripe, the point is marked as 1 in a white stripe, and each point corresponds to an n-bit long code;
the Line Shifting code is provided with 28-n black-and-white alternate ladder-shaped stripes with the width of 28-n, after one time of scanning, the stripes are shifted to the left by 1pixel to form a new pattern, and the stripes are shifted for 28-n times as the next time of scanning to form 28-n patterns; the same point on the model is respectively subjected to projection removal by 28-n projection patterns, the point is marked as 0 in a black stripe, the point is marked as 1 in a white stripe, and each point corresponds to a code with the length of 28-n bits;
in the structured light coding mode, n in Gray Code coding is set to be 5, and five-bit coding is obtained through Gray Code coding; when n=5, the pattern width of the lineshift code is 8 pixels, and the pattern can be shifted to the left 7 times to obtain the same group as the pattern in the first shift; and 5 pairs of Gray Code coding patterns and 7 lines of Line Shifting coding patterns are arranged together, and a 12-bit Code is obtained after projection.
2. The method for extracting stripe boundary based on coded structured light according to claim 1, wherein in the step S2, a flat whiteboard is set in the computer, the surface of the whiteboard is bright and clean and has no other color and is equal to the projection pattern, and the projection pattern size is set to 256×640 pixels; the model is encoded using the encoding scheme in step S1.
3. The method according to claim 2, wherein in the step S3, the picture of the object to be measured projected on the model is encoded by using the encoding method in the step S1.
4. The method for extracting stripe boundary based on coded structured light according to claim 3, wherein in the step S4, the model created in the step S2 for the code obtained in the step S3 is searched to obtain all the target stripes which are fit, and all the target stripes which are fit are extracted to obtain a target stripe code map;
in the model of step S2, the codes of the stripes are arranged in order, and the stripes conforming to the codes are proposed as a continuous stripe pattern when the search is performed in step S3.
5. The method according to claim 1, wherein in the step S5, when more than 1pixel point corresponding to the same code is encountered in a row of the code map, the pixel point adjacent to the next code is taken as a point on the stripe corresponding to the code; and searching for the coding phases at two sides of the stripe boundary line as an integral mutual binding.
CN201811525725.7A 2018-12-13 2018-12-13 Stripe boundary extraction method based on coded structured light Active CN109816738B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811525725.7A CN109816738B (en) 2018-12-13 2018-12-13 Stripe boundary extraction method based on coded structured light

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811525725.7A CN109816738B (en) 2018-12-13 2018-12-13 Stripe boundary extraction method based on coded structured light

Publications (2)

Publication Number Publication Date
CN109816738A CN109816738A (en) 2019-05-28
CN109816738B true CN109816738B (en) 2023-05-09

Family

ID=66602910

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811525725.7A Active CN109816738B (en) 2018-12-13 2018-12-13 Stripe boundary extraction method based on coded structured light

Country Status (1)

Country Link
CN (1) CN109816738B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111951377B (en) * 2020-07-31 2023-03-14 中国科学院深圳先进技术研究院 Three-dimensional object reconstruction method and terminal equipment
CN112729166B (en) * 2021-01-04 2022-03-11 熵智科技(深圳)有限公司 Structured light encoding method, encoding and decoding method, device, computer device and medium
CN113820661B (en) * 2021-09-03 2023-07-28 暨南大学 Visible light positioning method and system based on binary and double pointer stripe search

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1928492A (en) * 2006-09-15 2007-03-14 东南大学 Gray code based phase development method in three-dimensional scanning system
WO2007061632A2 (en) * 2005-11-09 2007-05-31 Geometric Informatics, Inc. Method and apparatus for absolute-coordinate three-dimensional surface imaging

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101974651B1 (en) * 2011-06-22 2019-05-02 성균관대학교산학협력단 Measuring method of 3d image depth and a system for measuring 3d image depth using boundary inheritance based hierarchical orthogonal coding
CN107490348A (en) * 2017-07-26 2017-12-19 爱佩仪中测(成都)精密仪器有限公司 Coding grating projecting method in coding structural light three-dimensional measurement

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007061632A2 (en) * 2005-11-09 2007-05-31 Geometric Informatics, Inc. Method and apparatus for absolute-coordinate three-dimensional surface imaging
CN1928492A (en) * 2006-09-15 2007-03-14 东南大学 Gray code based phase development method in three-dimensional scanning system

Also Published As

Publication number Publication date
CN109816738A (en) 2019-05-28

Similar Documents

Publication Publication Date Title
CN109816738B (en) Stripe boundary extraction method based on coded structured light
CN109035276B (en) Image edge extraction method and device and automatic driving system
JP2007317184A (en) Two-dimensional bar code, and encoding and decoding method thereof
CN110096920B (en) High-precision high-speed positioning label and positioning method for visual servo
CN105654015A (en) Systems and methods for decoding two-dimensional matrix symbols
CN105574533B (en) A kind of image characteristic extracting method and device
WO2018219156A1 (en) Structured light coding method and apparatus, and terminal device
CN105975894B (en) A kind of one-dimension code recognizer based on auto-adaptable image edge detection and mapping model
CN105068918A (en) Page test method and device
CN106991702B (en) Projector calibration method and device
JP2018120445A (en) Car number recognition apparatus
CN116883887A (en) Leakage gas detection method for infrared video
CN113496133A (en) Two-dimensional code identification method and device, electronic equipment and storage medium
CN114820789A (en) Intelligent identification and positioning method and system for irregular target
CN105389781A (en) Vehicle light repairing method based on saliency detection and Criminisi algorithm
CN102885631A (en) Distortion correction method applied to flat-panel charge coupling device (CCD) detector
CN110557622A (en) Depth information acquisition method and device based on structured light, equipment and medium
CN111783877B (en) Depth information measurement method based on single-frame grid composite coding template structured light
CN110675499B (en) Three-dimensional modeling method based on binocular structured light three-dimensional scanning system
CN104851100A (en) Binocular view stereo matching method under variable light source
CN115376131A (en) Design and identification method of dot-shaped coding mark
CN111191759B (en) Two-dimensional code generation method, positioning and decoding method based on GPU
CN108038898B (en) Single-frame binary structure optical coding and decoding method
CN112330611A (en) FPGA-oriented high-parallelism light spot segmentation method
Fang et al. One-shot monochromatic symbol pattern for 3D reconstruction using perfect submap coding

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant