Skip to content

Commit 9850ba2

Browse files
author
tsing
committed
Modified documentation
1 parent 1d45403 commit 9850ba2

File tree

5 files changed

+41
-68
lines changed

5 files changed

+41
-68
lines changed

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ endif()
2222
cmake_minimum_required(VERSION 3.1)
2323
set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )
2424
project( SLS )
25+
set (VERSION_MAJOR 4)
26+
set (VERSION_MINOR 0)
27+
set (VERSION_PATCH 1)
28+
2529

2630
# Include this project
2731
include_directories(./src/lib)
@@ -83,6 +87,7 @@ option (COVERAGE "Build with coverage test, require GTEST=on" OFF)
8387
if (COVERAGE AND GTEST)
8488
set (CMAKE_CXX_FLAGS "-std=c++11 -g -O0 -fprofile-arcs -ftest-coverage")
8589
set (CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
90+
set(CMAKE_EXE_LINKER_FLAGS="-fprofile-arcs -ftest-coverage")
8691
endif()
8792

8893
# Enable documentation

README.md

+8-61
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ make test
4040
```
4141
Google test will be downloaded and compiled during the compilation stage.
4242

43+
### Build documentation
44+
Document with Doxygen is availabe to be built. Use `-DBUILD_DOC=on` cmake flag to enable documentation. Run `make doc`, the documentation will be generated in the `doc` directory of building path.
45+
46+
### Code coverage
47+
Code coverage report is provided by using [lcov](http://ltp.sourceforge.net/coverage/lcov.php). In order to get the code coverage report, enable both test and coverage flag: `-DGTEST=on -DCOVERAGE=on` and run `make coverage`. The coverage report will be generated in the `coverage` directory of building path.
48+
4349
### Run demo binary
4450
```
4551
usage: ./SLS --leftcam=string --rightcam=string --leftconfig=string --rightconfig=string --output=string --format=string --width=unsigned long --height=unsigned long [options] ...
@@ -62,66 +68,8 @@ Most of the outputs are written to the log file named `SLS.log`. To track the ou
6268

6369
### Use the library
6470

65-
This project also provides libraries that can be easily integrated into other projects. Here's a quick start code for using the libraries.
66-
67-
```C++
68-
#ifdef CPU
69-
70-
/* Using CPU reconstruction */
71-
#include <core/fileReader.h>
72-
#include <core/Reconstructor.h>
73-
#else
74-
75-
/* Using CUDA reconstruction */
76-
#include <ReconstructorCUDA/fileReaderCUDA.cuh>
77-
#include <ReconstructorCUDA/ReconstructorCUDA.cuh>
78-
#endif
79-
80-
81-
int main()
82-
{
83-
// Folders contain reconstruction images
84-
std::string rightCameraFolder = "../../data/alexander/rightCam/dataset1/"
85-
std::string leftCameraFolder = "../../data/alexander/leftCam/dataset1/"
86-
87-
// Camera configuration files
88-
std::string rightConfigFile = "../../data/alexander/rightCam/calib/output/calib.xml"
89-
std::string leftConfigFile = "../../data/alexander/leftCam/calib/output/calib.xml"
90-
91-
#ifdef CPU
92-
SLS::FileReader rightCam("rightCamera");
93-
SLS::FileReader leftCam("leftCamera");
94-
#else
95-
SLS::FileReaderCUDA rightCam("rightCamera");
96-
SLS::FileReaderCUDA leftCam("leftCamera");
97-
#endif
98-
99-
// Load image from data folder
100-
rightCam.loadImages(rightCameraFolder);
101-
leftCam.loadImages(leftCameraFolder);
102-
103-
// Load configuration files
104-
rightCam.loadConfig(rightConfigFile);
105-
leftCam.loadConfig(leftConfigFile);
106-
107-
// Initialize a reconstructor the projector resolution.
108-
#ifdef CPU
109-
SLS::ReconstructorCPU reconstructor(1024,768);
110-
#else
111-
SLS::ReconstructorCUDA reconstructor(1024,768);
112-
#endif
113-
// Pass cameras to the reconstructor.
114-
reconstructor.addCamera(&rightCam);
115-
reconstructor.addCamera(&leftCam);
116-
117-
// Reconstructor returns a point cloud
118-
auto pointCloud = reconstructor.reconstruct();
119-
120-
// Export point cloud to file.
121-
pointCloud.exportPointCloud("alexander.ply", "ply");
122-
return 0;
123-
}
124-
```
71+
This project also provides libraries that can be easily integrated into other projects. Here's a quick start code for using the libraries. An example of [CPU](https://github.com/theICTlab/3DUNDERWORLD-SLS-GPU_CPU/blob/dev/src/app/App.cpp) and [GPU](https://github.com/theICTlab/3DUNDERWORLD-SLS-GPU_CPU/blob/dev/src/app/App_CUDA.cu) applications are included in the repository.
72+
12573

12674
## Known issues
12775

@@ -174,4 +122,3 @@ Immersive and Creative Technologies Lab (http://www.theICTlab.org), Concordia Un
174122
bibsource = {dblp computer science bibliography, http://dblp.org}
175123
}
176124
```
177-

doc/CMakeLists.txt

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
find_package(Doxygen REQUIRED)
2-
message(STATUS ${DOXYGEN_EXECUTABLE})
2+
3+
set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.in)
4+
set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/doxyfile)
5+
set(doxy_main_page ${CMAKE_SOURCE_DIR}/README.md)
6+
7+
configure_file(${doxyfile_in} ${doxyfile} @ONLY)
8+
9+
add_custom_target(doc
10+
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
11+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
12+
COMMENT "Generating API documentation with Doxygen"
13+
VERBATIM)
314

doc/doxygen.in

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
PROJECT_NAME = "@CMAKE_PROJECT_NAME@"
22
PROJECT_NUMBER = @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
3-
STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@ \
4-
@PROJECT_BINARY_DIR@
3+
STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@/src/lib
54
INPUT = @doxy_main_page@ \
6-
@PROJECT_SOURCE_DIR@ \
7-
@PROJECT_BINARY_DIR@
5+
@PROJECT_SOURCE_DIR@/src/lib
6+
7+
EXTRACT_ALL = YES
8+
EXTENSION_MAPPING = cu=c++ \
9+
cuh=c++
810
FILE_PATTERNS = *.h \
9-
*.cc
11+
*.cc \
12+
*.hpp \
13+
*.cpp \
14+
*.cu \
15+
*.cuh
16+
1017
RECURSIVE = YES
1118
USE_MDFILE_AS_MAINPAGE = @doxy_main_page@
1219

test/CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ target_link_libraries(runCPUTest core)
2929
# Use test
3030
if (COVERAGE)
3131
include(CodeCoverage)
32-
setup_target_for_coverage(${PROJECT_NAME}_coverage runCPUTest coverage)
32+
if(CMAKE_COMPILER_IS_GNUCXX)
33+
target_link_libraries(runCPUTest gcov)
34+
endif()
35+
setup_target_for_coverage(coverage runCPUTest coverage)
3336
endif(COVERAGE)
3437

3538
add_test( NAME CPU_TEST

0 commit comments

Comments
 (0)