Subversion Repositories seema-scanner

Rev

Rev 153 | Rev 177 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 153 Rev 168
Line 87... Line 87...
87
\section{Software components}
87
\section{Software components}
88
The SeeMaLab 3D scanner has a full graphical user interface for calibration, and scanning. The output from this software is a number of color pointclouds in the PLY format along with a Meshlab alignment project file (file suffix .aln). The .aln-file contains orientation information as provided from the rotation stage parameters. This allows the user to import the point cloud for further processing in Meshlab, e.g. to produce a full mesh model of the surface. The rotation axis is determined during calibration, which means that usually no manual or algorithm-assisted alignment of partial surfaces is necessary. 
88
The SeeMaLab 3D scanner has a full graphical user interface for calibration, and scanning. The output from this software is a number of color pointclouds in the PLY format along with a Meshlab alignment project file (file suffix .aln). The .aln-file contains orientation information as provided from the rotation stage parameters. This allows the user to import the point cloud for further processing in Meshlab, e.g. to produce a full mesh model of the surface. The rotation axis is determined during calibration, which means that usually no manual or algorithm-assisted alignment of partial surfaces is necessary. 
89
 
89
 
90
To get fine grained control over the scan procedure, the user can modify the source code for the GUI application, or use the supplied Matlab wrappers. These wrappers provide basic functionality to capture images with the cameras, project a specific pattern on the projector, or rotate the rotation stage to a specific position. Using these components, a full structured light scanner can be implemented in Matlab with full design freedom. 
90
To get fine grained control over the scan procedure, the user can modify the source code for the GUI application, or use the supplied Matlab wrappers. These wrappers provide basic functionality to capture images with the cameras, project a specific pattern on the projector, or rotate the rotation stage to a specific position. Using these components, a full structured light scanner can be implemented in Matlab with full design freedom. 
91
 
91
 
-
 
92
\section{Compiling and Installing}
92
\section{GUI}
93
A default user account is used on the SeeMaLab scanner computers, and here the software is installed in a stable (tested) version. The software repository is checked out and built in the home folder (\texttt{{\textasciitilde}/seema-scanner}). An icon in the launcher bar links to this executable. 
-
 
94
 
93
The scanner GUI was developed using Qt, OpenCV and the Pointcloud Library (PCL). It enables the user to perform calibration of the scanner, and to acquire scan data. It is built in a modular fashion, to allow for new structured light strategies to be implemented. It is, however, supposed to be simple and stable, so please keep experimental builds in separate SVN branches. 
95
The software was developed using Qt, OpenCV and the Pointcloud Library (PCL). 
94
 
96
 
95
GUI functionality heavily depends on Qt. For interoperability with PCL, it is necessary to build against Qt 4.x. Most other components, specifically those with Matlab wrappers, have minimal dependencies, and can be used outside of the GUI framework.
97
In order to make modifications and test (e.g. change some parameters in the reconstruction process), the SVN repository should be checked out/compiled in a seperate user account. The software is linked against the default versions of Qt, OpenCV and PCL in the current Ubuntu LTS release. This ensures easy compilation and install. 
-
 
98
 
-
 
99
\section{GUI}
-
 
100
The GUI enables the user to perform calibration of the scanner, and to acquire scan data. It is built in a modular fashion, to allow for new structured light strategies to be implemented. It is, however, supposed to be simple and stable, so please keep experimental builds in separate SVN branches. 
96
 
101
 
97
The GUI is installed on the SeeMaLab Scanner computer on the seema-scanner user account. The software repository is checked out and built in the home folder (\texttt{{\textasciitilde}/seema-scanner}). An icon in the launcher bar links to this executable. 
102
GUI functionality heavily depends on Qt. Most other components, specifically those with Matlab wrappers, have minimal dependencies, and can be used outside of the GUI framework.
98
 
103
 
99
In the GUI program, the user can open a preference window, so select a pattern sequence and configure the timing parameters. These preferences are stored in \texttt{{\textasciitilde}/.config/DTU/seema-scanner.conf}. Some preferences are not exposed in the GUI (e.g. calibration board size and field count), but can be manually edited in the file before the program is started.
104
In the GUI program, the user can open a preference window, so select a pattern sequence and configure the timing parameters. These preferences are stored in \texttt{{\textasciitilde}/.config/DTU/seema-scanner.conf}. Some preferences are not exposed in the GUI, but can be manually edited in the file before the program is started.
100
 
105
 
101
\section{\texttt{Projector} Class} 
106
\section{\texttt{Projector} Class} 
102
This class provides a fullscreen OpenGL context, and the ability to project any texture. The window/context creation is operating system dependant. It works very well on Linux with proprietary nVidia drivers, as found on the scan computer. In order to get a completely independent screen output, which does not interfere with the window manager, the projector needs to be set up as a seperate X screen in \texttt{xorg.conf}. The absolute position of this second X screen must provide a small gap to the primary screen. This gives a secondary screen, which is not recognised by Compiz (Unity in Ubuntu), but which can be accessed through the Projector class.
107
This class provides a fullscreen OpenGL context, and the ability to project any texture. The window/context creation is operating system dependant. It works very well on Linux with proprietary nVidia drivers, as found on the scan computer. In order to get a completely independent screen output, which does not interfere with the window manager, the projector needs to be set up as a seperate X screen in \texttt{xorg.conf}. The absolute position of this second X screen must provide a small gap to the primary screen. This gives a secondary screen, which is not recognised by Compiz (Unity in Ubuntu), but which can be accessed through the Projector class.
103
 
108
 
104
\section{\texttt{Camera} Class}
109
\section{\texttt{Camera} Class}
Line 139... Line 144...
139
	\item Press ''Single Capture'' or ''Batch Capture'' in the GUI.
144
	\item Press ''Single Capture'' or ''Batch Capture'' in the GUI.
140
	\item Sequences of patterns are projected onto the object. The captured images can be reviewed, and one or multiple captured sequences reconstructed using the ''Reconstruct'' button. 
145
	\item Sequences of patterns are projected onto the object. The captured images can be reviewed, and one or multiple captured sequences reconstructed using the ''Reconstruct'' button. 
141
	\item The results will show up in the ''Points Clouds'' tab. Single point clouds can be shown or hidden, see figure \ref{fig:pointclouds1}.
146
	\item The results will show up in the ''Points Clouds'' tab. Single point clouds can be shown or hidden, see figure \ref{fig:pointclouds1}.
142
	\item All data can be exported from the GUI program by means of the top bar menus. By exporting the point clouds into a folder, a \texttt{*.aln} is stored alongside these, which contains pose information in global coordinate space, which aligns the points clouds correctly and relative to each other.
147
	\item All data can be exported from the GUI program by means of the top bar menus. By exporting the point clouds into a folder, a \texttt{*.aln} is stored alongside these, which contains pose information in global coordinate space, which aligns the points clouds correctly and relative to each other.
143
\end{enumerate}
148
\end{enumerate}
144
\begin{figure}[H]
149
\begin{figure}[h]
145
	\centering
150
	\centering
146
		\includegraphics[width=.7\textwidth]{calibration0.png}
151
		\includegraphics[width=.7\textwidth]{calibration0.png}
147
	\caption{The GUI showing the ''Calibration'' tab.}
152
	\caption{The GUI showing the ''Calibration'' tab.}
148
	\label{fig:calibration0}
153
	\label{fig:calibration0}
149
\end{figure}
154
\end{figure}
150
\begin{figure}[H]
155
\begin{figure}[h]
151
	\centering
156
	\centering
152
		\includegraphics[width=.7\textwidth]{pointclouds0.png}
157
		\includegraphics[width=.7\textwidth]{pointclouds0.png}
153
	\caption{GUI showing the result of calibration in the ''Point Clouds'' tab.}
158
	\caption{GUI showing the result of calibration in the ''Point Clouds'' tab.}
154
	\label{fig:pointclouds0}
159
	\label{fig:pointclouds0}
155
\end{figure}
160
\end{figure}
156
\begin{figure}[H]
161
\begin{figure}[h]
157
	\centering
162
	\centering
158
		\includegraphics[width=.7\textwidth]{capture0.png}
163
		\includegraphics[width=.7\textwidth]{capture0.png}
159
	\caption{The ''Capture'' tab in the GUI.}
164
	\caption{The ''Capture'' tab in the GUI.}
160
	\label{fig:capture0}
165
	\label{fig:capture0}
161
\end{figure}
166
\end{figure}
162
\begin{figure}[H]
167
\begin{figure}[h]
163
	\centering
168
	\centering
164
		\includegraphics[width=.7\textwidth]{pointclouds1.png}
169
		\includegraphics[width=.7\textwidth]{pointclouds1.png}
165
	\caption{''Point Clouds'' tab with reconstructed point clouds.}
170
	\caption{''Point Clouds'' tab with reconstructed point clouds.}
166
	\label{fig:pointclouds1}
171
	\label{fig:pointclouds1}
167
\end{figure}
172
\end{figure}
Line 174... Line 179...
174
	\item The PLY files do contain XYZ and RGB values for all points. You will need to compute normals, in order for the surface reconstruction to succeed. These normals can be estimated and consistently oriented by considering the camera viewpoint. Select all point cloud in turn and for each, choose ''Filters $\rightarrow$ Point Sets $\rightarrow$ Compute Normals for Point Set''. Make sure the ''Flip normals...'' checkbox is ticked (see fig. \ref{fig:meshlab1}). Suitable neighbourhood values are in the order of $10$. You can visualise the estimated normals through the ''Render'' menu.
179
	\item The PLY files do contain XYZ and RGB values for all points. You will need to compute normals, in order for the surface reconstruction to succeed. These normals can be estimated and consistently oriented by considering the camera viewpoint. Select all point cloud in turn and for each, choose ''Filters $\rightarrow$ Point Sets $\rightarrow$ Compute Normals for Point Set''. Make sure the ''Flip normals...'' checkbox is ticked (see fig. \ref{fig:meshlab1}). Suitable neighbourhood values are in the order of $10$. You can visualise the estimated normals through the ''Render'' menu.
175
	\item After estimating normals for all point clouds in a set, choose ''Filters $\rightarrow$ Mesh Layer $\rightarrow$ Flatten Visible Layers''. Make sure to retain unreferenced vertices, because at this point, none of the points will be part of any triangles (see figure \ref{fig:meshlab2}). This process will alter all coordinates by applying the pose transformation to all point clouds before merging them.
180
	\item After estimating normals for all point clouds in a set, choose ''Filters $\rightarrow$ Mesh Layer $\rightarrow$ Flatten Visible Layers''. Make sure to retain unreferenced vertices, because at this point, none of the points will be part of any triangles (see figure \ref{fig:meshlab2}). This process will alter all coordinates by applying the pose transformation to all point clouds before merging them.
176
	\item Save the resulting merged point cloud. In the save dialog, make sure to include the normals in the output file (see fig. \ref{fig:meshlab3}).
181
	\item Save the resulting merged point cloud. In the save dialog, make sure to include the normals in the output file (see fig. \ref{fig:meshlab3}).
177
\end{enumerate}
182
\end{enumerate}
178
 
183
 
179
\begin{figure}[H]
184
\begin{figure}[h]
180
	\centering
185
	\centering
181
		\includegraphics[width=\textwidth]{meshlab0.png}
186
		\includegraphics[width=\textwidth]{meshlab0.png}
182
	\caption{One full set of scans (9 point clouds covering $360^\circ$ in $40^\circ$ intervals).}	
187
	\caption{One full set of scans (9 point clouds covering $360^\circ$ in $40^\circ$ intervals).}	
183
	\label{fig:meshlab0}
188
	\label{fig:meshlab0}
184
\end{figure}
189
\end{figure}
185
\begin{figure}[H]
190
\begin{figure}[h]
186
	\centering
191
	\centering
187
		\includegraphics[width=.4\textwidth]{meshlab1.png}
192
		\includegraphics[width=.4\textwidth]{meshlab1.png}
188
	\caption{Estimate normals, and orient them consistenly towards the camera (positive z-axis).}
193
	\caption{Estimate normals, and orient them consistenly towards the camera (positive z-axis).}
189
	\label{fig:meshlab1}
194
	\label{fig:meshlab1}
190
\end{figure}
195
\end{figure}
191
\begin{figure}[H]
196
\begin{figure}[h]
192
	\centering
197
	\centering
193
		\includegraphics[width=.25\textwidth]{meshlab2.png}
198
		\includegraphics[width=.25\textwidth]{meshlab2.png}
194
	\caption{Flatten visible layers and retain ''unreferences vertices'', i.e. points not in a triangle.}
199
	\caption{Flatten visible layers and retain ''unreferences vertices'', i.e. points not in a triangle.}
195
	\label{fig:meshlab2}
200
	\label{fig:meshlab2}
196
\end{figure}
201
\end{figure}
197
\begin{figure}[H]
202
\begin{figure}[h]
198
	\centering
203
	\centering
199
		\includegraphics[width=.7\textwidth]{meshlab3.png}
204
		\includegraphics[width=.7\textwidth]{meshlab3.png}
200
	\caption{Save the merged point clouds, and include the estimated normals in the output file.}
205
	\caption{Save the merged point clouds, and include the estimated normals in the output file.}
201
	\label{fig:meshlab3}
206
	\label{fig:meshlab3}
202
\end{figure}
207
\end{figure}