# Adaptive Bidirectional Gray-Scale Center of Gravity Extraction Algorithm of Laser Stripes

^{*}

## Abstract

**:**

## 1. Introduction

## 2. An Adaptive Bidirectional Gray-Scale Center of Gravity Extraction Algorithm

#### 2.1. Light Distribution Characteristics

#### 2.2. Initial Image Processing Area Setting

#### 2.3. Image Preprocessing

#### 2.4. Secondary Adaptive Image Processing Region Setting

#### 2.5. Principle of Bidirectional Center of Gravity Method

- (1)
- First, the horizontal and vertical gradation barycenter of the image are recorded respectively, and the set of the barycenter is called $P1/P2$.
- (2)
- Then, the horizontal and vertical search is carried out according to the $uppoint$. The searching distance is defined as $d1/d2$, respectively, and the searching range does not exceed the width $\tau $ of the half-light stripe. The center points in $P1/P2$ that meet the search conditions are retained, and the ones that do not meet the search conditions are eliminated.$$\begin{array}{l}\left\{0\le {d}_{1}\le \frac{\tau}{2},0\le {d}_{2}\le \frac{\tau}{2}\right\}\\ \begin{array}{c}d1=\left|uppoint-P1\right|\\ d2=\left|uppoint-P2\right|\end{array}\end{array}$$
- (3)
- If both horizontal and vertical search points exist, the middle point of the coordinates of two points $P1/P2$ will be counted as the $mpoints$ of the middle point of the light stripe, as shown in Formula (6). Otherwise, the point of the horizontal or vertical search will be counted as the $mpoints$.$$mpoints=\left\{\begin{array}{l}(P1(u,v)+P2(u,v))/2\\ P1(u,v)/P2(u,v)\end{array}\right\}$$

#### 2.6. The Principle of Weight Optimization

## 3. Experimental Results and Analysis

## 4. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Yu, L.L.; Li, Y.W.; Luan, Y.B.; Chen, Z.M.; Li, H. Line structure cursor calibration based on 2D planar targets. Chin. J. Sci. Instrum.
**2020**, 41, 124–131. [Google Scholar] - Li, Y.Y.; Zhang, Z.Y.; Yuan, L. A Review on The Central Extraction of Linear Structured Optical Strips. Laser Optoelectron. Prog.
**2013**, 50, 13–22. [Google Scholar] - Wu, Q.H.; Zhou, Y.; Li, Z.Q.; Cai, Q.J.S.; Wan, C. Dual-frequency curve fitting line structure light fringe center extraction method. Laser Optoelectron. Prog.
**2020**, 57, 336–343. [Google Scholar] - Hu, Y.; Fang, S.P. Linear structure light stripe center extraction method. Laser Optoelectron. Prog.
**2021**, 58, 196–200. [Google Scholar] - Zhang, H.; Miao, H.X.; Guo, Z.W.; Rao, X.N. Laser stripe centerline extraction method in dynamic environment. Comput. Meas. Control
**2021**, 29, 226–233+256. [Google Scholar] - Li, T.T.; Yang, F.; Li, S.G.; He, Y. Extraction method based on Gaussian-Lorentz peak fitting of the center of a line structure light strip. Laser Optoelectron. Prog.
**2019**, 56, 175–184. [Google Scholar] - Yang, Y.; Yan, B.; Dong, D.W.; Huang, Y.; Tang, Z.Z. Line structure light centerline extraction method based on quadratic smoothing algorithm. Laser Optoelectron. Prog.
**2020**, 57, 309–315. [Google Scholar] - Wan, Z.R.; Lai, L.J.; Mao, J.; Zhu, L.M. Extraction and segmentation method of laser stripe in linear structured light scanner. Opt. Eng.
**2021**, 60, 046104. [Google Scholar] [CrossRef] - He, Z.X.; Kang, L.P.; Zhao, X.Y.; Zhang, S.Y.; Tan, J.R. Robust laser stripe extraction for 3D measurement of complex objects. Meas. Sci. Technol.
**2021**, 32, 065002. [Google Scholar] [CrossRef] - Liu, Y.J.; Song, J.; Yuan, W.X.; Xue, H.L.; Li, S.F. Sub-pixel Center Extraction Method for Line structured Light Stripe. IOP Conf. Ser. Mater. Sci. Eng.
**2020**, 768, 072045. [Google Scholar] [CrossRef] - Shi, X.Q.; Sun, Y.Z.; Liu, H.T.; Bai, L.Q.; Lin, C.H. Research on laser stripe characteristics and center extraction algorithm for desktop laser scanner. SN Appl. Sci.
**2021**, 3, 298. [Google Scholar] [CrossRef] - Li, Y.H.; Zhou, J.B.; Huang, F.S.; Liu, L.J. Sub-Pixel Extraction of Laser Stripe Center Using an Improved Gray-Gravity Method. Sensors
**2017**, 17, 814. [Google Scholar] [CrossRef] [PubMed][Green Version] - Wang, F.B.; Liu, H.F.; Wang, R.; Zeng, K. Linear structured light fringe center subpixel adaptive extraction algorithm. Laser Technol.
**2021**, 45, 350–356. [Google Scholar] - Lu, Y.H.; Zhang, J.; Li, X.Y.; Li, Y.L.; Tan, J. A Robust Method for Adaptive Center Extraction of Linear Structured Light Stripe. Trans. Nanjing Univ. Aeronaut. Astronaut.
**2020**, 37, 586–596. [Google Scholar] - Zhang, L.; Zhang, Y.J.; Chen, B. Improving the extracting precision of stripe center for structured light measurement. Optik
**2020**, 207, 163816. [Google Scholar] [CrossRef] - Gao, H.P.; Xu, G.L. Robust Analysis and Laser Stripe Center Extraction for Rail Images. Appl. Sci.
**2021**, 11, 2038. [Google Scholar] [CrossRef] - Wang, Y.; Jiang, S.S. Extraction Center Pixel Coordinates from Human Body Laser Stripe Image with Bezier Curve Fitting Method. J. Fiber Bioeng. Inform.
**2015**, 8, 575–584. [Google Scholar] [CrossRef] - Wang, S.C.; Han, Q.; Wang, H.; Zhao, X.X.; Dai, P. Laser Stripe Center Extraction Method of Rail Profile in Train-Running Environment. Acta Opt. Sin.
**2019**, 39, 175–184. [Google Scholar] - Yang, G.W.; Wang, Y.Z. Three-dimensional measurement of precise shaft parts based on line structured light and deep learning. Measurement
**2022**, 191, 110837. [Google Scholar] [CrossRef] - Chen, H.Y.; Xu, X.J.; Pang, J.Z.; Li, K.M. Adaptive center extraction method for stripes on the reflective surface of nuclear fuel rods. J. Appl. Opt.
**2021**, 42, 86–94. [Google Scholar] - Li, Y.H.; Liu, P.; Zhou, J.B.; Ren, Y.Z.; Jin, J.Y. Structured light bar center extraction based on BP neural network. Acta Opt. Sin.
**2019**, 39, 186–194. [Google Scholar] - Zhou, J.B.; Wang, K.; Yang, G.; Liu, X.H.; Du, R.J.; Li, Y.H. Real-time uncertainty estimation of stripe center extraction results using adaptive BP neural network. Measurement
**2022**, 194, 111022. [Google Scholar] [CrossRef] - Zhou, Y.; Meng, X.Q.; Jiang, D.B.; Tang, H.J. Structured light fringe center extraction method in complex interference situations. Chin. J. Lasers
**2020**, 47, 172–180. [Google Scholar] - Nan, F.; Li, D.H.; Gao, Q.; Yu, X. Improved adaptive light fringe center extraction of the Steger algorithm. Laser J.
**2018**, 39, 85–88. [Google Scholar] - Pan, S.; Shao, X.J.; Li, X.L.; Tang, X.J. Block-matched laser stripe subpixel center extraction. Laser Infrared
**2021**, 51, 814–819. [Google Scholar] - Li, W.M.; Peng, G.; Gao, X.Y.; Ding, C. Linear laser strip center fast extraction algorithm. Chin. J. Lasers
**2020**, 47, 192–199. [Google Scholar] - Li, W.M.; Mei, F.; Hu, Z.; Gao, X.Y.; Yu, H.Y. The extraction algorithm is advanced internally in the center of the line laser strip. Chin. J. Lasers
**2021**, 48, 105–117. [Google Scholar] - Liu, Z.; Li, S.; Feng, C. Laser fringe center extraction based on cross-correlation algorithm. Chin. J. Lasers
**2013**, 40, 202–207. [Google Scholar] - Liu, C.W.; Duan, F.J.; Fu, X.; Li, J.X.; Li, T.Y.; Han, P.W.; Ai, S.Z. A novel method to correct the bias of curvilinear light stripe center. Opt. Lasers Eng.
**2022**, 155, 107058. [Google Scholar] [CrossRef] - Zhang, X.H.; Liu, J.; Xu, Y.Y. Center extraction for non-uniform line structured light stripe with wide view field. In MIPPR 2019: Automatic Target Recognition and Navigation; SPIE: Bellingham, WA, USA, 2020; p. 11429. [Google Scholar]

**Figure 12.**The original image of the light stripe, and the center graph of the light stripe extracted by each algorithm. (

**a**) The original image of the light stripe; (

**b**) Steger; (

**c**) the gray-scale center of gravity; (

**d**) geometric center; and (

**e**) the improved gray-scale center of gravity.

**Figure 16.**The algorithm in this paper processes the renderings. (

**a**) Steel plate surface; (

**b**) upper surface of roller; (

**c**) paperboard surface; and (

**d**) angle steel upper surface.

This Paper’s Algorithm | Steger | Gray-Scale Center of Gravity | Geometric Center | Improved Gray-Scale Center of Gravity |
---|---|---|---|---|

0.3813 | 1.9510 | 0.5678 | 0.6000 | 0.4752 |

This Paper’s Algorithm | Steger | Gray-Scale Center of Gravity | Geometric Center | Improved Gray-Scale Center of Gravity |
---|---|---|---|---|

0.314051 | 1.824630 | 0.391013 | 0.428601 | 0.361370 |

Image Ordinal Number | Image Resolution/Pixel | Processing Time/s | ||||
---|---|---|---|---|---|---|

This Paper’s Algorithm | Steger | Gray-Scale Center of Gravity | Geometric Center | Improved Gray-Scale Center of Gravity | ||

1 | 317 × 214 | 0.034 | 0.213 | 0.038 | 0.042 | 0.053 |

2 | 649 × 343 | 0.077 | 0.257 | 0.083 | 0.086 | 0.109 |

3 | 808 × 550 | 0.159 | 0.268 | 0.173 | 0.175 | 0.228 |

4 | 808 × 600 | 0.172 | 0.282 | 0.194 | 0.197 | 0.254 |

5 | 808 × 608 | 0.175 | 0.303 | 0.194 | 0.197 | 0.255 |

6 | 4096 × 2500 | 0.875 | 2.647 | 1.250 | 1.199 | 1.639 |

7 | 4096 × 3000 | 0.910 | 2.811 | 1.296 | 1.192 | 1.701 |

This Paper’s Algorithm | Steger | Gray-Scale Center of Gravity | Geometric Center | Improved Gray-Scale Center of Gravity |
---|---|---|---|---|

1.5833 | 1.6690 | 1.9980 | 2.1131 | 1.8017 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Zhang, M.; Li, Z.; Zhang, F.; Ma, L.
Adaptive Bidirectional Gray-Scale Center of Gravity Extraction Algorithm of Laser Stripes. *Sensors* **2022**, *22*, 9567.
https://doi.org/10.3390/s22249567

**AMA Style**

Zhang M, Li Z, Zhang F, Ma L.
Adaptive Bidirectional Gray-Scale Center of Gravity Extraction Algorithm of Laser Stripes. *Sensors*. 2022; 22(24):9567.
https://doi.org/10.3390/s22249567

**Chicago/Turabian Style**

Zhang, Miaomiao, Zhengnan Li, Fuquan Zhang, and Lidong Ma.
2022. "Adaptive Bidirectional Gray-Scale Center of Gravity Extraction Algorithm of Laser Stripes" *Sensors* 22, no. 24: 9567.
https://doi.org/10.3390/s22249567