Subversion Repositories seema-scanner

Rev

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

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