## 3 Proposed Algorithmic Procedure
### Dimension Measurement Principle
\right] \tag{3}\]  
Assuming the 3D coordinates (\(\mathrm{X_{c}}\),\(\mathrm{Y_{c}}\),\(Z_{\mathrm{c}}\)) are also on the laser stripes and in the image pixel coordinate system, (u,v) could be derived from Equations (1) and (3):  
\[\mathrm{X_{c}}=Z_{\mathrm{c}}\frac{(\mathrm{u-u}_{0})}{\alpha} \tag{4}\]  
\[\mathrm{Y_{c}}=Z_{\mathrm{c}}\frac{(\mathrm{v-v}_{0})}{\beta} \tag{5}\]  
\[Z_{\mathrm{c}}=\frac{\mathrm{d_{i}}}{\mathrm{a_{i}}}(-\frac{\mathrm{c_{i}}}{ \mathrm{a_{i}}}-\frac{(\mathrm{u-u}_{0})}{\alpha}-\frac{\mathrm{b_{i}}}{ \mathrm{a_{i}}}\frac{(\mathrm{v-v}_{0})}{\beta})^{-1} \tag{6}\]  
Therefore, the 3D coordinates P(\(\mathrm{X_{c}}\),\(\mathrm{Y_{c}}\),\(Z_{\mathrm{c}}\)) on the laser stripes in the camera coordinate system can be computed. Thus, all the 3D coordinates on the laser stripes in the camera coordinate system of the image can be obtained. Thus, with the 2D coordinates (Dot D\({}_{1}\), D\({}_{2}\), D\({}_{3}\), D\({}_{4}\), O) on the laser stripes of the box face, the box face plane equation can easily be fitted with the least-squares method in the camera coordinate system:  
\[\mathrm{Ax_{c}+By_{c}+Cz_{c}+1=0} \tag{7}\]  
where A, B, and C are the coefficients of the box face plane equation. Thus, the 3D coordinates of these key points (\(\mathrm{V_{1}}\), \(\mathrm{V_{2}}\), \(\mathrm{V_{3}}\), and \(\mathrm{V_{4}}\)) on the silhouette edges of the laser-box image could be derived from Equations (3) and (7). We assume that the 3D coordinates of the  
line of the laser strip with the horizontal and vertical fitted lines of the feature points (Figure 7c) on the calibration pattern as calibration points on the laser strips. We collected N calibration images to obtain a sufficient number of calibration points on the laser stripe. In accordance with Equation (4), the 3D calibrated point's coordinates \(\mathrm{P}(\mathrm{X}_{\mathrm{c}}\mathrm{Y}_{\mathrm{c}}\mathrm{Z}_{\mathrm{c}})\) of the 2D coordinates \(\mathrm{p}(\mathrm{u}\mathrm{,}\mathrm{v})\) on the laser straight lines can be computed in the camera coordinate system. The objective function is the sum of the squares of the Euclidean distances from the calibration point to the laser plane, and the laser plane equations can be fitted via the Levenberg-Marquardt method [34; 35] with these sufficient 3D calibration points:  
\[\mathrm{F}(\mathrm{a},\mathrm{b},\mathrm{c})=\mathrm{min}\left(\sum_{k=1}^{ \mathrm{N}}\left(\frac{\left|\mathrm{a}\mathrm{X}_{\mathrm{ck}}+\mathrm{b} \mathrm{Y}_{\mathrm{ck}}+\mathrm{c}\mathrm{Z}_{\mathrm{ck}}+1\right|}{\sqrt{ \mathrm{a}^{2}+\mathrm{b}^{2}+\mathrm{c}^{2}}}\right)^{2}\right) \tag{11}\]  
where \(\mathrm{a}\), \(\mathrm{b}\), \(\mathrm{c}\) are the parameters of the laser plane equation, \(\mathrm{N}\) is the number of times the calibration pattern is placed, (\(\mathrm{X}_{\mathrm{ck}}\mathrm{Y}_{\mathrm{ck}}\mathrm{Z}_{\mathrm{ck}}\)) is the coordinate of the calibration points on the laser stripe, and \(\mathrm{N}=15\), \(\mathrm{K}=1\), \(2\), \(3\)... \(\mathrm{N}\). Figure 7a shows the general setup of our calibration approach. Figure 7b shows an example of a set of images used in the calibration, that is, \(1300\) mm \(\times\)\(1200\) mm (having \(19\times 19\) corner pattern, with square size \(57.0\) mm used) and affixed to the glass. Figure 7d shows a laser plane fitted result during calibration. 2.2 Optimization for Calibration Parameters by Analyzing the Probability Distributions and Outlier Removal  
In practical applications, the internal and external parameters of the same line structure visual device calculated via different calibration image sets will be different. The output of the camera and the laser projector exhibits noise, and the error estimates of the internal and external parameters will affect the final measurement. In the study, we assumed that it has a normal probability distribution in calibration. If calibration is performed at n times, the true value of these parameters can be restored.