Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a87b95c
Fix build with VisualStudio 2010
uboot Jun 2, 2016
379548c
Fix build with VTK6 and Qt4
uboot Jun 2, 2016
8cbc5a8
Support IDS cameras in CMake build
uboot Jun 2, 2016
47fb76f
Disable ximea support per default
uboot Jun 9, 2016
1b5fc7c
Fix intendation
uboot Jun 9, 2016
ab481ca
Build with OpenCV versions 2 and 3
uboot Jun 9, 2016
7dd462f
Added QtGlWidget based projector
gBaltar Jun 12, 2016
dd7e5ec
Added OpenCV based camera and V4L2
gBaltar Jun 12, 2016
87e9a12
Merge branch 'qtprojector'
uboot Aug 25, 2016
35c2ac9
Add ProjectorQtGL and CameraOpenCV to CMake build
uboot Aug 25, 2016
4f7dd6d
All projectors and cameras are CMake options
uboot Aug 25, 2016
57e9db2
V4L and OpenCV cameras so not depend on Qt
uboot Sep 8, 2016
869759c
Move codecs, triangulation and calibration to dedicated algorithms li…
uboot Sep 8, 2016
9f2bb63
Remove unused boost dependencies
uboot Sep 8, 2016
2dff6d9
Algorithms do not depend on Qt
uboot Sep 12, 2016
1b04942
Export symbols of algorithms library on windows
uboot Sep 21, 2016
6f61d0a
Fix Qt4 build
uboot Sep 21, 2016
9d1dbcc
Fix OpenGL projector
uboot Sep 23, 2016
8fe2952
Move camera classes to separate library, rename slalgorithms to slalg…
uboot Sep 23, 2016
fc0ced9
Move projector classes to separate library
uboot Sep 23, 2016
4f52e5a
Get rid of projector compile defines in studio
uboot Sep 23, 2016
419c27a
Remove static camera libraries
uboot Sep 23, 2016
b25f18d
Build only libraries if PCL and VTK are not available
uboot Sep 28, 2016
f6aa3ce
Fix build without PCL and VTK
uboot Oct 21, 2016
46cf2c6
Disable lightcrafter support per default
uboot Oct 21, 2016
2698d4c
Add (empty) factory functions for codecs
uboot Oct 26, 2016
acd9396
Implement factory function for codecs
uboot Oct 27, 2016
402fdbb
Fix finding GLEW
uboot Nov 2, 2016
aa31314
Do not build Qt projector per default
uboot Nov 4, 2016
9854197
Install libraries
uboot Nov 14, 2016
16df99b
Fix loop in gray code codec
uboot Nov 16, 2016
edb7c17
Export calibration codecs
uboot Dec 31, 2016
ca06ab1
Convert to cv::Mat to output to stream
uboot Mar 1, 2017
50e19ea
Remove unused include
uboot Mar 2, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 68 additions & 135 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,45 @@
#Baysen Vision Inc. Structured Light project setup file
#Copyright Reserved. 2013-2016

cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR)
include(GenerateExportHeader)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

project(slstudio)
find_package(PCL REQUIRED)
find_package(VTK REQUIRED)
find_package(OpenCV REQUIRED)
find_package(Boost 1.47 COMPONENTS filesystem thread chrono exception REQUIRED)
if(OpenCV_VERSION VERSION_LESS "3")
add_definitions(-DOPENCV2)
endif(OpenCV_VERSION VERSION_LESS "3")

find_package(Glew REQUIRED)
find_package(OpenGL REQUIRED)

find_package(PCL)
find_package(VTK)
find_package(Boost 1.47 COMPONENTS chrono filesystem system timer REQUIRED)

set(USE_QT5 true)
if(VTK_FOUND)
if(VTK_QT_VERSION VERSION_LESS "5")
set(USE_QT5 false)
endif(VTK_QT_VERSION VERSION_LESS "5")
endif(VTK_FOUND)

if(${USE_QT5})
find_package(Qt5 COMPONENTS Core Gui Test Widgets OpenGL)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
else()
#Legacy qt4 support
find_package(Qt4 REQUIRED QtCore QtGui QtTest QtOpenGL)
include(${QT_USE_FILE})
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}
${PCL_INCLUDE_DIRS} ${VTK_DIR} ${OpenCV_INCLUDE_DIRS} ${Boost_INCLUDE_DIR}
${GLEW_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIRS} )
include(${VTK_USE_FILE})
${CMAKE_CURRENT_BINARY_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src/camera
${CMAKE_CURRENT_BINARY_DIR}/src/projector
${OpenCV_INCLUDE_DIRS} ${Boost_INCLUDE_DIR}
${GLEW_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})

include_directories(${PROJECT_SOURCE_DIR}/src/camera)
include_directories(${PROJECT_SOURCE_DIR}/src/projector)
Expand All @@ -23,22 +48,14 @@ include_directories(${PROJECT_SOURCE_DIR}/src/triangulator)
include_directories(${PROJECT_SOURCE_DIR}/src/calibrator)
include_directories(${PROJECT_SOURCE_DIR}/src/tracker)

add_definitions(${PCL_DEFINITIONS})

set(QT_USE_QTOPENGL TRUE)
add_subdirectory(${PROJECT_SOURCE_DIR}/src)
add_subdirectory(${PROJECT_SOURCE_DIR}/src/camera)
add_subdirectory(${PROJECT_SOURCE_DIR}/src/projector)

#generate cmake config header file
configure_file(${PROJECT_SOURCE_DIR}/slconfig.h.in
${PROJECT_BINARY_DIR}/slconfig.h)

option(WITH_CAMERAXIMEA "Use Ximea Camera" ON)
option(WITH_CAMERAIIDC "Use IIDC Camera" OFF)
option(WITH_CAMERAIDSIMAGING "Use IDS Camera" OFF)
option(WITH_CAMERAPOINTGREY "Use Pointgrey Camera" OFF)
option(WITH_LC3000API "Use LightCrafter 3000 projector" ON)
option(WITH_LC4500API "Use LightCrafter 4500 projector" ON)


#Set source file set
file(GLOB UI_FILES src/SLStudio.ui
src/SLPreferenceDialog.ui
Expand All @@ -64,36 +81,6 @@ file(GLOB H_FILES ${PROJECT_BINARY_DIR}/cmakeconfig.h
src/SLTrackerDialog.h
src/SLTriangulatorWorker.h
src/SLTraceWidget.h
src/camera/Camera.h
src/projector/Projector.h
src/projector/ProjectorOpenGL.h
src/projector/OpenGLContext.h
src/projector/ProjectorLC3000.h
src/projector/ProjectorLC4500.h
src/codec/Codec.h
src/codec/phaseunwrap.h
src/codec/phasecorr.h
src/codec/pstools.h
src/codec/CodecCalibration.h
src/codec/CodecPhaseShift2x3.h
src/codec/CodecPhaseShiftDescatter.h
src/codec/CodecPhaseShift3.h
src/codec/CodecPhaseShift3FastWrap.h
src/codec/CodecPhaseShift3Unwrap.h
src/codec/CodecPhaseShift4.h
src/codec/CodecGrayCode.h
src/codec/CodecPhaseShift2p1.h
src/codec/CodecFastRatio.h
src/codec/CodecPhaseShiftModulated.h
src/codec/CodecPhaseShiftMicro.h
src/codec/CodecPhaseShiftNStep.h
src/triangulator/Triangulator.h
src/calibrator/CalibrationData.h
src/calibrator/Calibrator.h
src/calibrator/CalibratorLocHom.h
src/calibrator/CalibratorRBF.h
src/calibrator/CThinPlateSpline.h
src/calibrator/RBFInterpolator.h
src/tracker/Tracker.h
src/tracker/TrackerICP.h
src/tracker/TrackerNDT.h
Expand Down Expand Up @@ -121,30 +108,6 @@ file(GLOB CPP_FILES src/main.cpp
src/SLTrackerDialog.cpp
src/SLTriangulatorWorker.cpp
src/SLTraceWidget.cpp
src/camera/Camera.cpp
src/projector/ProjectorOpenGL.cpp
src/codec/phaseunwrap.cpp
src/codec/phasecorr.cpp
src/codec/CodecCalibration.cpp
src/codec/CodecPhaseShift2x3.cpp
src/codec/CodecPhaseShiftDescatter.cpp
src/codec/CodecPhaseShift3.cpp
src/codec/CodecPhaseShift3FastWrap.cpp
src/codec/CodecPhaseShift3Unwrap.cpp
src/codec/CodecPhaseShift4.cpp
src/codec/CodecFastRatio.cpp
src/codec/CodecPhaseShift2p1.cpp
src/codec/CodecPhaseShiftModulated.cpp
src/codec/CodecPhaseShiftMicro.cpp
src/codec/CodecGrayCode.cpp
src/codec/pstools.cpp
src/codec/CodecPhaseShiftNStep.cpp
src/triangulator/Triangulator.cpp
src/calibrator/CalibrationData.cpp
src/calibrator/CalibratorLocHom.cpp
src/calibrator/CalibratorRBF.cpp
src/calibrator/CThinPlateSpline.cpp
src/calibrator/RBFInterpolator.cpp
src/cvtools.cpp
src/tracker/TrackerICP.cpp
src/tracker/TrackerNDT.cpp
Expand All @@ -154,69 +117,39 @@ file(GLOB CPP_FILES src/main.cpp

file(GLOB RC_FILES src/SLResources.qrc)


# Compile with system dependent OpenGL Context code
if(APPLE)
list(APPEND CPP_FILES src/projector/OpenGLContext.Mac.mm)
elseif(WIN32)
list(APPEND CPP_FILES src/projector/OpenGLContext.Win.cpp)
add_definitions(-DWIN32 -D_UNICODE -DUNICODE)
else()
list(APPEND CPP_FILES src/projector/OpenGLContext.Unix.cpp)
if(VTK_FOUND AND PCL_FOUND)
include(${VTK_USE_FILE})
add_definitions(${PCL_DEFINITIONS})


include_directories(${PCL_INCLUDE_DIRS} ${VTK_DIR})

if(USE_QT5)
qt5_wrap_ui(UISrcs ${UI_FILES})
# CMAKE_AUTOMOC in ON so the MocHdrs will be automatically wrapped.
qt5_add_resources(RCC_SRCS ${RC_FILES})
add_executable(slstudio ${CPP_FILES} ${UISrcs} ${H_FILES} ${RCC_SRCS})
qt5_use_modules(slstudio Core Gui Widgets Test)
add_definitions(${COMPILER_DEFINES})
target_link_libraries(slstudio slalgorithm slcamera slprojector
${VTK_LIBRARIES} ${PCL_LIBRARIES}
${OpenCV_LIBS} ${Boost_LIBRARIES})
else(USE_QT5)
#Legacy qt4 support

qt4_wrap_ui(UISrcs ${UI_FILES})
qt4_wrap_cpp(MOCSrcs ${H_FILES})
qt4_add_resources(RCC_SRCS ${RC_FILES})

add_executable(slstudio ${CPP_FILES} ${UISrcs} ${MOCSrcs} ${RCC_SRCS})
target_link_libraries(slstudio slalgorithm slcamera slprojector
Qt4::QtTest ${VTK_LIBRARIES} ${PCL_LIBRARIES}
${OpenCV_LIBS} ${Boost_LIBRARIES})
endif(USE_QT5)

if(MSVC)
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/wd4819 /wd4996" )
endif(MSVC)
endif()

set(DEVICE_LIBS)
#Device Options - camera
add_subdirectory(${PROJECT_SOURCE_DIR}/src/camera)
#Device Options - projector
add_subdirectory(${PROJECT_SOURCE_DIR}/src/projector)

if(WITH_CAMERAXIMEA)
link_directories(${XIMEA_LIBRARY_DIR})
add_definitions(-DWITH_CAMERAXIMEA)
endif(WITH_CAMERAXIMEA)

if(WITH_LC4500API)
add_definitions(-DWITH_LC4500API)
endif(WITH_LC4500API)

if(WITH_LC3000API)
add_definitions(-DWITH_LC3000API)
endif(WITH_LC3000API)


if(VTK_QT_VERSION VERSION_GREATER "4")
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
find_package(Qt5 COMPONENTS Core Gui Test Widgets REQUIRED)


qt5_wrap_ui(UISrcs ${UI_FILES} )
# CMAKE_AUTOMOC in ON so the MocHdrs will be automatically wrapped.
qt5_add_resources(RCC_SRCS ${RC_FILES})
add_executable(slstudio ${CPP_FILES} ${UISrcs} ${H_FILES} ${RCC_SRCS})
qt5_use_modules(slstudio Core Gui Widgets Test)
target_link_libraries(slstudio ${VTK_LIBRARIES} ${PCL_LIBRARIES}
${OpenCV_LIBS} ${Boost_LIBRARIES} ${GLEW_LIBRARIES}
${OPENGL_LIBRARIES} ${DEVICE_LIBS})

else(VTK_QT_VERSION VERSION_GREATER "4")
#Legacy qt4 support
find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})

qt4_wrap_ui(UISrcs ${UI_FILES})
qt4_wrap_cpp(MOCSrcs ${H_FILES})
qt4_add_resources(RCC_SRCS ${RC_FILES})

add_executable(slstudio ${CPP_FILES} ${UISrcs} ${MOCSrcs} ${RCC_SRCS})
target_link_libraries(slstudio QVTK ${PCL_LIBRARIES} ${OpenCV_LIBS}
${Boost_LIBRARIES} ${GLEW_LIBRARIES} ${OPENGL_LIBRARIES} ${DEVICE_LIBS})

endif(VTK_QT_VERSION VERSION_GREATER "4")
if(MSVC)
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/wd4819 /wd4996" )
endif(MSVC)
message(status " :Ximea Lib : ${XIMEA_LIBRARY} at ${XIMEA_LIBRARY_DIR}")
message(status " :Device Libs : ${DEVICE_LIBS} ")

20 changes: 20 additions & 0 deletions cmake/FindGlew.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
set(GLEW_FOUND false)
set(GLEW_PATH)
set(GLEW_LIBRARY)

find_path(GLEW_PATH GL/glew.h)

if(EXISTS ${GLEW_PATH})
if(UNIX)
find_library(GLEW_LIBRARY GLEW)
else()
find_library(GLEW_LIBRARY glew32.lib)
endif()
if(EXISTS ${GLEW_LIBRARY})
set(GLEW_FOUND 1)
endif()
endif()

mark_as_advanced(FORCE GLEW_FOUND)
mark_as_advanced(FORCE GLEW_PATH)
mark_as_advanced(FORCE GLEW_LIBRARY)
27 changes: 27 additions & 0 deletions cmake/FindIds.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# - Find IDS
# This module looks for the IDS uEye software package
# and determines where the binaries and header files are.
# This code sets the following variables:
#
# IDS_FOUND - True if uEye API found
# IDS_PATH: - Path to the uEye API folder
# IDS_LIBRARY_DIR - uEye libraries folder

set(IDS_FOUND)
set(IDS_PATH)
set(IDS_LIBRARY)

if(WIN32)
find_path(IDS_PATH uEye.h)

if(EXISTS ${IDS_PATH})
find_library(IDS_LIBRARY uEye_api.lib)
if(EXISTS ${IDS_LIBRARY})
set(IDS_FOUND 1)
endif()
endif()
endif()

mark_as_advanced(FORCE IDS_FOUND)
mark_as_advanced(FORCE IDS_PATH)
mark_as_advanced(FORCE IDS_LIBRARY)
7 changes: 6 additions & 1 deletion slconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
#cmakedefine WITH_CAMERAIIDC
#cmakedefine WITH_CAMERAIDSIMAGING
#cmakedefine WITH_CAMERAPOINTGREY
#cmakedefine WITH_CAMERAV4L
#cmakedefine WITH_CAMERAOPENCV

#cmakedefine WITH_LC3000API
#cmakedefine WITH_LC4500API
#cmakedefine WITH_LC4500API
#cmakedefine WITH_PROJECTOROPENGL
#cmakedefine WITH_PROJECTORQT
63 changes: 63 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
set(HEADERS
cvtools.h
codec/Codec.h
codec/phaseunwrap.h
codec/phasecorr.h
codec/pstools.h
codec/CodecCalibration.h
codec/CodecPhaseShift2x3.h
codec/CodecPhaseShiftDescatter.h
codec/CodecPhaseShift3.h
codec/CodecPhaseShift3FastWrap.h
codec/CodecPhaseShift3Unwrap.h
codec/CodecPhaseShift4.h
codec/CodecGrayCode.h
codec/CodecPhaseShift2p1.h
codec/CodecFastRatio.h
codec/CodecPhaseShiftModulated.h
codec/CodecPhaseShiftMicro.h
codec/CodecPhaseShiftNStep.h
triangulator/Triangulator.h
calibrator/CalibrationData.h
calibrator/Calibrator.h
calibrator/CalibratorLocHom.h
calibrator/CalibratorRBF.h
calibrator/CThinPlateSpline.h
calibrator/RBFInterpolator.h
)

set(SOURCES
cvtools.cpp
codec/Codec.cpp
codec/phaseunwrap.cpp
codec/phasecorr.cpp
codec/CodecCalibration.cpp
codec/CodecPhaseShift2x3.cpp
codec/CodecPhaseShiftDescatter.cpp
codec/CodecPhaseShift3.cpp
codec/CodecPhaseShift3FastWrap.cpp
codec/CodecPhaseShift3Unwrap.cpp
codec/CodecPhaseShift4.cpp
codec/CodecFastRatio.cpp
codec/CodecPhaseShift2p1.cpp
codec/CodecPhaseShiftModulated.cpp
codec/CodecPhaseShiftMicro.cpp
codec/CodecGrayCode.cpp
codec/pstools.cpp
codec/CodecPhaseShiftNStep.cpp
triangulator/Triangulator.cpp
calibrator/CalibrationData.cpp
calibrator/CalibratorLocHom.cpp
calibrator/CalibratorRBF.cpp
calibrator/CThinPlateSpline.cpp
calibrator/RBFInterpolator.cpp
)

add_compiler_export_flags()
add_library(slalgorithm SHARED ${HEADERS} ${SOURCES})
generate_export_header(slalgorithm)
target_link_libraries(slalgorithm
${OpenCV_LIBS}
${Boost_LIBRARIES}
)
install(TARGETS slalgorithm LIBRARY DESTINATION lib)
Loading