# Multi-Constrained Optimization Method of Line Segment Extraction Based on Multi-Scale Image Space
## 2 Methods
### Model Construction
#### 2.1.2 Multi-Scale Image Space Line Segment Extraction Method  
In order to overcome the segmentation fracture problem of line segment extraction, the proposed method combines the idea of fuzzy processing by down-sampling the original image to produce a pyramid-like model of multi-scale image space.  
To perform this method, the specific procedure was as follows: (1) According to the actual image resolution and processing requirements, the standard deviation factor (scale space factor) of Gaussian filter kernel function \(\sigma\) was set and the maximum down-sampling number \(t_{\text{max}}\) was set; (2) Gaussian kernel convolution on image \(I\) to achieve Gaussian blur of the image was performed; (3) image-based down-sample on image-scale space factor \(\sigma\) (\(\sigma\) is generally set to 0.5) was carried out; (4) to detect line segment, the traditional method was used for this layered image and the line segments were stored in the corresponding line vector spaces; (5) steps (2 -4) were repeated until the maximum number of down-sampling was reached. Specifically, the Gaussian-blurred image \(I^{\prime}(u,v,\sigma)\) is first generated with Equation (1).  
\[\left\{\begin{array}{l}I^{\prime}(u,v,\sigma)=G(u,v,\sigma)*I(u,v)\\ G(u,v,\sigma)=1/2\pi a^{2}*\exp\Bigl{(}-(u^{2}+v^{2})/2\sigma^{2}\Bigr{)}\end{array} \right., \tag{1}\]  
where \(G(u,v,\sigma)\) is the Gaussian kernel function, \(I(u,v)\) is the image \(I\), and \(*\) is the convolution operation on the image pixel \((u,v)\).  
Based on scale space factor \(\sigma\), the original image was down-sampled to obtain a low-resolution image \(J\). The above operation was repeated to continue down-sampling of image \(J\) until the maximum down-sampling number \(t_{max}\) was reached. Finally, an \(N\)-layer image model was created (\(N=t_{max}+1\)), forming a pyramid-like multi-scale image space model.  
To detect line segments, traditional line segment detection method was used for each image layer in scale space and line segment vector spaces corresponding to the number of images were opened. Line segments extracted in each scale image were stored in a line segment vector \(LineVec^{(k)}=\{\}\), where \(k\) represents the \(k\)-scale image of line segment vector space and the maximum value of \(k\) is \(N\). Moreover, line segment endpoints' coordinates and length information were stored in line segment class \(line_{i}^{(k)}=\left\{u_{start}^{(i)},v_{start}^{(i)},u_{end}^{(i)},v_{end}^{( i)},length^{(i)}\right\}\), where \({}^{k}\) represents \(k\)th line segment vector space and \({}^{i}\) represents \(i\)th line in the image. Line segment extraction and storage process is shown in Figure 3.  
Figure 3 shows that the traditional line segment detector extracts line segments for each scale image and stores segments in vector space. If detector extracts \(m_{1}\) and \(m_{2}\) line segments in the first and second layers of the image, respectively, then the line segment method extracts \(m_{N}\) line segments  
Figure 3: Line segment extraction and storage model in multi-scale image space.  
in the Nth layer of the image. The expression of multi-scale image space line feature vector can be represented with Equation (2).  
\[\left\{\begin{array}{c}\begin{array}{c}\mathit{LineVec}^{(1)}=\left\{ line_{1}^{(1)},\mathit{line}_{2}^{(1)},\mathit{line}_{3}^{(1)},\cdots,\mathit{line}_{m_{1}}^{(1)} \right\}\\ \mathit{LineVec}^{(2)}=\left\{line_{1}^{(2)},\mathit{line}_{2}^{(2)}, \mathit{line}_{3}^{(2)},\cdots,\mathit{line}_{m_{2}}^{(2)}\right\}\\ \vdots\\ \mathit{LineVec}^{(N)}=\left\{\mathit{line}_{1}^{(N)},\mathit{line}_{2}^{(N) },\mathit{line}_{3}^{(N)},\cdots,\mathit{line}_{m_{N}}^{(N)}\right\}\end{array}\right. \tag{2}\]