Subversion Repositories seema-scanner

Rev

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

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