Subversion Repositories seema-scanner

Rev

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

Rev 24 Rev 25
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
# Dependencies: Qt 4, OpenCV, PCL
8
# Dependencies: Qt 4, OpenCV, PCL
9
#
9
#
10
# Image Analysis and Computer Graphics, DTU, 2014
10
# Image Analysis and Computer Graphics, DTU, 2014
11
#
11
#
12
#------------------------------------------------------------
12
#------------------------------------------------------------
13
 
13
 
14
QT += core gui
14
QT += core gui
15
 
15
 
16
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
16
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
17
 
17
 
18
TARGET = SMScanner
18
TARGET = SMScanner
19
TEMPLATE = app
19
TEMPLATE = app
20
 
20
 
21
HEADERS  += SMScanner.h \
21
HEADERS  += SMScanner.h \
22
        SMVideoWidget.h \
22
        SMVideoWidget.h \
23
        SMPointCloudWidget.h \
23
        SMPointCloudWidget.h \
24
        camera/Camera.h \
24
        camera/Camera.h \
25
        projector/Projector.h \
25
        projector/Projector.h \
26
        projector/ProjectorOpenGL.h \
26
        projector/ProjectorOpenGL.h \
27
        projector/OpenGLContext.h \
27
        projector/OpenGLContext.h \
28
        codec/Codec.h \
28
        codec/Codec.h \
29
        codec/CodecGrayCode.h \
29
        codec/CodecGrayCode.h \
30
        codec/CodecPhaseShift2x3.h \
30
        codec/CodecPhaseShift2x3.h \
31
        cvtools.h \
31
        cvtools.h \
32
        SMCalibrationParams.h \
-
 
33
        SMCaptureWorker.h \
32
        SMCaptureWorker.h \
34
        rotationstage/RotationStage.h \
33
        rotationstage/RotationStage.h \
35
        SMPreferenceDialog.h \
34
        SMPreferenceDialog.h \
36
        SMCalibrator.h \
35
        SMCalibrator.h \
37
        SMTypes.h \
36
        SMTypes.h \
38
    SMTriangulator.h
37
    SMTriangulator.h
39
 
38
 
40
SOURCES += main.cpp\
39
SOURCES += main.cpp\
41
        SMScanner.cpp \
40
        SMScanner.cpp \
42
        SMVideoWidget.cpp \
41
        SMVideoWidget.cpp \
43
        SMPointCloudWidget.cpp \
42
        SMPointCloudWidget.cpp \
44
        camera/Camera.cpp \
43
        camera/Camera.cpp \
45
        projector/ProjectorOpenGL.cpp \
44
        projector/ProjectorOpenGL.cpp \
46
        codec/CodecGrayCode.cpp \
45
        codec/CodecGrayCode.cpp \
47
        codec/CodecPhaseShift2x3.cpp \
46
        codec/CodecPhaseShift2x3.cpp \
48
        cvtools.cpp \
47
        cvtools.cpp \
49
        SMCaptureWorker.cpp \
48
        SMCaptureWorker.cpp \
50
        rotationstage/RotationStage.cpp \
49
        rotationstage/RotationStage.cpp \
51
        SMCalibrator.cpp \
50
        SMCalibrator.cpp \
52
        SMPreferenceDialog.cpp \
51
        SMPreferenceDialog.cpp \
53
    SMTriangulator.cpp
52
    SMTriangulator.cpp
54
 
53
 
55
 
54
 
56
FORMS    += SMScanner.ui \
55
FORMS    += SMScanner.ui \
57
    SMAboutDialog.ui \
56
    SMAboutDialog.ui \
58
    SMPreferenceDialog.ui
57
    SMPreferenceDialog.ui
59
 
58
 
60
INCLUDEPATH += camera/ projector/ codec/ triangulator/ rotationstage/ calibration/
59
INCLUDEPATH += camera/ projector/ codec/ triangulator/ rotationstage/ calibration/
61
 
60
 
62
 
61
 
63
# Operating System dependant linking and including
62
# Operating System dependant linking and including
64
# Linux
63
# Linux
65
unix:!macx {
64
unix:!macx {
66
    CONFIG += link_pkgconfig
65
    CONFIG += link_pkgconfig
67
    # Link VTK and Boost (no pkg-config)
66
    # Link VTK and Boost (no pkg-config)
68
    INCLUDEPATH += /usr/include/vtk-5.8/
67
    INCLUDEPATH += /usr/include/vtk-5.8/
69
    LIBS += -lQVTK -lvtkCommon -lvtkFiltering -lvtkRendering -lvtkIO -lvtkGraphics
68
    LIBS += -lQVTK -lvtkCommon -lvtkFiltering -lvtkRendering -lvtkIO -lvtkGraphics
70
    # PCL pkg-config workaround
69
    # PCL pkg-config workaround
71
    LIBS += -lboost_system -lpcl_visualization -lpcl_common -lpcl_io -lpcl_search -lpcl_surface
70
    LIBS += -lboost_system -lpcl_visualization -lpcl_common -lpcl_io -lpcl_search -lpcl_surface
72
    # PKG-config libs
71
    # PKG-config libs
73
    INCLUDEPATH += /usr/local/include/pcl-1.7 /usr/include/eigen3/
72
    INCLUDEPATH += /usr/local/include/pcl-1.7 /usr/include/eigen3/
74
    PKGCONFIG += gl glu x11 xrandr 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
73
    PKGCONFIG += gl glu x11 xrandr 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
75
}
74
}
76
# Windows
75
# Windows
77
win32 {
76
win32 {
78
    # Boost join
77
    # Boost join
79
    DEFINES += DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED
78
    DEFINES += DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED
80
 
79
 
81
    # opencv
80
    # opencv
82
    INCLUDEPATH += "$$(OPENCV_INCLUDE_DIR)/" #C:\opencv\build\include
81
    INCLUDEPATH += "$$(OPENCV_INCLUDE_DIR)/" #C:\opencv\build\include
83
 
82
 
84
    CONFIG(debug,debug|release){
83
    CONFIG(debug,debug|release){
85
    #debug
84
    #debug
86
    LIBS += -L"$$(OPENCV_DIR)" \ #C:\opencv\build\x64\vc10\lib
85
    LIBS += -L"$$(OPENCV_DIR)" \ #C:\opencv\build\x64\vc10\lib
87
            -lopencv_core247d \
86
            -lopencv_core247d \
88
            -lopencv_highgui247d \
87
            -lopencv_highgui247d \
89
            -lopencv_imgproc247d \
88
            -lopencv_imgproc247d \
90
            -lopencv_calib3d247d
89
            -lopencv_calib3d247d
91
    } else {
90
    } else {
92
    #release
91
    #release
93
    LIBS += -L"$$(OPENCV_DIR)" \
92
    LIBS += -L"$$(OPENCV_DIR)" \
94
            -lopencv_core247 \
93
            -lopencv_core247 \
95
            -lopencv_highgui247 \
94
            -lopencv_highgui247 \
96
            -lopencv_imgproc247 \
95
            -lopencv_imgproc247 \
97
            -lopencv_calib3d247
96
            -lopencv_calib3d247
98
    }
97
    }
99
 
98
 
100
    # pcl
99
    # pcl
101
    INCLUDEPATH += "$$(PCL_INCLUDE_DIR)/" #C:\Program Files\PCL\include\pcl-1.7
100
    INCLUDEPATH += "$$(PCL_INCLUDE_DIR)/" #C:\Program Files\PCL\include\pcl-1.7
102
 
101
 
103
    CONFIG(debug,debug|release){
102
    CONFIG(debug,debug|release){
104
    #debug
103
    #debug
105
    LIBS += -L"$$(PCL_DIR)" \ #C:\Program Files\PCL\lib
104
    LIBS += -L"$$(PCL_DIR)" \ #C:\Program Files\PCL\lib
106
            -lpcl_visualization_debug \
105
            -lpcl_visualization_debug \
107
            -lpcl_io_debug \
106
            -lpcl_io_debug \
108
            -lpcl_common_debug \
107
            -lpcl_common_debug \
109
            -lpcl_features_debug \
108
            -lpcl_features_debug \
110
            -lpcl_filters_debug \
109
            -lpcl_filters_debug \
111
            -lpcl_io_debug \
110
            -lpcl_io_debug \
112
            -lpcl_io_ply_debug \
111
            -lpcl_io_ply_debug \
113
            -lpcl_kdtree_debug \
112
            -lpcl_kdtree_debug \
114
            -lpcl_keypoints_debug \
113
            -lpcl_keypoints_debug \
115
            -lpcl_octree_debug \
114
            -lpcl_octree_debug \
116
            -lpcl_registration_debug \
115
            -lpcl_registration_debug \
117
            -lpcl_sample_consensus_debug \
116
            -lpcl_sample_consensus_debug \
118
            -lpcl_search_debug \
117
            -lpcl_search_debug \
119
            -lpcl_segmentation_debug \
118
            -lpcl_segmentation_debug \
120
            -lpcl_surface_debug \
119
            -lpcl_surface_debug \
121
            -lpcl_tracking_debug \
120
            -lpcl_tracking_debug \
122
            -lpcl_visualization_debug
121
            -lpcl_visualization_debug
123
    } else {
122
    } else {
124
    # release
123
    # release
125
    LIBS += -L"$$(PCL_DIR)" \
124
    LIBS += -L"$$(PCL_DIR)" \
126
            -lpcl_visualization_release \
125
            -lpcl_visualization_release \
127
            -lpcl_io_release \
126
            -lpcl_io_release \
128
            -lpcl_common_release \
127
            -lpcl_common_release \
129
            -lpcl_features_release \
128
            -lpcl_features_release \
130
            -lpcl_filters_release \
129
            -lpcl_filters_release \
131
            -lpcl_io_release \
130
            -lpcl_io_release \
132
            -lpcl_io_ply_release \
131
            -lpcl_io_ply_release \
133
            -lpcl_kdtree_release \
132
            -lpcl_kdtree_release \
134
            -lpcl_keypoints_release \
133
            -lpcl_keypoints_release \
135
            -lpcl_octree_release \
134
            -lpcl_octree_release \
136
            -lpcl_registration_release \
135
            -lpcl_registration_release \
137
            -lpcl_sample_consensus_release \
136
            -lpcl_sample_consensus_release \
138
            -lpcl_search_release \
137
            -lpcl_search_release \
139
            -lpcl_segmentation_release \
138
            -lpcl_segmentation_release \
140
            -lpcl_surface_release \
139
            -lpcl_surface_release \
141
            -lpcl_tracking_release \
140
            -lpcl_tracking_release \
142
            -lpcl_visualization_release
141
            -lpcl_visualization_release
143
    }
142
    }
144
 
143
 
145
    # pcl dependencies
144
    # pcl dependencies
146
    INCLUDEPATH += "$$(BOOST_ROOT)/include" \
145
    INCLUDEPATH += "$$(BOOST_ROOT)/include" \
147
                   "$$(EIGEN_ROOT)/include" \
146
                   "$$(EIGEN_ROOT)/include" \
148
                   "$$(FLANN_ROOT)/include"
147
                   "$$(FLANN_ROOT)/include"
149
    LIBS += -L"$$(BOOST_ROOT)/lib" -lboost_system-vc100-mt-1_50 -lboost_system-vc100-mt-gd-1_50
148
    LIBS += -L"$$(BOOST_ROOT)/lib" -lboost_system-vc100-mt-1_50 -lboost_system-vc100-mt-gd-1_50
150
 
149
 
151
    # vtk
150
    # vtk
152
    INCLUDEPATH += "$$(VTK_INCLUDE_DIR)" #C:\Program Files\VTK\include\vtk-5.10
151
    INCLUDEPATH += "$$(VTK_INCLUDE_DIR)" #C:\Program Files\VTK\include\vtk-5.10
153
 
152
 
154
    CONFIG(debug,debug|release){
153
    CONFIG(debug,debug|release){
155
    #debug
154
    #debug
156
    LIBS += -L"$$(VTK_DIR)" \ #C:\Program Files\VTK\lib\vtk-5.10
155
    LIBS += -L"$$(VTK_DIR)" \ #C:\Program Files\VTK\lib\vtk-5.10
157
            -lvtkGraphics-gd \
156
            -lvtkGraphics-gd \
158
            -lQVTK-gd \
157
            -lQVTK-gd \
159
            -lvtkCommon-gd \
158
            -lvtkCommon-gd \
160
            -lvtkFiltering-gd \
159
            -lvtkFiltering-gd \
161
            -lvtkRendering-gd \
160
            -lvtkRendering-gd \
162
            -lvtkIO-gd \
161
            -lvtkIO-gd \
163
            -lvtkpng-gd \
162
            -lvtkpng-gd \
164
            -lvtksys-gd \
163
            -lvtksys-gd \
165
            -lvtktiff-gd \
164
            -lvtktiff-gd \
166
            -lvtkjpeg-gd \
165
            -lvtkjpeg-gd \
167
            -lvtkexpat-gd \
166
            -lvtkexpat-gd \
168
            -lvtkzlib-gd
167
            -lvtkzlib-gd
169
    } else {
168
    } else {
170
    # release
169
    # release
171
    LIBS += -L"$$(VTK_DIR)" \
170
    LIBS += -L"$$(VTK_DIR)" \
172
            -lvtkGraphics \
171
            -lvtkGraphics \
173
            -lQVTK \
172
            -lQVTK \
174
            -lvtkCommon \
173
            -lvtkCommon \
175
            -lvtkFiltering \
174
            -lvtkFiltering \
176
            -lvtkRendering \
175
            -lvtkRendering \
177
            -lvtkIO \
176
            -lvtkIO \
178
            -lvtkpng \
177
            -lvtkpng \
179
            -lvtksys \
178
            -lvtksys \
180
            -lvtktiff \
179
            -lvtktiff \
181
            -lvtkjpeg \
180
            -lvtkjpeg \
182
            -lvtkexpat \
181
            -lvtkexpat \
183
            -lvtkzlib
182
            -lvtkzlib
184
    }
183
    }
185
 
184
 
186
}
185
}
187
# Mac OS X
186
# Mac OS X
188
macx {
187
macx {
189
    INCLUDEPATH += /opt/local/include/vtk-5.10/
188
    INCLUDEPATH += /opt/local/include/vtk-5.10/
190
    LIBS += -L/opt/local/lib/vtk-5.10/ -lQVTK -lvtkCommon -lvtkFiltering -lvtkRendering -lvtkIO -lvtkGraphics
189
    LIBS += -L/opt/local/lib/vtk-5.10/ -lQVTK -lvtkCommon -lvtkFiltering -lvtkRendering -lvtkIO -lvtkGraphics
191
    LIBS += -L/opt/local/lib/ -lboost_system-mt
190
    LIBS += -L/opt/local/lib/ -lboost_system-mt
192
    CONFIG += link_pkgconfig
191
    CONFIG += link_pkgconfig
193
    PKGCONFIG += opencv pcl_visualization-1.7 pcl_filters-1.7 pcl_search-1.7 pcl_registration-1.7
192
    PKGCONFIG += opencv pcl_visualization-1.7 pcl_filters-1.7 pcl_search-1.7 pcl_registration-1.7
194
    DEFINES += BOOST_TT_HAS_OPERATOR_HPP_INCLUDED
193
    DEFINES += BOOST_TT_HAS_OPERATOR_HPP_INCLUDED
195
}
194
}
196
 
195
 
197
 
196
 
198
# Compile with system dependent OpenGL Context code
197
# Compile with system dependent OpenGL Context code
199
unix:!macx{
198
unix:!macx{
200
    SOURCES += projector/OpenGLContext.XRandr.cpp
199
    SOURCES += projector/OpenGLContext.XRandr.cpp
201
    LIBS += -lXxf86vm -lXcursor
200
    LIBS += -lXxf86vm -lXcursor
202
}
201
}
203
win32{
202
win32{
204
    SOURCES += projector/OpenGLContext.Win.cpp
203
    SOURCES += projector/OpenGLContext.Win.cpp
205
}
204
}
206
macx{
205
macx{
207
    CONFIG += objective_c
206
    CONFIG += objective_c
208
    OBJECTIVE_SOURCES += projector/OpenGLContext.Mac.mm
207
    OBJECTIVE_SOURCES += projector/OpenGLContext.Mac.mm
209
    LIBS += -framework Cocoa -framework OpenGL
208
    LIBS += -framework Cocoa -framework OpenGL
210
}
209
}
211
 
210
 
212
 
211
 
213
# Compile with camera driver bindings
212
# Compile with camera driver bindings
214
 
213
 
215
# Point Grey flycapture
214
# Point Grey flycapture
216
unix:!macx:exists(/usr/include/flycapture/FlyCapture2.h){
215
unix:!macx:exists(/usr/include/flycapture/FlyCapture2.h){
217
    INCLUDEPATH += /usr/include/flycapture
216
    INCLUDEPATH += /usr/include/flycapture
218
    DEFINES += WITH_CAMERAPOINTGREY
217
    DEFINES += WITH_CAMERAPOINTGREY
219
    LIBS += -lflycapture
218
    LIBS += -lflycapture
220
}
219
}
221
win32:exists("C:/Program Files/Point Grey Research/FlyCapture2/include/FlyCapture2.h"){
220
win32:exists("C:/Program Files/Point Grey Research/FlyCapture2/include/FlyCapture2.h"){
222
    DEFINES += WITH_CAMERAPOINTGREY
221
    DEFINES += WITH_CAMERAPOINTGREY
223
    INCLUDEPATH += "C:/Program Files/Point Grey Research/FlyCapture2/include/"
222
    INCLUDEPATH += "C:/Program Files/Point Grey Research/FlyCapture2/include/"
224
    LIBS += -L"C:/Program Files/Point Grey Research/FlyCapture2/lib64" -lFlyCapture2
223
    LIBS += -L"C:/Program Files/Point Grey Research/FlyCapture2/lib64" -lFlyCapture2
225
}
224
}
226
contains(DEFINES, WITH_CAMERAPOINTGREY) {
225
contains(DEFINES, WITH_CAMERAPOINTGREY) {
227
    HEADERS += camera/CameraPointGrey.h
226
    HEADERS += camera/CameraPointGrey.h
228
    SOURCES += camera/CameraPointGrey.cpp
227
    SOURCES += camera/CameraPointGrey.cpp
229
}
228
}
230
 
229
 
231
# Compile with rotation stage driver
230
# Compile with rotation stage driver
232
SOURCES += rotationstage/ArcusPerformaxDriver.c
231
SOURCES += rotationstage/ArcusPerformaxDriver.c
233
unix:!macx{
232
unix:!macx{
234
    PKGCONFIG += libusb-1.0
233
    PKGCONFIG += libusb-1.0
235
}
234
}
236
 
235