Subversion Repositories seema-scanner

Rev

Rev 207 | Rev 217 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 207 Rev 208
1
#------------------------------------------------------------
1
#------------------------------------------------------------
2
#
2
#
3
# SMScanner
3
# SMScanner
4
#
4
#
5
# Control Interface and point cloud reconstruction interface
5
# Control Interface and point cloud reconstruction interface
6
# for the SeeMa Lab Structured Light Scanner.
6
# for the SeeMa Lab Structured Light Scanner.
7
#
7
#
8
# Supported OS: Ubuntu 16.04
8
# Supported OS: Ubuntu 16.04
9
#
9
#
10
# Dependencies: Qt 5, OpenCV, PCL 1.7.2
10
# Dependencies: Qt 5, OpenCV, PCL 1.7.2
11
#
11
#
12
# Image Analysis and Computer Graphics, DTU, 2017
12
# Image Analysis and Computer Graphics, DTU, 2017
13
#
13
#
14
#------------------------------------------------------------
14
#------------------------------------------------------------
15
 
15
 
16
QT += core gui testlib
16
QT += core gui testlib
17
 
17
 
18
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
18
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
19
 
19
 
20
TARGET = SMScanner
20
TARGET = SMScanner
21
TEMPLATE = app
21
TEMPLATE = app
22
 
22
 
23
HEADERS  += SMScanner.h \
23
HEADERS  += SMScanner.h \
24
        SMVideoWidget.h \
24
        SMVideoWidget.h \
25
        SMPointCloudWidget.h \
25
        SMPointCloudWidget.h \
26
        camera/Camera.h \
26
        camera/Camera.h \
27
        projector/Projector.h \
27
        projector/Projector.h \
28
        projector/ProjectorOpenGL.h \
28
        projector/ProjectorOpenGL.h \
29
        projector/OpenGLContext.h \
29
        projector/OpenGLContext.h \
30
        cvtools.h \
30
        cvtools.h \
31
        SMCaptureWorker.h \
31
        SMCaptureWorker.h \
32
        rotationstage/RotationStage.h \
32
        rotationstage/RotationStage.h \
33
        SMPreferenceDialog.h \
33
        SMPreferenceDialog.h \
34
        SMTypes.h \
34
        SMTypes.h \
35
        SMCalibrationWorker.h \
35
        SMCalibrationWorker.h \
36
        #SMCalibrationWorkerArUco.h \
36
        #SMCalibrationWorkerArUco.h \
37
        SMCalibrationParameters.h \
37
        SMCalibrationParameters.h \
38
        SMReconstructionWorker.h \
38
        SMReconstructionWorker.h \
-
 
39
        SMMeshingWorker.h \
39
        algorithm/Algorithm.h \
40
        algorithm/Algorithm.h \
40
        algorithm/AlgorithmGrayCode.h \
41
        algorithm/AlgorithmGrayCode.h \
41
        algorithm/AlgorithmGrayCodeHorzVert.h \
42
        algorithm/AlgorithmGrayCodeHorzVert.h \
42
        algorithm/AlgorithmLineShift.h \
43
        algorithm/AlgorithmLineShift.h \
43
        algorithm/AlgorithmPhaseShiftThreeFreq.h \
44
        algorithm/AlgorithmPhaseShiftThreeFreq.h \
44
        algorithm/AlgorithmPhaseShiftTwoFreq.h \
45
        algorithm/AlgorithmPhaseShiftTwoFreq.h \
45
        algorithm/AlgorithmPhaseShiftTwoFreqHorzVert.h \
46
        algorithm/AlgorithmPhaseShiftTwoFreqHorzVert.h \
46
        algorithm/AlgorithmPhaseShiftEmbedded.h \
47
        algorithm/AlgorithmPhaseShiftEmbedded.h \
47
        algorithm/algorithmtools.h \
48
        algorithm/algorithmtools.h \
48
    SMVideoZoomWidget.h
49
    SMVideoZoomWidget.h
49
 
50
 
50
SOURCES += main.cpp\
51
SOURCES += main.cpp\
51
        SMScanner.cpp \
52
        SMScanner.cpp \
52
        SMVideoWidget.cpp \
53
        SMVideoWidget.cpp \
53
        SMPointCloudWidget.cpp \
54
        SMPointCloudWidget.cpp \
54
        camera/Camera.cpp \
55
        camera/Camera.cpp \
55
        projector/ProjectorOpenGL.cpp \
56
        projector/ProjectorOpenGL.cpp \
56
        cvtools.cpp \
57
        cvtools.cpp \
57
        SMCaptureWorker.cpp \
58
        SMCaptureWorker.cpp \
58
        rotationstage/RotationStage.cpp \
59
        rotationstage/RotationStage.cpp \
59
        SMPreferenceDialog.cpp \
60
        SMPreferenceDialog.cpp \
60
        SMCalibrationWorker.cpp \
61
        SMCalibrationWorker.cpp \
61
        #SMCalibrationWorkerArUco.cpp \
62
        #SMCalibrationWorkerArUco.cpp \
62
        SMCalibrationParameters.cpp \
63
        SMCalibrationParameters.cpp \
63
        SMReconstructionWorker.cpp \
64
        SMReconstructionWorker.cpp \
-
 
65
        SMMeshingWorker.cpp \
64
        algorithm/AlgorithmGrayCode.cpp \
66
        algorithm/AlgorithmGrayCode.cpp \
65
        algorithm/AlgorithmGrayCodeHorzVert.cpp \
67
        algorithm/AlgorithmGrayCodeHorzVert.cpp \
66
        algorithm/AlgorithmLineShift.cpp \
68
        algorithm/AlgorithmLineShift.cpp \
67
        algorithm/AlgorithmPhaseShiftThreeFreq.cpp \
69
        algorithm/AlgorithmPhaseShiftThreeFreq.cpp \
68
        algorithm/AlgorithmPhaseShiftTwoFreq.cpp \
70
        algorithm/AlgorithmPhaseShiftTwoFreq.cpp \
69
        algorithm/AlgorithmPhaseShiftTwoFreqHorzVert.cpp \
71
        algorithm/AlgorithmPhaseShiftTwoFreqHorzVert.cpp \
70
        algorithm/AlgorithmPhaseShiftEmbedded.cpp \
72
        algorithm/AlgorithmPhaseShiftEmbedded.cpp \
71
    SMVideoZoomWidget.cpp
73
    SMVideoZoomWidget.cpp
72
 
74
 
73
FORMS    += SMScanner.ui \
75
FORMS    += SMScanner.ui \
74
        SMAboutDialog.ui \
76
        SMAboutDialog.ui \
75
        SMPreferenceDialog.ui
77
        SMPreferenceDialog.ui
76
 
78
 
77
INCLUDEPATH += camera/ projector/ algorithm/ triangulator/ rotationstage/ calibration/
79
INCLUDEPATH += camera/ projector/ algorithm/ triangulator/ rotationstage/ calibration/
78
 
80
 
79
 
81
 
80
# Operating System dependant linking and including
82
# Operating System dependant linking and including
81
# Linux
83
# Linux
82
unix:!macx {
84
unix:!macx {
83
    CONFIG += link_pkgconfig
85
    CONFIG += link_pkgconfig
84
    # Link VTK (no pkg-config, only cmake files, hence we link manually for now)
86
    # Link VTK (no pkg-config, only cmake files, hence we link manually for now)
85
    INCLUDEPATH += /usr/include/vtk-7.1/ /usr/include/vtk-6.2/
87
    INCLUDEPATH += /usr/include/vtk-7.1/ /usr/include/vtk-6.2/
86
    LIBS += -L/usr/lib64/opengl/nvidia/lib -lvtkViewsQt -lvtkRenderingQt -lvtkGUISupportQt -lvtkRenderingCore -lvtkCommonExecutionModel \
88
    LIBS += -L/usr/lib64/opengl/nvidia/lib -lvtkViewsQt -lvtkRenderingQt -lvtkGUISupportQt -lvtkRenderingCore -lvtkCommonExecutionModel \
87
            -lvtkCommonDataModel -lvtkCommonMath -lvtkCommonCore -lvtkIOImage -lvtkCommonColor
89
            -lvtkCommonDataModel -lvtkCommonMath -lvtkCommonCore -lvtkIOImage -lvtkCommonColor
88
    # PCL pkg-config workaround
90
    # PCL pkg-config workaround
89
    LIBS += -lboost_system -lpcl_visualization -lpcl_common -lpcl_io -lpcl_search -lpcl_surface
91
    LIBS += -lboost_system -lpcl_visualization -lpcl_common -lpcl_io -lpcl_search -lpcl_surface
90
    # PKG-config libs
92
    # PKG-config libs
91
    INCLUDEPATH += /usr/local/include/pcl-1.7 /usr/include/pcl-1.8 /usr/include/eigen3/
93
    INCLUDEPATH += /usr/local/include/pcl-1.7 /usr/include/pcl-1.8 /usr/include/eigen3/
92
    PKGCONFIG += gl x11 opencv pcl_registration-1.8 pcl_visualization-1.8 pcl_surface-1.8 pcl_search-1.8 \
94
    PKGCONFIG += gl x11 opencv pcl_registration-1.8 pcl_visualization-1.8 pcl_surface-1.8 pcl_search-1.8 \
93
                 pcl_filters-1.8 pcl_kdtree-1.8 pcl_tracking-1.8 flann eigen3
95
                 pcl_filters-1.8 pcl_kdtree-1.8 pcl_tracking-1.8 flann eigen3
94
    # Ceres
96
    # Ceres
95
    CONFIG += c++11
97
    CONFIG += c++11
96
    LIBS += -fopenmp -ltbb -ltbbmalloc -ltbbmalloc_proxy
98
    LIBS += -fopenmp -ltbb -ltbbmalloc -ltbbmalloc_proxy
97
    LIBS += -lcholmod -lceres -lglog
99
    LIBS += -lceres -lglog
-
 
100
    #LIBS += -lcholmod
98
    QMAKE_CXXFLAGS += -fopenmp -openmp
101
    QMAKE_CXXFLAGS += -fopenmp -openmp
99
}
102
}
100
 
103
 
101
 
104
 
102
# Windows
105
# Windows
103
win32 {
106
win32 {
104
    # Boost join
107
    # Boost join
105
    DEFINES += DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED
108
    DEFINES += DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED
106
 
109
 
107
    # opencv
110
    # opencv
108
    INCLUDEPATH += "$$(OPENCV_INCLUDE_DIR)/" #C:\opencv\build\include
111
    INCLUDEPATH += "$$(OPENCV_INCLUDE_DIR)/" #C:\opencv\build\include
109
 
112
 
110
    CONFIG(debug,debug|release){
113
    CONFIG(debug,debug|release){
111
    #debug
114
    #debug
112
    LIBS += -L"$$(OPENCV_DIR)" \ #C:\opencv\build\x64\vc10\lib
115
    LIBS += -L"$$(OPENCV_DIR)" \ #C:\opencv\build\x64\vc10\lib
113
            -lopencv_core247d \
116
            -lopencv_core247d \
114
            -lopencv_highgui247d \
117
            -lopencv_highgui247d \
115
            -lopencv_imgproc247d \
118
            -lopencv_imgproc247d \
116
            -lopencv_calib3d247d
119
            -lopencv_calib3d247d
117
    } else {
120
    } else {
118
    #release
121
    #release
119
    LIBS += -L"$$(OPENCV_DIR)" \
122
    LIBS += -L"$$(OPENCV_DIR)" \
120
            -lopencv_core247 \
123
            -lopencv_core247 \
121
            -lopencv_highgui247 \
124
            -lopencv_highgui247 \
122
            -lopencv_imgproc247 \
125
            -lopencv_imgproc247 \
123
            -lopencv_calib3d247
126
            -lopencv_calib3d247
124
    }
127
    }
125
 
128
 
126
    # pcl
129
    # pcl
127
    INCLUDEPATH += "$$(PCL_INCLUDE_DIR)/" #C:\Program Files\PCL\include\pcl-1.7
130
    INCLUDEPATH += "$$(PCL_INCLUDE_DIR)/" #C:\Program Files\PCL\include\pcl-1.7
128
 
131
 
129
    CONFIG(debug,debug|release){
132
    CONFIG(debug,debug|release){
130
    #debug
133
    #debug
131
    LIBS += -L"$$(PCL_DIR)" \ #C:\Program Files\PCL\lib
134
    LIBS += -L"$$(PCL_DIR)" \ #C:\Program Files\PCL\lib
132
            -lpcl_visualization_debug \
135
            -lpcl_visualization_debug \
133
            -lpcl_io_debug \
136
            -lpcl_io_debug \
134
            -lpcl_common_debug \
137
            -lpcl_common_debug \
135
            -lpcl_features_debug \
138
            -lpcl_features_debug \
136
            -lpcl_filters_debug \
139
            -lpcl_filters_debug \
137
            -lpcl_io_debug \
140
            -lpcl_io_debug \
138
            -lpcl_io_ply_debug \
141
            -lpcl_io_ply_debug \
139
            -lpcl_kdtree_debug \
142
            -lpcl_kdtree_debug \
140
            -lpcl_keypoints_debug \
143
            -lpcl_keypoints_debug \
141
            -lpcl_octree_debug \
144
            -lpcl_octree_debug \
142
            -lpcl_registration_debug \
145
            -lpcl_registration_debug \
143
            -lpcl_sample_consensus_debug \
146
            -lpcl_sample_consensus_debug \
144
            -lpcl_search_debug \
147
            -lpcl_search_debug \
145
            -lpcl_segmentation_debug \
148
            -lpcl_segmentation_debug \
146
            -lpcl_surface_debug \
149
            -lpcl_surface_debug \
147
            -lpcl_tracking_debug \
150
            -lpcl_tracking_debug \
148
            -lpcl_visualization_debug
151
            -lpcl_visualization_debug
149
    } else {
152
    } else {
150
    # release
153
    # release
151
    LIBS += -L"$$(PCL_DIR)" \
154
    LIBS += -L"$$(PCL_DIR)" \
152
            -lpcl_visualization_release \
155
            -lpcl_visualization_release \
153
            -lpcl_io_release \
156
            -lpcl_io_release \
154
            -lpcl_common_release \
157
            -lpcl_common_release \
155
            -lpcl_features_release \
158
            -lpcl_features_release \
156
            -lpcl_filters_release \
159
            -lpcl_filters_release \
157
            -lpcl_io_release \
160
            -lpcl_io_release \
158
            -lpcl_io_ply_release \
161
            -lpcl_io_ply_release \
159
            -lpcl_kdtree_release \
162
            -lpcl_kdtree_release \
160
            -lpcl_keypoints_release \
163
            -lpcl_keypoints_release \
161
            -lpcl_octree_release \
164
            -lpcl_octree_release \
162
            -lpcl_registration_release \
165
            -lpcl_registration_release \
163
            -lpcl_sample_consensus_release \
166
            -lpcl_sample_consensus_release \
164
            -lpcl_search_release \
167
            -lpcl_search_release \
165
            -lpcl_segmentation_release \
168
            -lpcl_segmentation_release \
166
            -lpcl_surface_release \
169
            -lpcl_surface_release \
167
            -lpcl_tracking_release \
170
            -lpcl_tracking_release \
168
            -lpcl_visualization_release
171
            -lpcl_visualization_release
169
    }
172
    }
170
 
173
 
171
    # pcl dependencies
174
    # pcl dependencies
172
    INCLUDEPATH += "$$(BOOST_ROOT)/include" \
175
    INCLUDEPATH += "$$(BOOST_ROOT)/include" \
173
                   "$$(EIGEN_ROOT)/include" \
176
                   "$$(EIGEN_ROOT)/include" \
174
                   "$$(FLANN_ROOT)/include"
177
                   "$$(FLANN_ROOT)/include"
175
    LIBS += -L"$$(BOOST_ROOT)/lib" -lboost_system-vc100-mt-1_50 -lboost_system-vc100-mt-gd-1_50
178
    LIBS += -L"$$(BOOST_ROOT)/lib" -lboost_system-vc100-mt-1_50 -lboost_system-vc100-mt-gd-1_50
176
 
179
 
177
    # vtk
180
    # vtk
178
    INCLUDEPATH += "$$(VTK_INCLUDE_DIR)" #C:\Program Files\VTK\include\vtk-5.10
181
    INCLUDEPATH += "$$(VTK_INCLUDE_DIR)" #C:\Program Files\VTK\include\vtk-5.10
179
 
182
 
180
    CONFIG(debug,debug|release){
183
    CONFIG(debug,debug|release){
181
    #debug
184
    #debug
182
    LIBS += -L"$$(VTK_DIR)" \ #C:\Program Files\VTK\lib\vtk-5.10
185
    LIBS += -L"$$(VTK_DIR)" \ #C:\Program Files\VTK\lib\vtk-5.10
183
            -lvtkGraphics-gd \
186
            -lvtkGraphics-gd \
184
            -lQVTK-gd \
187
            -lQVTK-gd \
185
            -lvtkCommon-gd \
188
            -lvtkCommon-gd \
186
            -lvtkFiltering-gd \
189
            -lvtkFiltering-gd \
187
            -lvtkRendering-gd \
190
            -lvtkRendering-gd \
188
            -lvtkIO-gd \
191
            -lvtkIO-gd \
189
            -lvtkpng-gd \
192
            -lvtkpng-gd \
190
            -lvtksys-gd \
193
            -lvtksys-gd \
191
            -lvtktiff-gd \
194
            -lvtktiff-gd \
192
            -lvtkjpeg-gd \
195
            -lvtkjpeg-gd \
193
            -lvtkexpat-gd \
196
            -lvtkexpat-gd \
194
            -lvtkzlib-gd
197
            -lvtkzlib-gd
195
    } else {
198
    } else {
196
    # release
199
    # release
197
    LIBS += -L"$$(VTK_DIR)" \
200
    LIBS += -L"$$(VTK_DIR)" \
198
            -lvtkGraphics \
201
            -lvtkGraphics \
199
            -lQVTK \
202
            -lQVTK \
200
            -lvtkCommon \
203
            -lvtkCommon \
201
            -lvtkFiltering \
204
            -lvtkFiltering \
202
            -lvtkRendering \
205
            -lvtkRendering \
203
            -lvtkIO \
206
            -lvtkIO \
204
            -lvtkpng \
207
            -lvtkpng \
205
            -lvtksys \
208
            -lvtksys \
206
            -lvtktiff \
209
            -lvtktiff \
207
            -lvtkjpeg \
210
            -lvtkjpeg \
208
            -lvtkexpat \
211
            -lvtkexpat \
209
            -lvtkzlib
212
            -lvtkzlib
210
    }
213
    }
211
 
214
 
212
}
215
}
213
# Mac OS X
216
# Mac OS X
214
macx {
217
macx {
215
    INCLUDEPATH += /opt/local/include/vtk-5.10/
218
    INCLUDEPATH += /opt/local/include/vtk-5.10/
216
    LIBS += -L/opt/local/lib/vtk-5.10/ -lQVTK -lvtkCommon -lvtkFiltering -lvtkRendering -lvtkIO -lvtkGraphics
219
    LIBS += -L/opt/local/lib/vtk-5.10/ -lQVTK -lvtkCommon -lvtkFiltering -lvtkRendering -lvtkIO -lvtkGraphics
217
    LIBS += -L/opt/local/lib/ -lboost_system-mt
220
    LIBS += -L/opt/local/lib/ -lboost_system-mt
218
    CONFIG += link_pkgconfig
221
    CONFIG += link_pkgconfig
219
    PKGCONFIG += opencv pcl_visualization-1.7 pcl_filters-1.7 pcl_search-1.7 pcl_registration-1.7
222
    PKGCONFIG += opencv pcl_visualization-1.7 pcl_filters-1.7 pcl_search-1.7 pcl_registration-1.7
220
    DEFINES += BOOST_TT_HAS_OPERATOR_HPP_INCLUDED
223
    DEFINES += BOOST_TT_HAS_OPERATOR_HPP_INCLUDED
221
}
224
}
222
 
225
 
223
 
226
 
224
# Compile with system dependent OpenGL Context code
227
# Compile with system dependent OpenGL Context code
225
unix:!macx{
228
unix:!macx{
226
    SOURCES += projector/OpenGLContext.Xscreens.cpp
229
    SOURCES += projector/OpenGLContext.Xscreens.cpp
227
    LIBS += -lXxf86vm
230
    LIBS += -lXxf86vm
228
}
231
}
229
win32{
232
win32{
230
    SOURCES += projector/OpenGLContext.Win.cpp
233
    SOURCES += projector/OpenGLContext.Win.cpp
231
}
234
}
232
macx{
235
macx{
233
    CONFIG += objective_c
236
    CONFIG += objective_c
234
    OBJECTIVE_SOURCES += projector/OpenGLContext.Mac.mm
237
    OBJECTIVE_SOURCES += projector/OpenGLContext.Mac.mm
235
    LIBS += -framework Cocoa -framework OpenGL
238
    LIBS += -framework Cocoa -framework OpenGL
236
}
239
}
237
 
240
 
238
 
241
 
239
# Compile with camera driver bindings
242
# Compile with camera driver bindings
240
 
243
 
241
# Point Grey flycapture
244
# Point Grey flycapture
242
unix:!macx:exists(/usr/include/flycapture/FlyCapture2.h){
245
unix:!macx:exists(/usr/include/flycapture/FlyCapture2.h){
243
    INCLUDEPATH += /usr/include/flycapture
246
    INCLUDEPATH += /usr/include/flycapture
244
    DEFINES += WITH_CAMERAPOINTGREY
247
    DEFINES += WITH_CAMERAPOINTGREY
245
    LIBS += -lflycapture
248
    LIBS += -lflycapture
246
}
249
}
247
win32:exists("C:/Program Files/Point Grey Research/FlyCapture2/include/FlyCapture2.h"){
250
win32:exists("C:/Program Files/Point Grey Research/FlyCapture2/include/FlyCapture2.h"){
248
    DEFINES += WITH_CAMERAPOINTGREY
251
    DEFINES += WITH_CAMERAPOINTGREY
249
    INCLUDEPATH += "C:/Program Files/Point Grey Research/FlyCapture2/include/"
252
    INCLUDEPATH += "C:/Program Files/Point Grey Research/FlyCapture2/include/"
250
    LIBS += -L"C:/Program Files/Point Grey Research/FlyCapture2/lib64" -lFlyCapture2
253
    LIBS += -L"C:/Program Files/Point Grey Research/FlyCapture2/lib64" -lFlyCapture2
251
}
254
}
252
contains(DEFINES, WITH_CAMERAPOINTGREY) {
255
contains(DEFINES, WITH_CAMERAPOINTGREY) {
253
    HEADERS += camera/CameraPointGrey.h
256
    HEADERS += camera/CameraPointGrey.h
254
    SOURCES += camera/CameraPointGrey.cpp
257
    SOURCES += camera/CameraPointGrey.cpp
255
}
258
}
256
 
259
 
257
# Compile with rotation stage driver
260
# Compile with rotation stage driver
258
SOURCES += rotationstage/ArcusPerformaxDriver.c
261
SOURCES += rotationstage/ArcusPerformaxDriver.c
259
unix:!macx{
262
unix:!macx{
260
    PKGCONFIG += libusb-1.0
263
    PKGCONFIG += libusb-1.0
261
}
264
}
262
 
265