Subversion Repositories seema-scanner

Rev

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

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